[][src]Type Definition nalgebra::base::MatrixN

type MatrixN<N, D> = Matrix<N, D, D, Owned<N, D, D>>;

A statically sized column-major square matrix with D rows and columns.

Because this is an alias, not all its methods are listed here. See the Matrix type too.

Implementations

impl<N, D: DimName> MatrixN<N, D> where
    N: Scalar + Zero + One,
    DefaultAllocator: Allocator<N, D, D>, 
[src]

pub fn new_scaling(scaling: N) -> Self[src]

Creates a new homogeneous matrix that applies the same scaling factor on each dimension.

pub fn new_nonuniform_scaling<SB>(
    scaling: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
    D: DimNameSub<U1>,
    SB: Storage<N, DimNameDiff<D, U1>>, 
[src]

Creates a new homogeneous matrix that applies a distinct scaling factor for each dimension.

pub fn new_translation<SB>(
    translation: &Vector<N, DimNameDiff<D, U1>, SB>
) -> Self where
    D: DimNameSub<U1>,
    SB: Storage<N, DimNameDiff<D, U1>>, 
[src]

Creates a new homogeneous matrix that applies a pure translation.

impl<N, D: Dim> MatrixN<N, D> where
    N: Scalar,
    DefaultAllocator: Allocator<N, D, D>, 
[src]

pub fn from_diagonal<SB: Storage<N, D>>(diag: &Vector<N, D, SB>) -> Self where
    N: Zero
[src]

Creates a square matrix with its diagonal set to diag and all other entries set to 0.

Example


let m = Matrix3::from_diagonal(&Vector3::new(1.0, 2.0, 3.0));
// The two additional arguments represent the matrix dimensions.
let dm = DMatrix::from_diagonal(&DVector::from_row_slice(&[1.0, 2.0, 3.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 == 3.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)] == 3.0);

impl<N: ComplexField, D> MatrixN<N, D> where
    D: DimMin<D, Output = D>,
    DefaultAllocator: Allocator<N, D, D> + Allocator<(usize, usize), DimMinimum<D, D>> + Allocator<N, D> + Allocator<N::RealField, D> + Allocator<N::RealField, D, D>, 
[src]

pub fn exp(&self) -> Self[src]

Computes exponential of this matrix

Trait Implementations

impl<N: SimdRealField, D: DimName, R> From<Isometry<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
    D: DimNameAdd<U1>,
    R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
    DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>> + Allocator<N, D>, 
[src]

impl<N: SimdRealField, D: DimName, R> From<Similarity<N, D, R>> for MatrixN<N, DimNameSum<D, U1>> where
    D: DimNameAdd<U1>,
    R: SubsetOf<MatrixN<N, DimNameSum<D, U1>>>,
    DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, 
[src]

impl<N: RealField, D: DimName, C> From<Transform<N, D, C>> for MatrixN<N, DimNameSum<D, U1>> where
    D: DimNameAdd<U1>,
    C: TCategory,
    DefaultAllocator: Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, 
[src]

impl<N: Scalar + Zero + One, D: DimName> From<Translation<N, D>> for MatrixN<N, DimNameSum<D, U1>> where
    D: DimNameAdd<U1>,
    DefaultAllocator: Allocator<N, D> + Allocator<N, DimNameSum<D, U1>, DimNameSum<D, U1>>, 
[src]

impl<N, D: DimName> One for MatrixN<N, D> where
    N: Scalar + Zero + One + ClosedMul + ClosedAdd,
    DefaultAllocator: Allocator<N, D, D>, 
[src]

impl<'a, N, D: DimName> Product<&'a Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>> for MatrixN<N, D> where
    N: Scalar + Zero + One + ClosedMul + ClosedAdd,
    DefaultAllocator: Allocator<N, D, D>, 
[src]

impl<N, D: DimName> Product<Matrix<N, D, D, <DefaultAllocator as Allocator<N, D, D>>::Buffer>> for MatrixN<N, D> where
    N: Scalar + Zero + One + ClosedMul + ClosedAdd,
    DefaultAllocator: Allocator<N, D, D>, 
[src]