-
-
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
special matrix types should define constructors for AbstractMatrix
not Matrix
#165
Comments
julia> Bidiagonal(rand(5,5))
ERROR: MethodError: `convert` has no method matching convert(::Type{Base.LinAlg.Bidiagonal{T}}, ::Array{Float64,2}) Edit: I was missing the upper / lower boolean flag, so this in fact defined. |
|
That would make sense to me as the convert method that the constructor would also fall back to. Should probably error if any elements not representable in the structured type are nonzero? Though that could be very expensive to check. Should these be analogous to checked integer conversions ("input does not fit in destination type") or masking operations that ignore some data so can change the meaning? Or maybe the constructor should do one and convert should do the other? |
That is what we were doing as of v0.4 release And its still with us today. Though now days So new examples may be need:
etc |
Things are looking pretty consistent here now in the far future, so I'm going to go ahead and close this, but feel free to reopen if that's a mistake!
|
Right now this is inconsistently applied:
but the following works:
The text was updated successfully, but these errors were encountered: