cpe::matrix2 Class Reference

Matrix 2x2. More...

Public Member Functions

 matrix2 ()
 empty constructor (identity)
 
 matrix2 (const double &x00, const double &x01, const double &x10, const double &x11)
 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,1])
 
double & operator() (const size_t &k1, const size_t &k2)
 Access to the k_th entry (k in [0,1])
 
const double * pointer () const
 fast pointer access
 
double * pointer_unprotected ()
 fast pointer access
 
matrix2 operator+ (const matrix2 &m2) const
 
  • operator

 
matrix2 operator+ (const double &s) const
 
  • operator

 
matrix2 operator- (const matrix2 &m2) const
 
  • operator

 
matrix2 operator- (const double &s) const
 
  • operator

 
matrix2 operator* (const double &s) const
 multiply by a scalar operator
 
v2 operator* (const v2 &v) const
 multiply matrix with a v3
 
matrix2 operator* (const matrix2 &m2) const
 matrix mulitplication
 
matrix2 operator/ (const double &s) const
 divide by a scalar operator
 
matrix2operator+= (const matrix2 &m)
 internal +
 
matrix2operator+= (const double &s)
 internal +
 
matrix2operator-= (const matrix2 &m)
 internal -
 
matrix2operator-= (const double &s)
 internal -
 
matrix2operator*= (const double &s)
 internal *
 
matrix2operator/= (const double &s)
 internal /
 
matrix2 operator- () const
 unary negation
 
matrix2 product_compontentwise (const matrix2 &m) const
 does componentwise multiplication
 
matrix2product_compontentwise_internal (const matrix2 &m)
 does componentwise multiplication
 
matrix2 transposed () const
 transpose matrix
 
std::vector< double > to_vector () const
 convert 3x3 matrix into a vector of double of size 9
 

Static Public Member Functions

static matrix2 identity ()
 build identity matrix
 
static matrix2 zeros ()
 build zero matrix
 
static matrix2 rotation (const double &angle)
 build rotation matrix
 
static matrix2 scale (const double &s)
 build scaling matrix
 
static matrix2 scale (const double &s_x, const double &s_y)
 build scaling matrix
 

Private Member Functions

void assert_size (const size_t &k1, const size_t &k2) const
 assert that a size_t belongs to [[0,1]]
 

Private Attributes

double m [4]
 internal storage of the matrix
 

Detailed Description

Matrix 2x2.

Constructor & Destructor Documentation

cpe::matrix2::matrix2 ( )

empty constructor (identity)

References m.

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

+ Here is the caller graph for this function:

cpe::matrix2::matrix2 ( const double &  x00,
const double &  x01,
const double &  x10,
const double &  x11 
)

direct constructor with every value

References m.

Member Function Documentation

void cpe::matrix2::assert_size ( const size_t &  k1,
const size_t &  k2 
) const
private

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

Referenced by operator()().

+ Here is the caller graph for this function:

matrix2 cpe::matrix2::identity ( )
static

build identity matrix

References matrix2().

+ Here is the call graph for this function:

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

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

References assert_size(), and m.

+ Here is the call graph for this function:

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

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

References assert_size(), and m.

+ Here is the call graph for this function:

matrix2 cpe::matrix2::operator* ( const double &  s) const

multiply by a scalar operator

v2 cpe::matrix2::operator* ( const v2 v) const

multiply matrix with a v3

References m, cpe::v2::x(), and cpe::v2::y().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::operator* ( const matrix2 m2) const

matrix mulitplication

References m, pointer_unprotected(), and zeros().

+ Here is the call graph for this function:

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

internal *

References m.

matrix2 cpe::matrix2::operator+ ( const matrix2 m2) const

  • operator

References m, and matrix2().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::operator+ ( const double &  s) const

  • operator

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

internal +

References m.

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

internal +

References m.

matrix2 cpe::matrix2::operator- ( const matrix2 m2) const

  • operator

matrix2 cpe::matrix2::operator- ( const double &  s) const

  • operator

References m, and matrix2().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::operator- ( ) const

unary negation

References m, and matrix2().

+ Here is the call graph for this function:

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

internal -

References m.

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

internal -

References m.

matrix2 cpe::matrix2::operator/ ( const double &  s) const

divide by a scalar operator

References m, and matrix2().

+ Here is the call graph for this function:

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

internal /

References m.

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

fast pointer access

Warning
unprotected access

References m.

Referenced by cpe::operator-(), and cpe::operator<<().

+ Here is the caller graph for this function:

double * cpe::matrix2::pointer_unprotected ( )

fast pointer access

Warning
unprotected access

References m.

Referenced by operator*().

+ Here is the caller graph for this function:

matrix2 cpe::matrix2::product_compontentwise ( const matrix2 m) const

does componentwise multiplication

References m, and matrix2().

+ Here is the call graph for this function:

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

does componentwise multiplication

References m.

matrix2 cpe::matrix2::rotation ( const double &  angle)
static

build rotation matrix

References matrix2().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::scale ( const double &  s)
static

build scaling matrix

References matrix2().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::scale ( const double &  s_x,
const double &  s_y 
)
static

build scaling matrix

References matrix2().

+ Here is the call graph for this function:

std::vector< double > cpe::matrix2::to_vector ( ) const

convert 3x3 matrix into a vector of double of size 9

References m.

matrix2 cpe::matrix2::transposed ( ) const

transpose matrix

References m, and matrix2().

+ Here is the call graph for this function:

matrix2 cpe::matrix2::zeros ( )
static

build zero matrix

References matrix2().

Referenced by operator*().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation


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