Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Matrix2x2 Struct Reference

Basic 2x2 matrix data type. More...

#include <mitsuba/core/matrix.h>

+ Inheritance diagram for mitsuba::Matrix2x2:

Public Member Functions

 Matrix2x2 ()
 
 Matrix2x2 (Float value)
 Initialize the matrix with constant entries. More...
 
 Matrix2x2 (const Float _m[2][2])
 Initialize the matrix from a given 2x2 array. More...
 
 Matrix2x2 (const Float _m[4])
 Initialize the matrix from a given (float) 2x2 array in row-major order. More...
 
 Matrix2x2 (const Vector2 &v1, const Vector2 &v2)
 Initialize the matrix from two 2D column vectors. More...
 
 Matrix2x2 (Stream *stream)
 Unserialize a matrix from a stream. More...
 
 Matrix2x2 (const Matrix< 2, 2, Float > &mtx)
 Copy constructor. More...
 
 Matrix2x2 (Float a00, Float a01, Float a10, Float a11)
 Initialize with the given values. More...
 
Float det () const
 Return the determinant (Faster than Matrix::det) More...
 
FINLINE bool invert2x2 (Matrix2x2 &target) const
 Compute the inverse (Faster than Matrix::invert) More...
 
FINLINE bool invert (Matrix2x2 &target) const
 
FINLINE bool invert2x2 (Matrix2x2 &target, Float &det) const
 Compute the inverse with det (Faster than Matrix::invert) More...
 
Vector2 operator* (const Vector2 &v) const
 Matrix-vector multiplication. More...
 
Matrix2x2 operator* (Float value) const
 Scalar multiplication (creates a temporary) More...
 
Matrix2x2operator= (const Matrix< 2, 2, Float > &mat)
 Assignment operator. More...
 
Vector2 row (int i) const
 Return a row by index. More...
 
Vector2 col (int i) const
 Return a column by index. More...
 
- Public Member Functions inherited from mitsuba::Matrix< 2, 2, Float >
 Matrix ()
 Construct a new MxN matrix without initializing it. More...
 
 Matrix (Floatvalue)
 Initialize the matrix with constant entries. More...
 
 Matrix (const Float_m[M][N])
 Initialize the matrix from a given MxN array. More...
 
 Matrix (const Float_m[M *N])
 Initialize the matrix from a given (flat) MxN array in row-major order. More...
 
 Matrix (Stream *stream)
 Unserialize a matrix from a stream. More...
 
 Matrix (const Matrix &mtx)
 Copy constructor. More...
 
void setIdentity ()
 Initialize with the identity matrix. More...
 
void setZero ()
 Initialize with zeroes. More...
 
Floatoperator() (int i, int j)
 Indexing operator. More...
 
const Floatoperator() (int i, int j) const
 Indexing operator (const verions) More...
 
bool operator== (const Matrix &mat) const
 Equality operator. More...
 
bool operator!= (const Matrix &mat) const
 Inequality operator. More...
 
Matrixoperator= (const Matrix &mat)
 Assignment operator. More...
 
Matrix operator+ (const Matrix &mat) const
 Matrix addition (returns a temporary) More...
 
Matrix operator+ (Floatvalue) const
 Matrix-scalar addition (returns a temporary) More...
 
const Matrixoperator+= (const Matrix &mat)
 Matrix addition. More...
 
const Matrixoperator+= (Floatvalue)
 Matrix-scalar addition. More...
 
Matrix operator- (const Matrix &mat) const
 Matrix subtraction (returns a temporary) More...
 
Matrix operator- (Floatvalue) const
 Matrix-scalar subtraction (returns a temporary) More...
 
const Matrixoperator- (Floatvalue)
 Matrix-scalar subtraction. More...
 
Matrix operator- () const
 Component-wise negation. More...
 
const Matrixoperator-= (const Matrix &mat)
 Matrix subtraction. More...
 
const Matrixoperator-= (Floatvalue)
 Matrix-scalar addition. More...
 
Matrix operator* (Floatvalue) const
 Scalar multiplication (creates a temporary) More...
 
const Matrixoperator*= (Floatvalue)
 Scalar multiplication. More...
 
const Matrixoperator*= (const Matrix &mat)
 Matrix multiplication (for square matrices) More...
 
Matrix operator/ (Floatvalue) const
 Scalar division (creates a temporary) More...
 
const Matrixoperator/= (Floatvalue)
 Scalar division. More...
 
