ColMatrix3x3< T > Class Template Reference

#include <TAPsColMatrix3x3.hpp>

Collaboration diagram for ColMatrix3x3< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ColMatrix3x3 (T const af[9])
 ColMatrix3x3 (T, T, T, T, T, T, T, T, T)
 ColMatrix3x3 (T)
 ColMatrix3x3 (ColMatrix3x3< T > const &M)
 ColMatrix3x3 ()
const double * GetDataDouble () const
const float * GetDataFloat () const
const long double * GetDataLongDouble () const
GetDeterminant () const
ColMatrix3x3< T > GetInverse () const
ColMatrix3x3< T > GetTranspose () const
const double * GetTransposeDataDouble () const
const float * GetTransposeDataFloat () const
const long double * GetTransposeDataLongDouble () const
ColMatrix3x3< T > & Inversed ()
void MakeDiagonal (T const af[3])
void MakeDiagonal (T d)
void MakeIdentity ()
void MakeZero ()
void MultLeft (ColMatrix3x3< T > const &M)
void MultRight (ColMatrix3x3< T > const &M)
 operator const T * () const
 operator T * ()
T const & operator() (int r, int c) const
T & operator() (int r, int c)
ColMatrix3x3< T > operator* (T s) const
ColMatrix3x3< T > operator* (ColMatrix3x3< T > const &M) const
ColMatrix3x3< T > & operator*= (T s)
ColMatrix3x3< T > & operator*= (ColMatrix3x3< T > const &M)
ColMatrix3x3< T > operator+ (ColMatrix3x3< T > const &M) const
ColMatrix3x3< T > & operator+= (ColMatrix3x3< T > const &M)
ColMatrix3x3< T > operator- (ColMatrix3x3< T > const &M) const
ColMatrix3x3< T > operator- ()
ColMatrix3x3< T > & operator-= (ColMatrix3x3< T > const &M)
ColMatrix3x3< T > operator/ (T s) const
ColMatrix3x3< T > & operator/= (T s)
ColMatrix3x3< T > & operator= (ColMatrix3x3< T > const &M)
T const & operator[] (int i) const
T & operator[] (int i)
void SetAllElements (T const af[9])
void SetAllElements (T, T, T, T, T, T, T, T, T)
void SetAllElements (T)
ColMatrix3x3< T > & Transposed ()
 ~ColMatrix3x3 ()

Private Attributes

e [9]

Static Private Attributes

static double g_d [9]
static float g_f [9]
static long double g_ld [9]

Friends

ColMatrix3x3< T > operator* (T s, ColMatrix3x3< T > const &M)
std::ostream & operator<< (std::ostream &output, ColMatrix3x3< T > const &M)


Detailed Description

template<typename T>
class ColMatrix3x3< T >

Definition at line 18 of file TAPsColMatrix3x3.hpp.


Constructor & Destructor Documentation

template<typename T>
BEGIN_NAMESPACE_TAPs ColMatrix3x3< T >::ColMatrix3x3 (  )  [inline]

Definition at line 20 of file TAPsColMatrix3x3.cpp.

00021 {
00022     // Identity Matrix
00023     /*e0*/  e[1]  = e[2]  = 
00024     e[3]  = /*e4*/  e[5]  =
00025     e[6]  = e[7]  = /*e8*/ Math<T>::ZERO;
00026     e[0]  = e[4]  = e[8] = Math<T>::ONE;
00027 }

template<typename T>
ColMatrix3x3< T >::ColMatrix3x3 ( ColMatrix3x3< T > const &  M  )  [inline]

Definition at line 30 of file TAPsColMatrix3x3.cpp.

00031 {
00032     e[0] = M.e[0];  e[1] = M.e[1];  e[2] = M.e[2];
00033     e[3] = M.e[3];  e[4] = M.e[4];  e[5] = M.e[5];
00034     e[6] = M.e[6];  e[7] = M.e[7];  e[8] = M.e[8];
00035 }

