NLMech  0.1.0
util::Matrix3 Struct Reference

A structure to represent 3d matrices. More...

#include <matrix.h>

Collaboration diagram for util::Matrix3:
Collaboration graph

Public Member Functions

double det () const
 Computes the determinant of matrix. More...
 
std::vector< double > dot (const std::vector< double > &v) const
 Computes the dot product between matrix and vector. More...
 
util::Point3 dot (const util::Point3 &v)
 Computes the dot product of the matrix and the vector v. More...
 
Matrix3 inv () const
 Computes the determinant of matrix. More...
 
 Matrix3 ()
 Constructor.
 
 Matrix3 (const Matrix3 &m)
 Constructor. More...
 
 Matrix3 (const std::vector< std::vector< double >> &m)
 Constructor. More...
 
 Matrix3 (const util::Point3 &a1, const util::Point3 &a2, const util::Point3 &a3)
 Constructor. More...
 
 Matrix3 (const util::Point3 &diagonal)
 Constructor. More...
 
Point3 operator() (size_t i)
 Access operator of the i-th element. More...
 
Point3 operator() (size_t i) const
 Access operator of the i-th element. More...
 
float & operator() (size_t i, size_t j)
 Access operator of the Matrix element M(i,j) More...
 
const float & operator() (size_t i, size_t j) const
 Access operator of the Matrix element M(i,j) More...
 
void print (int nt=0, int lvl=0) const
 Prints the information. More...
 
std::string printStr (int nt=0, int lvl=0) const
 Prints the information. More...
 
Matrix3 transpose () const
 Computes the transpose of matrix. More...
 

Data Fields

Data members
float d_data [3][3] {}
 data
 

Detailed Description

A structure to represent 3d matrices.

Constructor & Destructor Documentation

◆ Matrix3() [1/4]

util::Matrix3::Matrix3 ( const util::Point3 diagonal)
inline

Constructor.

Parameters
diagonalDiagonal vector

◆ Matrix3() [2/4]

util::Matrix3::Matrix3 ( const util::Point3 a1,
const util::Point3 a2,
const util::Point3 a3 
)
inline

Constructor.

Parameters
a1first row
a2second row
a3third row

◆ Matrix3() [3/4]

util::Matrix3::Matrix3 ( const std::vector< std::vector< double >> &  m)
inline

Constructor.

Parameters
mMatrix in vector template

◆ Matrix3() [4/4]

util::Matrix3::Matrix3 ( const Matrix3 m)
inline

Constructor.

Parameters
mMatrix in vector template

Member Function Documentation

◆ det()

double util::Matrix3::det ( ) const
inline

Computes the determinant of matrix.

Returns
det Determinant

Referenced by inv().

Here is the caller graph for this function:

◆ dot() [1/2]

std::vector<double> util::Matrix3::dot ( const std::vector< double > &  v) const
inline

Computes the dot product between matrix and vector.

Parameters
vvector
Returns
vector Dot product

◆ dot() [2/2]

util::Point3 util::Matrix3::dot ( const util::Point3 v)
inline

Computes the dot product of the matrix and the vector v.

Parameters
vThe vector
Returns
The evaluation of the dot product

◆ inv()

Matrix3 util::Matrix3::inv ( ) const
inline

Computes the determinant of matrix.

Returns
inv Inverse of m
Here is the call graph for this function:

◆ operator()() [1/4]

Point3 util::Matrix3::operator() ( size_t  i)
inline

Access operator of the i-th element.

Parameters
iIndex i
Returns
The i-th element

◆ operator()() [2/4]

Point3 util::Matrix3::operator() ( size_t  i) const
inline

Access operator of the i-th element.

Parameters
iIndex i
Returns
The i-th element

◆ operator()() [3/4]

float& util::Matrix3::operator() ( size_t  i,
size_t  j 
)
inline

Access operator of the Matrix element M(i,j)

Parameters
iIndex i
jIndex j
Returns
Matrix element M(i,j)

◆ operator()() [4/4]

const float& util::Matrix3::operator() ( size_t  i,
size_t  j 
) const
inline

Access operator of the Matrix element M(i,j)

Parameters
iIndex i
jIndex j
Returns
Matrix element M(i,j)

◆ print()

void util::Matrix3::print ( int  nt = 0,
int  lvl = 0 
) const
inline

Prints the information.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Here is the call graph for this function:

◆ printStr()

std::string util::Matrix3::printStr ( int  nt = 0,
int  lvl = 0 
) const
inline

Prints the information.

Parameters
ntNumber of tabs to append before printing
lvlInformation level (higher means more information)
Returns
The resulting string

Referenced by print().

Here is the caller graph for this function:

◆ transpose()

Matrix3 util::Matrix3::transpose ( ) const
inline

Computes the transpose of matrix.

Returns
Matrix Transpose of m
Here is the call graph for this function:

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