Float trace () const
 Compute the trace of a square matrix. More...
 
Float frob () const
 Compute the Frobenius norm. More...
 
bool lu (Matrix &LU, int piv[M], int &pivsign) const
 Compute the LU decomposition of a matrix. More...
 
bool chol (Matrix &L) const
 
void cholSolve (const Matrix< M, K, Float > &B, Matrix< M, K, Float > &X) const
 
void luSolve (const Matrix< M, K, Float > &B, Matrix< M, K, Float > &X, int piv[M]) const
 
Float luDet (int pivsign) const
 Compute the determinant of a decomposed matrix created by lu() More...
 
Float cholDet () const
 Compute the determinant of a decomposed matrix created by chol() More...
 
bool isZero () const
 Check if the matrix is identically zero. More...
 
bool isIdentity () const
 Test if this is the identity matrix. More...
 
Float det () const
 Compute the determinant of a square matrix (internally creates a LU decomposition) More...
 
bool invert (Matrix &target) const
 Compute the inverse of a square matrix using the Gauss-Jordan algorithm. More...
 
void symEig (Matrix &Q, Floatd[M]) const
 Perform a symmetric eigendecomposition of a square matrix into Q and D. More...
 
void transpose (Matrix< N, M, Float > &target) const
 Compute the transpose of this matrix. More...
 
void serialize (Stream *stream) const
 Serialize the matrix to a stream. More...
 
std::string toString () const
 Return a string representation. More...
 

Additional Inherited Members

- Public Attributes inherited from mitsuba::Matrix< 2, 2, Float >
Float m [M][N]
 
- Static Protected Member Functions inherited from mitsuba::Matrix< 2, 2, Float >
static void tred2 (FloatV[M][N], Floatd[N], Floate[N])
 Symmetric Householder reduction to tridiagonal form. More...
 
static void tql2 (FloatV[M][N], Floatd[N], Floate[N])
 Symmetric tridiagonal QL algorithm. More...
 

Detailed Description

Basic 2x2 matrix data type.

Constructor & Destructor Documentation

mitsuba::Matrix2x2::Matrix2x2 ( )
inline
mitsuba::Matrix2x2::Matrix2x2 ( Float  value)
inlineexplicit

Initialize the matrix with constant entries.

mitsuba::Matrix2x2::Matrix2x2 ( const Float  _m[2][2])
inlineexplicit

Initialize the matrix from a given 2x2 array.

mitsuba::Matrix2x2::Matrix2x2 ( const Float  _m[4])
inlineexplicit

Initialize the matrix from a given (float) 2x2 array in row-major order.

mitsuba::Matrix2x2::Matrix2x2 ( const Vector2 v1,
const Vector2 v2 
)
inlineexplicit

Initialize the matrix from two 2D column vectors.

mitsuba::Matrix2x2::Matrix2x2 ( Stream stream)
inlineexplicit

Unserialize a matrix from a stream.

mitsuba::Matrix2x2::Matrix2x2 ( const Matrix< 2, 2, Float > &  mtx)
inline

Copy constructor.

mitsuba::Matrix2x2::Matrix2x2 ( Float  a00,
Float  a01,
Float  a10,
Float  a11 
)
inline

Initialize with the given values.

Member Function Documentation

Vector2 mitsuba::Matrix2x2::col ( int  i) const
inline

Return a column by index.

Float mitsuba::Matrix2x2::det ( ) const
inline

Return the determinant (Faster than Matrix::det)

FINLINE bool mitsuba::Matrix2x2::invert ( Matrix2x2 target) const
inline
FINLINE bool mitsuba::Matrix2x2::invert2x2 ( Matrix2x2 target) const
inline

Compute the inverse (Faster than Matrix::invert)

FINLINE bool mitsuba::Matrix2x2::invert2x2 ( Matrix2x2 target,
Float det 
) const
inline

Compute the inverse with det (Faster than Matrix::invert)

Vector2 mitsuba::Matrix2x2::operator* ( const Vector2 v) const
inline

Matrix-vector multiplication.

Matrix2x2 mitsuba::Matrix2x2::operator* ( Float  value) const
inline

Scalar multiplication (creates a temporary)

Matrix2x2& mitsuba::Matrix2x2::operator= ( const Matrix< 2, 2, Float > &  mat)
inline

Assignment operator.

Vector2 mitsuba::Matrix2x2::row ( int  i) const
inline

Return a row by index.


The documentation for this struct was generated from the following file: