pub trait LinearProgram {
    type Param;
    type Float: ArgminFloat;

    // Provided methods
    fn c(&self) -> Result<Vec<Self::Float>, Error> { ... }
    fn b(&self) -> Result<Vec<Self::Float>, Error> { ... }
    fn A(&self) -> Result<Vec<Vec<Self::Float>>, Error> { ... }
}
Expand description

Defines a linear Program

Example

use argmin::core::{LinearProgram, Error};

struct Problem {}

impl LinearProgram for Problem {
    type Param = Vec<f64>;
    type Float = f64;

    fn c(&self) -> Result<Vec<Self::Float>, Error> {
        Ok(vec![1.0, 2.0])
    }

    fn b(&self) -> Result<Vec<Self::Float>, Error> {
        Ok(vec![3.0, 4.0])
    }

    fn A(&self) -> Result<Vec<Vec<Self::Float>>, Error> {
        Ok(vec![vec![5.0, 6.0], vec![7.0, 8.0]])
    }
}

Required Associated Types§

source

type Param

Type of the parameter vector

source

type Float: ArgminFloat

Precision of floats

Provided Methods§

source

fn c(&self) -> Result<Vec<Self::Float>, Error>

TODO c for linear programs Those three could maybe be merged into a single function; name unclear

source

fn b(&self) -> Result<Vec<Self::Float>, Error>

TODO b for linear programs

source

fn A(&self) -> Result<Vec<Vec<Self::Float>>, Error>

TODO A for linear programs

Implementors§