You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What do you need it for? Note that neither LinearAlgebra.LU nor StaticArrays.LU are abstract arrays that you can index etc. They both iterate L, U, and p (matrix, matrix, vector) so considering this the Any eltype make more sense.
The following chunk of code will land in an upcoming version of ImplicitDifferentiation.jl. Basically I wanna solve a linear system with a possibly failed LU decomposition, and replace the results with NaNs if needed:
functionsafe_solve(A_lu, b)
T =float(promote_type(eltype(A_lu), eltype(b)))
x_maybenan =Vector{T}(undef, size(A_lu, 2))
ifissuccess(A_lu)
x_maybenan .= A \ b
else
x_maybenan .=convert(T, NaN)
endreturn x_maybenan
end
But this errored twice: because of float(eltype(A_lu)) and because of size(A_lu).
Note that neither LinearAlgebra.LU nor StaticArrays.LU are abstract arrays
Basically that's what confused me. Since matrix operations like * and \ are defined, I thought every matrix operation would be. But I understand why that is not the case.
For my scenario, I used the fields of the LU decomposition instead and it worked.
The text was updated successfully, but these errors were encountered: