Cache

Trait Cache 

Source
pub trait Cache<T, const NX: usize, const NU: usize> {
    // Required methods
    fn update_active(&mut self, prim_residual: T, dual_residual: T) -> Option<T>;
    fn get_active(&self) -> &SingleCache<T, NX, NU>;
}

Required Methods§

Source

fn update_active(&mut self, prim_residual: T, dual_residual: T) -> Option<T>

Updates which cache is active by evaluating the primal and dual residuals.

Returns: A scalar (old_rho/new_rho) to be applied to constraint duals in case the cache changed

Source

fn get_active(&self) -> &SingleCache<T, NX, NU>

Get a reference to the currently active cache.

Implementors§

Source§

impl<T, const NX: usize, const NU: usize> Cache<T, NX, NU> for SingleCache<T, NX, NU>
where T: Scalar + RealField + Copy,

Source§

impl<T, const NX: usize, const NU: usize, const NUM: usize> Cache<T, NX, NU> for ArrayCache<T, NX, NU, NUM>
where T: Scalar + RealField + Copy,