MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MatrixSymmetric3D Class Reference

Implementation of a 3D symmetric matrix. More...

#include <MatrixSymmetric.h>

Public Member Functions

 operator Matrix3D ()
 
 MatrixSymmetric3D (void)
 
 MatrixSymmetric3D (const Mdouble xx, const Mdouble xy, const Mdouble xz, const Mdouble yy, const Mdouble yz, const Mdouble zz)
 
void set_zero ()
 
Mdouble trace () const
 
MatrixSymmetric3D operator+ (const MatrixSymmetric3D &A) const
 
MatrixSymmetric3D operator- (const MatrixSymmetric3D &A) const
 
MatrixSymmetric3D operator+ (const Mdouble A) const
 
MatrixSymmetric3D operator- (const Mdouble A) const
 
MatrixSymmetric3D operator* (const Mdouble A) const
 
MatrixSymmetric3D operator/ (const Mdouble A) const
 
MatrixSymmetric3Doperator+= (const MatrixSymmetric3D &A)
 
MatrixSymmetric3Doperator-= (const MatrixSymmetric3D &A)
 
MatrixSymmetric3Doperator/= (const Mdouble a)
 

Public Attributes

Mdouble XX
 
Mdouble XY
 
Mdouble XZ
 
Mdouble YY
 
Mdouble YZ
 
Mdouble ZZ
 

Friends

Vec3D operator* (const MatrixSymmetric3D A, const Vec3D B)
 
std::ostream & operator<< (std::ostream &os, const MatrixSymmetric3D &A)
 
std::istream & operator>> (std::istream &is, MatrixSymmetric3D &A)
 
MatrixSymmetric3D square (const MatrixSymmetric3D &A)
 
MatrixSymmetric3D sqrt (const MatrixSymmetric3D &A)
 

Detailed Description

Implementation of a 3D symmetric matrix.

Definition at line 35 of file MatrixSymmetric.h.

Constructor & Destructor Documentation

MatrixSymmetric3D::MatrixSymmetric3D ( void  )
inline

Definition at line 43 of file MatrixSymmetric.h.

Referenced by operator*(), operator+(), operator-(), and operator/().

43 {}
MatrixSymmetric3D::MatrixSymmetric3D ( const Mdouble  xx,
const Mdouble  xy,
const Mdouble  xz,
const Mdouble  yy,
const Mdouble  yz,
const Mdouble  zz 
)
inline

Definition at line 45 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

46  {
47  XX = xx; XY = xy; XZ = xz;
48  YY = yy; YZ = yz;
49  ZZ = zz;
50  }

Member Function Documentation

MatrixSymmetric3D::operator Matrix3D ( )
inline

Definition at line 41 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

41 { return Matrix3D(XX, XY, XZ, XY, YY, YZ, XZ, YZ, ZZ); };
Implementation of a 3D matrix.
Definition: Matrix.h:35
MatrixSymmetric3D MatrixSymmetric3D::operator* ( const Mdouble  A) const
inline

Definition at line 93 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

94  {
95  return MatrixSymmetric3D(XX * A, XY * A, XZ * A,
96  YY * A, YZ * A, ZZ * A);
97  }
MatrixSymmetric3D MatrixSymmetric3D::operator+ ( const MatrixSymmetric3D A) const
inline

Definition at line 62 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

63  {
64  return MatrixSymmetric3D(XX + A.XX, XY + A.XY, XZ + A.XZ,
65  YY + A.YY, YZ + A.YZ, ZZ + A.ZZ);
66  }
MatrixSymmetric3D MatrixSymmetric3D::operator+ ( const Mdouble  A) const
inline

Definition at line 74 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

75  {
76  return MatrixSymmetric3D(XX + A, XY + A, XZ + A,
77  YY + A, YZ + A, ZZ + A);
78  }
MatrixSymmetric3D& MatrixSymmetric3D::operator+= ( const MatrixSymmetric3D A)
inline

Definition at line 117 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

118  {
119  XX += A.XX;
120  XY += A.XY;
121  XZ += A.XZ;
122  YY += A.YY;
123  YZ += A.YZ;
124  ZZ += A.ZZ;
125  return *this;
126  }
MatrixSymmetric3D MatrixSymmetric3D::operator- ( const MatrixSymmetric3D A) const
inline

