UT_Matrix2T< T > Class Template Reference

#include <UT_Matrix2.h>

List of all members.

Public Member Functions

 UT_Matrix2T ()
 Construct uninitialized matrix.
 UT_Matrix2T (T val)
 Construct identity matrix, multipled by scalar.
 UT_Matrix2T (T val00, T val01, T val10, T val11)
UT_Matrix2T< T > & operator= (const UT_Matrix3 &m)
UT_Matrix2T< T > & operator+= (const UT_Matrix2T< T > &m)
UT_Matrix2T< T > & operator-= (const UT_Matrix2T< T > &m)
UT_Matrix2T< T > & operator*= (const UT_Matrix2T< T > &m)
unsigned operator== (const UT_Matrix2T< T > &m) const
unsigned operator!= (const UT_Matrix2T< T > &m) const
UT_Matrix2T< T > & operator= (T val)
UT_Matrix2T< T > & operator+= (T scalar)
UT_Matrix2T< T > & operator-= (T scalar)
UT_Matrix2T< T > & operator*= (T scalar)
UT_Matrix2T< T > & operator/= (T scalar)
template<typename S >
UT_Matrix2T< T > & operator= (const UT_Vector2T< S > &vec)
template<typename S >
UT_Matrix2T< T > & operator+= (const UT_Vector2T< S > &vec)
template<typename S >
UT_Matrix2T< T > & operator-= (const UT_Vector2T< S > &vec)
determinant () const
trace () const
template<typename S >
int eigenvalues (UT_Vector2T< S > &r, UT_Vector2T< S > &i) const
 Returns eigenvalues of this matrix.
int invert ()
 Invert this matrix and return 0 if OK, 1 if singular.
int invert (UT_Matrix2T< T > &m) const
tolerance () const
 Returns the tolerance of our class.
template<typename S >
int solve (const UT_Vector2T< S > &b, UT_Vector2T< S > &x) const
void transpose (void)
UT_Matrix2T< T > transpose (void) const
void identity ()
 Set the matrix to identity.
void initialize ()
 Initialize this matrix to zero.
unsigned hash () const
 Compute a hash.
getEuclideanNorm () const
getEuclideanNorm2 () const
 Euclidean norm squared.
int save (ostream &os, int binary) const
bool load (UT_IStream &is)
void outAsciiNoName (ostream &os) const
template<>
float tolerance () const
template<>
double tolerance () const
 UT_Matrix2T (const fpreal32 m[2][2])
 Construct a deep copy of the input row-major data.
 UT_Matrix2T (const fpreal64 m[2][2])
 Construct a deep copy of the input row-major data.
T & operator() (unsigned row, unsigned col)
 Return a matrix entry. No bounds checking on subscripts.
operator() (unsigned row, unsigned col) const
 Return a matrix entry. No bounds checking on subscripts.
const T * data (void) const
 Return the raw matrix data.
T * data (void)
 Return the raw matrix data.
T * operator() (unsigned row)
 Return a matrix row. No bounds checking on subscript.
const T * operator() (unsigned row) const
 Return a matrix row. No bounds checking on subscript.
UT_Vector2T< T > operator[] (unsigned row) const
 Return a matrix row. No bounds checking on subscript.
bool save (UT_JSONWriter &w) const
bool save (UT_JSONValue &v) const
bool load (UT_JSONParser &p)

Static Public Member Functions

static int entries ()
 Returns the vector size.

Friends

ostream & operator<< (ostream &os, const UT_Matrix2T< T > &v)


Detailed Description

template<typename T>
class UT_Matrix2T< T >

This class implements a 2x2 matrix in row-major order.

Most of Houdini operates with row vectors that are left-multiplied with matrices. e.g., z = v * M

Definition at line 68 of file UT_Matrix2.h.


Constructor & Destructor Documentation

template<typename T>
UT_Matrix2T< T >::UT_Matrix2T (  )  [inline]

Construct uninitialized matrix.

Definition at line 72 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T< T >::UT_Matrix2T ( val  )  [inline, explicit]

Construct identity matrix, multipled by scalar.

Definition at line 77 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T< T >::UT_Matrix2T ( const fpreal32  m[2][2]  )  [inline, explicit]

Construct a deep copy of the input row-major data.

Definition at line 84 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T< T >::UT_Matrix2T ( const fpreal64  m[2][2]  )  [inline, explicit]

Construct a deep copy of the input row-major data.

Definition at line 89 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T< T >::UT_Matrix2T ( val00,
val01,
val10,
val11 
) [inline]

This constructor is for convenience; in many situations, it's less efficient than the array-based constructors.

Definition at line 98 of file UT_Matrix2.h.


Member Function Documentation

template<typename T>
T* UT_Matrix2T< T >::data ( void   )  [inline]

Return the raw matrix data.

Definition at line 238 of file UT_Matrix2.h.

template<typename T>
const T* UT_Matrix2T< T >::data ( void   )  const [inline]

Return the raw matrix data.

Definition at line 237 of file UT_Matrix2.h.

template<typename T>
T UT_Matrix2T< T >::determinant (  )  const [inline]

Definition at line 173 of file UT_Matrix2.h.

template<typename T >
template<typename S >
int UT_Matrix2T< T >::eigenvalues ( UT_Vector2T< S > &  r,
UT_Vector2T< S > &  i 
) const [inline]

Returns eigenvalues of this matrix.

Definition at line 91 of file UT_Matrix2.C.

template<typename T>
static int UT_Matrix2T< T >::entries ( void   )  [inline, static]

Returns the vector size.

Definition at line 290 of file UT_Matrix2.h.

template<typename T>
T UT_Matrix2T< T >::getEuclideanNorm (  )  const [inline]

Euclidean or Frobenius norm of a matrix. Does sqrt(sum(a_ij ^2))

Definition at line 262 of file UT_Matrix2.h.

template<typename T >
T UT_Matrix2T< T >::getEuclideanNorm2 (  )  const [inline]

Euclidean norm squared.

Definition at line 149 of file UT_Matrix2.C.

template<typename T>
unsigned UT_Matrix2T< T >::hash (  )  const [inline]

Compute a hash.

Definition at line 242 of file UT_Matrix2.h.

template<typename T>
void UT_Matrix2T< T >::identity (  )  [inline]

Set the matrix to identity.

Definition at line 208 of file UT_Matrix2.h.

template<typename T>
void UT_Matrix2T< T >::initialize ( void   )  [inline]

Initialize this matrix to zero.

Definition at line 215 of file UT_Matrix2.h.

template<typename T>
int UT_Matrix2T< T >::invert ( UT_Matrix2T< T > &  m  )  const [inline]

Invert the matrix and return 0 if OK, 1 if singular. Puts the inverted matrix in m, and leaves this matrix unchanged.

Definition at line 102 of file UT_Matrix2.C.

template<typename T >
int UT_Matrix2T< T >::invert ( void   )  [inline]

Invert this matrix and return 0 if OK, 1 if singular.

Definition at line 68 of file UT_Matrix2.C.

template<typename T >
bool UT_Matrix2T< T >::load ( UT_JSONParser p  )  [inline]

Methods to serialize to a JSON stream. The matrix is stored as an array of 4 reals.

Definition at line 240 of file UT_Matrix2.C.

template<typename T >
bool UT_Matrix2T< T >::load ( UT_IStream is  )  [inline]

Definition at line 185 of file UT_Matrix2.C.

template<typename T>
unsigned UT_Matrix2T< T >::operator!= ( const UT_Matrix2T< T > &  m  )  const [inline]

Definition at line 130 of file UT_Matrix2.h.

template<typename T>
const T* UT_Matrix2T< T >::operator() ( unsigned  row  )  const [inline]

Return a matrix row. No bounds checking on subscript.

Definition at line 251 of file UT_Matrix2.h.

template<typename T>
T* UT_Matrix2T< T >::operator() ( unsigned  row  )  [inline]

Return a matrix row. No bounds checking on subscript.

Definition at line 246 of file UT_Matrix2.h.

template<typename T>
T UT_Matrix2T< T >::operator() ( unsigned  row,
unsigned  col 
) const [inline]

Return a matrix entry. No bounds checking on subscripts.

Definition at line 228 of file UT_Matrix2.h.

template<typename T>
T& UT_Matrix2T< T >::operator() ( unsigned  row,
unsigned  col 
) [inline]

Return a matrix entry. No bounds checking on subscripts.

Definition at line 223 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator*= ( scalar  )  [inline]

Definition at line 151 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T< T > & UT_Matrix2T< T >::operator*= ( const UT_Matrix2T< T > &  m  )  [inline]

Definition at line 45 of file UT_Matrix2.C.

