GEL
2
GEL is a library for Geometry and Linear Algebra
|
Basic class template for matrices. More...
#include <ArithMatFloat.h>
Inherited by CGLA::ArithSqMatFloat< V, M, 2 >, CGLA::ArithSqMatFloat< V, M, 3 >, CGLA::ArithSqMatFloat< Vec2d, Mat2x2d, 2 >, CGLA::ArithSqMatFloat< Vec2f, Mat2x2f, 2 >, CGLA::ArithSqMatFloat< Vec3d, Mat3x3d, 3 >, CGLA::ArithSqMatFloat< Vec3f, Mat3x3f, 3 >, CGLA::ArithSqMatFloat< Vec4d, Mat4x4d, 4 >, CGLA::ArithSqMatFloat< Vec4f, Mat4x4f, 4 >, and CGLA::ArithSqMatFloat< VT, M, 4 >.
Public Types | |
typedef HVT | HVectorType |
Horizontal vector type. | |
typedef VVT | VVectorType |
Vertical vector type. | |
typedef HVT::ScalarType | ScalarType |
The type of a matrix element. | |
Public Member Functions | |
const ScalarType * | get () const |
ScalarType * | get () |
const HVT & | operator[] (unsigned int i) const |
Const index operator. Returns i'th row of matrix. | |
HVT & | operator[] (unsigned int i) |
Non-const index operator. Returns i'th row of matrix. | |
bool | operator== (const MT &v) const |
Equality operator. | |
bool | operator!= (const MT &v) const |
Inequality operator. | |
const MT | operator* (ScalarType k) const |
Multiply scalar onto matrix. All entries are multiplied by scalar. | |
const MT | operator/ (ScalarType k) const |
Divide all entries in matrix by scalar. | |
const MT & | operator*= (ScalarType k) |
Assignment multiplication of matrix by scalar. | |
const MT & | operator/= (ScalarType k) |
Assignment division of matrix by scalar. | |
const MT | operator+ (const MT &m1) const |
Add two matrices. | |
const MT | operator- (const MT &m1) const |
Subtract two matrices. | |
const MT & | operator+= (const MT &v) |
Assigment addition of matrices. | |
const MT & | operator-= (const MT &v) |
Assigment subtraction of matrices. | |
const MT | operator- () const |
Negate matrix. | |
Static Public Member Functions | |
static unsigned int | get_v_dim () |
Get vertical dimension of matrix. | |
static unsigned int | get_h_dim () |
Get horizontal dimension of matrix. | |
Protected Member Functions | |
ArithMatFloat () | |
Construct 0 matrix. | |
ArithMatFloat (ScalarType x) | |
Construct a matrix where all entries are the same. | |
ArithMatFloat (HVT _a) | |
Construct a matrix where all rows are the same. | |
ArithMatFloat (HVT _a, HVT _b) | |
Construct a matrix with two rows. | |
ArithMatFloat (HVT _a, HVT _b, HVT _c) | |
Construct a matrix with three rows. | |
ArithMatFloat (HVT _a, HVT _b, HVT _c, HVT _d) | |
Construct a matrix with four rows. | |
Protected Attributes | |
HVT | data [ROWS] |
The actual contents of the matrix. |
Basic class template for matrices.
In this template a matrix is defined as an array of vectors. This may not in all cases be the most efficient but it has the advantage that it is possible to use the double subscripting notation:
T x = m[i][j]
This template should be used through inheritance just like the vector template
const ScalarType* CGLA::ArithMatFloat< VVT, HVT, MT, ROWS >::get | ( | ) | const [inline] |
Get const pointer to data array. This function may be useful when interfacing with some other API such as OpenGL (TM).
ScalarType* CGLA::ArithMatFloat< VVT, HVT, MT, ROWS >::get | ( | ) | [inline] |
Get pointer to data array. This function may be useful when interfacing with some other API such as OpenGL (TM).