Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
cil::Matrix3f Class Referencefinal

The Matrix3f class is 3 X 3 matrix. More...

#include <matrix.h>

Inheritance diagram for cil::Matrix3f:
cil::Matrix< Matrix3f > cil::Tuple< float > cil::Variant

Public Member Functions

 Matrix3f ()
 Constructs a 3 X 3 matrix objects, initializing elements on the diagonal to 1 and all others to 0.
 
 Matrix3f (float e00, float e01, float e02, float e10, float e11, float e12, float e20, float e21, float e22)
 Constructs a 3 X 3 matrix objects, and sets the elements with the input fload parameters.
 
 Matrix3f (const Vector3f &c0, const Vector3f &c1, const Vector3f &c2)
 Constructs a 3 X 3 matrix object by setting the vector c0 to the first column, c1 to the second column and c2 to the third column.
 
 Matrix3f (const Matrix2f &other)
 Constructs a 3 X 3 matrix object, and sets its 2 X 2 submatrix with another 2 X 2 matrix, remaining the other elements as their initialized values.
 
 Matrix3f (const Matrix3f &other)
 Constructs a 3 X 3 matrix object by copying the elements of another 3 X 3 matrix.

 
 Matrix3f (const Matrix4f &other)
 Constructs a 3 X 3 matrix object by copying the elements of the 3 X 3 submatrix of another 4 X 4 matrix.
 
void set (float e00, float e01, float e02, float e10, float e11, float e12, float e20, float e21, float e22)
 Sets the elements of this 3 X 3 matrix object.
 
float determinant () const
 Returns the determinant of the Matrix3f object.
 
bool invert ()
 Inverts this matrix. Returns a boolean value of true if success(non-singular). If the determinant is zero(singular matrix), sets the matrix to identity and returns false.
 
- Public Member Functions inherited from cil::Matrix< Matrix3f >
 Matrix (int dim)
 Constructs a dim X dim Matrix object, initializing elements on the diagonal to 1 and all others to 0.
 
const float * operator[] (int index) const
 Returns a constant pointer to the first element in the column of index of this matrix, providing a read-only access.
 
float * operator[] (int index)
 Returns a pointer to the first element in the column of index of this matrix, providing a read-write access.
 
Matrixoperator+= (const Matrix &other)
 Performs element-wise addition between the current Matrix and another matrix.
 
Matrix< Matrix3f > & operator-= (const Matrix &other)
 Performs element-wise subtraction between the current Matrix and another matrix.
 
Matrix< Matrix3f > & operator*= (const Matrix &other)
 Performs right matrix multiplication of the current matrix with another matrix.
 
Matrix3f operator+ (const Matrix3f &other) const
 Returns a new Matrix object that is formed by element-wise addition between the current matrix and another matrix.
 
Matrix3f operator- (const Matrix3f &other) const
 Returns a new Matrix object that is formed by element-wise subtraction between the current matrix and another matrix.
 
Matrix3f operator* (const Matrix3f &other) const
 Returns a new Matrix object that is formed by matrix multiplication between the current Matrix and another matrix.
 
void setIdentity ()
 Sets elements on the diagonal of this matrix to 1 and all others to 0.
 
void transpose ()
 Transpose this matrix.
 
- Public Member Functions inherited from cil::Tuple< float >
 Tuple (int size)
 Constructs a Tuple object with a specified number of elements, and initialize all elements to 0.
 
virtual ~Tuple ()
 
int size () const
 Gets the number of elements of the Tuple.
 
float * data ()
 Gets the data array of the Tuple.
 
const float * data () const
 Gets the data array of the Tuple, and the data could not be modified upon which this function is called.
 
void setData (const float *data)
 Sets the data array of the Variant.
 
Tuple< float > & operator= (const Tuple &other)
 Copys the data of another Tuple to the one on which the operator is invoked.
 
bool operator== (const Tuple &other) const
 Compares the Tuple with another one, and returns true if they are equal, otherwise returns false.
 
bool operator!= (const Tuple &other) const
 Compares the Tuple with another one, and returns false if they are equal, otherwise returns true.
 
- Public Member Functions inherited from cil::Variant
 Variant ()
 
virtual ~Variant ()
 
const std::string & type () const
 

Additional Inherited Members

- Protected Attributes inherited from cil::Matrix< Matrix3f >
int m_dim
 The dimension of the Matrix.
 
- Protected Attributes inherited from cil::Tuple< float >
float * m_data
 The data array of the Tuple.
 
int m_size
 The number of elements that the data array of the Tuple holds.
 
- Protected Attributes inherited from cil::Variant
std::string m_type
 

Detailed Description

The Matrix3f class is 3 X 3 matrix.

Constructor & Destructor Documentation

◆ Matrix3f() [1/6]

cil::Matrix3f::Matrix3f ( )

Constructs a 3 X 3 matrix objects, initializing elements on the diagonal to 1 and all others to 0.

See also
Matrix(int dim)

◆ Matrix3f() [2/6]

cil::Matrix3f::Matrix3f ( float e00,
float e01,
float e02,
float e10,
float e11,
float e12,
float e20,
float e21,
float e22 )

Constructs a 3 X 3 matrix objects, and sets the elements with the input fload parameters.

The first column of the matrix is {e00, e01, e02}, the second column is {e10, e11, e12}, and the third column is {e20, e21, e22}.

◆ Matrix3f() [3/6]

cil::Matrix3f::Matrix3f ( const Vector3f & c0,
const Vector3f & c1,
const Vector3f & c2 )

Constructs a 3 X 3 matrix object by setting the vector c0 to the first column, c1 to the second column and c2 to the third column.

◆ Matrix3f() [4/6]

cil::Matrix3f::Matrix3f ( const Matrix2f & other)

Constructs a 3 X 3 matrix object, and sets its 2 X 2 submatrix with another 2 X 2 matrix, remaining the other elements as their initialized values.

◆ Matrix3f() [5/6]

cil::Matrix3f::Matrix3f ( const Matrix3f & other)

Constructs a 3 X 3 matrix object by copying the elements of another 3 X 3 matrix.

◆ Matrix3f() [6/6]

cil::Matrix3f::Matrix3f ( const Matrix4f & other)

Constructs a 3 X 3 matrix object by copying the elements of the 3 X 3 submatrix of another 4 X 4 matrix.

Member Function Documentation

◆ determinant()

float cil::Matrix3f::determinant ( ) const

Returns the determinant of the Matrix3f object.

◆ invert()

bool cil::Matrix3f::invert ( )

Inverts this matrix. Returns a boolean value of true if success(non-singular). If the determinant is zero(singular matrix), sets the matrix to identity and returns false.

◆ set()

void cil::Matrix3f::set ( float e00,
float e01,
float e02,
float e10,
float e11,
float e12,
float e20,
float e21,
float e22 )

Sets the elements of this 3 X 3 matrix object.

The first column of the matrix is {e00, e01, e02}, the second column is {e10, e11, e12}, and the third column is {e20, e21, e22}.