[][src]Function optlib::testfunctions::paraboloid

pub fn paraboloid<G: Float>(x: &Vec<G>) -> f64

Paraboloid.

y = (x0 - 1)^2 + (x1 - 2)^2 + (x2 - 3)^2 ... (xn - n)^2 The min val is 0.0 for point (0.0, 1.0, 2.0, ... n).

use optlib::testfunctions::paraboloid;

let x = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let value = paraboloid(&x);

assert!(value < 1e-5);
assert!(value >= 0.0);