linalg-rs / sandbox

An experimental repository to test Rust linear algebra traits
Apache License 2.0
0 stars 0 forks source link

Timo/associated types #4

Open tbetcke opened 1 year ago

tbetcke commented 1 year ago

1.) Implemented associated types for operators and vectors.

OperatorBase now has two associated types In and Out for the scalar input and output type. Vector has an associted scalar type called Item. The trait methods have been adapted accordingly. This gives every object a native type. We could then implement adapters on top to allow conversion between different representations.

2.) I have made a proposal for a scalar trait type. It is a subset of the Num trait from the num crate. It does not require string conversion and only needs addition, multiplication, subtraction, and division. It has no remainder operation as this might not always make sense (consider the scalar type for example itself to be a dense matrix). Not sure yet if this is best but would be good to have a definition that allows arbitrary fields as scalar type.

3.) I updated the test_mult_sketchy test to succeed when the matvec panics.