pub fn numerical_gradient_2d<T, F: Fn(&Vec<T>) -> T>(f: &F, x: &mut Vec2d<T>) -> Vec2d<T>
where
    T: Float,
{
    let mut grad: Vec2d<T> = Vec2d::new();
    for v in x {
        grad.push(numerical_gradient_1d(f, &mut v.clone()));
    }
    grad
}
/// 1-directional gradient
/// The 2nd input of this function is assumed to be a Vec<Vec<T>> created by
/// horizontally stacking flattened arrays created by mesh_grid().
1-directional gradient
The 2nd input of this function is assumed to be a Vec> created by
horizontally stacking flattened arrays created by mesh_grid().
1 - directional gradient The 2nd input of this function is assumed to be a Vec > created by horizontally stacking flattened arrays created by mesh_grid () .
pub fn numerical_gradient_2d<T, F: Fn(&Vec<T>) -> T>(f: &F, x: &mut Vec2d<T>) -> Vec2d<T>
where
    T: Float,
{
    let mut grad: Vec2d<T> = Vec2d::new();
    for v in x {
        grad.push(numerical_gradient_1d(f, &mut v.clone()));
    }
    grad
}
pub fn numerical_gradient_2d < T , F : Fn ( & Vec < T > ) -> T > ( f : & F , x : & mut Vec2d < T > ) -> Vec2d < T > where T : Float , { let mut grad : Vec2d < T > = Vec2d :: new ( ) ; for v in x { grad . push ( numerical_gradient_1d ( f , & mut v . clone ( ) ) ) ; } grad }
1-directional gradient
The 2nd input of this function is assumed to be a Vec<Vec<T>> created by
horizontally stacking flattened arrays created by mesh_grid().
1 - directional gradient The 2nd input of this function is assumed to be a Vec<Vec<T >> created by horizontally stacking flattened arrays created by mesh_grid () .
f
&F
x
&mut Vec2d<T>
f
&F
x
&mut Vec2d<T>