NAMD
Public Member Functions | List of all members
Matrix4TMD Class Reference

Public Member Functions

 Matrix4TMD (void)
 
 Matrix4TMD (const BigReal *m)
 
void multpoint (BigReal point[3]) 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[3])
 

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:114

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[0]=1.0f;
43  mat[5]=1.0f;
44  mat[10]=1.0f;
45  mat[15]=1.0f;
46  }
double BigReal
Definition: common.h:114
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[4];
60  for (int j=0; j<4; j++) {
61  tmp[0] = mat[j];
62  tmp[1] = mat[4+j];
63  tmp[2] = mat[8+j];
64  tmp[3] = mat[12+j];
65  for (int i=0; i<4; i++) {
66  mat[4*i+j] = m.mat[4*i]*tmp[0] + m.mat[4*i+1]*tmp[1] +
67  m.mat[4*i+2]*tmp[2] + m.mat[4*i+3]*tmp[3];
68  }
69  }
70  }
double BigReal
Definition: common.h:114
void Matrix4TMD::multpoint ( BigReal  point[3]) const
inline

Definition at line 28 of file GlobalMasterTMD.C.

28  {
29  BigReal tmp[3];
30  BigReal itmp3 = 1.0f / (point[0]*mat[3] + point[1]*mat[7] +
31  point[2]*mat[11] + mat[15]);
32  tmp[0] = itmp3*point[0];
33  tmp[1] = itmp3*point[1];
34  tmp[2] = itmp3*point[2];
35  point[0]=tmp[0]*mat[0] + tmp[1]*mat[4] + tmp[2]*mat[ 8] + itmp3*mat[12];
36  point[1]=tmp[0]*mat[1] + tmp[1]*mat[5] + tmp[2]*mat[ 9] + itmp3*mat[13];
37  point[2]=tmp[0]*mat[2] + tmp[1]*mat[6] + tmp[2]*mat[10] + itmp3*mat[14];
38  }
double BigReal
Definition: common.h:114
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[12] = x;
74  m.mat[13] = y;
75  m.mat[14] = 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[3])
inline

Definition at line 78 of file GlobalMasterTMD.C.

References translate().

Referenced by translate().

78 { translate(d[0], d[1], d[2]); }
void translate(BigReal x, BigReal y, BigReal z)
void Matrix4TMD::transpose ( )
inline

Definition at line 47 of file GlobalMasterTMD.C.

47  {
48  BigReal tmp[16];
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:114

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