pub fn generate<F>(rows: usize, cols: usize, f: F) -> Self
        where F: Fn(usize, usize) -> T
    {
        Vec2d {
            data: (0..rows*cols).map(|index| f(index / cols, index % cols)).collect(),
            shape: (rows, cols)
        }
    }
/// Create a `Vec2d<T>` using a generator function.
Create a `Vec2d` using a generator function.
Create a ` Vec2d ` using a generator function .
pub fn generate<F>(rows: usize, cols: usize, f: F) -> Self
        where F: Fn(usize, usize) -> T
    {
        Vec2d {
            data: (0..rows*cols).map(|index| f(index / cols, index % cols)).collect(),
            shape: (rows, cols)
        }
    }
pub fn generate < F > ( rows : usize , cols : usize , f : F ) -> Self where F : Fn ( usize , usize ) -> T { Vec2d { data : ( 0 .. rows * cols ) . map ( | index | f ( index / cols , index % cols ) ) . collect ( ) , shape : ( rows , cols ) } }
Create a `Vec2d<T>` using a generator function.
Create a ` Vec2d<T > ` using a generator function .
rows
usize
cols
usize
f
F