message: added sphere test functions
diff: @@ -12,7 +12,17 @@ pub fn rosenbrock_derivative(param: &[f64], a: f64, b: f64) -> Result<Vec<f64>>
  let x = param[0];
  let y = param[1];
  let mut out = vec![];
  - out.push(-2_f64 * a + 4_f64 * b * x.powf(3_f64) - 4_f64 * b * x * y + 2_f64 * x);
  - out.push(2_f64 * b * (y - x.powf(2_f64)));
  + out.push(-2.0 * a + 4.0 * b * x.powf(3.0) - 4.0 * b * x * y + 2.0 * x);
  + out.push(2.0 * b * (y - x.powf(2.0)));
  Ok(out)
  }
  +
  +/// Sphere test function
  +pub fn sphere(param: &[f64]) -> Result<f64> {
  + Ok(param.iter().map(|x| x.powf(2.0)).sum())
  +}
  +
  +/// Derivative of sphere test function
  +pub fn sphere_derivative(param: &[f64]) -> Result<Vec<f64>> {
  + Ok(param.iter().map(|x| 2.0 * x).collect())
  +}
  