Registry / utility / argmin

argmin

JSON →
library0.11.0rscratesunverified

Numerical optimization in pure Rust.

# Cargo.toml [dependencies] argmin = "0.11.0"
INSTALL
IMPORT
SIG · ARGMIN
A
argmin
utilityrustv0.11.0
harness data pending
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); }
Debug
Known issues
gotchaArgmin requires the `ndarray` feature for vector operations; without it, only scalar optimization is available.
fix
Add `features = ["ndarray"]` to your Cargo.toml dependency.
affects: >=0.11.0
Upgrade
Version history
0.11.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
2
Resources
argmin — cargo add argmin · libregistry