MercuryDPM
Beta
|
Implementation of a 3D symmetric matrix. More...
#include <MatrixSymmetric.h>
Public Member Functions | |
operator Matrix3D () const | |
Casting operator; casts MatrixSymmetric3D to Matrix3D. More... | |
MatrixSymmetric3D () | |
Default constructor. More... | |
MatrixSymmetric3D (const Mdouble xx, const Mdouble xy, const Mdouble xz, const Mdouble yy, const Mdouble yz, const Mdouble zz) | |
Alternative constructor, with all (6) elements as arguments. More... | |
void | setZero () |
Sets all elements to zero. More... | |
Mdouble | trace () const |
Returns the MEAN of the diagonal elements (i.e. the trace divided by three). More... | |
MatrixSymmetric3D | operator+ (const MatrixSymmetric3D &A) const |
Matrix addition. More... | |
MatrixSymmetric3D | operator- (const MatrixSymmetric3D &A) const |
Matrix substraction. More... | |
MatrixSymmetric3D | operator+ (const Mdouble a) const |
Scalar addition. More... | |
MatrixSymmetric3D | operator- (const Mdouble a) const |
Scalar substraction. More... | |
MatrixSymmetric3D | operator* (const Mdouble a) const |
Scalar multiplication. More... | |
MatrixSymmetric3D | operator/ (const Mdouble a) const |
Scalar division. More... | |
MatrixSymmetric3D & | operator+= (const MatrixSymmetric3D &A) |
Matrix addition. More... | |
MatrixSymmetric3D & | operator-= (const MatrixSymmetric3D &A) |
Matrix substraction. More... | |
MatrixSymmetric3D & | operator/= (const Mdouble a) |
Scalar division. More... | |
Static Public Member Functions | |
static MatrixSymmetric3D | square (const MatrixSymmetric3D &A) |
Calculates the pointwise square. More... | |
static MatrixSymmetric3D | sqrt (const MatrixSymmetric3D &A) |
Calculates the pointwise square root. More... | |
static MatrixSymmetric3D | selfDyadic (const Vec3D &a) |
Calculates the dyadic product of a Vec3D with itself: \(a \otimes a\). More... | |
static MatrixSymmetric3D | symmetrisedDyadic (const Vec3D &a, const Vec3D &b) |
Calculates the symmetrised dyadic product of two Vec3D: \( \frac{1}{2}(a \otimes b + b \otimes a) \). More... | |
Public Attributes | |
Mdouble | XX |
The six distinctive matrix elements. More... | |
Mdouble | XY |
Mdouble | XZ |
Mdouble | YY |
Mdouble | YZ |
Mdouble | ZZ |
Friends | |
Vec3D | operator* (const MatrixSymmetric3D &A, const Vec3D &b) |
Vector multiplication. More... | |
std::ostream & | operator<< (std::ostream &os, const MatrixSymmetric3D &A) |
Add elements to an ostream. More... | |
std::istream & | operator>> (std::istream &is, MatrixSymmetric3D &A) |
Add elements to an istream. More... | |
Implementation of a 3D symmetric matrix.
Definition at line 36 of file MatrixSymmetric.h.
MatrixSymmetric3D::MatrixSymmetric3D | ( | ) |
Default constructor.
Default constructor
Definition at line 42 of file MatrixSymmetric.cc.
Referenced by operator*(), operator+(), operator-(), operator/(), selfDyadic(), sqrt(), square(), and symmetrisedDyadic().
MatrixSymmetric3D::MatrixSymmetric3D | ( | const Mdouble | xx, |
const Mdouble | xy, | ||
const Mdouble | xz, | ||
const Mdouble | yy, | ||
const Mdouble | yz, | ||
const Mdouble | zz | ||
) |
Alternative constructor, with all (6) elements as arguments.
Alternative constructor, lets you define all (6) elements
[in] | xx | initializer for an element of the matrix |
[in] | xy | initializer for an element of the matrix |
[in] | xz | initializer for an element of the matrix |
[in] | yy | initializer for an element of the matrix |
[in] | yz | initializer for an element of the matrix |
[in] | zz | initializer for an element of the matrix |
Definition at line 55 of file MatrixSymmetric.cc.
References XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D::operator Matrix3D | ( | ) | const |
Casting operator; casts MatrixSymmetric3D to Matrix3D.
This operator casts a MatrixSymmetric3D object to a Matrix3D object when needed.
Definition at line 34 of file MatrixSymmetric.cc.
MatrixSymmetric3D MatrixSymmetric3D::operator* | ( | const Mdouble | a | ) | const |
Scalar multiplication.
Scalar multiplication
[in] | a | the scalar |
Definition at line 142 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D MatrixSymmetric3D::operator+ | ( | const MatrixSymmetric3D & | A | ) | const |
Matrix addition.
Addition of symmetric 3D matrices
[in] | A | symmetric matrix to be added |
Definition at line 88 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D MatrixSymmetric3D::operator+ | ( | const Mdouble | a | ) | const |
Scalar addition.
Addition of a scalar
[in] | a | scalar to be added |
Definition at line 108 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D & MatrixSymmetric3D::operator+= | ( | const MatrixSymmetric3D & | A | ) |
Matrix addition.
Matrix addition
[in] | A | the matrix to be added to this one |
Definition at line 187 of file MatrixSymmetric.cc.
References XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D MatrixSymmetric3D::operator- | ( | const MatrixSymmetric3D & | A | ) | const |
Matrix substraction.
Substraction of symmetric 3D matrices
[in] | A | symmetric matrix to be substracted |
Definition at line 98 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D MatrixSymmetric3D::operator- | ( | const Mdouble | a | ) | const |
Scalar substraction.
Substraction of a scalar
[in] | a | scalar to be substracted |
Definition at line 118 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D & MatrixSymmetric3D::operator-= | ( | const MatrixSymmetric3D & | A | ) |
Matrix substraction.
Matrix substraction
[in] | A | the matrix to be substracted |
Definition at line 203 of file MatrixSymmetric.cc.
References XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D MatrixSymmetric3D::operator/ | ( | const Mdouble | a | ) | const |
Scalar division.
Scalar division
[in] | a | the scalar to be divided by |
Definition at line 153 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
MatrixSymmetric3D & MatrixSymmetric3D::operator/= | ( | const Mdouble | a | ) |
Scalar division.
Scalar division
[in] | a | the scalar to be divided by |
Definition at line 219 of file MatrixSymmetric.cc.
References XX, XY, XZ, YY, YZ, and ZZ.
|
static |
Calculates the dyadic product of a Vec3D with itself: \(a \otimes a\).
Calculates the dyadic product of a 3D vector with itself, which (obviously) results in a symmetric 3D matrix. NB: this is a STATIC function!
[in] | a | the 3D vector |
Definition at line 259 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
void MatrixSymmetric3D::setZero | ( | ) |
Sets all elements to zero.
Sets all elements of the symmetric matrix to 0.
Definition at line 68 of file MatrixSymmetric.cc.
References XX, XY, XZ, YY, YZ, and ZZ.
|
static |
Calculates the pointwise square root.
Pointwise square roots the matrix, i.e. takes the sq. root of each element. NB: this is a STATIC function!
[in] | A | The matrix to be pointwise square rooted |
Definition at line 247 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), XX, XY, XZ, YY, YZ, and ZZ.
|
static |
Calculates the pointwise square.
Pointwise squares the matrix, i.e. takes the square of each element. NB: is a STATIC function!
[in] | A | The matrix to be pointwise squared |
Definition at line 236 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), mathsFunc::square(), XX, XY, XZ, YY, YZ, and ZZ.
|
static |
Calculates the symmetrised dyadic product of two Vec3D: \( \frac{1}{2}(a \otimes b + b \otimes a) \).
Calculates the dyadic product of two 3D vectors, and 'symmetrises' the resulting matrix by taking the average of each pair of opposing non-diagonal elements. NB: this is a STATIC function!
[in] | a | the first 3D vector |
[in] | b | the second 3D vector |
Definition at line 273 of file MatrixSymmetric.cc.
References MatrixSymmetric3D(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Mdouble MatrixSymmetric3D::trace | ( | ) | const |
Returns the MEAN of the diagonal elements (i.e. the trace divided by three).
Returns the MEAN of the diagonal matrix elements, which is technically the trace divided by the number of diagonal elements.
Definition at line 78 of file MatrixSymmetric.cc.
|
friend |
Vector multiplication.
Multiplication of a symmetric 3D matrix with a vector (global operator, friend of this class)
[in] | A | the matrix |
[in] | b | the vector |
Definition at line 130 of file MatrixSymmetric.cc.
|
friend |
Add elements to an ostream.
Adds all elements of a symmetric 3D matrix to an ostream
[in,out] | os | output stream |
[in] | A | the matrix |
Definition at line 164 of file MatrixSymmetric.cc.
|
friend |
Add elements to an istream.
Reads the elements of a symmetric 3D matrix from an istream
[in,out] | is | input stream, |
[out] | A | the matrix |
Definition at line 176 of file MatrixSymmetric.cc.
Mdouble MatrixSymmetric3D::XX |
The six distinctive matrix elements.
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), square(), and trace().
Mdouble MatrixSymmetric3D::XY |
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), and square().
Mdouble MatrixSymmetric3D::XZ |
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), and square().
Mdouble MatrixSymmetric3D::YY |
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), square(), and trace().
Mdouble MatrixSymmetric3D::YZ |
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), and square().
Mdouble MatrixSymmetric3D::ZZ |
Definition at line 42 of file MatrixSymmetric.h.
Referenced by MatrixSymmetric3D(), operator*(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator>>(), setZero(), sqrt(), square(), and trace().