itt-ustutt / num-dual

Generalized (hyper-) dual numbers in rust
Apache License 2.0
60 stars 7 forks source link

More generic dual numbers #54

Closed prehner closed 1 year ago

prehner commented 1 year ago

The switch to nalgebra as backend for vector dual numbers provides the opportunity to make them generic with respect to the array backend. In particular the number of elements can be generalized to be either constant or dynamic.

To make use of the change, Copy should not be a supertrait of DualNum anymore (else only the dual numbers with constant size would implement DualNum). As a consequence, additional operations between owned and borrowed instances need to be implemented.