NLMech  0.1.0
util::SymMatrix3 Struct Reference

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

#include <matrix.h>

Collaboration diagram for util::SymMatrix3:
Collaboration graph

Public Member Functions

void copy (double m[6]) const
 Copy. More...
 
double det () const
 Computes the determinant of matrix. More...
 
std::vector< double > dot (const std::vector< double > &v) const
 Computes the dot product of this matrix with another vector. More...
 
util::Point3 dot (const util::Point3 &v)
 Computes the dot product of this matrix with another vector. More...
 
float & get (size_t i)
 Return the i-th element. More...
 
const float & get (size_t i) const
 Return the i-th element. More...
 
SymMatrix3 inv () const
 Computes the determinant of matrix. 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...
 
 SymMatrix3 ()
 Constructor.
 
 SymMatrix3 (const Matrix3 &m)
 Constructor. More...
 
 SymMatrix3 (const std::vector< double > &m)
 Constructor. More...
 
 SymMatrix3 (const std::vector< std::vector< double >> &m)
 Constructor. More...
 
 SymMatrix3 (const SymMatrix3 &m)
 Constructor. More...
 
 SymMatrix3 (const util::Point3 &diagonal)
 Constructor. More...
 
SymMatrix3 transpose () const
 Computes the transpose of matrix. More...
 

Data Fields

Data members

0 - xx component 1 - yy component 2 - zz component 3 - yz component 4 - xz component 5 - xy component

float d_data [6] {}
 data
 

Detailed Description

A structure to represent 3d matrices.

Constructor & Destructor Documentation

◆ SymMatrix3() [1/5]

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

Constructor.

Parameters
diagonalDiagonal vector

◆ SymMatrix3() [2/5]

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

Constructor.

Parameters
mMatrix in vector template

◆ SymMatrix3() [3/5]

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

Constructor.

Parameters
mMatrix in vector template

◆ SymMatrix3() [4/5]

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

Constructor.

Parameters
mMatrix in vector template

◆ SymMatrix3() [5/5]

util::SymMatrix3::SymMatrix3 ( const SymMatrix3 m)
inline

Constructor.

Parameters
mMatrix in vector template

Member Function Documentation

◆ copy()

void util::SymMatrix3::copy ( double  m[6]) const
inline

Copy.

warning

Parameters
mMatrix

◆ det()

double util::SymMatrix3::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::SymMatrix3::dot ( const std::vector< double > &  v) const
inline

Computes the dot product of this matrix with another vector.

Parameters
vA vector
Returns
Vector Resulting vector

◆ dot() [2/2]

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

Computes the dot product of this matrix with another vector.

Parameters
vA vector
Returns
Vector Resulting vector

◆ get() [1/2]

float& util::SymMatrix3::get ( size_t  i)
inline

Return the i-th element.

Parameters
iIndex
Returns
The i-ith element

◆ get() [2/2]

const float& util::SymMatrix3::get ( size_t  i) const
inline

Return the i-th element.

Parameters
iIndex
Returns
the i-th element

◆ inv()

SymMatrix3 util::SymMatrix3::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::SymMatrix3::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::SymMatrix3::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::SymMatrix3::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::SymMatrix3::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::SymMatrix3::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::SymMatrix3::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
resulting string

Referenced by print().

Here is the caller graph for this function:

◆ transpose()

SymMatrix3 util::SymMatrix3::transpose ( ) const
inline

Computes the transpose of matrix.

Returns
Matrix Transpose of m

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