Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Executor
✓ use argmin::core::Executor;
Minimizes the Rosenbrock function using steepest descent.
use argmin::core::{Executor, CostFunction};
use argmin::solver::gradientdescent::SteepestDescent;
struct Rosenbrock {}
impl CostFunction for Rosenbrock {
type Param = Vec<f64>;
type Output = f64;
fn cost(&self, p: &Self::Param) -> Result<Self::Output, argmin::core::Error> {
Ok((1.0 - p[0]).powi(2) + 100.0 * (p[1] - p[0].powi(2)).powi(2))
}
}
fn main() {
let problem = Rosenbrock {};
let solver = SteepestDescent::new();
let executor = Executor::new(problem, solver);
let res = executor.run().unwrap();
println!("Result: {:?}", res.state.best_param);
}
Upgrade
Version history
0.11.0latest on crates.io
Audit
Dependencies
No dependency data recorded yet.