[][src]Struct crabsformer::Matrix

pub struct Matrix<T> { /* fields omitted */ }

Matrix elements structure

TODO: add overview about matrix here.

  1. how to create a matrix
  2. Matrix operation
  3. Indexing, etc.

Methods

impl<T> Matrix<T>[src]

pub fn shape(&self) -> [usize; 2][src]

The shape of the matrix [nrows, ncols].

Examples

let m = matrix![
    3.0, 1.0;
    4.0, 1.0;
    5.0, 9.0;
];
assert_eq!(m.shape(), [3, 2]);

impl<T> Matrix<T> where
    T: FromPrimitive + Num + Copy
[src]

pub fn full(shape: [usize; 2], value: T) -> Matrix<T>[src]

pub fn zeros(shape: [usize; 2]) -> Matrix<T>[src]

pub fn zeros_like(m: &Matrix<T>) -> Matrix<T>[src]

pub fn ones(shape: [usize; 2]) -> Matrix<T>[src]

pub fn ones_like(m: &Matrix<T>) -> Matrix<T>[src]

pub fn from_vec(elements: Vec<Vec<T>>) -> Matrix<T>[src]

impl<U> Matrix<U> where
    U: SampleUniform
[src]

pub fn uniform(shape: [usize; 2], low: U, high: U) -> Matrix<U>[src]

impl Matrix<f64>[src]

pub fn normal(shape: [usize; 2], mean: f64, std_dev: f64) -> Matrix<f64>[src]

Trait Implementations

impl<T> PartialEq<Matrix<T>> for Matrix<T> where
    T: Num + Copy
[src]

impl<T: Debug> Debug for Matrix<T>[src]

Auto Trait Implementations

impl<T> Send for Matrix<T> where
    T: Send

impl<T> Sync for Matrix<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.