pub fn gradient_shift(&self, p: isize, gradient: [f64; 3]) -> isize {
        let shift = self.shift.get(p);
        // [ [-x, 0, +x], [-y, 0, +y], [-z, 0, +z] ]
        let i = (gradient[0] * 9f64 + gradient[1] * 3f64 + gradient[2] + 13f64)
                as usize;
        shift[i]
    }
/// Get the gradient shift from the current point
Get the gradient shift from the current point
Get the gradient shift from the current point
pub fn gradient_shift(&self, p: isize, gradient: [f64; 3]) -> isize {
        let shift = self.shift.get(p);
        // [ [-x, 0, +x], [-y, 0, +y], [-z, 0, +z] ]
        let i = (gradient[0] * 9f64 + gradient[1] * 3f64 + gradient[2] + 13f64)
                as usize;
        shift[i]
    }
pub fn gradient_shift ( & self , p : isize , gradient : [ f64 ; 3 ] ) -> isize { let shift = self . shift . get ( p ) ; // [ [-x, 0, +x], [-y, 0, +y], [-z, 0, +z] ] let i = ( gradient [ 0 ] * 9f64 + gradient [ 1 ] * 3f64 + gradient [ 2 ] + 13f64 ) as usize ; shift [ i ] }
Get the gradient shift from the current point
Get the gradient shift from the current point
&self
p
isize
gradient
[f64; 3]
&self
p
isize
gradient
[f64; 3]