ClanLib  2.3.7
List of all members
CL_Mat2< Type > Class Template Reference

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. More...
 
CL_Mat2< Type > & add (const CL_Mat2< Type > &add_matrix)
 Add this matrix and a specified matrix. More...
 
CL_Mat2< Type > & subtract (const CL_Mat2< Type > &subtract_matrix)
 Subtract this matrix and a specified matrix. More...
 
Operators
 operator Type const * () const
 Operator that returns the matrix as a array. More...
 
 operator Type * ()
 Operator that returns the matrix as a array. More...
 
Type & operator[] (int i)
 Operator that returns the matrix cell at the given index. More...
 
const Type & operator[] (int i) const
 Operator that returns the matrix cell at the given index. More...
 
Type & operator[] (unsigned int i)
 Operator that returns the matrix cell at the given index. More...
 
const Type & operator[] (unsigned int i) const
 Operator that returns the matrix cell at the given index. More...
 
CL_Mat2< Type > & operator= (const CL_Mat2< Type > &copy)
 Copy assignment operator. More...
 
CL_Mat2< Type > & operator= (const CL_Mat4< Type > &copy)
 Copy assignment operator. More...
 
CL_Mat2< Type > & operator= (const CL_Mat3< Type > &copy)
 Copy assignment operator. More...
 
CL_Mat2< Type > operator* (const CL_Mat2< Type > &mult) const
 Multiplication operator. More...
 
CL_Mat2< Type > operator+ (const CL_Mat2< Type > &add_matrix) const
 Addition operator. More...
 
CL_Mat2< Type > operator- (const CL_Mat2< Type > &subtract_matrix) const
 Subtract operator. More...
 
bool operator== (const CL_Mat2< Type > &other)
 Equality operator. More...
 
bool operator!= (const CL_Mat2< Type > &other)
 Not-equal operator. More...
 

Public Attributes

Attributes
Type matrix [4]
 

Construction

 CL_Mat2 ()
 Constructs a 2x2 matrix (uninitialised) More...
 
 CL_Mat2 (const CL_Mat2< Type > &copy)
 Constructs a 2x2 matrix (copied) More...
 
 CL_Mat2 (const CL_Mat3< Type > &copy)
 Constructs a 2x2 matrix (copied from a 3d matrix) More...
 
 CL_Mat2 (const CL_Mat4< Type > &copy)
 Constructs a 2x2 matrix (copied from a 4d matrix) More...
 
 CL_Mat2 (const float *init_matrix)
 Constructs a 2x2 matrix (copied from 4 floats) More...
 
 CL_Mat2 (Type m00, Type m01, Type m10, Type m11)
 Constructs a 2x2 matrix (copied from specified values) More...
 
 CL_Mat2 (const double *init_matrix)
 Constructs a 2x2 matrix (copied from 4 doubles) More...
 
 CL_Mat2 (const cl_byte64 *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 64 bit integers) More...
 
 CL_Mat2 (const cl_byte32 *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 32 bit integers) More...
 
 CL_Mat2 (const cl_byte16 *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 16 bit integers) More...
 
 CL_Mat2 (const cl_byte8 *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 8 bit integers) More...
 
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. More...
 
static CL_Mat2< Type > add (const CL_Mat2< Type > &matrix_1, const CL_Mat2< Type > &matrix_2)
 Add 2 matrices. More...
 
static CL_Mat2< Type > subtract (const CL_Mat2< Type > &matrix_1, const CL_Mat2< Type > &matrix_2)
 Subtract 2 matrices. More...
 

Detailed Description

template<typename Type>
class CL_Mat2< Type >

2D matrix

These matrix templates are defined for: int (CL_Mat2i), float (CL_Mat2f), double (CL_Mat2d)

Constructor & Destructor Documentation

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( )
inline

Constructs a 2x2 matrix (uninitialised)

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const CL_Mat2< Type > &  copy)
inline

Constructs a 2x2 matrix (copied)

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const CL_Mat3< Type > &  copy)

Constructs a 2x2 matrix (copied from a 3d matrix)

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const CL_Mat4< Type > &  copy)

Constructs a 2x2 matrix (copied from a 4d matrix)

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const float *  init_matrix)
inline

Constructs a 2x2 matrix (copied from 4 floats)

References CL_Mat2< Type >::matrix.

template<typename Type>
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.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const double *  init_matrix)
inline

Constructs a 2x2 matrix (copied from 4 doubles)

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const cl_byte64 init_matrix)
inline

Constructs a 2x2 matrix (copied from 4, 64 bit integers)

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const cl_byte32 init_matrix)
inline

Constructs a 2x2 matrix (copied from 4, 32 bit integers)

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const cl_byte16 init_matrix)
inline

Constructs a 2x2 matrix (copied from 4, 16 bit integers)

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::CL_Mat2 ( const cl_byte8 init_matrix)
inline

Constructs a 2x2 matrix (copied from 4, 8 bit integers)

References CL_Mat2< Type >::matrix.

Member Function Documentation

template<typename Type>
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

Parameters
matrix_1= First Matrix to add
matrix_2= Second Matrix to add
Returns
The matrix

Referenced by CL_Mat2< Type >::operator+().

template<typename Type>
CL_Mat2<Type>& CL_Mat2< Type >::add ( const CL_Mat2< Type > &  add_matrix)

Add this matrix and a specified matrix.

This adds the matrix as follows: this = add_matrix - this

Parameters
add_matrix= Matrix to add
Returns
reference to this object
template<typename Type>
static CL_Mat2<Type> CL_Mat2< Type >::identity ( )
static
template<typename Type>
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

Parameters
matrix_1= First Matrix to multiply
matrix_2= Second Matrix to multiply
Returns
The matrix

Referenced by CL_Mat2< Type >::operator*().

template<typename Type>
CL_Mat2<Type>& CL_Mat2< Type >::multiply ( const CL_Mat2< Type > &  mult)

Multiply this matrix and a specified matrix.

This multiplies the matrix as follows: this = mult * this

Parameters
mult= Matrix to multiply
Returns
reference to this object
template<typename Type>
static CL_Mat2<Type> CL_Mat2< Type >::null ( )
static
template<typename Type>
CL_Mat2< Type >::operator Type * ( )
inline

Operator that returns the matrix as a array.

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2< Type >::operator Type const * ( ) const
inline

Operator that returns the matrix as a array.

References CL_Mat2< Type >::matrix.

template<typename Type>
bool CL_Mat2< Type >::operator!= ( const CL_Mat2< Type > &  other)
inline

Not-equal operator.

template<typename Type>
CL_Mat2<Type> CL_Mat2< Type >::operator* ( const CL_Mat2< Type > &  mult) const
inline

Multiplication operator.

References CL_Mat2< Type >::multiply().

template<typename Type>
CL_Mat2<Type> CL_Mat2< Type >::operator+ ( const CL_Mat2< Type > &  add_matrix) const
inline

Addition operator.

References CL_Mat2< Type >::add().

template<typename Type>
CL_Mat2<Type> CL_Mat2< Type >::operator- ( const CL_Mat2< Type > &  subtract_matrix) const
inline

Subtract operator.

References CL_Mat2< Type >::subtract().

template<typename Type>
CL_Mat2<Type>& CL_Mat2< Type >::operator= ( const CL_Mat2< Type > &  copy)
inline

Copy assignment operator.

References CL_Mat2< Type >::matrix.

template<typename Type>
CL_Mat2<Type>& CL_Mat2< Type >::operator= ( const CL_Mat4< Type > &  copy)

Copy assignment operator.

template<typename Type>
CL_Mat2<Type>& CL_Mat2< Type >::operator= ( const CL_Mat3< Type > &  copy)

Copy assignment operator.

template<typename Type>
bool CL_Mat2< Type >::operator== ( const CL_Mat2< Type > &  other)
inline

Equality operator.

References CL_Mat2< Type >::matrix.

template<typename Type>
Type& CL_Mat2< Type >::operator[] ( int  i)
inline

Operator that returns the matrix cell at the given index.

References CL_Mat2< Type >::matrix.

template<typename Type>
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.

template<typename Type>
Type& CL_Mat2< Type >::operator[] ( unsigned int  i)
inline

Operator that returns the matrix cell at the given index.

References CL_Mat2< Type >::matrix.

template<typename Type>
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.

template<typename Type>
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

Parameters
matrix_1= First Matrix to subtract
matrix_2= Second Matrix to subtract
Returns
The matrix

Referenced by CL_Mat2< Type >::operator-().

template<typename Type>
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

Parameters
subtract_matrix= Matrix to subtract
Returns
reference to this object

Member Data Documentation

template<typename Type>
Type CL_Mat2< Type >::matrix[4]

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