NAMD
Matrix4Symmetry Class Reference

`#include <Matrix4Symmetry.h>`

## Public Member Functions

Matrix4Symmetry ()

Matrix4Symmetry (const BigReal *)

Matrix4Symmetry (BigReal[])

void multpoint (BigReal point[3]) const

void identity ()

void transpose ()

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

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

void translate (BigReal d[3])

BigReal mat [16]

## Detailed Description

Definition at line 5 of file Matrix4Symmetry.h.

## Constructor & Destructor Documentation

 Matrix4Symmetry::Matrix4Symmetry ( )

Definition at line 3 of file Matrix4Symmetry.C.

References identity().

3 { identity(); }
 Matrix4Symmetry::Matrix4Symmetry ( const BigReal * m )

Definition at line 4 of file Matrix4Symmetry.C.

References mat.

4 { memcpy(mat, m, 16*sizeof(BigReal)); }
BigReal mat[16]
double BigReal
Definition: common.h:114
 Matrix4Symmetry::Matrix4Symmetry ( BigReal arr[] )

Definition at line 5 of file Matrix4Symmetry.C.

References mat.

5  {
6  for(int i = 0; i < 16; i++){mat[i] = arr[i];}
7  }
BigReal mat[16]

## Member Function Documentation

 void Matrix4Symmetry::identity ( void )

Definition at line 20 of file Matrix4Symmetry.C.

References mat.

Referenced by Matrix4Symmetry().

20  {
21  memset(mat, 0, 16*sizeof(BigReal));
22  mat[0]=1.0f;
23  mat[5]=1.0f;
24  mat[10]=1.0f;
25  mat[15]=1.0f;
26  }
BigReal mat[16]
double BigReal
Definition: common.h:114
 void Matrix4Symmetry::multmatrix ( const Matrix4Symmetry & m )

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

Definition at line 38 of file Matrix4Symmetry.C.

References mat.

Referenced by translate().

38  {
39  BigReal tmp[4];
40  for (int j=0; j<4; j++) {
41  tmp[0] = mat[j];
42  tmp[1] = mat[4+j];
43  tmp[2] = mat[8+j];
44  tmp[3] = mat[12+j];
45  for (int i=0; i<4; i++) {
46  mat[4*i+j] = m.mat[4*i]*tmp[0] + m.mat[4*i+1]*tmp[1] +
47  m.mat[4*i+2]*tmp[2] + m.mat[4*i+3]*tmp[3];
48  }
49  }
50  }
BigReal mat[16]
double BigReal
Definition: common.h:114
 void Matrix4Symmetry::multpoint ( BigReal point[3] ) const

Definition at line 8 of file Matrix4Symmetry.C.

References mat.

8  {
9  BigReal tmp[3];
10  BigReal itmp3 = 1.0f / (point[0]*mat[3] + point[1]*mat[7] +
11  point[2]*mat[11] + mat[15]);
12  tmp[0] = itmp3*point[0];
13  tmp[1] = itmp3*point[1];
14  tmp[2] = itmp3*point[2];
15  point[0]=tmp[0]*mat[0] + tmp[1]*mat[4] + tmp[2]*mat[ 8] + itmp3*mat[12];
16  point[1]=tmp[0]*mat[1] + tmp[1]*mat[5] + tmp[2]*mat[ 9] + itmp3*mat[13];
17  point[2]=tmp[0]*mat[2] + tmp[1]*mat[6] + tmp[2]*mat[10] + itmp3*mat[14];
18  }
BigReal mat[16]
double BigReal
Definition: common.h:114
 void Matrix4Symmetry::translate ( BigReal x, BigReal y, BigReal z )

Definition at line 51 of file Matrix4Symmetry.C.

References mat, multmatrix(), x, y, and z.

Referenced by translate().

51  {
52  Matrix4Symmetry m;
53  m.mat[12] = x;
54  m.mat[13] = y;
55  m.mat[14] = z;
56  multmatrix(m);
57  }
void multmatrix(const Matrix4Symmetry &)
premultiply the matrix by the given matrix, this-&gt;other * this
BigReal mat[16]
gridSize z
gridSize y
gridSize x
 void Matrix4Symmetry::translate ( BigReal d[3] )

Definition at line 58 of file Matrix4Symmetry.C.

References translate().

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

Definition at line 27 of file Matrix4Symmetry.C.

References mat.

27  {
28  BigReal tmp[16];
29  int i,j;
30  for(i=0;i<4;i++) {
31  for(j=0;j<4;j++) {
32  tmp[4*i+j] = mat[i+4*j];
33  }
34  }
35  for(i=0;i<16;i++) mat[i] = tmp[i];
36  }
BigReal mat[16]
double BigReal
Definition: common.h:114

## Member Data Documentation

 BigReal Matrix4Symmetry::mat[16]

Definition at line 7 of file Matrix4Symmetry.h.

Referenced by identity(), Matrix4Symmetry(), multmatrix(), multpoint(), translate(), and transpose().

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