-
Notifications
You must be signed in to change notification settings - Fork 151
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
a Diagonal of a SVector doesn't keep its type #235
Comments
Thats by definition of |
I see. |
Could perhaps define an unexported struct Diagonal{T, N}
diag::SVector{N, T}
end
Base.Diagonal(v::SVector) = Diagonal(v) julia> m = SVector(1,2,3)
3-element SVector{3,Int64}:
1
2
3
julia> Diagonal(m)
StaticArrays.Diagonal{Int64,3}([1, 2, 3]) Perhaps too many additional methods are needed to make this usable though. |
Oh, thanks for pointing this out. It's another of many places in Obviously it's best to fix Base for 0.7, though I guess as a rather nasty hack, we could overload |
Or we could just define |
The only objective I'd care about, as a user, is the performance and ease of use. So aesthetics aside, |
Yes, |
@getzdan is working on a port of https://github.com/mschauer/Bridge.jl to use StaticArrays and added relevant code, see |
|
* throw if no fields * after code review
First seen here:
The text was updated successfully, but these errors were encountered: