Struct nalgebra::Mat2 [] [src]

pub struct Mat2<N> {
    pub m11: N,
    pub m21: N,
    pub m12: N,
    pub 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> Mat2<N>

fn as_array(&self) -> &[[N; 2]; 2][]

View this matrix as a column-major array of arrays.

fn as_array_mut<'a>(&'a mut self) -> &'a mut [[N; 2]; 2][]

View this matrix as a column-major mutable array of arrays.

fn from_array_ref(array: &[[N; 2]; 2]) -> &Mat2<N>[]

View a column-major array of array as a vector.

fn from_array_mut(array: &mut [[N; 2]; 2]) -> &mut Mat2<N>[]

View a column-major array of array as a mutable vector.

impl<N: Copy> Mat2<N>

unsafe fn at_fast(&self, (i, j): (usize, usize)) -> N

unsafe fn set_fast(&mut self, (i, j): (usize, usize), val: N)

Trait Implementations

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

fn new_identity(dim: usize) -> Mat2<N>

impl<N: Copy> Repeat<N> for Mat2<N>

fn repeat(val: N) -> Mat2<N>

impl<Nin: Copy, Nout: Copy + Cast<Nin>> Cast<Mat2<Nin>> for Mat2<Nout>

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

impl<N: Add<N, Output=N>> Add<Mat2<N>> for Mat2<N>

type Output = Mat2<N>

fn add(self, right: Mat2<N>) -> Mat2<N>

impl<N: Sub<N, Output=N>> Sub<Mat2<N>> for Mat2<N>

type Output = Mat2<N>

fn sub(self, right: Mat2<N>) -> Mat2<N>

impl<N: Copy + Add<N, Output=N>> Add<N> for Mat2<N>

type Output = Mat2<N>

fn add(self, right: N) -> Mat2<N>

impl<N: Copy + Sub<N, Output=N>> Sub<N> for Mat2<N>

type Output = Mat2<N>

fn sub(self, right: N) -> Mat2<N>

impl<N: Copy + Mul<N, Output=N>> Mul<N> for Mat2<N>

type Output = Mat2<N>

fn mul(self, right: N) -> Mat2<N>

impl<N: Copy + Div<N, Output=N>> Div<N> for Mat2<N>

type Output = Mat2<N>

fn div(self, right: N) -> Mat2<N>

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

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

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

fn zero() -> Mat2<N>

fn is_zero(&self) -> bool

impl<N: Copy + BaseNum> One for Mat2<N>

fn one() -> Mat2<N>

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

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

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

fn iter_mut<'l>(&'l mut self) -> IterMut<'l, N>

impl<N> Dim for Mat2<N>

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

impl<N> Shape<(usize, usize)> for Mat2<N>

fn shape(&self) -> (usize, usize)

impl<N: Copy> Indexable<(usize, usize), N> for Mat2<N>

fn swap(&mut self, (i1, j1): (usize, usize), (i2, j2): (usize, usize))

unsafe fn unsafe_at(&self, (i, j): (usize, usize)) -> N

unsafe fn unsafe_set(&mut self, (i, j): (usize, usize), val: N)

impl<N> Index<(usize, usize)> for Mat2<N>

type Output = N

fn index(&self, (i, j): (usize, usize)) -> &N

impl<N> IndexMut<(usize, usize)> for Mat2<N>

fn index_mut(&mut self, (i, j): (usize, usize)) -> &mut N

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

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

fn transpose_mut(&mut self)

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

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

fn approx_ulps(_: Option<Mat2<N>>) -> u32

fn approx_eq_eps(&self, other: &Mat2<N>, epsilon: &N) -> bool

fn approx_eq_ulps(&self, other: &Mat2<N>, ulps: u32) -> bool

fn approx_eq(&self, other: &Self) -> bool

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

fn nrows(&self) -> usize

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

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

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

fn ncols(&self) -> usize

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

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

impl<N: Clone + Copy + Zero> ColSlice<DVec2<N>> for Mat2<N>

fn col_slice(&self, cid: usize, rstart: usize, rend: usize) -> DVec2<N>

impl<N: Clone + Copy + Zero> RowSlice<DVec2<N>> for Mat2<N>

fn row_slice(&self, rid: usize, cstart: usize, cend: usize) -> DVec2<N>

impl<N: Copy + Zero> Diag<Vec2<N>> for Mat2<N>

fn from_diag(diag: &Vec2<N>) -> Mat2<N>

fn diag(&self) -> Vec2<N>

impl<N: Copy + Zero> DiagMut<Vec2<N>> for Mat2<N>

fn set_diag(&mut self, diag: &Vec2<N>)

impl<N: BaseNum + Copy> ToHomogeneous<Mat3<N>> for Mat2<N>

fn to_homogeneous(&self) -> Mat3<N>

impl<N: BaseNum + Copy> FromHomogeneous<Mat3<N>> for Mat2<N>

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

impl<N> EigenQR<N, Vec2<N>> for Mat2<N> where N: BaseFloat + ApproxEq<N> + Clone

fn eigen_qr(&self, eps: &N, niter: usize) -> (Mat2<N>, Vec2<N>)

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

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

Derived Implementations

impl<N: Copy> Copy for Mat2<N>

impl<N: Debug> Debug for Mat2<N>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<N: Hash> Hash for Mat2<N>

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

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

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

fn clone_from(&mut self, source: &Self)

impl<N: Decodable> Decodable for Mat2<N>

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Mat2<N>, __D::Error>

impl<N: Encodable> Encodable for Mat2<N>

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl<N: PartialEq> PartialEq for Mat2<N>

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

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

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