[src]

Struct nalgebra::structs::mat::Mat2

pub struct Mat2<N> {
    m11: N,
    m21: N,
    m12: N,
    m22: N,
}

Square matrix of dimension 2.

Fields

m11
m21
m12
m22

Methods

impl<N> Mat2<N>

fn new(m11: N, m12: N, m21: N, m22: N) -> Mat2<N>

impl<N: Clone> Mat2<N>

unsafe fn at_fast(&self, (tuple arg NYI): (uint, uint)) -> N

unsafe fn set_fast(&mut self, (tuple arg NYI): (uint, uint), val: N)

Trait Implementations

impl<N: Eq> Eq for Mat2<N>

Automatically derived.

fn eq(&self, __arg_0: &Mat2<N>) -> bool

fn ne(&self, __arg_0: &Mat2<N>) -> bool

impl<__E: Encoder, N: Encodable<__E>> Encodable<__E> for Mat2<N>

Automatically derived.

fn encode(&self, __arg_0: &mut __E)

impl<__D: Decoder, N: Decodable<__D>> Decodable<__D> for Mat2<N>

Automatically derived.

fn decode(__arg_0: &mut __D) -> Mat2<N>

impl<N: Clone> Clone for Mat2<N>

Automatically derived.

fn clone(&self) -> Mat2<N>

impl<N: DeepClone> DeepClone for Mat2<N>

Automatically derived.

fn deep_clone(&self) -> Mat2<N>

impl<N: IterBytes> IterBytes for Mat2<N>

Automatically derived.

fn iter_bytes(&self, __arg_0: bool, __arg_1: Cb) -> bool

impl<N: Rand> Rand for Mat2<N>

Automatically derived.

fn rand<R: Rng>(__arg_0: &mut R) -> Mat2<N>

impl<N: Zero> Zero for Mat2<N>

Automatically derived.

fn zero() -> Mat2<N>

fn is_zero(&self) -> bool

impl<N: ToStr> ToStr for Mat2<N>

Automatically derived.

fn to_str(&self) -> ~str

impl<N, Rhs: Mat2MulRhs<N, Res>, Res> Mul<Rhs, Res> for Mat2<N>

fn mul(&self, other: &Rhs) -> Res

impl<N, Rhs: Mat2DivRhs<N, Res>, Res> Div<Rhs, Res> for Mat2<N>

fn div(&self, other: &Rhs) -> Res

impl<N, Rhs: Mat2AddRhs<N, Res>, Res> Add<Rhs, Res> for Mat2<N>

fn add(&self, other: &Rhs) -> Res

impl<N, Rhs: Mat2SubRhs<N, Res>, Res> Sub<Rhs, Res> for Mat2<N>

fn sub(&self, other: &Rhs) -> Res

impl<T: Mat2Cast<N>, N> Cast<T> for Mat2<N>

fn from(t: T) -> Mat2<N>

Converts an element of type T to an element of type Self.

impl<Nin: Clone, Nout: Clone + Cast<Nin>> Mat2Cast<Nout> for Mat2<Nin>

fn to(v: Mat2<Nin>) -> Mat2<Nout>

impl<N: Clone + Add<N, N>> Mat2AddRhs<N, Mat2<N>> for Mat2<N>

fn binop(left: &Mat2<N>, right: &Mat2<N>) -> Mat2<N>

impl<N: Clone + Sub<N, N>> Mat2SubRhs<N, Mat2<N>> for Mat2<N>

fn binop(left: &Mat2<N>, right: &Mat2<N>) -> Mat2<N>

impl<N: Signed> Absolute<Mat2<N>> for Mat2<N>

fn abs(m: &Mat2<N>) -> Mat2<N>

Computes some absolute value of this object. Typically, this will make all component of a matrix or vector positive.

impl<N: Clone + One + Zero> One for Mat2<N>

fn one() -> Mat2<N>

impl<N> Iterable<N> for Mat2<N>

fn iter<'l>(&'l self) -> VecIterator<'l, N>

Gets a vector-like read-only iterator.

impl<N> IterableMut<N> for Mat2<N>

fn mut_iter<'l>(&'l mut self) -> VecMutIterator<'l, N>

Gets a vector-like read-write iterator.

impl<N> Dim for Mat2<N>

fn dim(_: Option<Mat2<N>>) -> uint

The dimension of the object.

impl<N: Clone> Indexable<(uint, uint), N> for Mat2<N>

fn at(&self, (tuple arg NYI): (uint, uint)) -> N

Reads the i-th element of self.

fn set(&mut self, (tuple arg NYI): (uint, uint), val: N)

Writes to the i-th element of self.

fn swap(&mut self, (tuple arg NYI): (uint, uint), (tuple arg NYI): (uint, uint))

Swaps the i-th element of self with its j-th element.

unsafe fn unsafe_at(&self, (tuple arg NYI): (uint, uint)) -> N

Reads the i-th element of self.

i is not checked.

unsafe fn unsafe_set(&mut self, (tuple arg NYI): (uint, uint), val: N)

Writes to the i-th element of self.

i is not checked.

impl<N: Clone> Transpose for Mat2<N>

fn transpose_cpy(m: &Mat2<N>) -> Mat2<N>

Computes the transpose of a matrix.

fn transpose(&mut self)

In-place version of transposed.

impl<N: ApproxEq<N>> ApproxEq<N> for Mat2<N>

fn approx_epsilon(_: Option<Mat2<N>>) -> N

Default epsilon for approximation.

fn approx_eq(a: &Mat2<N>, b: &Mat2<N>) -> bool

Tests approximate equality.

fn approx_eq_eps(a: &Mat2<N>, b: &Mat2<N>, epsilon: &N) -> bool

Tests approximate equality using a custom epsilon.

impl<N: Clone + Zero> Row<Vec2<N>> for Mat2<N>

fn nrows(&self) -> uint

The number of column of self.

fn set_row(&mut self, row: uint, v: Vec2<N>)

Writes the i-th row of self.

fn row(&self, row: uint) -> Vec2<N>

Reads the i-th row of self.

impl<N: Clone + Zero> Col<Vec2<N>> for Mat2<N>

fn ncols(&self) -> uint

The number of column of this matrix or vector.

fn set_col(&mut self, col: uint, v: Vec2<N>)

Writes the i-th column of self.

fn col(&self, col: uint) -> Vec2<N>

Reads the i-th column of self.

impl<N: One + Zero + Clone> ToHomogeneous<Mat3<N>> for Mat2<N>

fn to_homogeneous(m: &Mat2<N>) -> Mat3<N>

Gets the homogeneous coordinates form of this object.

impl<N: One + Zero + Clone> FromHomogeneous<Mat3<N>> for Mat2<N>

fn from(m: &Mat3<N>) -> Mat2<N>

Builds an object from its homogeneous coordinate form.

Note that this this is not required that from is the inverse of to_homogeneous. Typically, from will remove some informations unrecoverable by to_homogeneous.