Available on crate feature
problems only.Expand description
N-dimensional Sphere function.
f(x) = Σᵢ xᵢ²
Smooth, convex, separable, unimodal. Global minimum at x = (0, …, 0)
with f = 0. The trivial canary problem — every solver should solve it
cleanly; failure indicates the implementation is broken.
Structs§
- Sphere
- Pre-wrapped Sphere problem. Generic over the parameter backend
P; the defaultP = Vec<f64>lets you writeSphere::default()for the common case. Backend impls (nalgebra::DVector<f64>,ndarray::Array1<f64>,faer::Col<f64>) are gated behind their respective features.
Statics§
- SPHERE_
SPEC - Catalogue entry for this problem.
Functions§
- sphere
- Evaluates the Sphere function at
x. - sphere_
gradient - Writes the Sphere gradient at
xintoout. Lengths must match.