Skip to content

[feat] custom numerical primitives #1

@fedemagnani

Description

@fedemagnani
  • PrimitivesTrait and implementers
  • macro for generation of fixed size implementers

To allow the use of custom numerical types, we should define a Primitives trait that specify as associated types all the numerical values used for double precision, vectors and matrices.

Such primitives should require trait bounds from num-traits or other widely adopted numerical interface in rust.

The Primitives trait should be implemented by unit structs acting as a sort of phantomdata so that, passed as turbofish in all the solvers, they would tell which primitives to use . A DefaultMath struct should implement f64 and standard linear algebra types: this struct should be the default il all the solvers, so that the average user doesn't have to specify the turbofish all the time.

One could use a macro for creating several combinations of implementers using different kind of lengths, to optimize performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions