Matrix 2x2. More...
Public Member Functions | |
matrix2 () | |
empty constructor (identity) More... | |
matrix2 (float x00, float x01, float x10, float x11) | |
direct constructor with every value More... | |
float | operator() (const size_t &k1, const size_t &k2) const |
Access to the k_th entry (k in [0,1]) More... | |
float & | operator() (const size_t &k1, const size_t &k2) |
Access to the k_th entry (k in [0,1]) More... | |
const float * | pointer () const |
fast pointer access More... | |
float * | pointer_unprotected () |
fast pointer access More... | |
matrix2 | operator+ (const matrix2 &m2) const |
| |
matrix2 | operator+ (float s) const |
| |
matrix2 | operator- (const matrix2 &m2) const |
| |
matrix2 | operator- (float s) const |
| |
matrix2 | operator* (float s) const |
multiply by a scalar operator More... | |
vec2 | operator* (const vec2 &v) const |
multiply matrix with a v3 More... | |
matrix2 | operator* (const matrix2 &m2) const |
matrix mulitplication More... | |
matrix2 | operator/ (float s) const |
divide by a scalar operator More... | |
matrix2 & | operator+= (const matrix2 &m) |
internal + More... | |
matrix2 & | operator+= (float s) |
internal + More... | |
matrix2 & | operator-= (const matrix2 &m) |
internal - More... | |
matrix2 & | operator-= (float s) |
internal - More... | |
matrix2 & | operator*= (float s) |
internal * More... | |
matrix2 & | operator/= (float s) |
internal / More... | |
matrix2 | operator- () const |
unary negation More... | |
matrix2 | product_compontentwise (const matrix2 &m) const |
does componentwise multiplication More... | |
matrix2 & | product_compontentwise_internal (const matrix2 &m) |
does componentwise multiplication More... | |
matrix2 | transposed () const |
transpose matrix More... | |
std::vector< float > | to_vector () const |
convert 3x3 matrix into a vector of float of size 9 More... | |
Static Public Member Functions | |
static matrix2 | identity () |
build identity matrix More... | |
static matrix2 | zeros () |
build zero matrix More... | |
static matrix2 | rotation (float angle) |
build rotation matrix More... | |
static matrix2 | scale (float s) |
build scaling matrix More... | |
static matrix2 | scale (float s_x, float s_y) |
build scaling matrix More... | |
Private Member Functions | |
void | assert_size (const size_t &k1, const size_t &k2) const |
assert that a size_t belongs to [[0,1]] More... | |
Private Attributes | |
float | m [4] |
internal storage of the matrix More... | |
Matrix 2x2.
cpe::matrix2::matrix2 | ( | ) |
empty constructor (identity)
References m.
Referenced by identity(), operator+(), operator-(), operator/(), product_compontentwise(), rotation(), scale(), transposed(), and zeros().
cpe::matrix2::matrix2 | ( | float | x00, |
float | x01, | ||
float | x10, | ||
float | x11 | ||
) |
direct constructor with every value
References m.
|
private |
assert that a size_t belongs to [[0,1]]
References MACRO_EXCEPTION_PARAMETER.
Referenced by operator()().
|
static |
float 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.
float & 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.
matrix2 cpe::matrix2::operator* | ( | float | s | ) | const |
multiply by a scalar operator
multiply matrix with a v3
References m, cpe::vec2::x(), and cpe::vec2::y().
matrix mulitplication
References m, pointer_unprotected(), and zeros().
matrix2 cpe::matrix2::operator+ | ( | float | s | ) | const |
matrix2 cpe::matrix2::operator- | ( | float | s | ) | const |
matrix2 cpe::matrix2::operator- | ( | ) | const |
matrix2 cpe::matrix2::operator/ | ( | float | s | ) | const |
const float * cpe::matrix2::pointer | ( | ) | const |
fast pointer access
References m.
Referenced by cpe::operator-(), and cpe::operator<<().
float * cpe::matrix2::pointer_unprotected | ( | ) |
does componentwise multiplication
References m.
|
static |
|
static |
|
static |
std::vector< float > cpe::matrix2::to_vector | ( | ) | const |
convert 3x3 matrix into a vector of float of size 9
References m.
matrix2 cpe::matrix2::transposed | ( | ) | const |
|
static |
build zero matrix
References matrix2().
Referenced by operator*().
|
private |
internal storage of the matrix
Referenced by matrix2(), operator()(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), pointer(), pointer_unprotected(), product_compontentwise(), product_compontentwise_internal(), to_vector(), and transposed().