NAMD
Matrix4Symmetry Class Reference

`#include <Matrix4Symmetry.h>`

## Public Member Functions

Matrix4Symmetry ()

Matrix4Symmetry (const BigReal *)

Matrix4Symmetry (BigReal[])

void multpoint (BigReal point) 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)

BigReal mat 

## 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
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

## 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=1.0f;
23  mat=1.0f;
24  mat=1.0f;
25  mat=1.0f;
26  }
BigReal mat
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;
40  for (int j=0; j<4; j++) {
41  tmp = mat[j];
42  tmp = mat[4+j];
43  tmp = mat[8+j];
44  tmp = mat[12+j];
45  for (int i=0; i<4; i++) {
46  mat[4*i+j] = m.mat[4*i]*tmp + m.mat[4*i+1]*tmp +
47  m.mat[4*i+2]*tmp + m.mat[4*i+3]*tmp;
48  }
49  }
50  }
BigReal mat
double BigReal
Definition: common.h:114
 void Matrix4Symmetry::multpoint ( BigReal point ) const

Definition at line 8 of file Matrix4Symmetry.C.

References mat.

8  {
9  BigReal tmp;
10  BigReal itmp3 = 1.0f / (point*mat + point*mat +
11  point*mat + mat);
12  tmp = itmp3*point;
13  tmp = itmp3*point;
14  tmp = itmp3*point;
15  point=tmp*mat + tmp*mat + tmp*mat[ 8] + itmp3*mat;
16  point=tmp*mat + tmp*mat + tmp*mat[ 9] + itmp3*mat;
17  point=tmp*mat + tmp*mat + tmp*mat + itmp3*mat;
18  }
BigReal mat
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 = x;
54  m.mat = y;
55  m.mat = z;
56  multmatrix(m);
57  }
void multmatrix(const Matrix4Symmetry &)
premultiply the matrix by the given matrix, this-&gt;other * this
BigReal mat
gridSize z
gridSize y
gridSize x
 void Matrix4Symmetry::translate ( BigReal d )

Definition at line 58 of file Matrix4Symmetry.C.

References translate().

58 { translate(d, d, d); }
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;
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
double BigReal
Definition: common.h:114

## Member Data Documentation

 BigReal Matrix4Symmetry::mat

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: