Trait cgmath::Matrix [] [src]

pub trait Matrix<S: BaseFloat, V: Clone + Vector<S> + 'static>: Array2<V, V, S> + Zero + One + ApproxEq<S> + Sized {
    fn mul_s(&self, s: S) -> Self;
    fn div_s(&self, s: S) -> Self;
    fn rem_s(&self, s: S) -> Self;
    fn add_m(&self, m: &Self) -> Self;
    fn sub_m(&self, m: &Self) -> Self;
    fn mul_v(&self, v: &V) -> V;
    fn mul_m(&self, m: &Self) -> Self;
    fn mul_self_s(&mut self, s: S);
    fn div_self_s(&mut self, s: S);
    fn rem_self_s(&mut self, s: S);
    fn add_self_m(&mut self, m: &Self);
    fn sub_self_m(&mut self, m: &Self);
    fn transpose(&self) -> Self;
    fn transpose_self(&mut self);
    fn determinant(&self) -> S;
    fn diagonal(&self) -> V;
    fn invert(&self) -> Option<Self>;
    fn is_diagonal(&self) -> bool;
    fn is_symmetric(&self) -> bool;

    fn mul_self_m(&mut self, m: &Self) { ... }
    fn trace(&self) -> S { ... }
    fn invert_self(&mut self) { ... }
    fn is_invertible(&self) -> bool { ... }
    fn is_identity(&self) -> bool { ... }
}

Required Methods

fn mul_s(&self, s: S) -> Self

Multiply this matrix by a scalar, returning the new matrix.

fn div_s(&self, s: S) -> Self

Divide this matrix by a scalar, returning the new matrix.

fn rem_s(&self, s: S) -> Self

Take the remainder of this matrix by a scalar, returning the new matrix.

fn add_m(&self, m: &Self) -> Self

Add this matrix with another matrix, returning the new metrix.

fn sub_m(&self, m: &Self) -> Self

Subtract another matrix from this matrix, returning the new matrix.

fn mul_v(&self, v: &V) -> V

Multiplay a vector by this matrix, returning a new vector.

fn mul_m(&self, m: &Self) -> Self

Multiply this matrix by another matrix, returning the new matrix.

fn mul_self_s(&mut self, s: S)

Multiply this matrix by a scalar, in-place.

fn div_self_s(&mut self, s: S)

Divide this matrix by a scalar, in-place.

fn rem_self_s(&mut self, s: S)

Take the remainder of this matrix, in-place.

fn add_self_m(&mut self, m: &Self)

Add this matrix with another matrix, in-place.

fn sub_self_m(&mut self, m: &Self)

Subtract another matrix from this matrix, in-place.

fn transpose(&self) -> Self

Transpose this matrix, returning a new matrix.

fn transpose_self(&mut self)

Transpose this matrix in-place.

fn determinant(&self) -> S

Take the determinant of this matrix.

fn diagonal(&self) -> V

Return a vector containing the diagonal of this matrix.

fn invert(&self) -> Option<Self>

Invert this matrix, returning a new matrix. m.mul_m(m.invert()) is the identity matrix. Returns None if this matrix is not invertible (has a determinant of zero).

fn is_diagonal(&self) -> bool

Test if this is a diagonal matrix. That is, every element outside of the diagonal is 0.

fn is_symmetric(&self) -> bool

Test if this matrix is symmetric. That is, it is equal to its transpose.

Provided Methods

fn mul_self_m(&mut self, m: &Self)

Multiply this matrix by another matrix, in-place.

fn trace(&self) -> S

Return the trace of this matrix. That is, the sum of the diagonal.

fn invert_self(&mut self)

Invert this matrix in-place.

fn is_invertible(&self) -> bool

Test if this matrix is invertible.

fn is_identity(&self) -> bool

Test if this matrix is the identity matrix. That is, it is diagonal and every element in the diagonal is one.

Implementors