[−][src]Type Definition nalgebra::base::MatrixMN
type MatrixMN<N, R, C> = Matrix<N, R, C, Owned<N, R, C>>;
A statically sized column-major matrix with R
rows and C
columns.
Methods
impl<N: Scalar, R: Dim, C: Dim> MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
pub unsafe fn new_uninitialized_generic(nrows: R, ncols: C) -> Self
[src]
Creates a new uninitialized matrix. If the matrix has a compile-time dimension, this panics
if nrows != R::to_usize()
or ncols != C::to_usize()
.
pub fn from_element_generic(nrows: R, ncols: C, elem: N) -> Self
[src]
Creates a matrix with all its elements set to elem
.
pub fn repeat_generic(nrows: R, ncols: C, elem: N) -> Self
[src]
Creates a matrix with all its elements set to elem
.
Same as from_element_generic
.
pub fn zeros_generic(nrows: R, ncols: C) -> Self where
N: Zero,
[src]
N: Zero,
Creates a matrix with all its elements set to 0.
pub fn from_iterator_generic<I>(nrows: R, ncols: C, iter: I) -> Self where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Creates a matrix with all its elements filled by an iterator.
pub fn from_row_slice_generic(nrows: R, ncols: C, slice: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in row-major order.
The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.
pub fn from_column_slice_generic(nrows: R, ncols: C, slice: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice. The components must have the same layout as the matrix data storage (i.e. column-major).
pub fn from_fn_generic<F>(nrows: R, ncols: C, f: F) -> Self where
F: FnMut(usize, usize) -> N,
[src]
F: FnMut(usize, usize) -> N,
Creates a matrix filled with the results of a function applied to each of its component coordinates.
pub fn identity_generic(nrows: R, ncols: C) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a new identity matrix.
If the matrix is not square, the largest square submatrix starting at index (0, 0)
is set
to the identity matrix. All other entries are set to zero.
pub fn from_diagonal_element_generic(nrows: R, ncols: C, elt: N) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a new matrix with its diagonal filled with copies of elt
.
If the matrix is not square, the largest square submatrix starting at index (0, 0)
is set
to the identity matrix. All other entries are set to zero.
pub fn from_partial_diagonal_generic(nrows: R, ncols: C, elts: &[N]) -> Self where
N: Zero,
[src]
N: Zero,
Creates a new matrix that may be rectangular. The first elts.len()
diagonal elements are
filled with the content of elts
. Others are set to 0.
Panics if elts.len()
is larger than the minimum among nrows
and ncols
.
pub fn from_rows<SB>(rows: &[Matrix<N, U1, C, SB>]) -> Self where
SB: Storage<N, U1, C>,
[src]
SB: Storage<N, U1, C>,
Builds a new matrix from its rows.
Panics if not enough rows are provided (for statically-sized matrices), or if all rows do not have the same dimensions.
Example
let m = Matrix3::from_rows(&[ RowVector3::new(1.0, 2.0, 3.0), RowVector3::new(4.0, 5.0, 6.0), RowVector3::new(7.0, 8.0, 9.0) ]); assert!(m.m11 == 1.0 && m.m12 == 2.0 && m.m13 == 3.0 && m.m21 == 4.0 && m.m22 == 5.0 && m.m23 == 6.0 && m.m31 == 7.0 && m.m32 == 8.0 && m.m33 == 9.0);
pub fn from_columns<SB>(columns: &[Vector<N, R, SB>]) -> Self where
SB: Storage<N, R>,
[src]
SB: Storage<N, R>,
Builds a new matrix from its columns.
Panics if not enough columns are provided (for statically-sized matrices), or if all columns do not have the same dimensions.
Example
let m = Matrix3::from_columns(&[ Vector3::new(1.0, 2.0, 3.0), Vector3::new(4.0, 5.0, 6.0), Vector3::new(7.0, 8.0, 9.0) ]); assert!(m.m11 == 1.0 && m.m12 == 4.0 && m.m13 == 7.0 && m.m21 == 2.0 && m.m22 == 5.0 && m.m23 == 8.0 && m.m31 == 3.0 && m.m32 == 6.0 && m.m33 == 9.0);
pub fn new_random_generic(nrows: R, ncols: C) -> Self where
Standard: Distribution<N>,
[src]
Standard: Distribution<N>,
Creates a matrix filled with random values.
pub fn from_distribution_generic<Distr: Distribution<N> + ?Sized, G: Rng + ?Sized>(
nrows: R,
ncols: C,
distribution: &Distr,
rng: &mut G
) -> Self
[src]
nrows: R,
ncols: C,
distribution: &Distr,
rng: &mut G
) -> Self
Creates a matrix filled with random values from the given distribution.
pub fn from_vec_generic(nrows: R, ncols: C, data: Vec<N>) -> Self
[src]
Creates a matrix backed by a given Vec
.
The output matrix is filled column-by-column.
Example
let vec = vec![0, 1, 2, 3, 4, 5]; let vec_ptr = vec.as_ptr(); let matrix = Matrix::from_vec_generic(Dynamic::new(vec.len()), U1, vec); let matrix_storage_ptr = matrix.data.as_vec().as_ptr(); // `matrix` is backed by exactly the same `Vec` as it was constructed from. assert_eq!(matrix_storage_ptr, vec_ptr);
impl<N: Scalar, R: DimName, C: DimName> MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
pub unsafe fn new_uninitialized() -> Self
[src]
Creates a new uninitialized matrix or vector.
pub fn from_element(elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Example
let v = Vector3::from_element(2.0); // The additional argument represents the vector dimension. let dv = DVector::from_element(3, 2.0); let m = Matrix2x3::from_element(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_element(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn repeat(elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Same as .from_element
.
Example
let v = Vector3::repeat(2.0); // The additional argument represents the vector dimension. let dv = DVector::repeat(3, 2.0); let m = Matrix2x3::repeat(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::repeat(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn zeros() -> Self where
N: Zero,
[src]
N: Zero,
Creates a matrix or vector with all its elements set to 0
.
Example
let v = Vector3::<f32>::zeros(); // The argument represents the vector dimension. let dv = DVector::<f32>::zeros(3); let m = Matrix2x3::<f32>::zeros(); // The two arguments represent the matrix dimensions. let dm = DMatrix::<f32>::zeros(2, 3); assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0); assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0); assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
pub fn from_iterator<I>(iter: I) -> Self where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Creates a matrix or vector with all its elements filled by an iterator.
The output matrix is filled column-by-column.
Example
let v = Vector3::from_iterator((0..3).into_iter()); // The additional argument represents the vector dimension. let dv = DVector::from_iterator(3, (0..3).into_iter()); let m = Matrix2x3::from_iterator((0..6).into_iter()); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter()); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_fn<F>(f: F) -> Self where
F: FnMut(usize, usize) -> N,
[src]
F: FnMut(usize, usize) -> N,
Creates a matrix or vector filled with the results of a function applied to each of its component coordinates.
Example
let v = Vector3::from_fn(|i, _| i); // The additional argument represents the vector dimension. let dv = DVector::from_fn(3, |i, _| i); let m = Matrix2x3::from_fn(|i, j| i * 3 + j); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn identity() -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.
Example
let m = Matrix2x3::<f32>::identity(); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::<f32>::identity(2, 3); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
pub fn from_diagonal_element(elt: N) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a matrix filled with its diagonal filled with elt
and all other
components set to zero.
Example
let m = Matrix2x3::from_diagonal_element(5.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_diagonal_element(2, 3, 5.0); assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
pub fn from_partial_diagonal(elts: &[N]) -> Self where
N: Zero,
[src]
N: Zero,
Creates a new matrix that may be rectangular. The first elts.len()
diagonal
elements are filled with the content of elts
. Others are set to 0.
Panics if elts.len()
is larger than the minimum among nrows
and ncols
.
Example
let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 && m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 && dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
pub fn from_distribution<Distr: Distribution<N> + ?Sized, G: Rng + ?Sized>(
distribution: &Distr,
rng: &mut G
) -> Self
[src]
distribution: &Distr,
rng: &mut G
) -> Self
Creates a matrix or vector filled with random values from the given distribution.
impl<N: Scalar, R: DimName, C: DimName> MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
Standard: Distribution<N>,
[src]
DefaultAllocator: Allocator<N, R, C>,
Standard: Distribution<N>,
pub fn new_random() -> Self
[src]
Creates a matrix filled with random values.
impl<N: Scalar, R: DimName> MatrixMN<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
pub unsafe fn new_uninitialized(ncols: usize) -> Self
[src]
Creates a new uninitialized matrix or vector.
pub fn from_element(ncols: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Example
let v = Vector3::from_element(2.0); // The additional argument represents the vector dimension. let dv = DVector::from_element(3, 2.0); let m = Matrix2x3::from_element(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_element(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn repeat(ncols: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Same as .from_element
.
Example
let v = Vector3::repeat(2.0); // The additional argument represents the vector dimension. let dv = DVector::repeat(3, 2.0); let m = Matrix2x3::repeat(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::repeat(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn zeros(ncols: usize) -> Self where
N: Zero,
[src]
N: Zero,
Creates a matrix or vector with all its elements set to 0
.
Example
let v = Vector3::<f32>::zeros(); // The argument represents the vector dimension. let dv = DVector::<f32>::zeros(3); let m = Matrix2x3::<f32>::zeros(); // The two arguments represent the matrix dimensions. let dm = DMatrix::<f32>::zeros(2, 3); assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0); assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0); assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
pub fn from_iterator<I>(ncols: usize, iter: I) -> Self where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Creates a matrix or vector with all its elements filled by an iterator.
The output matrix is filled column-by-column.
Example
let v = Vector3::from_iterator((0..3).into_iter()); // The additional argument represents the vector dimension. let dv = DVector::from_iterator(3, (0..3).into_iter()); let m = Matrix2x3::from_iterator((0..6).into_iter()); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter()); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_fn<F>(ncols: usize, f: F) -> Self where
F: FnMut(usize, usize) -> N,
[src]
F: FnMut(usize, usize) -> N,
Creates a matrix or vector filled with the results of a function applied to each of its component coordinates.
Example
let v = Vector3::from_fn(|i, _| i); // The additional argument represents the vector dimension. let dv = DVector::from_fn(3, |i, _| i); let m = Matrix2x3::from_fn(|i, j| i * 3 + j); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn identity(ncols: usize) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.
Example
let m = Matrix2x3::<f32>::identity(); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::<f32>::identity(2, 3); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
pub fn from_diagonal_element(ncols: usize, elt: N) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a matrix filled with its diagonal filled with elt
and all other
components set to zero.
Example
let m = Matrix2x3::from_diagonal_element(5.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_diagonal_element(2, 3, 5.0); assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
pub fn from_partial_diagonal(ncols: usize, elts: &[N]) -> Self where
N: Zero,
[src]
N: Zero,
Creates a new matrix that may be rectangular. The first elts.len()
diagonal
elements are filled with the content of elts
. Others are set to 0.
Panics if elts.len()
is larger than the minimum among nrows
and ncols
.
Example
let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 && m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 && dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
pub fn from_distribution<Distr: Distribution<N> + ?Sized, G: Rng + ?Sized>(
ncols: usize,
distribution: &Distr,
rng: &mut G
) -> Self
[src]
ncols: usize,
distribution: &Distr,
rng: &mut G
) -> Self
Creates a matrix or vector filled with random values from the given distribution.
impl<N: Scalar, R: DimName> MatrixMN<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
Standard: Distribution<N>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
Standard: Distribution<N>,
pub fn new_random(ncols: usize) -> Self
[src]
Creates a matrix filled with random values.
impl<N: Scalar, C: DimName> MatrixMN<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
pub unsafe fn new_uninitialized(nrows: usize) -> Self
[src]
Creates a new uninitialized matrix or vector.
pub fn from_element(nrows: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Example
let v = Vector3::from_element(2.0); // The additional argument represents the vector dimension. let dv = DVector::from_element(3, 2.0); let m = Matrix2x3::from_element(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_element(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn repeat(nrows: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Same as .from_element
.
Example
let v = Vector3::repeat(2.0); // The additional argument represents the vector dimension. let dv = DVector::repeat(3, 2.0); let m = Matrix2x3::repeat(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::repeat(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn zeros(nrows: usize) -> Self where
N: Zero,
[src]
N: Zero,
Creates a matrix or vector with all its elements set to 0
.
Example
let v = Vector3::<f32>::zeros(); // The argument represents the vector dimension. let dv = DVector::<f32>::zeros(3); let m = Matrix2x3::<f32>::zeros(); // The two arguments represent the matrix dimensions. let dm = DMatrix::<f32>::zeros(2, 3); assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0); assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0); assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
pub fn from_iterator<I>(nrows: usize, iter: I) -> Self where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Creates a matrix or vector with all its elements filled by an iterator.
The output matrix is filled column-by-column.
Example
let v = Vector3::from_iterator((0..3).into_iter()); // The additional argument represents the vector dimension. let dv = DVector::from_iterator(3, (0..3).into_iter()); let m = Matrix2x3::from_iterator((0..6).into_iter()); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter()); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_fn<F>(nrows: usize, f: F) -> Self where
F: FnMut(usize, usize) -> N,
[src]
F: FnMut(usize, usize) -> N,
Creates a matrix or vector filled with the results of a function applied to each of its component coordinates.
Example
let v = Vector3::from_fn(|i, _| i); // The additional argument represents the vector dimension. let dv = DVector::from_fn(3, |i, _| i); let m = Matrix2x3::from_fn(|i, j| i * 3 + j); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn identity(nrows: usize) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.
Example
let m = Matrix2x3::<f32>::identity(); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::<f32>::identity(2, 3); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
pub fn from_diagonal_element(nrows: usize, elt: N) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a matrix filled with its diagonal filled with elt
and all other
components set to zero.
Example
let m = Matrix2x3::from_diagonal_element(5.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_diagonal_element(2, 3, 5.0); assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
pub fn from_partial_diagonal(nrows: usize, elts: &[N]) -> Self where
N: Zero,
[src]
N: Zero,
Creates a new matrix that may be rectangular. The first elts.len()
diagonal
elements are filled with the content of elts
. Others are set to 0.
Panics if elts.len()
is larger than the minimum among nrows
and ncols
.
Example
let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 && m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 && dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
pub fn from_distribution<Distr: Distribution<N> + ?Sized, G: Rng + ?Sized>(
nrows: usize,
distribution: &Distr,
rng: &mut G
) -> Self
[src]
nrows: usize,
distribution: &Distr,
rng: &mut G
) -> Self
Creates a matrix or vector filled with random values from the given distribution.
impl<N: Scalar, C: DimName> MatrixMN<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
Standard: Distribution<N>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
Standard: Distribution<N>,
pub fn new_random(nrows: usize) -> Self
[src]
Creates a matrix filled with random values.
impl<N: Scalar> MatrixMN<N, Dynamic, Dynamic> where
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
[src]
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
pub unsafe fn new_uninitialized(nrows: usize, ncols: usize) -> Self
[src]
Creates a new uninitialized matrix or vector.
pub fn from_element(nrows: usize, ncols: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Example
let v = Vector3::from_element(2.0); // The additional argument represents the vector dimension. let dv = DVector::from_element(3, 2.0); let m = Matrix2x3::from_element(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_element(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn repeat(nrows: usize, ncols: usize, elem: N) -> Self
[src]
Creates a matrix or vector with all its elements set to elem
.
Same as .from_element
.
Example
let v = Vector3::repeat(2.0); // The additional argument represents the vector dimension. let dv = DVector::repeat(3, 2.0); let m = Matrix2x3::repeat(2.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::repeat(2, 3, 2.0); assert!(v.x == 2.0 && v.y == 2.0 && v.z == 2.0); assert!(dv[0] == 2.0 && dv[1] == 2.0 && dv[2] == 2.0); assert!(m.m11 == 2.0 && m.m12 == 2.0 && m.m13 == 2.0 && m.m21 == 2.0 && m.m22 == 2.0 && m.m23 == 2.0); assert!(dm[(0, 0)] == 2.0 && dm[(0, 1)] == 2.0 && dm[(0, 2)] == 2.0 && dm[(1, 0)] == 2.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 2.0);
pub fn zeros(nrows: usize, ncols: usize) -> Self where
N: Zero,
[src]
N: Zero,
Creates a matrix or vector with all its elements set to 0
.
Example
let v = Vector3::<f32>::zeros(); // The argument represents the vector dimension. let dv = DVector::<f32>::zeros(3); let m = Matrix2x3::<f32>::zeros(); // The two arguments represent the matrix dimensions. let dm = DMatrix::<f32>::zeros(2, 3); assert!(v.x == 0.0 && v.y == 0.0 && v.z == 0.0); assert!(dv[0] == 0.0 && dv[1] == 0.0 && dv[2] == 0.0); assert!(m.m11 == 0.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 0.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 0.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 0.0 && dm[(1, 2)] == 0.0);
pub fn from_iterator<I>(nrows: usize, ncols: usize, iter: I) -> Self where
I: IntoIterator<Item = N>,
[src]
I: IntoIterator<Item = N>,
Creates a matrix or vector with all its elements filled by an iterator.
The output matrix is filled column-by-column.
Example
let v = Vector3::from_iterator((0..3).into_iter()); // The additional argument represents the vector dimension. let dv = DVector::from_iterator(3, (0..3).into_iter()); let m = Matrix2x3::from_iterator((0..6).into_iter()); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_iterator(2, 3, (0..6).into_iter()); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_fn<F>(nrows: usize, ncols: usize, f: F) -> Self where
F: FnMut(usize, usize) -> N,
[src]
F: FnMut(usize, usize) -> N,
Creates a matrix or vector filled with the results of a function applied to each of its component coordinates.
Example
let v = Vector3::from_fn(|i, _| i); // The additional argument represents the vector dimension. let dv = DVector::from_fn(3, |i, _| i); let m = Matrix2x3::from_fn(|i, j| i * 3 + j); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_fn(2, 3, |i, j| i * 3 + j); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn identity(nrows: usize, ncols: usize) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates an identity matrix. If the matrix is not square, the largest square submatrix (starting at the first row and column) is set to the identity while all other entries are set to zero.
Example
let m = Matrix2x3::<f32>::identity(); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::<f32>::identity(2, 3); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 1.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 1.0 && dm[(1, 2)] == 0.0);
pub fn from_diagonal_element(nrows: usize, ncols: usize, elt: N) -> Self where
N: Zero + One,
[src]
N: Zero + One,
Creates a matrix filled with its diagonal filled with elt
and all other
components set to zero.
Example
let m = Matrix2x3::from_diagonal_element(5.0); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_diagonal_element(2, 3, 5.0); assert!(m.m11 == 5.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 5.0 && m.m23 == 0.0); assert!(dm[(0, 0)] == 5.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 5.0 && dm[(1, 2)] == 0.0);
pub fn from_partial_diagonal(nrows: usize, ncols: usize, elts: &[N]) -> Self where
N: Zero,
[src]
N: Zero,
Creates a new matrix that may be rectangular. The first elts.len()
diagonal
elements are filled with the content of elts
. Others are set to 0.
Panics if elts.len()
is larger than the minimum among nrows
and ncols
.
Example
let m = Matrix3::from_partial_diagonal(&[1.0, 2.0]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_partial_diagonal(3, 3, &[1.0, 2.0]); assert!(m.m11 == 1.0 && m.m12 == 0.0 && m.m13 == 0.0 && m.m21 == 0.0 && m.m22 == 2.0 && m.m23 == 0.0 && m.m31 == 0.0 && m.m32 == 0.0 && m.m33 == 0.0); assert!(dm[(0, 0)] == 1.0 && dm[(0, 1)] == 0.0 && dm[(0, 2)] == 0.0 && dm[(1, 0)] == 0.0 && dm[(1, 1)] == 2.0 && dm[(1, 2)] == 0.0 && dm[(2, 0)] == 0.0 && dm[(2, 1)] == 0.0 && dm[(2, 2)] == 0.0);
pub fn from_distribution<Distr: Distribution<N> + ?Sized, G: Rng + ?Sized>(
nrows: usize,
ncols: usize,
distribution: &Distr,
rng: &mut G
) -> Self
[src]
nrows: usize,
ncols: usize,
distribution: &Distr,
rng: &mut G
) -> Self
Creates a matrix or vector filled with random values from the given distribution.
impl<N: Scalar> MatrixMN<N, Dynamic, Dynamic> where
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
Standard: Distribution<N>,
[src]
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
Standard: Distribution<N>,
pub fn new_random(nrows: usize, ncols: usize) -> Self
[src]
Creates a matrix filled with random values.
impl<N: Scalar, R: DimName, C: DimName> MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
pub fn from_row_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in row-major order.
The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.
Example
let v = Vector3::from_row_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_row_slice(&[0, 1, 2]); let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn from_column_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in column-major order.
Example
let v = Vector3::from_column_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_column_slice(&[0, 1, 2]); let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_vec(data: Vec<N>) -> Self
[src]
Creates a matrix backed by a given Vec
.
The output matrix is filled column-by-column.
Example
let m = Matrix2x3::from_vec(vec![0, 1, 2, 3, 4, 5]); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_vec(2, 3, vec![0, 1, 2, 3, 4, 5]); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
impl<N: Scalar, R: DimName> MatrixMN<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
pub fn from_row_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in row-major order.
The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.
Example
let v = Vector3::from_row_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_row_slice(&[0, 1, 2]); let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn from_column_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in column-major order.
Example
let v = Vector3::from_column_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_column_slice(&[0, 1, 2]); let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_vec(data: Vec<N>) -> Self
[src]
Creates a matrix backed by a given Vec
.
The output matrix is filled column-by-column.
Example
let m = Matrix2x3::from_vec(vec![0, 1, 2, 3, 4, 5]); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_vec(2, 3, vec![0, 1, 2, 3, 4, 5]); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
impl<N: Scalar, C: DimName> MatrixMN<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
pub fn from_row_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in row-major order.
The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.
Example
let v = Vector3::from_row_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_row_slice(&[0, 1, 2]); let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn from_column_slice(data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in column-major order.
Example
let v = Vector3::from_column_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_column_slice(&[0, 1, 2]); let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_vec(data: Vec<N>) -> Self
[src]
Creates a matrix backed by a given Vec
.
The output matrix is filled column-by-column.
Example
let m = Matrix2x3::from_vec(vec![0, 1, 2, 3, 4, 5]); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_vec(2, 3, vec![0, 1, 2, 3, 4, 5]); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
impl<N: Scalar> MatrixMN<N, Dynamic, Dynamic> where
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
[src]
DefaultAllocator: Allocator<N, Dynamic, Dynamic>,
pub fn from_row_slice(nrows: usize, ncols: usize, data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in row-major order.
The order of elements in the slice must follow the usual mathematic writing, i.e., row-by-row.
Example
let v = Vector3::from_row_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_row_slice(&[0, 1, 2]); let m = Matrix2x3::from_row_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_row_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 1 && m.m13 == 2 && m.m21 == 3 && m.m22 == 4 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 1 && dm[(0, 2)] == 2 && dm[(1, 0)] == 3 && dm[(1, 1)] == 4 && dm[(1, 2)] == 5);
pub fn from_column_slice(nrows: usize, ncols: usize, data: &[N]) -> Self
[src]
Creates a matrix with its elements filled with the components provided by a slice in column-major order.
Example
let v = Vector3::from_column_slice(&[0, 1, 2]); // The additional argument represents the vector dimension. let dv = DVector::from_column_slice(&[0, 1, 2]); let m = Matrix2x3::from_column_slice(&[0, 1, 2, 3, 4, 5]); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_column_slice(2, 3, &[0, 1, 2, 3, 4, 5]); assert!(v.x == 0 && v.y == 1 && v.z == 2); assert!(dv[0] == 0 && dv[1] == 1 && dv[2] == 2); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
pub fn from_vec(nrows: usize, ncols: usize, data: Vec<N>) -> Self
[src]
Creates a matrix backed by a given Vec
.
The output matrix is filled column-by-column.
Example
let m = Matrix2x3::from_vec(vec![0, 1, 2, 3, 4, 5]); assert!(m.m11 == 0 && m.m12 == 2 && m.m13 == 4 && m.m21 == 1 && m.m22 == 3 && m.m23 == 5); // The two additional arguments represent the matrix dimensions. let dm = DMatrix::from_vec(2, 3, vec![0, 1, 2, 3, 4, 5]); assert!(dm[(0, 0)] == 0 && dm[(0, 1)] == 2 && dm[(0, 2)] == 4 && dm[(1, 0)] == 1 && dm[(1, 1)] == 3 && dm[(1, 2)] == 5);
impl<N> MatrixMN<N, U2, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
impl<N> MatrixMN<N, U3, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
pub fn new(
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U4, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U5, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U5>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U6, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U6>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m56: N,
m61: N,
m62: N,
m63: N,
m64: N,
m65: N,
m66: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m56: N,
m61: N,
m62: N,
m63: N,
m64: N,
m65: N,
m66: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U2, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
pub fn new(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N) -> Self
[src]
Initializes this matrix from its components.
impl<N> MatrixMN<N, U2, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U4>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U2, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U5>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U2, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U6>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U3, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U2>,
pub fn new(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N) -> Self
[src]
Initializes this matrix from its components.
impl<N> MatrixMN<N, U3, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U3, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U5>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U3, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U6>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U4, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U2>,
pub fn new(
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N
) -> Self
[src]
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U4, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U3>,
pub fn new(
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U4, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U5>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U4, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U6>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U5, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U2>,
pub fn new(
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N,
m51: N,
m52: N
) -> Self
[src]
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N,
m51: N,
m52: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U5, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U3>,
pub fn new(
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N,
m51: N,
m52: N,
m53: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N,
m51: N,
m52: N,
m53: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U5, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U4>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N,
m51: N,
m52: N,
m53: N,
m54: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N,
m51: N,
m52: N,
m53: N,
m54: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U5, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U6>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m56: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m16: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m26: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m36: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m46: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m56: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U6, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U2>,
pub fn new(
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N,
m51: N,
m52: N,
m61: N,
m62: N
) -> Self
[src]
m11: N,
m12: N,
m21: N,
m22: N,
m31: N,
m32: N,
m41: N,
m42: N,
m51: N,
m52: N,
m61: N,
m62: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U6, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U3>,
pub fn new(
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N,
m51: N,
m52: N,
m53: N,
m61: N,
m62: N,
m63: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m21: N,
m22: N,
m23: N,
m31: N,
m32: N,
m33: N,
m41: N,
m42: N,
m43: N,
m51: N,
m52: N,
m53: N,
m61: N,
m62: N,
m63: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U6, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U4>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N,
m51: N,
m52: N,
m53: N,
m54: N,
m61: N,
m62: N,
m63: N,
m64: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m21: N,
m22: N,
m23: N,
m24: N,
m31: N,
m32: N,
m33: N,
m34: N,
m41: N,
m42: N,
m43: N,
m44: N,
m51: N,
m52: N,
m53: N,
m54: N,
m61: N,
m62: N,
m63: N,
m64: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U6, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U5>,
pub fn new(
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m61: N,
m62: N,
m63: N,
m64: N,
m65: N
) -> Self
[src]
m11: N,
m12: N,
m13: N,
m14: N,
m15: N,
m21: N,
m22: N,
m23: N,
m24: N,
m25: N,
m31: N,
m32: N,
m33: N,
m34: N,
m35: N,
m41: N,
m42: N,
m43: N,
m44: N,
m45: N,
m51: N,
m52: N,
m53: N,
m54: N,
m55: N,
m61: N,
m62: N,
m63: N,
m64: N,
m65: N
) -> Self
Initializes this matrix from its components.
impl<N> MatrixMN<N, U1, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U1>,
impl<N> MatrixMN<N, U1, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U2>,
impl<N> MatrixMN<N, U1, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U3>,
impl<N> MatrixMN<N, U1, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U4>,
impl<N> MatrixMN<N, U1, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U5>,
impl<N> MatrixMN<N, U1, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U6>,
pub fn new(x: N, y: N, z: N, w: N, a: N, b: N) -> Self
[src]
Initializes this matrix from its components.
impl<N> MatrixMN<N, U2, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
impl<N> MatrixMN<N, U3, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
impl<N> MatrixMN<N, U4, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
impl<N> MatrixMN<N, U5, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U1>,
impl<N> MatrixMN<N, U6, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U1>,
pub fn new(x: N, y: N, z: N, w: N, a: N, b: N) -> Self
[src]
Initializes this matrix from its components.
impl<N: Scalar, C: Dim> MatrixMN<N, Dynamic, C> where
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
DefaultAllocator: Allocator<N, Dynamic, C>,
pub fn resize_vertically_mut(&mut self, new_nrows: usize, val: N) where
DefaultAllocator: Reallocator<N, Dynamic, C, Dynamic, C>,
[src]
DefaultAllocator: Reallocator<N, Dynamic, C, Dynamic, C>,
Changes the number of rows of this matrix in-place.
The values are copied such that self[(i, j)] == result[(i, j)]
. If the result has more
rows than self
, then the extra rows are filled with val
.
Defined only for owned matrices with a dynamic number of rows (for example, DVector
).
impl<N: Scalar, R: Dim> MatrixMN<N, R, Dynamic> where
DefaultAllocator: Allocator<N, R, Dynamic>,
[src]
DefaultAllocator: Allocator<N, R, Dynamic>,
pub fn resize_horizontally_mut(&mut self, new_ncols: usize, val: N) where
DefaultAllocator: Reallocator<N, R, Dynamic, R, Dynamic>,
[src]
DefaultAllocator: Reallocator<N, R, Dynamic, R, Dynamic>,
Changes the number of column of this matrix in-place.
The values are copied such that self[(i, j)] == result[(i, j)]
. If the result has more
columns than self
, then the extra columns are filled with val
.
Defined only for owned matrices with a dynamic number of columns (for example, DVector
).
Trait Implementations
impl<N> From<[N; 1]> for MatrixMN<N, U1, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U1>,
impl<N> From<[N; 2]> for MatrixMN<N, U1, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U2>,
impl<N> From<[N; 3]> for MatrixMN<N, U1, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U3>,
impl<N> From<[N; 4]> for MatrixMN<N, U1, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U4>,
impl<N> From<[N; 5]> for MatrixMN<N, U1, U5> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U5>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U5>,
impl<N> From<[N; 6]> for MatrixMN<N, U1, U6> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U6>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U6>,
impl<N> From<[N; 7]> for MatrixMN<N, U1, U7> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U7>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U7>,
impl<N> From<[N; 8]> for MatrixMN<N, U1, U8> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U8>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U8>,
impl<N> From<[N; 9]> for MatrixMN<N, U1, U9> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U9>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U9>,
impl<N> From<[N; 10]> for MatrixMN<N, U1, U10> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U10>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U10>,
impl<N> From<[N; 11]> for MatrixMN<N, U1, U11> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U11>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U11>,
impl<N> From<[N; 12]> for MatrixMN<N, U1, U12> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U12>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U12>,
impl<N> From<[N; 13]> for MatrixMN<N, U1, U13> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U13>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U13>,
impl<N> From<[N; 14]> for MatrixMN<N, U1, U14> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U14>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U14>,
impl<N> From<[N; 15]> for MatrixMN<N, U1, U15> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U15>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U15>,
impl<N> From<[N; 16]> for MatrixMN<N, U1, U16> where
N: Scalar,
DefaultAllocator: Allocator<N, U1, U16>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U1, U16>,
impl<N> From<[N; 2]> for MatrixMN<N, U2, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
impl<N> From<[N; 3]> for MatrixMN<N, U3, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
impl<N> From<[N; 4]> for MatrixMN<N, U4, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
impl<N> From<[N; 5]> for MatrixMN<N, U5, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U5, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U5, U1>,
impl<N> From<[N; 6]> for MatrixMN<N, U6, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U6, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U6, U1>,
impl<N> From<[N; 7]> for MatrixMN<N, U7, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U7, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U7, U1>,
impl<N> From<[N; 8]> for MatrixMN<N, U8, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U8, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U8, U1>,
impl<N> From<[N; 9]> for MatrixMN<N, U9, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U9, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U9, U1>,
impl<N> From<[N; 10]> for MatrixMN<N, U10, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U10, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U10, U1>,
impl<N> From<[N; 11]> for MatrixMN<N, U11, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U11, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U11, U1>,
impl<N> From<[N; 12]> for MatrixMN<N, U12, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U12, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U12, U1>,
impl<N> From<[N; 13]> for MatrixMN<N, U13, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U13, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U13, U1>,
impl<N> From<[N; 14]> for MatrixMN<N, U14, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U14, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U14, U1>,
impl<N> From<[N; 15]> for MatrixMN<N, U15, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U15, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U15, U1>,
impl<N> From<[N; 16]> for MatrixMN<N, U16, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U16, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U16, U1>,
impl<N: Scalar> From<[[N; 2]; 2]> for MatrixMN<N, U2, U2> where
DefaultAllocator: Allocator<N, U2, U2>,
[src]
DefaultAllocator: Allocator<N, U2, U2>,
impl<N: Scalar> From<[[N; 2]; 3]> for MatrixMN<N, U2, U3> where
DefaultAllocator: Allocator<N, U2, U3>,
[src]
DefaultAllocator: Allocator<N, U2, U3>,
impl<N: Scalar> From<[[N; 2]; 4]> for MatrixMN<N, U2, U4> where
DefaultAllocator: Allocator<N, U2, U4>,
[src]
DefaultAllocator: Allocator<N, U2, U4>,
impl<N: Scalar> From<[[N; 2]; 5]> for MatrixMN<N, U2, U5> where
DefaultAllocator: Allocator<N, U2, U5>,
[src]
DefaultAllocator: Allocator<N, U2, U5>,
impl<N: Scalar> From<[[N; 2]; 6]> for MatrixMN<N, U2, U6> where
DefaultAllocator: Allocator<N, U2, U6>,
[src]
DefaultAllocator: Allocator<N, U2, U6>,
impl<N: Scalar> From<[[N; 3]; 2]> for MatrixMN<N, U3, U2> where
DefaultAllocator: Allocator<N, U3, U2>,
[src]
DefaultAllocator: Allocator<N, U3, U2>,
impl<N: Scalar> From<[[N; 3]; 3]> for MatrixMN<N, U3, U3> where
DefaultAllocator: Allocator<N, U3, U3>,
[src]
DefaultAllocator: Allocator<N, U3, U3>,
impl<N: Scalar> From<[[N; 3]; 4]> for MatrixMN<N, U3, U4> where
DefaultAllocator: Allocator<N, U3, U4>,
[src]
DefaultAllocator: Allocator<N, U3, U4>,
impl<N: Scalar> From<[[N; 3]; 5]> for MatrixMN<N, U3, U5> where
DefaultAllocator: Allocator<N, U3, U5>,
[src]
DefaultAllocator: Allocator<N, U3, U5>,
impl<N: Scalar> From<[[N; 3]; 6]> for MatrixMN<N, U3, U6> where
DefaultAllocator: Allocator<N, U3, U6>,
[src]
DefaultAllocator: Allocator<N, U3, U6>,
impl<N: Scalar> From<[[N; 4]; 2]> for MatrixMN<N, U4, U2> where
DefaultAllocator: Allocator<N, U4, U2>,
[src]
DefaultAllocator: Allocator<N, U4, U2>,
impl<N: Scalar> From<[[N; 4]; 3]> for MatrixMN<N, U4, U3> where
DefaultAllocator: Allocator<N, U4, U3>,
[src]
DefaultAllocator: Allocator<N, U4, U3>,
impl<N: Scalar> From<[[N; 4]; 4]> for MatrixMN<N, U4, U4> where
DefaultAllocator: Allocator<N, U4, U4>,
[src]
DefaultAllocator: Allocator<N, U4, U4>,
impl<N: Scalar> From<[[N; 4]; 5]> for MatrixMN<N, U4, U5> where
DefaultAllocator: Allocator<N, U4, U5>,
[src]
DefaultAllocator: Allocator<N, U4, U5>,
impl<N: Scalar> From<[[N; 4]; 6]> for MatrixMN<N, U4, U6> where
DefaultAllocator: Allocator<N, U4, U6>,
[src]
DefaultAllocator: Allocator<N, U4, U6>,
impl<N: Scalar> From<[[N; 5]; 2]> for MatrixMN<N, U5, U2> where
DefaultAllocator: Allocator<N, U5, U2>,
[src]
DefaultAllocator: Allocator<N, U5, U2>,
impl<N: Scalar> From<[[N; 5]; 3]> for MatrixMN<N, U5, U3> where
DefaultAllocator: Allocator<N, U5, U3>,
[src]
DefaultAllocator: Allocator<N, U5, U3>,
impl<N: Scalar> From<[[N; 5]; 4]> for MatrixMN<N, U5, U4> where
DefaultAllocator: Allocator<N, U5, U4>,
[src]
DefaultAllocator: Allocator<N, U5, U4>,
impl<N: Scalar> From<[[N; 5]; 5]> for MatrixMN<N, U5, U5> where
DefaultAllocator: Allocator<N, U5, U5>,
[src]
DefaultAllocator: Allocator<N, U5, U5>,
impl<N: Scalar> From<[[N; 5]; 6]> for MatrixMN<N, U5, U6> where
DefaultAllocator: Allocator<N, U5, U6>,
[src]
DefaultAllocator: Allocator<N, U5, U6>,
impl<N: Scalar> From<[[N; 6]; 2]> for MatrixMN<N, U6, U2> where
DefaultAllocator: Allocator<N, U6, U2>,
[src]
DefaultAllocator: Allocator<N, U6, U2>,
impl<N: Scalar> From<[[N; 6]; 3]> for MatrixMN<N, U6, U3> where
DefaultAllocator: Allocator<N, U6, U3>,
[src]
DefaultAllocator: Allocator<N, U6, U3>,
impl<N: Scalar> From<[[N; 6]; 4]> for MatrixMN<N, U6, U4> where
DefaultAllocator: Allocator<N, U6, U4>,
[src]
DefaultAllocator: Allocator<N, U6, U4>,
impl<N: Scalar> From<[[N; 6]; 5]> for MatrixMN<N, U6, U5> where
DefaultAllocator: Allocator<N, U6, U5>,
[src]
DefaultAllocator: Allocator<N, U6, U5>,
impl<N: Scalar> From<[[N; 6]; 6]> for MatrixMN<N, U6, U6> where
DefaultAllocator: Allocator<N, U6, U6>,
[src]
DefaultAllocator: Allocator<N, U6, U6>,
impl<N> From<Vector2<N>> for MatrixMN<N, U2, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U1>,
impl<N> From<Vector3<N>> for MatrixMN<N, U3, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U1>,
impl<N> From<Vector4<N>> for MatrixMN<N, U4, U1> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U1>,
impl<N> From<ColumnMatrix2<N>> for MatrixMN<N, U2, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
fn from(m: ColumnMatrix2<N>) -> Self
[src]
impl<N> From<ColumnMatrix2x3<N>> for MatrixMN<N, U2, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
fn from(m: ColumnMatrix2x3<N>) -> Self
[src]
impl<N> From<ColumnMatrix3<N>> for MatrixMN<N, U3, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
fn from(m: ColumnMatrix3<N>) -> Self
[src]
impl<N> From<ColumnMatrix3x4<N>> for MatrixMN<N, U3, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
fn from(m: ColumnMatrix3x4<N>) -> Self
[src]
impl<N> From<ColumnMatrix4<N>> for MatrixMN<N, U4, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
fn from(m: ColumnMatrix4<N>) -> Self
[src]
impl<N> Into<ColumnMatrix2<N>> for MatrixMN<N, U2, U2> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U2>,
fn into(self) -> ColumnMatrix2<N>
[src]
impl<N> Into<ColumnMatrix2x3<N>> for MatrixMN<N, U2, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U2, U3>,
fn into(self) -> ColumnMatrix2x3<N>
[src]
impl<N> Into<ColumnMatrix3<N>> for MatrixMN<N, U3, U3> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U3>,
fn into(self) -> ColumnMatrix3<N>
[src]
impl<N> Into<ColumnMatrix3x4<N>> for MatrixMN<N, U3, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U3, U4>,
fn into(self) -> ColumnMatrix3x4<N>
[src]
impl<N> Into<ColumnMatrix4<N>> for MatrixMN<N, U4, U4> where
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
[src]
N: Scalar,
DefaultAllocator: Allocator<N, U4, U4>,
fn into(self) -> ColumnMatrix4<N>
[src]
impl<N, R1: DimName, C1: DimName> MulAssign<Rotation<N, C1>> for MatrixMN<N, R1, C1> where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
[src]
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
fn mul_assign(&mut self, right: Rotation<N, C1>)
[src]
impl<'b, N, R1: DimName, C1: DimName> MulAssign<&'b Rotation<N, C1>> for MatrixMN<N, R1, C1> where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
[src]
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
fn mul_assign(&mut self, right: &'b Rotation<N, C1>)
[src]
impl<N, R1: DimName, C1: DimName> DivAssign<Rotation<N, C1>> for MatrixMN<N, R1, C1> where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
[src]
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
fn div_assign(&mut self, right: Rotation<N, C1>)
[src]
impl<'b, N, R1: DimName, C1: DimName> DivAssign<&'b Rotation<N, C1>> for MatrixMN<N, R1, C1> where
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
[src]
N: Scalar + Zero + One + ClosedAdd + ClosedMul,
DefaultAllocator: Allocator<N, R1, C1> + Allocator<N, C1, C1>,
fn div_assign(&mut self, right: &'b Rotation<N, C1>)
[src]
impl<N, R: DimName, C: DimName> Sum<Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>> for MatrixMN<N, R, C> where
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, R, C>,
impl<N, C: Dim> Sum<Matrix<N, Dynamic, C, <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer>> for MatrixMN<N, Dynamic, C> where
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, Dynamic, C>,
fn sum<I: Iterator<Item = MatrixMN<N, Dynamic, C>>>(
iter: I
) -> MatrixMN<N, Dynamic, C>
[src]
iter: I
) -> MatrixMN<N, Dynamic, C>
Example
assert_eq!(vec![DVector::repeat(3, 1.0f64), DVector::repeat(3, 1.0f64), DVector::repeat(3, 1.0f64)].into_iter().sum::<DVector<f64>>(), DVector::repeat(3, 1.0f64) + DVector::repeat(3, 1.0f64) + DVector::repeat(3, 1.0f64));
Panics
Panics if the iterator is empty:
iter::empty::<DMatrix<f64>>().sum::<DMatrix<f64>>(); // panics!
impl<'a, N, R: DimName, C: DimName> Sum<&'a Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>> for MatrixMN<N, R, C> where
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, R, C>,
impl<'a, N, C: Dim> Sum<&'a Matrix<N, Dynamic, C, <DefaultAllocator as Allocator<N, Dynamic, C>>::Buffer>> for MatrixMN<N, Dynamic, C> where
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, Dynamic, C>,
[src]
N: Scalar + ClosedAdd + Zero,
DefaultAllocator: Allocator<N, Dynamic, C>,
impl<N, R: DimName, C: DimName> Bounded for MatrixMN<N, R, C> where
N: Scalar + Bounded,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Bounded,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: DimName, C: DimName> Zero for MatrixMN<N, R, C> where
N: Scalar + Zero + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Zero + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
fn zero() -> Self
[src]
fn is_zero(&self) -> bool
[src]
fn set_zero(&mut self)
[src]
Sets self
to the additive identity element of Self
, 0
.
impl<N, R: DimName, C: DimName> AbstractMagma<Additive> for MatrixMN<N, R, C> where
N: Scalar + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
fn operate(&self, other: &Self) -> Self
[src]
fn op(&self, O, lhs: &Self) -> Self
[src]
Performs specific operation.
impl<N, R: DimName, C: DimName> AbstractQuasigroup<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractQuasigroup<Additive> + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractQuasigroup<Additive> + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
fn prop_inv_is_latin_square_approx(args: (Self, Self)) -> bool where
Self: RelativeEq<Self>,
[src]
Self: RelativeEq<Self>,
Returns true
if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_inv_is_latin_square(args: (Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if latin squareness holds for the given arguments. Read more
impl<N, R: DimName, C: DimName> AbstractSemigroup<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractSemigroup<Additive> + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractSemigroup<Additive> + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where
Self: RelativeEq<Self>,
[src]
Self: RelativeEq<Self>,
Returns true
if associativity holds for the given arguments. Approximate equality is used for verifications. Read more
fn prop_is_associative(args: (Self, Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if associativity holds for the given arguments.
impl<N, R: DimName, C: DimName> AbstractLoop<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractLoop<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractLoop<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: DimName, C: DimName> AbstractMonoid<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractMonoid<Additive> + Zero + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractMonoid<Additive> + Zero + ClosedAdd,
DefaultAllocator: Allocator<N, R, C>,
fn prop_operating_identity_element_is_noop_approx(args: (Self,)) -> bool where
Self: RelativeEq<Self>,
[src]
Self: RelativeEq<Self>,
Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more
fn prop_operating_identity_element_is_noop(args: (Self,)) -> bool where
Self: Eq,
[src]
Self: Eq,
Checks whether operating with the identity element is a no-op for the given argument. Read more
impl<N, R: DimName, C: DimName> AbstractGroup<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractGroup<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractGroup<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: DimName, C: DimName> AbstractGroupAbelian<Additive> for MatrixMN<N, R, C> where
N: Scalar + AbstractGroupAbelian<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + AbstractGroupAbelian<Additive> + Zero + ClosedAdd + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
fn prop_is_commutative_approx(args: (Self, Self)) -> bool where
Self: RelativeEq<Self>,
[src]
Self: RelativeEq<Self>,
Returns true
if the operator is commutative for the given argument tuple. Approximate equality is used for verifications. Read more
fn prop_is_commutative(args: (Self, Self)) -> bool where
Self: Eq,
[src]
Self: Eq,
Returns true
if the operator is commutative for the given argument tuple.
impl<N, R: DimName, C: DimName> TwoSidedInverse<Additive> for MatrixMN<N, R, C> where
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
fn two_sided_inverse(&self) -> Self
[src]
fn two_sided_inverse_mut(&mut self)
[src]
impl<N, R: DimName, C: DimName> Identity<Additive> for MatrixMN<N, R, C> where
N: Scalar + Zero,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Zero,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: Dim, C: Dim> JoinSemilattice for MatrixMN<N, R, C> where
N: Scalar + JoinSemilattice,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + JoinSemilattice,
DefaultAllocator: Allocator<N, R, C>,
impl<N1, N2, R1, C1, R2, C2> SubsetOf<Matrix<N2, R2, C2, <DefaultAllocator as Allocator<N2, R2, C2>>::Buffer>> for MatrixMN<N1, R1, C1> where
R1: Dim,
C1: Dim,
R2: Dim,
C2: Dim,
N1: Scalar,
N2: Scalar + SupersetOf<N1>,
DefaultAllocator: Allocator<N2, R2, C2> + Allocator<N1, R1, C1> + SameShapeAllocator<N1, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,
[src]
R1: Dim,
C1: Dim,
R2: Dim,
C2: Dim,
N1: Scalar,
N2: Scalar + SupersetOf<N1>,
DefaultAllocator: Allocator<N2, R2, C2> + Allocator<N1, R1, C1> + SameShapeAllocator<N1, R1, C1, R2, C2>,
ShapeConstraint: SameNumberOfRows<R1, R2> + SameNumberOfColumns<C1, C2>,
fn to_superset(&self) -> MatrixMN<N2, R2, C2>
[src]
fn is_in_subset(m: &MatrixMN<N2, R2, C2>) -> bool
[src]
unsafe fn from_superset_unchecked(m: &MatrixMN<N2, R2, C2>) -> Self
[src]
fn from_superset(element: &T) -> Option<Self>
[src]
The inverse inclusion map: attempts to construct self
from the equivalent element of its superset. Read more
impl<N, R: Dim, C: Dim> MeetSemilattice for MatrixMN<N, R, C> where
N: Scalar + MeetSemilattice,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + MeetSemilattice,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: Dim, C: Dim> Lattice for MatrixMN<N, R, C> where
N: Scalar + Lattice,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Lattice,
DefaultAllocator: Allocator<N, R, C>,
fn meet_join(&self, other: &Self) -> (Self, Self)
[src]
fn partial_min(&'a self, other: &'a Self) -> Option<&'a Self>
[src]
Return the minimum of self
and other
if they are comparable.
fn partial_max(&'a self, other: &'a Self) -> Option<&'a Self>
[src]
Return the maximum of self
and other
if they are comparable.
fn partial_sort2(&'a self, other: &'a Self) -> Option<(&'a Self, &'a Self)>
[src]
Sorts two values in increasing order using a partial ordering.
fn partial_clamp(&'a self, min: &'a Self, max: &'a Self) -> Option<&'a Self>
[src]
Clamp value
between min
and max
. Returns None
if value
is not comparable to min
or max
. Read more
impl<N, R: DimName, C: DimName> AbstractModule<Additive, Additive, Multiplicative> for MatrixMN<N, R, C> where
N: Scalar + RingCommutative,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + RingCommutative,
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: DimName, C: DimName> Module for MatrixMN<N, R, C> where
N: Scalar + RingCommutative,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + RingCommutative,
DefaultAllocator: Allocator<N, R, C>,
type Ring = N
The underlying scalar field.
impl<N: ComplexField, R: DimName, C: DimName> InnerSpace for MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
impl<N, R: DimName, C: DimName> FiniteDimVectorSpace for MatrixMN<N, R, C> where
N: Scalar + Field,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Field,
DefaultAllocator: Allocator<N, R, C>,
fn dimension() -> usize
[src]
fn canonical_basis_element(i: usize) -> Self
[src]
fn dot(&self, other: &Self) -> N
[src]
unsafe fn component_unchecked(&self, i: usize) -> &N
[src]
unsafe fn component_unchecked_mut(&mut self, i: usize) -> &mut N
[src]
fn canonical_basis<F>(f: F) where
F: FnMut(&Self) -> bool,
[src]
F: FnMut(&Self) -> bool,
Applies the given closule to each element of this vector space's canonical basis. Stops if f
returns false
. Read more
impl<N: ComplexField, R: DimName, C: DimName> NormedSpace for MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
type RealField = N::RealField
The result of the norm (not necessarily the same same as the field used by this vector space).
type ComplexField = N
The field of this space must be this complex number.
fn norm_squared(&self) -> N::RealField
[src]
fn norm(&self) -> N::RealField
[src]
fn normalize(&self) -> Self
[src]
fn normalize_mut(&mut self) -> N::RealField
[src]
fn try_normalize(&self, min_norm: N::RealField) -> Option<Self>
[src]
fn try_normalize_mut(&mut self, min_norm: N::RealField) -> Option<N::RealField>
[src]
impl<N, R: DimName, C: DimName> VectorSpace for MatrixMN<N, R, C> where
N: Scalar + Field,
DefaultAllocator: Allocator<N, R, C>,
[src]
N: Scalar + Field,
DefaultAllocator: Allocator<N, R, C>,
type Field = N
The underlying scalar field.
impl<N: ComplexField, R: DimName, C: DimName> FiniteDimInnerSpace for MatrixMN<N, R, C> where
DefaultAllocator: Allocator<N, R, C>,
[src]
DefaultAllocator: Allocator<N, R, C>,
fn orthonormalize(vs: &mut [Self]) -> usize
[src]
fn orthonormal_subspace_basis<F>(vs: &[Self], f: F) where
F: FnMut(&Self) -> bool,
[src]
F: FnMut(&Self) -> bool,