Commit 095d2d09 authored by Rui Vieira's avatar Rui Vieira 🍵
Browse files

Change name to partial

parent 308447b8
......@@ -132,7 +132,7 @@ impl MonotonicCubicSpline {
(*self.m_m.get(i).unwrap(), *self.m_m.get(i+1).unwrap()));
}
fn curry(x: Vec<f64>, y: Vec<f64>) -> impl Fn(f64) -> f64 {
fn partial(x: Vec<f64>, y: Vec<f64>) -> impl Fn(f64) -> f64 {
move |p| {
let mut spline = MonotonicCubicSpline::new(&x, &y);
spline.interpolate(p)
......@@ -178,7 +178,7 @@ mod test_normal {
let x = vec![0.0, 2.0, 3.0, 10.0];
let y = vec![1.0, 4.0, 8.0, 10.5];
let smooth = MonotonicCubicSpline::curry(x.clone(), y.clone());
let smooth = MonotonicCubicSpline::partial(x.clone(), y.clone());
let mut x_interp = Vec::new();
let mut y_interp = Vec::new();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment