Closed DanielVandH closed 2 months ago
@TSGut wrote that code
I'd return Eye{T}(∞)
There is a reason but it's fine to change it as long as you test it well.
The reason is that in multiple contexts jacobimatrix
and things using them assume that the data structure is of particular type and this compounds when you have chained multiplications. If you return an object of different type in some situations it will likely mean special casing those functions or overloading them to also work with other types / converting the arrays.
I guess just try returning Eye or I and see if anything breaks. As you saw with inv
ApplyArray is very particular about memorylayouts and types.
Think this has now changed in the latest PR, so closing
https://github.com/JuliaApproximation/SemiclassicalOrthogonalPolynomials.jl/blob/54e43e480dbb512010b1f3d188300549c3870674/src/SemiclassicalOrthogonalPolynomials.jl#L266
Is there a technical reason why we can't just return
I
here? TheSymTridiagonal
causes the bandwidth of further multiplications to be increased by 1 on each side for example, if chaining connections where the last connection could just be the identity.