-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reexport inv
and diag
etc from LinearAlgebra
?
#187
Comments
Well we probably wouldn't want to export them in order to not clog people's namespace (if they want With that said, it's actually a little trickier than the above to implement things like ab = ComponentVector(a=1, b=2)
xy = ComponentVector(x=3, y=4)
abxy = ab * xy' what would you expect the axes of |
I agree there is ambiguity in the case of As for the case of julia> using LinearAlgebra, ComponentArrays
julia> M = [1 2; 3 4];
julia> inv(ComponentMatrix(M, Axis(a=1, b=2), Axis(a=1, b=2)))
2×2 Matrix{Float64}:
1.5 -0.5
-2.0 1.0 while ...
function inv(A::StridedMatrix{T}) where T
checksquare(A)
S = typeof((one(T)*zero(T) + one(T)*zero(T))/one(T))
AA = convert(AbstractArray{S}, A)
if istriu(AA)
Ai = triu!(parent(inv(UpperTriangular(AA))))
elseif istril(AA)
Ai = tril!(parent(inv(LowerTriangular(AA))))
else
Ai = inv!(lu(AA))
Ai = convert(typeof(parent(Ai)), Ai)
end
return Ai
end
... Maybe I should open two separate issues with these? |
Is ther any reason not to reexport
inv
anddiag
etc? They can implemented quite easily as follows.The text was updated successfully, but these errors were encountered: