CMSC23700 Common Code Library
Support code for CS23700 programming projects
cs237::__detail::mat2x2< T > Struct Template Reference

template class for 2x2 matrices More...

#include <cs237-mat2x2.hxx>

Public Member Functions

 mat2x2 ()
 create an uninitialized matrix More...
 
 mat2x2 (mat2x2 const &m)
 copy constructor More...
 
 mat2x2 (T m00, T m10, T m01, T m11)
 construct a matrix from individual elements given in column-major order More...
 
 mat2x2 (vec2< T > const &c0, vec2< T > const &c1)
 construct a matrix from column vectors More...
 
 mat2x2 (mat3x3< T > const &mm)
 extract the upper-left 2x2 matrix from a 3x3 matrix More...
 
 mat2x2 (mat2x3< T > const &mm)
 extract the upper-left 2x2 matrix from a 2x3 matrix More...
 
 mat2x2 (mat3x2< T > const &mm)
 extract the upper-left 2x2 matrix from a 3x2 matrix More...
 
 mat2x2 (T const &x)
 construct a diagonal matrix with diagonal elements initialized to x More...
 
mat2x2operator= (mat2x2 const &mm)
 
mat2x2operator+= (T const &s)
 
mat2x2operator+= (mat2x2 const &v)
 
mat2x2operator-= (T const &s)
 
mat2x2operator-= (mat2x2 const &v)
 
mat2x2operator*= (T const &s)
 
mat2x2operator*= (mat2x2 const &m)
 
mat2x2 inverse () const
 return the inverse of this matrix More...
 
mat2x2 transpose () const
 return the transpose of this matrix More...
 
determinant () const
 return the determiniant of this matrix More...
 
vec2< T > & operator[] (unsigned int const &i)
 return the i'th column vector More...
 
vec2< T > const & operator[] (unsigned int const &i) const
 

Public Attributes

vec2< T > cv [2]
 

Detailed Description

template<typename T>
struct cs237::__detail::mat2x2< T >

template class for 2x2 matrices

Constructor & Destructor Documentation

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( )
inline

create an uninitialized matrix

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( mat2x2< T > const &  m)
inline

copy constructor

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( m00,
m10,
m01,
m11 
)
inlineexplicit

construct a matrix from individual elements given in column-major order

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( vec2< T > const &  c0,
vec2< T > const &  c1 
)
inlineexplicit

construct a matrix from column vectors

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( mat3x3< T > const &  mm)
inlineexplicit

extract the upper-left 2x2 matrix from a 3x3 matrix

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( mat2x3< T > const &  mm)
inlineexplicit

extract the upper-left 2x2 matrix from a 2x3 matrix

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( mat3x2< T > const &  mm)
inlineexplicit

extract the upper-left 2x2 matrix from a 3x2 matrix

template<typename T >
cs237::__detail::mat2x2< T >::mat2x2 ( T const &  x)
inlineexplicit

construct a diagonal matrix with diagonal elements initialized to x

Member Function Documentation

template<typename T >
T cs237::__detail::mat2x2< T >::determinant ( ) const
inline

return the determiniant of this matrix

template<typename T >
mat2x2< T > cs237::__detail::mat2x2< T >::inverse ( ) const
inline

return the inverse of this matrix

template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator*= ( T const &  s)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator*= ( mat2x2< T > const &  m)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator+= ( T const &  s)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator+= ( mat2x2< T > const &  v)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator-= ( T const &  s)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator-= ( mat2x2< T > const &  v)
inline
template<typename T >
mat2x2< T > & cs237::__detail::mat2x2< T >::operator= ( mat2x2< T > const &  mm)
inline
template<typename T >
vec2< T > & cs237::__detail::mat2x2< T >::operator[] ( unsigned int const &  i)
inline

return the i'th column vector

return the i'th column vector of the matrix

template<typename T >
vec2< T > const & cs237::__detail::mat2x2< T >::operator[] ( unsigned int const &  i) const
inline
template<typename T >
mat2x2< T > cs237::__detail::mat2x2< T >::transpose ( ) const
inline

return the transpose of this matrix

Member Data Documentation

template<typename T >
vec2<T> cs237::__detail::mat2x2< T >::cv[2]

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