cpe::matrix4 Class Reference

List of all members.

Public Member Functions

 matrix4 ()
 empty constructor (identity)
 matrix4 (const double &x00, const double &x01, const double &x02, const double &x03, const double &x10, const double &x11, const double &x12, const double &x13, const double &x20, const double &x21, const double &x22, const double &x23, const double &x30, const double &x31, const double &x32, const double &x33)
 direct constructor with every value
const double & operator() (const size_t &k1, const size_t &k2) const
 Access to the k_th entry (k in [0,3]).
double & operator() (const size_t &k1, const size_t &k2)
 Access to the k_th entry (k in [0,3]).
const double * pointer () const
 fast pointer access
double * pointer_unprotected ()
 fast pointer access
matrix4operator+= (const matrix4 &m)
 internal +
matrix4operator+= (const double &s)
 internal +
matrix4operator-= (const matrix4 &m)
 internal -
matrix4operator-= (const double &s)
 internal -
matrix4operator*= (const double &s)
 internal *
matrix4operator/= (const double &s)
 internal /
matrix4 operator- () const
 unary negation
matrix4 product_compontentwise (const matrix4 &m) const
 does componentwise mutliplication
matrix4product_compontentwise_internal (const matrix4 &m)
 does componentwise mutliplication
double scalar_product (const v4 &a, const v4 &b) const
 does the product a^t M b, where (a,b) are v4 vectors
matrix4 transposed () const
 transpose matrix

Static Public Member Functions

static matrix4 identity ()
 build identity matrix
static matrix4 zeros ()
 build zero matrix
static matrix4 rotation (const v3 &axis, const double &angle)
 build rotation matrix
static matrix4 scale (const double &s)
 build scaling matrix (3D scaling, not w)
static matrix4 scale (const double &s_x, const double &s_y, const double &s_z, const double &s_w)
 build scaling matrix

Private Member Functions

void assert_size (const size_t &k1, const size_t &k2) const throw (std::exception)
 assert that a size_t belongs to [[0,3]]

Private Attributes

double m [16]
 internal storage of the matrix

Friends

matrix4 operator+ (const matrix4 &m1, const matrix4 &m2)
 + operator
matrix4 operator+ (const double &s, const matrix4 &m)
 + operator
matrix4 operator+ (const matrix4 &m, const double &s)
 + operator
matrix4 operator- (const matrix4 &m1, const matrix4 &m2)
 
  • operator

matrix4 operator- (const double &s, const matrix4 &m)
 
  • operator

matrix4 operator- (const matrix4 &m, const double &s)
 
  • operator

matrix4 operator* (const double &s, const matrix4 &m)
 multiply by a scalar operator
matrix4 operator* (const matrix4 &m, const double &s)
 multiply by a scalar operator
v4 operator* (const matrix4 &m, const v4 &v)
 multiply matrix with a v4
v4 operator* (const v4 &v, const matrix4 &m)
 multiply matrix with a v4
matrix4 operator* (const matrix4 &m1, const matrix4 &m2)
 matrix mulitplication
matrix4 operator/ (const matrix4 &m, const double &s)
 divide by a scalar operator
std::ostream & operator<< (std::ostream &stream, const matrix4 &m)
 output the vector in ostream

Constructor & Destructor Documentation

cpe::matrix4::matrix4 (  ) 

empty constructor (identity)

References m.

Referenced by identity(), operator-(), product_compontentwise(), rotation(), scale(), transposed(), and zeros().

cpe::matrix4::matrix4 ( const double &  x00,
const double &  x01,
const double &  x02,
const double &  x03,
const double &  x10,
const double &  x11,
const double &  x12,
const double &  x13,
const double &  x20,
const double &  x21,
const double &  x22,
const double &  x23,
const double &  x30,
const double &  x31,
const double &  x32,
const double &  x33 
)

direct constructor with every value

References m.


Member Function Documentation

void cpe::matrix4::assert_size ( const size_t &  k1,
const size_t &  k2 
) const throw (std::exception) [private]

assert that a size_t belongs to [[0,3]]

References cpe::string_converter::to_string().

Referenced by operator()().

Here is the call graph for this function:

matrix4 cpe::matrix4::identity (  )  [static]

build identity matrix

References matrix4().

Here is the call graph for this function:

double & cpe::matrix4::operator() ( const size_t &  k1,
const size_t &  k2 
)

Access to the k_th entry (k in [0,3]).

References assert_size(), and m.

Here is the call graph for this function:

const double & cpe::matrix4::operator() ( const size_t &  k1,
const size_t &  k2 
) const

Access to the k_th entry (k in [0,3]).

References assert_size(), and m.

Here is the call graph for this function:

matrix4 & cpe::matrix4::operator*= ( const double &  s  ) 

internal *

References m.

matrix4 & cpe::matrix4::operator+= ( const double &  s  ) 

internal +

References m.

matrix4 & cpe::matrix4::operator+= ( const matrix4 m  ) 

internal +

References m.

matrix4 cpe::matrix4::operator- (  )  const

unary negation

References m, and matrix4().

Here is the call graph for this function:

matrix4 & cpe::matrix4::operator-= ( const double &  s  ) 

internal -

References m.

matrix4 & cpe::matrix4::operator-= ( const matrix4 m  ) 

internal -

References m.

matrix4 & cpe::matrix4::operator/= ( const double &  s  ) 

internal /

References m.

const double * cpe::matrix4::pointer (  )  const

fast pointer access

Warning:
unprotected access

References m.

double * cpe::matrix4::pointer_unprotected (  ) 

fast pointer access

Warning:
unprotected access

References m.

Referenced by cpe::operator*().

matrix4 cpe::matrix4::product_compontentwise ( const matrix4 m  )  const

does componentwise mutliplication

Returns:
MC_v2d(x*p.x(),y*p.y(),z*p.z())

References m, and matrix4().

Here is the call graph for this function:

matrix4 & cpe::matrix4::product_compontentwise_internal ( const matrix4 m  ) 

does componentwise mutliplication

perform p=(p.x()*p2.x(),p.y()*p2.x())

References m.

matrix4 cpe::matrix4::rotation ( const v3 axis,
const double &  angle 
) [static]

build rotation matrix

References matrix4(), and cpe::v3::normalized().

Here is the call graph for this function:

double cpe::matrix4::scalar_product ( const v4 a,
const v4 b 
) const

does the product a^t M b, where (a,b) are v4 vectors

References cpe::v4::dot().

Here is the call graph for this function:

matrix4 cpe::matrix4::scale ( const double &  s_x,
const double &  s_y,
const double &  s_z,
const double &  s_w 
) [static]

build scaling matrix

References matrix4().

Here is the call graph for this function:

matrix4 cpe::matrix4::scale ( const double &  s  )  [static]

build scaling matrix (3D scaling, not w)

References matrix4().

Here is the call graph for this function:

matrix4 cpe::matrix4::transposed (  )  const

transpose matrix

References m, and matrix4().

Here is the call graph for this function:

matrix4 cpe::matrix4::zeros (  )  [static]

build zero matrix

References matrix4().

Referenced by cpe::operator*().

Here is the call graph for this function:


Friends And Related Function Documentation

matrix4 operator* ( const matrix4 m1,
const matrix4 m2 
) [friend]

matrix mulitplication

v4 operator* ( const v4 v,
const matrix4 m 
) [friend]

multiply matrix with a v4

v4 operator* ( const matrix4 m,
const v4 v 
) [friend]

multiply matrix with a v4

matrix4 operator* ( const matrix4 m,
const double &  s 
) [friend]

multiply by a scalar operator

matrix4 operator* ( const double &  s,
const matrix4 m 
) [friend]

multiply by a scalar operator

matrix4 operator+ ( const matrix4 m,
const double &  s 
) [friend]

+ operator

matrix4 operator+ ( const double &  s,
const matrix4 m 
) [friend]

+ operator

matrix4 operator+ ( const matrix4 m1,
const matrix4 m2 
) [friend]

+ operator

matrix4 operator- ( const matrix4 m,
const double &  s 
) [friend]

  • operator

matrix4 operator- ( const double &  s,
const matrix4 m 
) [friend]

  • operator

matrix4 operator- ( const matrix4 m1,
const matrix4 m2 
) [friend]

  • operator

matrix4 operator/ ( const matrix4 m,
const double &  s 
) [friend]

divide by a scalar operator

std::ostream& operator<< ( std::ostream &  stream,
const matrix4 m 
) [friend]

output the vector in ostream


Member Data Documentation

double cpe::matrix4::m[16] [private]

The documentation for this class was generated from the following files:
Generated on Mon Feb 27 17:40:12 2012 by  doxygen 1.6.3