-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Inconsistent handling of one
and zero
for special matrix types.
#170
Comments
Is there a documentation that specifies what functions a matrix type needs to implement? Of course, this should really be a concept, but until Julia has these, documentation and maybe a generic test function would catch this:
|
Not formally. The general interface question is discussed in JuliaLang/julia#6975, and I had dabbled in similar testing ideas in my formal algebra of types notebook. Currently the thinking is that |
Right, the notebook! Cool stuff. For matrix types (that are receiving a lot of development at the moment), a more stringent requirement may make sense, and things could probably also be tested more easily. |
These all work now, but there is a little disagreement between zero{T}(x::AbstractArray{T}) = fill!(similar(x), zero(T))
one{T}(x::AbstractMatrix{T}) = eye(T, size(x, 1)) # … after ensuring that the matrix is square They should probably both use |
Hrm, this issue just got a little bit worse due to the above abstract definitions:
|
|
Looks like all is well on this front now in the future; I'm going to close as completed but feel free to undo if that's a mistake for some reason I'm missing!
|
Sometimes
one
orzero
returns a dense matrix, other times a special matrix type.one
andzero
are not defined for all major special matrix types inLinAlg
.Ex.
The text was updated successfully, but these errors were encountered: