clan::Mat2< Type > Class Template Reference

2D matrix More...

#include <mat2.h>

Public Member Functions

Operations
bool is_equal (const Mat2< Type > &other, Type epsilon) const
 Returns true if equal within the bounds of an epsilon. 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...
 
Mat2< Type > & operator= (const Mat2< Type > &copy)
 Copy assignment operator. More...
 
Mat2< Type > & operator= (const Mat4< Type > &copy)
 Copy assignment operator. More...
 
Mat2< Type > & operator= (const Mat3< Type > &copy)
 Copy assignment operator. More...
 
Mat2< Type > operator* (const Mat2< Type > &mult) const
 Multiplication operator. More...
 
Mat2< Type > operator+ (const Mat2< Type > &add_matrix) const
 Addition operator. More...
 
Mat2< Type > operator- (const Mat2< Type > &subtract_matrix) const
 Subtract operator. More...
 
bool operator== (const Mat2< Type > &other) const
 Equality operator. More...
 
bool operator!= (const Mat2< Type > &other) const
 Not-equal operator. More...
 

Public Attributes

Attributes
Type matrix [4]
 

Construction

 Mat2 ()
 Constructs a 2x2 matrix (zero'ed) More...
 
 Mat2 (const Mat2< Type > &copy)
 Constructs a 2x2 matrix (copied) More...
 
 Mat2 (const Mat3< Type > &copy)
 Constructs a 2x2 matrix (copied from a 3d matrix) More...
 
 Mat2 (const Mat4< Type > &copy)
 Constructs a 2x2 matrix (copied from a 4d matrix) More...
 
 Mat2 (const float *init_matrix)
 Constructs a 2x2 matrix (copied from 4 floats) More...
 
 Mat2 (Type m00, Type m01, Type m10, Type m11)
 Constructs a 2x2 matrix (copied from specified values) More...
 
 Mat2 (const double *init_matrix)
 Constructs a 2x2 matrix (copied from 4 doubles) More...
 
 Mat2 (const int64_t *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 64 bit integers) More...
 
 Mat2 (const int32_t *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 32 bit integers) More...
 
 Mat2 (const int16_t *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 16 bit integers) More...
 
 Mat2 (const int8_t *init_matrix)
 Constructs a 2x2 matrix (copied from 4, 8 bit integers) More...
 
static Mat2< Type > null ()
 
static Mat2< Type > identity ()
 
static Mat2< Type > multiply (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2)
 Multiply 2 matrices. More...
 
static Mat2< Type > add (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2)
 Add 2 matrices. More...
 
static Mat2< Type > subtract (const Mat2< Type > &matrix_1, const Mat2< Type > &matrix_2)
 Subtract 2 matrices. More...
 
static bool is_equal (const Mat2< Type > &first, const Mat2< Type > &second, Type epsilon)
 Returns true if equal within the bounds of an epsilon. More...
 

Detailed Description

template<typename Type>
class clan::Mat2< Type >

2D matrix

These matrix templates are defined for: int (Mat2i), float (Mat2f), double (Mat2d)


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