You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's true - the default return type from similar_type is SArray. Generally this was chosen because it's faster, and using a "functional" style with StaticArrays is generally as or more performant that mutating a MArray (even if it is pre-allocated).
This behavior has been raised a few times, e.g. #327. I don't particularly mind where we go on this. Like I said, when I rewrote all my cleverly thought out code using pre-allocated MArrays with a functional form and SArrays, it got faster, so I see the current design a way of "educating" users to avoid mutatable arrays where possible, but I admit this may be an overreach.
Note also that we do support mul! (A_mul_B! on v0.6) and map! and broadcast! if you want to manually manage your memory resources. But these operations don't tend to invoke SIMD instructions, unfortunately, so they are slower than you would think/like.
If I multiply a mutable array by a constant or another mutable array, I get a static array. This doesn't seem like it should be the desired behavior.
For example:
or
The text was updated successfully, but these errors were encountered: