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§
Sourcetype Float: ArgminFloat
type Float: ArgminFloat
Precision of floats