Struct Matrix Copy item path Source pub struct Matrix<T: Clone > {
pub rows: usize ,
pub columns: usize ,
}
Expand description Matrix
§ Examples:
use polymath::prelude::* ;
fn main() {
let a: Matrix<f64> = Matrix::new((2 , 4 ), 0.0 ); let b: f64 = 5.0 ;
let c: Matrix<f64> = a.clone() + b; assert! (c - b == a);
}
§ columns: usize
Create a new matrix
§ Examples:
use polymath::prelude::* ;
fn main() {
let matrix: Matrix<f64> = Matrix::new((2 , 4 ), 0.0 );
}
Create a new matrix with pre-existing data
§ Examples:
use polymath::prelude::* ;
fn main() {
let rows: usize = 2 ;
let columns: usize = 2 ;
let mut data: Vec<u8> = Vec::with_capacity(rows * columns);
data.resize(rows * columns, 5 );
let matrix: Matrix<u8> = Matrix::from_vec((rows, columns), data).unwrap();
}
Get the length of the matrix’s underlying vector (recommended to use matrix.len() instead)
Get the length of the matrix in elements (rows * columns)
Get the length of the matrix ((rows, columns))
Get a value in the matrix’s underlying vector (linear)
Get a value in the matrix by 2d coordinates (x0 y0 is top left corner)
Set a value in the matrix’s underlying vector (linear)
Set a value in the matrix by 2d coordinates (x0 y0 is top left corner)
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
The resulting type after applying the +
operator.
Performs copy-assignment from
source
.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the /
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
The resulting type after applying the *
operator.
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the %
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
The resulting type after applying the -
operator.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit
)
Performs copy-assignment from
self
to
dest
.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.