pub trait Function<const N: usize> {
// Required method
fn objective(&self, input: Vector<N>) -> f64;
// Provided methods
fn gradient(&self, input: Vector<N>) -> Vector<N> { ... }
fn hessian(&self, input: Vector<N>) -> Matrix<N> { ... }
}Expand description
Abstracts over multivariable functions of arbitrary dimension.