2D matrix More...
#include <mat2.h>
Public Member Functions | |
Operations | |
CL_Mat2< Type > & | multiply (const CL_Mat2< Type > &mult) |
Multiply this matrix and a specified matrix. | |
CL_Mat2< Type > & | add (const CL_Mat2< Type > &add_matrix) |
Add this matrix and a specified matrix. | |
CL_Mat2< Type > & | subtract (const CL_Mat2< Type > &subtract_matrix) |
Subtract this matrix and a specified matrix. | |
Operators | |
operator Type const * () const | |
Operator that returns the matrix as a array. | |
operator Type * () | |
Operator that returns the matrix as a array. | |
Type & | operator[] (int i) |
Operator that returns the matrix cell at the given index. | |
const Type & | operator[] (int i) const |
Operator that returns the matrix cell at the given index. | |
Type & | operator[] (unsigned int i) |
Operator that returns the matrix cell at the given index. | |
const Type & | operator[] (unsigned int i) const |
Operator that returns the matrix cell at the given index. | |
CL_Mat2< Type > & | operator= (const CL_Mat2< Type > ©) |
Copy assignment operator. | |
CL_Mat2< Type > & | operator= (const CL_Mat4< Type > ©) |
Copy assignment operator. | |
CL_Mat2< Type > & | operator= (const CL_Mat3< Type > ©) |
Copy assignment operator. | |
CL_Mat2< Type > | operator* (const CL_Mat2< Type > &mult) const |
Multiplication operator. | |
CL_Mat2< Type > | operator+ (const CL_Mat2< Type > &add_matrix) const |
Addition operator. | |
CL_Mat2< Type > | operator- (const CL_Mat2< Type > &subtract_matrix) const |
Subtract operator. | |
bool | operator== (const CL_Mat2< Type > &other) |
Equality operator. | |
bool | operator!= (const CL_Mat2< Type > &other) |
Not-equal operator. | |
Public Attributes | |
Attributes | |
Type | matrix [4] |
Construction | |
| |
CL_Mat2 () | |
Constructs a 2x2 matrix (uninitialised). | |
CL_Mat2 (const CL_Mat2< Type > ©) | |
Constructs a 2x2 matrix (copied). | |
CL_Mat2 (const CL_Mat3< Type > ©) | |
Constructs a 2x2 matrix (copied from a 3d matrix). | |
CL_Mat2 (const CL_Mat4< Type > ©) | |
Constructs a 2x2 matrix (copied from a 4d matrix). | |
CL_Mat2 (const float *init_matrix) | |
Constructs a 2x2 matrix (copied from 4 floats). | |
CL_Mat2 (Type m00, Type m01, Type m10, Type m11) | |
Constructs a 2x2 matrix (copied from specified values). | |
CL_Mat2 (const double *init_matrix) | |
Constructs a 2x2 matrix (copied from 4 doubles). | |
CL_Mat2 (const cl_byte64 *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 64 bit integers). | |
CL_Mat2 (const cl_byte32 *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 32 bit integers). | |
CL_Mat2 (const cl_byte16 *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 16 bit integers). | |
CL_Mat2 (const cl_byte8 *init_matrix) | |
Constructs a 2x2 matrix (copied from 4, 8 bit integers). | |
static CL_Mat2< Type > | null () |
static CL_Mat2< Type > | identity () |
static CL_Mat2< Type > | multiply (const CL_Mat2< Type > &matrix_1, const CL_Mat2< Type > &matrix_2) |
Multiply 2 matrices. | |
static CL_Mat2< Type > | add (const CL_Mat2< Type > &matrix_1, const CL_Mat2< Type > &matrix_2) |
Add 2 matrices. | |
static CL_Mat2< Type > | subtract (const CL_Mat2< Type > &matrix_1, const CL_Mat2< Type > &matrix_2) |
Subtract 2 matrices. |
2D matrix
These matrix templates are defined for: int (CL_Mat2i), float (CL_Mat2f), double (CL_Mat2d)
Constructs a 2x2 matrix (uninitialised).
Constructs a 2x2 matrix (copied).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from a 3d matrix).
Constructs a 2x2 matrix (copied from a 4d matrix).
Constructs a 2x2 matrix (copied from 4 floats).
References CL_Mat2< Type >::matrix.
CL_Mat2< Type >::CL_Mat2 | ( | Type | m00, | |
Type | m01, | |||
Type | m10, | |||
Type | m11 | |||
) | [inline] |
Constructs a 2x2 matrix (copied from specified values).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from 4 doubles).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from 4, 64 bit integers).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from 4, 32 bit integers).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from 4, 16 bit integers).
References CL_Mat2< Type >::matrix.
Constructs a 2x2 matrix (copied from 4, 8 bit integers).
References CL_Mat2< Type >::matrix.
static CL_Mat2<Type> CL_Mat2< Type >::add | ( | const CL_Mat2< Type > & | matrix_1, | |
const CL_Mat2< Type > & | matrix_2 | |||
) | [static] |
Add 2 matrices.
This adds the matrix as follows: result = matrix1 + matrix2
matrix_1 | = First Matrix to add | |
matrix_2 | = Second Matrix to add |
Referenced by CL_Mat2< Type >::operator+().
Add this matrix and a specified matrix.
This adds the matrix as follows: this = add_matrix - this
add_matrix | = Matrix to add |
Multiply this matrix and a specified matrix.
This multiplies the matrix as follows: this = mult * this
mult | = Matrix to multiply |
static CL_Mat2<Type> CL_Mat2< Type >::multiply | ( | const CL_Mat2< Type > & | matrix_1, | |
const CL_Mat2< Type > & | matrix_2 | |||
) | [static] |
Multiply 2 matrices.
This multiplies the matrix as follows: result = matrix1 * matrix2
matrix_1 | = First Matrix to multiply | |
matrix_2 | = Second Matrix to multiply |
Referenced by CL_Mat2< Type >::operator*().
CL_Mat2< Type >::operator Type * | ( | ) | [inline] |
Operator that returns the matrix as a array.
References CL_Mat2< Type >::matrix.
CL_Mat2< Type >::operator Type const * | ( | ) | const [inline] |
Operator that returns the matrix as a array.
References CL_Mat2< Type >::matrix.
Not-equal operator.
CL_Mat2<Type> CL_Mat2< Type >::operator* | ( | const CL_Mat2< Type > & | mult | ) | const [inline] |
Multiplication operator.
References CL_Mat2< Type >::multiply().
CL_Mat2<Type> CL_Mat2< Type >::operator+ | ( | const CL_Mat2< Type > & | add_matrix | ) | const [inline] |
Addition operator.
References CL_Mat2< Type >::add().
CL_Mat2<Type> CL_Mat2< Type >::operator- | ( | const CL_Mat2< Type > & | subtract_matrix | ) | const [inline] |
Subtract operator.
References CL_Mat2< Type >::subtract().
Copy assignment operator.
Copy assignment operator.
CL_Mat2<Type>& CL_Mat2< Type >::operator= | ( | const CL_Mat2< Type > & | copy | ) | [inline] |
Copy assignment operator.
References CL_Mat2< Type >::matrix.
Equality operator.
References CL_Mat2< Type >::matrix.
Type& CL_Mat2< Type >::operator[] | ( | unsigned int | i | ) | [inline] |
Operator that returns the matrix cell at the given index.
References CL_Mat2< Type >::matrix.
Type& CL_Mat2< Type >::operator[] | ( | int | i | ) | [inline] |
Operator that returns the matrix cell at the given index.
References CL_Mat2< Type >::matrix.
const Type& CL_Mat2< Type >::operator[] | ( | unsigned int | i | ) | const [inline] |
Operator that returns the matrix cell at the given index.
References CL_Mat2< Type >::matrix.
const Type& CL_Mat2< Type >::operator[] | ( | int | i | ) | const [inline] |
Operator that returns the matrix cell at the given index.
References CL_Mat2< Type >::matrix.
static CL_Mat2<Type> CL_Mat2< Type >::subtract | ( | const CL_Mat2< Type > & | matrix_1, | |
const CL_Mat2< Type > & | matrix_2 | |||
) | [static] |
Subtract 2 matrices.
This subtract the matrix as follows: result = matrix1 - matrix2
matrix_1 | = First Matrix to subtract | |
matrix_2 | = Second Matrix to subtract |
Referenced by CL_Mat2< Type >::operator-().
CL_Mat2<Type>& CL_Mat2< Type >::subtract | ( | const CL_Mat2< Type > & | subtract_matrix | ) |
Subtract this matrix and a specified matrix.
This subtracts the matrix as follows: this = subtract_matrix - this
subtract_matrix | = Matrix to subtract |