template<typename T>
ColMatrix3x3< T >::ColMatrix3x3 ( t  )  [inline]

Definition at line 38 of file TAPsColMatrix3x3.cpp.

00039 {
00040     e[0] = e[1] = e[2] = 
00041     e[3] = e[4] = e[5] =
00042     e[6] = e[7] = e[8] = t;
00043 }

template<typename T>
ColMatrix3x3< T >::ColMatrix3x3 ( e00,
e01,
e02,
e10,
e11,
e12,
e20,
e21,
e22 
) [inline]

Definition at line 46 of file TAPsColMatrix3x3.cpp.

00049 {
00050     e[0] = e00;  e[1] = e01;  e[2] = e02;
00051     e[3] = e10;  e[4] = e11;  e[5] = e12;
00052     e[6] = e20;  e[7] = e21;  e[8] = e22;
00053 }

template<typename T>
ColMatrix3x3< T >::ColMatrix3x3 ( T const   af[9]  )  [inline]

Definition at line 56 of file TAPsColMatrix3x3.cpp.

00057 {
00058     e[0] = af[0];  e[1] = af[1];  e[2] = af[2];
00059     e[3] = af[3];  e[4] = af[4];  e[5] = af[5];
00060     e[6] = af[6];  e[7] = af[7];  e[8] = af[8];
00061 }

template<typename T>
ColMatrix3x3< T >::~ColMatrix3x3 (  )  [inline]

Definition at line 64 of file TAPsColMatrix3x3.cpp.

00065 {}


Member Function Documentation

template<typename T>
const double * ColMatrix3x3< T >::GetDataDouble (  )  const [inline]

Definition at line 363 of file TAPsColMatrix3x3.cpp.

00364 {
00365     for ( int i = 0; i < 9; ++i ) {
00366         g_d[i] = static_cast<double>( e[i] );
00367     }
00368     return g_d;
00369 }

template<typename T>
const float * ColMatrix3x3< T >::GetDataFloat (  )  const [inline]

Definition at line 354 of file TAPsColMatrix3x3.cpp.

00355 {
00356     for ( int i = 0; i < 9; ++i ) {
00357         g_f[i] = static_cast<float>( e[i] );
00358     }
00359     return g_f;
00360 }

template<typename T>
const long double * ColMatrix3x3< T >::GetDataLongDouble (  )  const [inline]

Definition at line 372 of file TAPsColMatrix3x3.cpp.

00373 {
00374     for ( int i = 0; i < 9; ++i ) {
00375         g_ld[i] = static_cast<long double>( e[i] );
00376     }
00377     return g_ld;
00378 }

template<typename T>
T ColMatrix3x3< T >::GetDeterminant (  )  const [inline]

Definition at line 209 of file TAPsColMatrix3x3.cpp.

