NAMD
Matrix4TMD Class Reference

## Public Member Functions

Matrix4TMD (void)

Matrix4TMD (const BigReal *m)

void multpoint (BigReal point) const

void identity ()

void transpose ()

void multmatrix (const Matrix4TMD &m)
premultiply the matrix by the given matrix, this->other * this More...

void translate (BigReal x, BigReal y, BigReal z)

void translate (BigReal d)

## Detailed Description

Definition at line 23 of file GlobalMasterTMD.C.

## Constructor & Destructor Documentation

 Matrix4TMD::Matrix4TMD ( void )
inline

Definition at line 26 of file GlobalMasterTMD.C.

26 { identity(); }
void identity()
 Matrix4TMD::Matrix4TMD ( const BigReal * m )
inline

Definition at line 27 of file GlobalMasterTMD.C.

27 { memcpy(mat, m, 16*sizeof(BigReal)); }
double BigReal
Definition: common.h:112

## Member Function Documentation

 void Matrix4TMD::identity ( )
inline

Definition at line 40 of file GlobalMasterTMD.C.

40  {
41  memset(mat, 0, 16*sizeof(BigReal));
42  mat=1.0f;
43  mat=1.0f;
44  mat=1.0f;
45  mat=1.0f;
46  }
double BigReal
Definition: common.h:112
 void Matrix4TMD::multmatrix ( const Matrix4TMD & m )
inline

premultiply the matrix by the given matrix, this->other * this

Definition at line 58 of file GlobalMasterTMD.C.

58  {
59  BigReal tmp;
60  for (int j=0; j<4; j++) {
61  tmp = mat[j];
62  tmp = mat[4+j];
63  tmp = mat[8+j];
64  tmp = mat[12+j];
65  for (int i=0; i<4; i++) {
66  mat[4*i+j] = m.mat[4*i]*tmp + m.mat[4*i+1]*tmp +
67  m.mat[4*i+2]*tmp + m.mat[4*i+3]*tmp;
68  }
69  }
70  }
double BigReal
Definition: common.h:112
 void Matrix4TMD::multpoint ( BigReal point ) const
inline

Definition at line 28 of file GlobalMasterTMD.C.

28  {
29  BigReal tmp;
30  BigReal itmp3 = 1.0f / (point*mat + point*mat +
31  point*mat + mat);
32  tmp = itmp3*point;
33  tmp = itmp3*point;
34  tmp = itmp3*point;
35  point=tmp*mat + tmp*mat + tmp*mat[ 8] + itmp3*mat;
36  point=tmp*mat + tmp*mat + tmp*mat[ 9] + itmp3*mat;
37  point=tmp*mat + tmp*mat + tmp*mat + itmp3*mat;
38  }
double BigReal
Definition: common.h:112
 void Matrix4TMD::translate ( BigReal x, BigReal y, BigReal z )
inline

Definition at line 71 of file GlobalMasterTMD.C.

References x, y, and z.

71  {
72  Matrix4TMD m;
73  m.mat = x;
74  m.mat = y;
75  m.mat = z;
76  multmatrix(m);
77  }
void multmatrix(const Matrix4TMD &m)
premultiply the matrix by the given matrix, this-&gt;other * this
gridSize z
gridSize y
gridSize x
 void Matrix4TMD::translate ( BigReal d )
inline

Definition at line 78 of file GlobalMasterTMD.C.

References translate().

Referenced by translate().

78 { translate(d, d, d); }
void translate(BigReal x, BigReal y, BigReal z)
 void Matrix4TMD::transpose ( )
inline

Definition at line 47 of file GlobalMasterTMD.C.

47  {
48  BigReal tmp;
49  int i,j;
50  for(i=0;i<4;i++) {
51  for(j=0;j<4;j++) {
52  tmp[4*i+j] = mat[i+4*j];
53  }
54  }
55  for(i=0;i<16;i++) mat[i] = tmp[i];
56  }
double BigReal
Definition: common.h:112

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