template<typename T >
template<typename S >
UT_Matrix2T< T > & UT_Matrix2T< T >::operator+= ( const UT_Vector2T< S > &  vec  )  [inline]

Definition at line 330 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator+= ( scalar  )  [inline]

Definition at line 141 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator+= ( const UT_Matrix2T< T > &  m  )  [inline]

Definition at line 115 of file UT_Matrix2.h.

template<typename T >
template<typename S >
UT_Matrix2T< T > & UT_Matrix2T< T >::operator-= ( const UT_Vector2T< S > &  vec  )  [inline]

Definition at line 340 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator-= ( scalar  )  [inline]

Definition at line 147 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator-= ( const UT_Matrix2T< T > &  m  )  [inline]

Definition at line 121 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator/= ( scalar  )  [inline]

Definition at line 157 of file UT_Matrix2.h.

template<typename T >
template<typename S >
UT_Matrix2T< T > & UT_Matrix2T< T >::operator= ( const UT_Vector2T< S > &  vec  )  [inline]

Definition at line 320 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T>& UT_Matrix2T< T >::operator= ( val  )  [inline]

Definition at line 135 of file UT_Matrix2.h.

template<typename T >
UT_Matrix2T< T > & UT_Matrix2T< T >::operator= ( const UT_Matrix3 m  )  [inline]

Conversion operator that returns a 2x2 from a 3x3 matrix by ignoring the last row and last column.

Definition at line 36 of file UT_Matrix2.C.

template<typename T>
unsigned UT_Matrix2T< T >::operator== ( const UT_Matrix2T< T > &  m  )  const [inline]

Definition at line 59 of file UT_Matrix2.C.

template<typename T >
UT_Vector2T< T > UT_Matrix2T< T >::operator[] ( unsigned  row  )  const [inline]

Return a matrix row. No bounds checking on subscript.

Definition at line 349 of file UT_Matrix2.h.

template<typename T >
void UT_Matrix2T< T >::outAsciiNoName ( ostream &  os  )  const [inline]

Definition at line 209 of file UT_Matrix2.C.

template<typename T >
bool UT_Matrix2T< T >::save ( UT_JSONValue v  )  const [inline]

Methods to serialize to a JSON stream. The matrix is stored as an array of 4 reals.

Definition at line 234 of file UT_Matrix2.C.

template<typename T >
bool UT_Matrix2T< T >::save ( UT_JSONWriter w  )  const [inline]

Methods to serialize to a JSON stream. The matrix is stored as an array of 4 reals.

Definition at line 228 of file UT_Matrix2.C.

template<typename T >
int UT_Matrix2T< T >::save ( ostream &  os,
int  binary 
) const [inline]

Definition at line 165 of file UT_Matrix2.C.

template<typename T >
template<typename S >
int UT_Matrix2T< T >::solve ( const UT_Vector2T< S > &  b,
UT_Vector2T< S > &  x 
) const [inline]

Definition at line 123 of file UT_Matrix2.C.

template<>
double UT_Matrix2T< double >::tolerance (  )  const [inline]

Definition at line 312 of file UT_Matrix2.h.

template<>
float UT_Matrix2T< float >::tolerance (  )  const [inline]

Definition at line 305 of file UT_Matrix2.h.

template<typename T>
T UT_Matrix2T< T >::tolerance (  )  const

Returns the tolerance of our class.

template<typename T>
T UT_Matrix2T< T >::trace (  )  const [inline]

Definition at line 177 of file UT_Matrix2.h.

template<typename T>
UT_Matrix2T<T> UT_Matrix2T< T >::transpose ( void   )  const

template<typename T >
UT_Matrix2T< T > UT_Matrix2T< T >::transpose ( void   )  [inline]

Definition at line 200 of file UT_Matrix2.h.


Friends And Related Function Documentation

template<typename T>
ostream& operator<< ( ostream &  os,
const UT_Matrix2T< T > &  v 
) [friend]

Definition at line 282 of file UT_Matrix2.h.


Member Data Documentation

template<typename T>
T UT_Matrix2T< T >::matx[2][2]

Definition at line 296 of file UT_Matrix2.h.

template<typename T>
T UT_Matrix2T< T >::myFloats[4]

Definition at line 297 of file UT_Matrix2.h.


The documentation for this class was generated from the following files:

Generated on Mon Jan 28 00:30:11 2013 for HDK by  doxygen 1.5.9