JDFTx  1.7.0
matrix3.h File Reference

3x3 matrices with CPU and GPU operators More...

#include <core/vector3.h>

Classes

class  matrix3< scalar >
 3x3 matrix More...
 
struct  symmetricMatrix3< scalar >
 Symmetric matrix that stores only non-redundant entries (with limited operations) More...
 
struct  SpaceGroupOp
 Space group operation r -> rot * r + a in real-space lattice coordinates. More...
 

Macros

#define METRIC_LENGTH_SQUARED
 Compute the length of a vector, using this matrix as the metric. More...
 
#define MUL_MAT_VEC(retType)
 
#define MUL_VEC_MAT(retType)
 
#define MUL_MAT_MAT(retType)
 

Functions

template<typename scalar >
__hostanddev__ matrix3< scalar > operator* (scalar s, const matrix3< scalar > &m)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > outer (const vector3< scalar > &a, const vector3< scalar > &b)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const matrix3< scalar > &m, const vector3< scalar > &v)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const matrix3< scalar > &m, const vector3< int > &v)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const matrix3< int > &m, const vector3< scalar > &v)
 
__hostanddev__ vector3< int > operator* (const matrix3< int > &m, const vector3< int > &v)
 
__hostanddev__ vector3< complexoperator* (const matrix3< complex > &m, const vector3<> &v)
 
__hostanddev__ vector3< complexoperator* (const matrix3<> &m, const vector3< complex > &v)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const vector3< scalar > &v, const matrix3< scalar > &m)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const vector3< int > &v, const matrix3< scalar > &m)
 
template<typename scalar >
__hostanddev__ vector3< scalar > operator* (const vector3< scalar > &v, const matrix3< int > &m)
 
__hostanddev__ vector3< int > operator* (const vector3< int > &v, const matrix3< int > &m)
 
__hostanddev__ vector3< complexoperator* (const vector3<> &v, const matrix3< complex > &m)
 
__hostanddev__ vector3< complexoperator* (const vector3< complex > &v, const matrix3<> &m)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > operator* (const matrix3< scalar > &m, const matrix3< scalar > &n)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > operator* (const matrix3< scalar > &m, const matrix3< int > &n)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > operator* (const matrix3< int > &m, const matrix3< scalar > &n)
 
__hostanddev__ matrix3< int > operator* (const matrix3< int > &m, const matrix3< int > &n)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > & operator*= (matrix3< scalar > &m, const matrix3< scalar > &n)
 
template<typename scalar >
__hostanddev__ matrix3< scalar > Diag (vector3< scalar > v)
 
template<typename scalar >
__hostanddev__ scalar trace (const matrix3< scalar > &m)
 Trace of matrix.
 
template<typename scalar >
__hostanddev__ scalar det (const matrix3< scalar > &m)
 Determinant of matrix.
 
template<typename scalar >
__hostanddev__ matrix3< scalar > adjugate (const matrix3< scalar > &m)
 
__hostanddev__ matrix3 inv (const matrix3<> &m)
 
template<typename scalar >
__hostanddev__ scalar nrm2sq (const matrix3< scalar > &m)
 square of 2-norm of matrix
 
template<typename scalar >
__hostanddev__ double nrm2 (const matrix3< scalar > &m)
 2-norm of matrix
 
__hostanddev__ matrix3 rotation (double theta, int axis)
 Create a rotation matrix.
 
template<typename scalar >
__hostanddev__ symmetricMatrix3< scalar > operator* (scalar s, symmetricMatrix3< scalar > m)
 Scale.
 
template<typename scalar >
__hostanddev__ symmetricMatrix3< scalar > outer (const vector3< scalar > &v)
 Symmetric outer product of vector.
 

Detailed Description

3x3 matrices with CPU and GPU operators

Macro Definition Documentation

◆ METRIC_LENGTH_SQUARED

#define METRIC_LENGTH_SQUARED
Value:
return v[0]*v[0]*m[0][0] + v[1]*v[1]*m[1][1] + v[2]*v[2]*m[2][2] \
+ 2*(v[0]*v[1]*m[0][1] + v[0]*v[2]*m[0][2] + v[1]*v[2]*m[1][2]);

Compute the length of a vector, using this matrix as the metric.