-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Matrix factorizations with unitful elements fail #128
Comments
What would you expect for the factorisation of a unitful matrix. Where should the units go? In the L or in the U of the lufact? Or should they both carry, in this case, a unit |
It's not entirely obvious to me, but I'd propose for a matrix M with units s:
|
The generic factorization function almost works for a matrix with seconds. As a natural consequence of the algorithm
When I fix the
but the problem is that |
It is a bit tricky with
|
That's a tough one. |
Even for an |
Of course |
In LU , L should be unitless and U should have units s On Tue, Jul 15, 2014 at 11:06 PM, Jiahao Chen [email protected]
|
@jiahao, note that |
I agree with Alan about A=LU. (As @andreasnoack pointed out, Gaussian elimination produces a dimensionless L.) |
I believe this is now just an julia> A = eye(2)Second
2x2 Array{SIUnits.SIQuantity{Float64,m,kg,s,A,K,mol,cd,rad,sr},2}:
1.0 s 0.0 s
0.0 s 1.0 s
julia> typeof(one(A[1]))
Float64 but julia> typeof(one(eltype(A)))
SIUnits.SIQuantity{Float64,0,0,0,0,0,0,0,0,0} because it falls back on the julia> 'a' == 'a' + 0
true (but we don't define Right now, cc: @Keno |
A simple example:
The error arises here because
lufact
dispatches on this method which computesT=eltype(A); S=one(T)/one(T)
and converts the matrix to anAbstractMatrix{S}
. In this caseS == Float64
drops the SIQuantity annotation, which causes the error.cc: @Keno @andreasnoack
The text was updated successfully, but these errors were encountered: