Skip to main content

Module sphere

Module sphere 

Source
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 default P = Vec<f64> lets you write Sphere::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 x into out. Lengths must match.