JDFTx  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
matrix3< scalar > Class Template Reference

3x3 matrix More...

#include <matrix3.h>

Public Member Functions

__hostanddev__ scalar & operator() (int i, int j)
 Access element.
 
__hostanddev__ const scalar & operator() (int i, int j) const
 Access element.
 
__hostanddev__ vector3< scalar > row (int i) const
 Extract row.
 
__hostanddev__ vector3< scalar > column (int i) const
 Extract column.
 
__hostanddev__ void set_row (int i, const vector3< scalar > &v)
 Set row.
 
__hostanddev__ void set_rows (const vector3< scalar > &v0, const vector3< scalar > &v1, const vector3< scalar > &v2)
 
__hostanddev__ void set_col (int j, const vector3< scalar > &v)
 Set column.
 
__hostanddev__ void set_cols (const vector3< scalar > &v0, const vector3< scalar > &v1, const vector3< scalar > &v2)
 
__hostanddev__ matrix3 (scalar d0=0, scalar d1=0, scalar d2=0)
 
__hostanddev__ matrix3 (scalar m00, scalar m01, scalar m02, scalar m10, scalar m11, scalar m12, scalar m20, scalar m21, scalar m22)
 
template<typename scalar2 >
__hostanddev__ matrix3 (const matrix3< scalar2 > &n)
 
__hostanddev__ matrix3< scalar > operator- () const
 
__hostanddev__ matrix3< scalar > operator+ (const matrix3< scalar > &n) const
 
__hostanddev__ matrix3< scalar > & operator+= (const matrix3< scalar > &n)
 
__hostanddev__ matrix3< scalar > operator- (const matrix3< scalar > &n) const
 
__hostanddev__ matrix3< scalar > & operator-= (const matrix3< scalar > &n)
 
__hostanddev__ matrix3< scalar > & operator*= (scalar s)
 
__hostanddev__ matrix3< scalar > operator* (scalar s) const
 
__hostanddev__ double metric_length_squared (const vector3< double > &v) const
 Compute vector length with this as metric.
 
__hostanddev__ scalar metric_length_squared (const vector3< int > &v) const
 Compute vector length with this as metric.
 
__hostanddev__ matrix3< scalar > operator/ (scalar s) const
 
__hostanddev__ matrix3< scalar > & operator/= (scalar s)
 
__hostanddev__ matrix3< scalar > operator~ () const
 transpose More...
 
void print (FILE *fp, const char *format, bool brackets=true) const
 < print to a file / stream
 
__hostanddev__ bool operator== (const matrix3< scalar > &n) const
 
__hostanddev__ bool operator!= (const matrix3< scalar > &n) const
 

Detailed Description

template<typename scalar = double>
class matrix3< scalar >

3x3 matrix

Constructor & Destructor Documentation

template<typename scalar = double>
__hostanddev__ matrix3< scalar >::matrix3 ( scalar  d0 = 0,
scalar  d1 = 0,
scalar  d2 = 0 
)
inlineexplicit
Parameters
d2Construct diagonal
template<typename scalar = double>
__hostanddev__ matrix3< scalar >::matrix3 ( scalar  m00,
scalar  m01,
scalar  m02,
scalar  m10,
scalar  m11,
scalar  m12,
scalar  m20,
scalar  m21,
scalar  m22 
)
inline
Parameters
m22Construct from all elements
template<typename scalar = double>
template<typename scalar2 >
__hostanddev__ matrix3< scalar >::matrix3 ( const matrix3< scalar2 > &  n)
inlineexplicit
Parameters
nConvert type

Member Function Documentation

template<typename scalar = double>
__hostanddev__ matrix3<scalar> matrix3< scalar >::operator~ ( ) const
inline

transpose

< Transpose matrix

template<typename scalar = double>
__hostanddev__ void matrix3< scalar >::set_cols ( const vector3< scalar > &  v0,
const vector3< scalar > &  v1,
const vector3< scalar > &  v2 
)
inline
Parameters
v2Set all columns
template<typename scalar = double>
__hostanddev__ void matrix3< scalar >::set_rows ( const vector3< scalar > &  v0,
const vector3< scalar > &  v1,
const vector3< scalar > &  v2 
)
inline
Parameters
v2Set all rows

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