Trait HasAlgebra
Source pub trait HasAlgebra {
type Algebra;
}
Expand description
Maps a scalar type T to its default algebra A.
Enables automatic algebra inference: Tensor<f64> → Standard,
Tensor<MaxPlus<f64>> → MaxPlus (in external crate).
§Implementing for custom types
ⓘstruct MyScalar(f64);
struct MyAlgebra;
impl HasAlgebra for MyScalar {
type Algebra = MyAlgebra;
}
The algebra associated with this scalar type.