UT_TMatrix2< T > Class Template Reference

#include <UT_Matrix2.h>

List of all members.

Public Member Functions

 UT_TMatrix2 ()
 Construct uninitialized matrix.
 UT_TMatrix2 (T val)
 Construct identity matrix, multipled by scalar.
 UT_TMatrix2 (T val00, T val01, T val10, T val11)
UT_TMatrix2< T > & operator= (const UT_Matrix3 &m)
UT_TMatrix2< T > & operator+= (const UT_TMatrix2< T > &m)
UT_TMatrix2< T > & operator-= (const UT_TMatrix2< T > &m)
UT_TMatrix2< T > & operator*= (const UT_TMatrix2< T > &m)
unsigned operator== (const UT_TMatrix2< T > &m) const
unsigned operator!= (const UT_TMatrix2< T > &m) const
UT_TMatrix2< T > & operator= (T val)
UT_TMatrix2< T > & operator+= (T scalar)
UT_TMatrix2< T > & operator-= (T scalar)
UT_TMatrix2< T > & operator*= (T scalar)
UT_TMatrix2< T > & operator/= (T scalar)
UT_TMatrix2< T > & operator= (const UT_Vector2 &vec)
UT_TMatrix2< T > & operator+= (const UT_Vector2 &vec)
UT_TMatrix2< T > & operator-= (const UT_Vector2 &vec)
determinant () const
trace () const
int eigenvalues (UT_Vector2 &r, UT_Vector2 &i) const
 Returns eigenvalues of this matrix.
int invert ()
 Invert this matrix and return 0 if OK, 1 if singular.
int invert (UT_TMatrix2< T > &m) const
tolerance () const
 Returns the tolerance of our class.
int solve (const UT_Vector2 &b, UT_Vector2 &x) const
void transpose (void)
UT_TMatrix2< T > transpose (void) const
void identity ()
 Set the matrix to identity.
void initialize ()
 Initialize this matrix to zero.
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<>
double tolerance () const
 UT_TMatrix2 (const fpreal32 m[2][2])
 Construct a deep copy of the input row-major data.
 UT_TMatrix2 (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.
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_Vector2 operator[] (unsigned row) const
 Return a matrix row. No bounds checking on subscript.

Friends

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


Detailed Description

template<typename T>
class UT_TMatrix2< 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 70 of file UT_Matrix2.h.


Constructor & Destructor Documentation

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

Construct uninitialized matrix.

Definition at line 74 of file UT_Matrix2.h.

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

Construct identity matrix, multipled by scalar.

Definition at line 79 of file UT_Matrix2.h.

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

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

Definition at line 86 of file UT_Matrix2.h.

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

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

Definition at line 91 of file UT_Matrix2.h.

template<typename T>
UT_TMatrix2< T >::UT_TMatrix2 ( 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 100 of file UT_Matrix2.h.


Member Function Documentation

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

Definition at line 172 of file UT_Matrix2.h.

template<typename T >
int UT_TMatrix2< T >::eigenvalues ( UT_Vector2 r,
UT_Vector2 i 
) const [inline]

Returns eigenvalues of this matrix.

Definition at line 87 of file UT_Matrix2.C.

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

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

Definition at line 250 of file UT_Matrix2.h.

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

Euclidean norm squared.

Definition at line 144 of file UT_Matrix2.C.

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

Set the matrix to identity.

Definition at line 205 of file UT_Matrix2.h.

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

Initialize this matrix to zero.

Definition at line 212 of file UT_Matrix2.h.

template<typename T>
int UT_TMatrix2< T >::invert ( UT_TMatrix2< 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 98 of file UT_Matrix2.C.

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

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

Definition at line 65 of file UT_Matrix2.C.

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

Definition at line 180 of file UT_Matrix2.C.

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

Definition at line 132 of file UT_Matrix2.h.

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

Return a matrix row. No bounds checking on subscript.

Definition at line 239 of file UT_Matrix2.h.

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

Return a matrix row. No bounds checking on subscript.

Definition at line 234 of file UT_Matrix2.h.

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

Return a matrix entry. No bounds checking on subscripts.

Definition at line 225 of file UT_Matrix2.h.

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

Return a matrix entry. No bounds checking on subscripts.

Definition at line 220 of file UT_Matrix2.h.

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

Definition at line 153 of file UT_Matrix2.h.

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

Definition at line 42 of file UT_Matrix2.C.

template<typename T>
UT_TMatrix2< T > & UT_TMatrix2< T >::operator+= ( const UT_Vector2 vec  )  [inline]

Definition at line 301 of file UT_Matrix2.h.

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

Definition at line 143 of file UT_Matrix2.h.

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

Definition at line 117 of file UT_Matrix2.h.

template<typename T>
UT_TMatrix2< T > & UT_TMatrix2< T >::operator-= ( const UT_Vector2 vec  )  [inline]

Definition at line 310 of file UT_Matrix2.h.

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

Definition at line 149 of file UT_Matrix2.h.

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

Definition at line 123 of file UT_Matrix2.h.

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

Definition at line 159 of file UT_Matrix2.h.

template<typename T>
UT_TMatrix2< T > & UT_TMatrix2< T >::operator= ( const UT_Vector2 vec  )  [inline]

Definition at line 292 of file UT_Matrix2.h.

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

Definition at line 137 of file UT_Matrix2.h.

template<typename T >
UT_TMatrix2< T > & UT_TMatrix2< 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 33 of file UT_Matrix2.C.

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

Definition at line 56 of file UT_Matrix2.C.

template<typename T >
UT_Vector2 UT_TMatrix2< T >::operator[] ( unsigned  row  )  const [inline]

Return a matrix row. No bounds checking on subscript.

Definition at line 319 of file UT_Matrix2.h.

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

Definition at line 204 of file UT_Matrix2.C.

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

Definition at line 160 of file UT_Matrix2.C.

template<typename T >
int UT_TMatrix2< T >::solve ( const UT_Vector2 b,
UT_Vector2 x 
) const [inline]

Definition at line 118 of file UT_Matrix2.C.

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

Definition at line 285 of file UT_Matrix2.h.

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

Returns the tolerance of our class.

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

Definition at line 176 of file UT_Matrix2.h.

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

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

Definition at line 197 of file UT_Matrix2.h.


Friends And Related Function Documentation

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

Definition at line 262 of file UT_Matrix2.h.


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

Generated on Fri May 25 00:10:55 2012 for HDK by  doxygen 1.5.9