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

type MatrixN<N, D> = MatrixMN<N, D, D>;

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

Methods

impl<N, D: DimName> MatrixN<N, D> where
    N: Scalar + Ring,
    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);

Trait Implementations

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: RealField, 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: RealField, 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, 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]

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> One for MatrixN<N, D> where
    N: Scalar + Zero + One + ClosedMul + ClosedAdd,
    DefaultAllocator: Allocator<N, D, D>, 
[src]

fn set_one(&mut self)[src]

Sets self to the multiplicative identity element of Self, 1.

fn is_one(&self) -> bool where
    Self: PartialEq<Self>, 
[src]

Returns true if self is equal to the multiplicative identity. Read more

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

fn op(&self, O, lhs: &Self) -> Self[src]

Performs specific operation.

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

fn prop_is_associative_approx(args: (Self, Self, Self)) -> bool where
    Self: RelativeEq<Self>, 
[src]

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]

Returns true if associativity holds for the given arguments.

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

fn prop_operating_identity_element_is_noop_approx(args: (Self,)) -> bool where
    Self: RelativeEq<Self>, 
[src]

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]

Checks whether operating with the identity element is a no-op for the given argument. Read more

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

fn id(O) -> Self[src]

Specific identity.

impl<N: RealField, D: DimNameSub<U1>> Transformation<Point<N, <D as DimNameSub<U1>>::Output>> for MatrixN<N, D> where
    DefaultAllocator: Allocator<N, D, D> + Allocator<N, DimNameDiff<D, U1>> + Allocator<N, DimNameDiff<D, U1>, DimNameDiff<D, U1>>, 
[src]