Loading [MathJax]/extensions/TeX/AMSsymbols.js
SIRIUS 7.5.0
Electronic structure library and applications
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Private Attributes | List of all members
sirius::r3::matrix< T > Class Template Reference

Handling of a 3x3 matrix of numerical data types. More...

#include <r3.hpp>

Public Member Functions

 matrix ()
 Construct a zero matrix. More...
 
 matrix (T mtrx__[3][3])
 Construct matrix form plain 3x3 array. More...
 
 matrix (std::vector< std::vector< T > > src__)
 Construct matrix from std::vector. More...
 
 matrix (std::array< std::array< T, 3 >, 3 > src__)
 
template<typename U >
 matrix (matrix< U > const &src__)
 Copy constructor. More...
 
 matrix (std::initializer_list< std::initializer_list< T > > mtrx__)
 Construct matrix form std::initializer_list. More...
 
matrix< T > & operator= (matrix< T > const &rhs)
 Assignment operator. More...
 
T & operator() (const int i, const int j)
 
T const & operator() (const int i, const int j) const
 
template<typename U >
auto operator+ (matrix< U > const &b) const
 Sum of two matrices. More...
 
template<typename U >
auto & operator+= (matrix< U > const &b)
 += operator More...
 
template<typename U >
auto & operator*= (U p)
 Multiply matrix by a scalar number. More...
 
det () const
 Return determinant of a matrix. More...
 
void zero ()
 

Private Attributes

mtrx_ [3][3]
 Store matrix \( M_{ij} \) as mtrx[i][j]. More...
 

Detailed Description

template<typename T>
class sirius::r3::matrix< T >

Handling of a 3x3 matrix of numerical data types.

Definition at line 231 of file r3.hpp.

Constructor & Destructor Documentation

◆ matrix() [1/6]

template<typename T >
sirius::r3::matrix< T >::matrix ( )
inline

Construct a zero matrix.

Definition at line 242 of file r3.hpp.

◆ matrix() [2/6]

template<typename T >
sirius::r3::matrix< T >::matrix ( mtrx__[3][3])
inline

Construct matrix form plain 3x3 array.

Definition at line 248 of file r3.hpp.

◆ matrix() [3/6]

template<typename T >
sirius::r3::matrix< T >::matrix ( std::vector< std::vector< T > >  src__)
inline

Construct matrix from std::vector.

Definition at line 258 of file r3.hpp.

◆ matrix() [4/6]

template<typename T >
sirius::r3::matrix< T >::matrix ( std::array< std::array< T, 3 >, 3 >  src__)
inline

Definition at line 267 of file r3.hpp.

◆ matrix() [5/6]

template<typename T >
template<typename U >
sirius::r3::matrix< T >::matrix ( matrix< U > const &  src__)
inline

Copy constructor.

Definition at line 278 of file r3.hpp.

◆ matrix() [6/6]

template<typename T >
sirius::r3::matrix< T >::matrix ( std::initializer_list< std::initializer_list< T > >  mtrx__)
inline

Construct matrix form std::initializer_list.

Definition at line 288 of file r3.hpp.

Member Function Documentation

◆ operator=()

template<typename T >
matrix< T > & sirius::r3::matrix< T >::operator= ( matrix< T > const &  rhs)
inline

Assignment operator.

Definition at line 298 of file r3.hpp.

◆ operator()() [1/2]

template<typename T >
T & sirius::r3::matrix< T >::operator() ( const int  i,
const int  j 
)
inline

Definition at line 310 of file r3.hpp.

◆ operator()() [2/2]

template<typename T >
T const & sirius::r3::matrix< T >::operator() ( const int  i,
const int  j 
) const
inline

Definition at line 315 of file r3.hpp.

◆ operator+()

template<typename T >
template<typename U >
auto sirius::r3::matrix< T >::operator+ ( matrix< U > const &  b) const
inline

Sum of two matrices.

Definition at line 322 of file r3.hpp.

◆ operator+=()

template<typename T >
template<typename U >
auto & sirius::r3::matrix< T >::operator+= ( matrix< U > const &  b)
inline

+= operator

Definition at line 335 of file r3.hpp.

◆ operator*=()

template<typename T >
template<typename U >
auto & sirius::r3::matrix< T >::operator*= ( p)
inline

Multiply matrix by a scalar number.

Definition at line 347 of file r3.hpp.

◆ det()

template<typename T >
T sirius::r3::matrix< T >::det ( ) const
inline

Return determinant of a matrix.

Definition at line 358 of file r3.hpp.

◆ zero()

template<typename T >
void sirius::r3::matrix< T >::zero ( )
inline

Definition at line 365 of file r3.hpp.

Friends And Related Function Documentation

◆ matrix

template<typename T >
template<typename U >
friend class matrix
friend

Definition at line 239 of file r3.hpp.

Member Data Documentation

◆ mtrx_

template<typename T >
T sirius::r3::matrix< T >::mtrx_[3][3]
private

Store matrix \( M_{ij} \) as mtrx[i][j].

Definition at line 235 of file r3.hpp.


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