[−][src]Struct crabsformer::Matrix
Matrix elements structure
TODO: add overview about matrix here.
- how to create a matrix
- Matrix operation
- 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]
T: FromPrimitive + Num + Copy,
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]
U: SampleUniform,
impl Matrix<f64>
[src]
Trait Implementations
impl<T> PartialEq<Matrix<T>> for Matrix<T> where
T: Num + Copy,
[src]
T: Num + Copy,
impl<T: Debug> Debug for Matrix<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,