pub fn apply(&self, mut result: SliceMut, coeff: u32, input: Slice) {
        debug_assert_eq!(input.len(), self.rows());
        for i in 0..input.len() {
            result.add(
                self.vectors[i].as_slice(),
                (coeff * input.entry(i)) % *self.p,
            );
        }
    }
/// Applies a matrix to a vector.
///
/// # Example
/// ```
/// # use fp::prime::ValidPrime;
/// let p = ValidPrime::new(7);
/// # use fp::matrix::Matrix;
/// # use fp::vector::FpVector;
/// let input  = [vec![1, 3, 6],
///               vec![0, 3, 4]];
///
/// let m = Matrix::from_vec(p, &input);
/// let v = FpVector::from_slice(p, &vec![3, 1]);
/// let mut result = FpVector::new(p, 3);
/// let desired_result = FpVector::from_slice(p, &vec![3, 5, 1]);
/// m.apply(result.as_slice_mut(), 1, v.as_slice());
/// assert_eq!(result, desired_result);
/// ```
Applies a matrix to a vector.
Applies a matrix to a vector .
pub fn apply(&self, mut result: SliceMut, coeff: u32, input: Slice) {
        debug_assert_eq!(input.len(), self.rows());
        for i in 0..input.len() {
            result.add(
                self.vectors[i].as_slice(),
                (coeff * input.entry(i)) % *self.p,
            );
        }
    }
pub fn apply ( & self , mut result : SliceMut , coeff : u32 , input : Slice ) { debug_assert_eq ! ( input len ( ) self rows ( ) ) ; for i in 0 .. input . len ( ) { result . add ( self . vectors [ i ] . as_slice ( ) , ( coeff * input . entry ( i ) ) % * self . p , ) ; } }
Applies a matrix to a vector.
Applies a matrix to a vector .
&self
result
SliceMut
coeff
u32
input
Slice
&self
result
SliceMut
coeff
u32
input
Slice
example
None
use fp::prime::validprime;
let p = ValidPrime::new(7).
let p = ValidPrime :: new ( 7 ) .
use fp::matrix::matrix;
None
use fp::vector::fpvector;


let m = Matrix::from_vec(p, &input);
let v = FpVector::from_slice(p, &vec![3, 1]);
let mut result = FpVector::new(p, 3);
let desired_result = FpVector::from_slice(p, &vec![3, 5, 1]);
m.apply(result.as_slice_mut(), 1, v.as_slice());
assert_eq!(result, desired_result);
```
let m = Matrix :: from_vec ( p &input ) ; let v = FpVector :: from_slice ( p &vec! [ 3 1 ] ) ; let mut result = FpVector :: new ( p 3 ) ; let desired_result = FpVector :: from_slice ( p &vec! [ 3 5 1 ] ) ; m . apply ( result . as_slice_mut () 1 v . as_slice () ) ; assert_eq! ( result desired_result ) ; ` ` `