00210 {
00211     return      e[0] * ( e[4]*e[8] - e[5]*e[7] )
00212             -   e[3] * ( e[1]*e[8] - e[2]*e[7] )
00213             +   e[6] * ( e[1]*e[5] - e[2]*e[4] );
00214 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::GetInverse (  )  const [inline]

Definition at line 188 of file TAPsColMatrix3x3.cpp.

00189 {
00190     T det = GetDeterminant();
00191 
00192     assert( det != 0 );
00193 
00194     if ( -Math<T>::EPSILON < det && det < Math<T>::EPSILON )
00195         return ColMatrix3x3( Math<T>::INFINITY );
00196 
00197     return ColMatrix3x3<T>(  ( e[4]*e[8] - e[5]*e[7] ) / det,
00198                              ( e[2]*e[7] - e[1]*e[8] ) / det,
00199                              ( e[1]*e[5] - e[2]*e[4] ) / det,
00200                              ( e[5]*e[6] - e[3]*e[8] ) / det,
00201                              ( e[0]*e[8] - e[2]*e[6] ) / det,
00202                              ( e[2]*e[3] - e[0]*e[5] ) / det,
00203                              ( e[3]*e[7] - e[4]*e[6] ) / det,
00204                              ( e[1]*e[6] - e[0]*e[7] ) / det,
00205                              ( e[0]*e[4] - e[1]*e[3] ) / det    );
00206 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::GetTranspose (  )  const [inline]

Definition at line 171 of file TAPsColMatrix3x3.cpp.

00172 {
00173     return  ColMatrix3x3<T> (   e[0], e[3], e[6], 
00174                             e[1], e[4], e[7], 
00175                             e[2], e[5], e[8] );
00176 }

template<typename T>
const double * ColMatrix3x3< T >::GetTransposeDataDouble (  )  const [inline]

Definition at line 396 of file TAPsColMatrix3x3.cpp.

00397 {
00398     g_d[0] = static_cast<double>( e[0] );
00399     g_d[1] = static_cast<double>( e[3] );
00400     g_d[2] = static_cast<double>( e[6] );
00401     g_d[3] = static_cast<double>( e[1] );
00402     g_d[4] = static_cast<double>( e[4] );
00403     g_d[5] = static_cast<double>( e[7] );
00404     g_d[6] = static_cast<double>( e[2] );
00405     g_d[7] = static_cast<double>( e[5] );
00406     g_d[8] = static_cast<double>( e[8] );
00407     return g_d;
00408 }

template<typename T>
const float * ColMatrix3x3< T >::GetTransposeDataFloat (  )  const [inline]

Definition at line 381 of file TAPsColMatrix3x3.cpp.

00382 {
00383     g_f[0] = static_cast<float>( e[0] );
00384     g_f[1] = static_cast<float>( e[3] );
00385     g_f[2] = static_cast<float>( e[6] );
00386     g_f[3] = static_cast<float>( e[1] );
00387     g_f[4] = static_cast<float>( e[4] );
00388     g_f[5] = static_cast<float>( e[7] );
00389     g_f[6] = static_cast<float>( e[2] );
00390     g_f[7] = static_cast<float>( e[5] );
00391     g_f[8] = static_cast<float>( e[8] );
00392     return g_f;
00393 }

template<typename T>
const long double * ColMatrix3x3< T >::GetTransposeDataLongDouble (  )  const [inline]

Definition at line 411 of file TAPsColMatrix3x3.cpp.

00412 {
00413     g_ld[0] = static_cast<long double>( e[0] );
00414     g_ld[1] = static_cast<long double>( e[3] );
00415     g_ld[2] = static_cast<long double>( e[6] );
00416     g_ld[3] = static_cast<long double>( e[1] );
00417     g_ld[4] = static_cast<long double>( e[4] );
00418     g_ld[5] = static_cast<long double>( e[7] );
00419     g_ld[6] = static_cast<long double>( e[2] );
00420     g_ld[7] = static_cast<long double>( e[5] );
00421     g_ld[8] = static_cast<long double>( e[8] );
00422     return g_ld;
00423 }

template<typename T>
ColMatrix3x3< T > & ColMatrix3x3< T >::Inversed (  )  [inline]

Definition at line 180 of file TAPsColMatrix3x3.cpp.

00181 {
00182     *this = (*this).GetInverse();
00183     return *this;
00184 }

template<typename T>
void ColMatrix3x3< T >::MakeDiagonal ( T const   af[3]  )  [inline]

Definition at line 141 of file TAPsColMatrix3x3.cpp.

00142 {
00143     e[0] = af[0];
00144     e[4] = af[1];
00145     e[8] = af[2];
00146     e[1] = e[2] = e[3] = e[5] = e[6] = e[7] = Math<T>::ZERO;
00147 }

template<typename T>
void ColMatrix3x3< T >::MakeDiagonal ( d  )  [inline]

Definition at line 134 of file TAPsColMatrix3x3.cpp.

00135 {
00136     e[0] = e[4] = e[8] = d;
00137     e[1] = e[2] = e[3] = e[5] = e[6] = e[7] = Math<T>::ZERO;
00138 }

template<typename T>
void ColMatrix3x3< T >::MakeIdentity (  )  [inline]

Definition at line 127 of file TAPsColMatrix3x3.cpp.

00128 {
00129     e[0] = e[4] = e[8] = Math<T>::ONE;
00130     e[1] = e[2] = e[3] = e[5] = e[6] = e[7] = Math<T>::ZERO;
00131 }

template<typename T>
void ColMatrix3x3< T >::MakeZero (  )  [inline]

Definition at line 150 of file TAPsColMatrix3x3.cpp.

00151 {
00152     e[0] = e[1] = e[2] = 
00153     e[3] = e[4] = e[5] = 
00154     e[6] = e[7] = e[8] = Math<T>::ZERO;
00155 }

template<typename T>
void ColMatrix3x3< T >::MultLeft ( ColMatrix3x3< T > const &  M  )  [inline]

Definition at line 338 of file TAPsColMatrix3x3.cpp.

00339 {
00340     *this = M * (*this);
00341 }

template<typename T>
void ColMatrix3x3< T >::MultRight ( ColMatrix3x3< T > const &  M  )  [inline]

Definition at line 344 of file TAPsColMatrix3x3.cpp.

00345 {
00346     *this *= M;
00347 }

template<typename T>
ColMatrix3x3< T >::operator const T * (  )  const [inline]

Definition at line 90 of file TAPsColMatrix3x3.cpp.

00091 {   return e;   }

template<typename T>
ColMatrix3x3< T >::operator T * (  )  [inline]

Definition at line 94 of file TAPsColMatrix3x3.cpp.

00095 {   return e;   }

template<typename T>
T const & ColMatrix3x3< T >::operator() ( int  r,
int  c 
) const [inline]

Definition at line 83 of file TAPsColMatrix3x3.cpp.

00084 {   return e[r + c*3];  }

template<typename T>
T & ColMatrix3x3< T >::operator() ( int  r,
int  c 
) [inline]

Definition at line 79 of file TAPsColMatrix3x3.cpp.

00080 {   return e[r + c*3];  }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator* ( s  )  const [inline]

Definition at line 322 of file TAPsColMatrix3x3.cpp.

00323 {
00324     return ColMatrix3x3<T>( e[0]*s, e[1]*s, e[2]*s,
00325                             e[3]*s, e[4]*s, e[5]*s,
00326                             e[6]*s, e[7]*s, e[8]*s );
00327 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator* ( ColMatrix3x3< T > const &  M  )  const [inline]

Definition at line 308 of file TAPsColMatrix3x3.cpp.

00309 {
00310     return ColMatrix3x3<T>( M.e[0]*e[0] + M.e[1]*e[3] + M.e[2]*e[6],
00311                             M.e[0]*e[1] + M.e[1]*e[4] + M.e[2]*e[7],
00312                             M.e[0]*e[2] + M.e[1]*e[5] + M.e[2]*e[8],
00313                             M.e[3]*e[0] + M.e[4]*e[3] + M.e[5]*e[6],
00314                             M.e[3]*e[1] + M.e[4]*e[4] + M.e[5]*e[7],
00315                             M.e[3]*e[2] + M.e[4]*e[5] + M.e[5]*e[8],
00316                             M.e[6]*e[0] + M.e[7]*e[3] + M.e[8]*e[6],
00317                             M.e[6]*e[1] + M.e[7]*e[4] + M.e[8]*e[7],
00318                             M.e[6]*e[2] + M.e[7]*e[5] + M.e[8]*e[8] );
00319 }

template<typename T>
ColMatrix3x3< T > & ColMatrix3x3< T >::operator*= ( s  )  [inline]

Definition at line 271 of file TAPsColMatrix3x3.cpp.

00272 {
00273     e[0] *= s;  e[1] *= s;  e[2] *= s;
00274     e[3] *= s;  e[4] *= s;  e[5] *= s;
00275     e[6] *= s;  e[7] *= s;  e[8] *= s;
00276     return *this;
00277 }

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

Definition at line 264 of file TAPsColMatrix3x3.cpp.

00265 {
00266     *this = (*this) * M;
00267     return *this;
00268 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator+ ( ColMatrix3x3< T > const &  M  )  const [inline]

Definition at line 292 of file TAPsColMatrix3x3.cpp.

00293 {
00294     return ColMatrix3x3<T>( e[0]+M.e[0], e[1]+M.e[1], e[2]+M.e[2],
00295                             e[3]+M.e[3], e[4]+M.e[4], e[5]+M.e[5],
00296                             e[6]+M.e[6], e[7]+M.e[7], e[8]+M.e[8] );
00297 }

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

Definition at line 246 of file TAPsColMatrix3x3.cpp.

00247 {
00248     e[0] += M.e[0];  e[1] += M.e[1];  e[2] += M.e[2];
00249     e[3] += M.e[3];  e[4] += M.e[4];  e[5] += M.e[5];
00250     e[6] += M.e[6];  e[7] += M.e[7];  e[8] += M.e[8];
00251     return *this;
00252 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator- ( ColMatrix3x3< T > const &  M  )  const [inline]

Definition at line 300 of file TAPsColMatrix3x3.cpp.

00301 {
00302     return ColMatrix3x3<T>( e[0]-M.e[0], e[1]-M.e[1], e[2]-M.e[2],
00303                             e[3]-M.e[3], e[4]-M.e[4], e[5]-M.e[5],
00304                             e[6]-M.e[6], e[7]-M.e[7], e[8]-M.e[8] );
00305 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator- (  )  [inline]

Definition at line 236 of file TAPsColMatrix3x3.cpp.

00237 {
00238     return ColMatrix3x3<T>( -e[0], -e[1], -e[2], 
00239                             -e[3], -e[4], -e[5], 
00240                             -e[6], -e[7], -e[8] );
00241 }

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

Definition at line 255 of file TAPsColMatrix3x3.cpp.

00256 {
00257     e[0] -= M.e[0];  e[1] -= M.e[1];  e[2] -= M.e[2];
00258     e[3] -= M.e[3];  e[4] -= M.e[4];  e[5] -= M.e[5];
00259     e[6] -= M.e[6];  e[7] -= M.e[7];  e[8] -= M.e[8];
00260     return *this;
00261 }

template<typename T>
ColMatrix3x3< T > ColMatrix3x3< T >::operator/ ( s  )  const [inline]

Definition at line 330 of file TAPsColMatrix3x3.cpp.

00331 {
00332     return ColMatrix3x3<T>( e[0]/s, e[1]/s, e[2]/s,
00333                             e[3]/s, e[4]/s, e[5]/s,
00334                             e[6]/s, e[7]/s, e[8]/s );
00335 }

template<typename T>
ColMatrix3x3< T > & ColMatrix3x3< T >::operator/= ( s  )  [inline]

Definition at line 280 of file TAPsColMatrix3x3.cpp.

00281 {
00282     e[0] /= s;  e[1] /= s;  e[2] /= s;
00283     e[3] /= s;  e[4] /= s;  e[5] /= s;
00284     e[6] /= s;  e[7] /= s;  e[8] /= s;
00285     return *this;
00286 }

template<typename T>
ColMatrix3x3< T > & ColMatrix3x3< T >::operator= ( ColMatrix3x3< T > const &  M  )  [inline]

Definition at line 221 of file TAPsColMatrix3x3.cpp.

00222 {
00223     if ( this != &M )
00224     {
00225         e[0] = M.e[0];  e[1] = M.e[1];  e[2] = M.e[2];
00226         e[3] = M.e[3];  e[4] = M.e[4];  e[5] = M.e[5];
00227         e[6] = M.e[6];  e[7] = M.e[7];  e[8] = M.e[8];
00228     }
00229     return *this;
00230 }

template<typename T>
T const & ColMatrix3x3< T >::operator[] ( int  i  )  const [inline]

Definition at line 75 of file TAPsColMatrix3x3.cpp.

00076 {   return e[i];    }

template<typename T>
T & ColMatrix3x3< T >::operator[] ( int  i  )  [inline]

Definition at line 71 of file TAPsColMatrix3x3.cpp.

00072 {   return e[i];    }

template<typename T>
void ColMatrix3x3< T >::SetAllElements ( T const   af[9]  )  [inline]

Definition at line 119 of file TAPsColMatrix3x3.cpp.

00120 {
00121     e[0] = af[0];  e[1] = af[1];  e[2] = af[2];
00122     e[3] = af[3];  e[4] = af[4];  e[5] = af[5];
00123     e[6] = af[6];  e[7] = af[7];  e[8] = af[8];
00124 }

template<typename T>
void ColMatrix3x3< T >::SetAllElements ( e00,
e01,
e02,
e10,
e11,
e12,
e20,
e21,
e22 
) [inline]

Definition at line 109 of file TAPsColMatrix3x3.cpp.

00112 {
00113     e[0] = e00;  e[1] = e01;  e[2] = e02;
00114     e[3] = e10;  e[4] = e11;  e[5] = e12;
00115     e[6] = e20;  e[7] = e21;  e[8] = e22;
00116 }

template<typename T>
void ColMatrix3x3< T >::SetAllElements ( t  )  [inline]

Definition at line 101 of file TAPsColMatrix3x3.cpp.

00102 {
00103     e[0] = e[1] = e[2] =
00104     e[3] = e[4] = e[5] =
00105     e[6] = e[7] = e[8] = t;
00106 }

template<typename T>
ColMatrix3x3< T > & ColMatrix3x3< T >::Transposed (  )  [inline]

Definition at line 161 of file TAPsColMatrix3x3.cpp.

00162 {
00163     T temp;
00164     temp = e[1];  e[1] = e[3];  e[3] = temp;
00165     temp = e[2];  e[2] = e[6];  e[6] = temp;
00166     temp = e[5];  e[5] = e[7];  e[7] = temp;
00167     return *this;
00168 }


Friends And Related Function Documentation

template<typename T>
ColMatrix3x3<T> operator* ( s,
ColMatrix3x3< T > const &  M 
) [friend]

Definition at line 107 of file TAPsColMatrix3x3.hpp.

00108     {   return M * s;   }

template<typename T>
std::ostream& operator<< ( std::ostream &  output,
ColMatrix3x3< T > const &  M 
) [friend]

Definition at line 37 of file TAPsColMatrix3x3.hpp.

00038     {
00039         int width = 14;
00040         //output << typeid(*this).name() << "( ";
00041         output  << "ColMatrix3x3<" << typeid(T).name() << "> =\n"
00042                 << "| " << std::setw(width) << M.e[0] 
00043                         << std::setw(width) << M.e[3] 
00044                         << std::setw(width) << M.e[6] << " |\n"
00045                 << "| " << std::setw(width) << M.e[1] 
00046                         << std::setw(width) << M.e[4] 
00047                         << std::setw(width) << M.e[7] << " |\n"
00048                 << "| " << std::setw(width) << M.e[2] 
00049                         << std::setw(width) << M.e[5] 
00050                         << std::setw(width) << M.e[8] << " |\n";
00051         //output << std::endl;
00052         return output;
00053     }


Member Data Documentation

template<typename T>
T ColMatrix3x3< T >::e[9] [private]

Definition at line 27 of file TAPsColMatrix3x3.hpp.

template<typename T>
double ColMatrix3x3< T >::g_d[9] [static, private]

Definition at line 31 of file TAPsColMatrix3x3.hpp.

template<typename T>
float ColMatrix3x3< T >::g_f[9] [static, private]

Definition at line 30 of file TAPsColMatrix3x3.hpp.

template<typename T>
long double ColMatrix3x3< T >::g_ld[9] [static, private]

Definition at line 32 of file TAPsColMatrix3x3.hpp.


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

Generated on Mon Oct 13 11:44:32 2008 for TAPs by  doxygen 1.5.6