Trait Context

Source
pub trait Context: Clone + Default {
    // Provided methods
    fn vector_from_element<V: Vector<C = Self>>(
        &self,
        len: usize,
        value: V::T,
    ) -> V { ... }
    fn vector_from_vec<V: Vector<C = Self>>(&self, vec: Vec<V::T>) -> V { ... }
    fn vector_zeros<V: Vector<C = Self>>(&self, len: usize) -> V { ... }
    fn dense_mat_zeros<V: Vector<C = Self> + DefaultDenseMatrix>(
        &self,
        rows: usize,
        cols: usize,
    ) -> <V as DefaultDenseMatrix>::M { ... }
}
Expand description

defines the current execution and allocation context of an operator / vector / matrix for example:

  • threading model (e.g. single-threaded, multi-threaded, GPU)
  • custom allocators, host/device memory
  • etc.

It will generally be the case that all the operators / vectors / matrices for the current ode problem share the same context

Provided Methods§

Source

fn vector_from_element<V: Vector<C = Self>>(&self, len: usize, value: V::T) -> V

Source

fn vector_from_vec<V: Vector<C = Self>>(&self, vec: Vec<V::T>) -> V

Source

fn vector_zeros<V: Vector<C = Self>>(&self, len: usize) -> V

Source

fn dense_mat_zeros<V: Vector<C = Self> + DefaultDenseMatrix>( &self, rows: usize, cols: usize, ) -> <V as DefaultDenseMatrix>::M

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Clone + Default> Context for T