HasAlgebra

Trait HasAlgebra 

Source
pub trait HasAlgebra {
    type Algebra;
}
Expand description

Maps a scalar type T to its default algebra Alg.

Enables automatic algebra inference: Tensor<f64>Standard<f64>, Tensor<MaxPlus<f64>>MaxPlusAlgebra<f64> (in external crate).

This trait is UX sugar for default algebra inference. The core algebra model is Alg::Scalar-centric (see Semiring).

§Implementing for custom types

struct MyScalar(f64);
struct MyAlgebra;

impl HasAlgebra for MyScalar {
    type Algebra = MyAlgebra;
}

Required Associated Types§

Source

type Algebra

The algebra associated with this scalar type.

Implementations on Foreign Types§

Source§

impl HasAlgebra for f32

Source§

impl HasAlgebra for f64

Source§

impl HasAlgebra for Complex32

Source§

impl HasAlgebra for Complex64

Implementors§