Definition at line 68 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

69  {
70  return MatrixSymmetric3D(XX - A.XX, XY - A.XY, XZ - A.XZ,
71  YY - A.YY, YZ - A.YZ, ZZ - A.ZZ);
72  }
MatrixSymmetric3D MatrixSymmetric3D::operator- ( const Mdouble  A) const
inline

Definition at line 80 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

81  {
82  return MatrixSymmetric3D(XX - A, XY - A, XZ - A,
83  YY - A, YZ - A, ZZ - A);
84  }
MatrixSymmetric3D& MatrixSymmetric3D::operator-= ( const MatrixSymmetric3D A)
inline

Definition at line 128 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

129  {
130  XX -= A.XX;
131  XY -= A.XY;
132  XZ -= A.XZ;
133  YY -= A.YY;
134  YZ -= A.YZ;
135  ZZ -= A.ZZ;
136  return *this;
137  }
MatrixSymmetric3D MatrixSymmetric3D::operator/ ( const Mdouble  A) const
inline

Definition at line 99 of file MatrixSymmetric.h.

References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.

100  {
101  return MatrixSymmetric3D(XX / A, XY / A, XZ / A,
102  YY / A, YZ / A, ZZ / A);
103  }
MatrixSymmetric3D& MatrixSymmetric3D::operator/= ( const Mdouble  a)
inline

Definition at line 139 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

140  {
141  XX /= a;
142  XY /= a;
143  XZ /= a;
144  YY /= a;
145  YZ /= a;
146  ZZ /= a;
147  return *this;
148  }
void MatrixSymmetric3D::set_zero ( )
inline

Definition at line 52 of file MatrixSymmetric.h.

References XX, XY, XZ, YY, YZ, and ZZ.

53  {
54  XX = XY = XZ = YY = YZ = ZZ = 0.0;
55  }
Mdouble MatrixSymmetric3D::trace ( ) const
inline

Definition at line 57 of file MatrixSymmetric.h.

References XX, YY, and ZZ.

58  {
59  return (XX+YY+ZZ)/3;
60  }

Friends And Related Function Documentation

Vec3D operator* ( const MatrixSymmetric3D  A,
const Vec3D  B 
)
friend

Definition at line 86 of file MatrixSymmetric.h.

87  {
88  return Vec3D(A.XX*B.X+A.XY*B.Y+A.XZ*B.Z,
89  A.XY*B.X+A.YY*B.Y+A.YZ*B.Z,
90  A.XZ*B.X+A.YZ*B.Y+A.ZZ*B.Z);
91  }
Mdouble X
Definition: Vector.h:44
Mdouble Y
Definition: Vector.h:44
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
Mdouble Z
Definition: Vector.h:44
std::ostream& operator<< ( std::ostream &  os,
const MatrixSymmetric3D A 
)
friend

Definition at line 105 of file MatrixSymmetric.h.

106  {
107  os << A.XX << ' ' << A.XY << ' ' << A.XZ << " " << A.YY << ' ' << A.YZ << " " << A.ZZ;
108  return os;
109  }
std::istream& operator>> ( std::istream &  is,
MatrixSymmetric3D A 
)
friend

Definition at line 111 of file MatrixSymmetric.h.

112  {
113  is >> A.XX >> A.XY >> A.XZ >> A.YY >> A.YZ >> A.ZZ;
114  return is;
115  }
MatrixSymmetric3D sqrt ( const MatrixSymmetric3D A)
friend

Definition at line 157 of file MatrixSymmetric.h.

158  {
159  return MatrixSymmetric3D(sqrt(A.XX), sqrt(A.XY), sqrt(A.XZ), sqrt(A.YY), sqrt(A.YZ), sqrt(A.ZZ));
160  }
friend MatrixSymmetric3D sqrt(const MatrixSymmetric3D &A)
MatrixSymmetric3D square ( const MatrixSymmetric3D A)
friend

Definition at line 151 of file MatrixSymmetric.h.

152  {
153  return MatrixSymmetric3D(sqr(A.XX), sqr(A.XY), sqr(A.XZ), sqr(A.YY), sqr(A.YZ), sqr(A.ZZ));
154  }
#define sqr(a)
Definition: ExtendedMath.h:36

Member Data Documentation


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