sparsemat / sprs

sparse linear algebra library for rust
Apache License 2.0
416 stars 47 forks source link

Add asymmetric operands to pointwise binary ops #290

Closed tchernobog closed 3 years ago

tchernobog commented 3 years ago

Alters the existing pointwise addition, subtraction, and multiplication binary operators so that they allow for different left-hand and right-hand side operands.

Note that in some cases this can lead to minor backwards incompatibilities due to the need to specify the type of one operand as it cannot be inferred automatically (e.g. when using an "eye" matrix). Please consider bumping the minor version number if merging.

tchernobog commented 3 years ago

Done. Please note that the current incarnation only implements vector addition and subtraction. The other operations, and extending to also cover matrices, can be added if there is interest. I didn't need it right away for my own project, so I held off for now.

mulimoen commented 3 years ago

Thanks for your great work on this @tchernobog!