Closed geo-ant closed 1 year ago
ah, yeah. it used to be possible to add two matrices. but i forgot to add it back since i refactored the code a while ago. i'll put it on my todo list
ah, yeah. it used to be possible to add two matrices. but i forgot to add it back since i refactored the code a while ago. i'll put it on my todo list
Hey, if you want I'll file a PR. You can give me a rough sketch of where you want the code to be and if there are special things I need to pay attention to. I'm happy to help :)
Is your feature request related to a problem? Please describe.
Hey, this might be an embarrassingly dumb question, but I cannot see a way to add two matrices using
+
(or subtract using-
). The official website does mention that the addition and subtraction operators should work as expected, but when I writea+b
for e.g. twoMat<f64>
instances, it won't compile. Looking at thefaer_core
crate I cannot find an implementation ofcore::ops::Add
. What am I missing?Describe the solution you'd like
It would be great if the
+
operator would just work for two suitableMat<E>
instances as well as oneMat<E>
and the as a suitableMatRef
instance. I can elaborate on what I mean by suitable, but roughly I mean if the entities can be added, then the matrix should be addable (given that the matrix dimensions match).Describe alternatives you've considered I could of course do element wise additions manually, but that would feel so much less ergonomic than having an
Add
trait implemented. Same forAddAssign
.Additional context
If I missed an obvious way to add matrices, I'd really appreciate a hint. If the
Add
andAddAssign
,Sub
, andSubAssign
traits are indeed not implemented I'd be very happy to file a PR because this crate is really awesome. Please let me know and thanks for your work :)