[][src]Struct optimization_engine::core::fbs::FBSEngine

pub struct FBSEngine<'a, GradientType, ConstraintType, CostType> where
    GradientType: Fn(&[f64], &mut [f64]) -> i32,
    CostType: Fn(&[f64], &mut f64) -> i32,
    ConstraintType: Constraint
{ /* fields omitted */ }

The FBE Engine defines the steps of the FBE algorithm and the termination criterion

Methods

impl<'a, GradientType, ConstraintType, CostType> FBSEngine<'a, GradientType, ConstraintType, CostType> where
    GradientType: Fn(&[f64], &mut [f64]) -> i32,
    CostType: Fn(&[f64], &mut f64) -> i32,
    ConstraintType: Constraint
[src]

pub fn new(
    problem: Problem<GradientType, ConstraintType, CostType>,
    cache: &'a mut FBSCache
) -> FBSEngine<'a, GradientType, ConstraintType, CostType>
[src]

Constructor for instances of FBSEngine

Arguments

  • problem problem definition (cost function, gradient of the cost, constraints)
  • mutable reference to a cache a cache (which is created once); the cache is reuseable

Returns

An new instance of FBSEngine

Trait Implementations

impl<'a, GradientType, ConstraintType, CostType> AlgorithmEngine for FBSEngine<'a, GradientType, ConstraintType, CostType> where
    GradientType: Fn(&[f64], &mut [f64]) -> i32 + 'a,
    CostType: Fn(&[f64], &mut f64) -> i32 + 'a,
    ConstraintType: Constraint + 'a, 
[src]

fn step(&mut self, u_current: &mut [f64]) -> bool[src]

Take a forward-backward step and check whether the algorithm should terminate

Arguments

  • u_current the current mutable

Returns

  • A boolean flag which istrue if and only if the algorith should not terminate

Panics

The method may panick if the computation of the gradient of the cost function or the cost function panics.

Auto Trait Implementations

impl<'a, GradientType, ConstraintType, CostType> Send for FBSEngine<'a, GradientType, ConstraintType, CostType> where
    ConstraintType: Send,
    CostType: Send,
    GradientType: Send

impl<'a, GradientType, ConstraintType, CostType> Sync for FBSEngine<'a, GradientType, ConstraintType, CostType> where
    ConstraintType: Sync,
    CostType: Sync,
    GradientType: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]