Trait Constrained

Source
pub trait Constrained {
    const NH: usize;
    const NG: usize;
    const CONSTRAINED: bool = true;

    // Required methods
    fn equality_constraints(x: Vec<f64>) -> Vec<f64>;
    fn inequality_constraints(x: Vec<f64>) -> Vec<f64>;

    // Provided methods
    fn h(x: Vec<f64>) -> Vec<f64> { ... }
    fn g(x: Vec<f64>) -> Vec<f64> { ... }
}
Expand description

This is a trait that ensures consistent implementation of constrained benchmark functions

Required Associated Constants§

Source

const NH: usize

This constant indicates the number of equality functions

Source

const NG: usize

This constant indicates the number of inequality functions

Provided Associated Constants§

Source

const CONSTRAINED: bool = true

This constant indicates a constrained function

Required Methods§

Source

fn equality_constraints(x: Vec<f64>) -> Vec<f64>

This function returns the value of equality constraints

Source

fn inequality_constraints(x: Vec<f64>) -> Vec<f64>

This function returns the value of inequality constraints

Provided Methods§

Source

fn h(x: Vec<f64>) -> Vec<f64>

This is an alias for the equality constraint function

Source

fn g(x: Vec<f64>) -> Vec<f64>

This is an alias for the inequality constraint function

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 Constrained for ChankongHaimes

Source§

const NH: usize = 0usize

Source§

const NG: usize = 2usize

Source§

impl Constrained for RosenbrockConst1

Source§

const NH: usize = 0usize

Source§

const NG: usize = 2usize

Source§

impl Constrained for RosenbrockConst2

Source§

const NH: usize = 0usize

Source§

const NG: usize = 1usize