Closed kmsquire closed 4 years ago
For your type, you can do this by defining the trait:
StaticArrays.similar_type(::Type{Point3D}, ::Type{Float64}, ::Size{(3,)}) = Point3D
This may be possible to fix in general, but the dispatch is tricky to get right. I think it's just about possible though, let me give it a try.
That is, I think we can "do the right thing" for user defined but non-parametric FieldArray
s. For the parametric case I don't think there's any way for us to do this.
PR is up: #731
Example:
Obviously, it's not hard to change it back into a
Point3D
.I'm wondering if it's reasonable and feasible for this to be automatic?
For example, is it as simple as defining
+
for FieldVector`s? Are there good reasons not to do this?(Presumably this definition would propagate to
sum
,mean
, etc.)