Public Member Functions | Public Attributes

Mat9d Struct Reference

#include <mat9d.h>

List of all members.

Public Member Functions

 Mat9d ()
 Mat9d (const double m_1, const double m_2, const double m_3, const double m_4, const double m_5, const double m_6, const double m_7, const double m_8, const double m_9)
Mat9d operator+ (const Mat9d &p) const
Mat9d operator- (const Mat9d &p) const
Mat9d operator* (const double a) const
double trace () const
Mat9doperator+= (const Mat9d &p)
Mat9doperator-= (const Mat9d &p)
Mat9doperator*= (const double a)
double & operator[] (const unsigned int index)
const double & operator[] (const unsigned int index) const

Public Attributes

double m1
double m2
double m3
double m4
double m5
double m6
double m7
double m8
double m9

Detailed Description

Structure and algebraic operations for the $3\times 3$ matrix Mat9d. The matrix elements of a Mat9d object $M$ are written in "vector" form:

\[ M=\left[\begin{array}{ccc} m_1 & m_2 & m_3 \\ m_4 & m_5 & m_6 \\ m_7 & m_8 & m_9 \end{array}\right]\quad.\]

Note:
Some of these functions are marked as inline.
Author:
Jan Cholewinski, Toby D. Young 2010

Constructor & Destructor Documentation

Mat9d::Mat9d (  ) [inline]

Constructor. Allocates memory for a $3\times3$ matrix Mat9d initialized with all elements equal to zero.

Mat9d::Mat9d ( const double  m_1,
const double  m_2,
const double  m_3,
const double  m_4,
const double  m_5,
const double  m_6,
const double  m_7,
const double  m_8,
const double  m_9 
) [inline]

Constructor. Allocates memory for a $3\times3$ matrix Mat9d initialized with user defined elements $m_i\,\forall m\in\{1,...,9\}$.


Member Function Documentation

Mat9d Mat9d::operator* ( const double  a ) const [inline]

Scalar-matrix subtraction $M\cdot a$. Multiply this matrix by the scalar quantity $a$.

Mat9d& Mat9d::operator*= ( const double  a ) [inline]

Matrix multiplication operator. Multiply this matrix by the constant $a$.

Mat9d Mat9d::operator+ ( const Mat9d p ) const [inline]

Matrix-matrix addition. Add matrix $p$ to this matrix.

Mat9d& Mat9d::operator+= ( const Mat9d p ) [inline]

Inline matrix addition.

Mat9d Mat9d::operator- ( const Mat9d p ) const [inline]

Matrix-matrix subtraction. Subtract matrix $p$ from this matrix.

Mat9d& Mat9d::operator-= ( const Mat9d p ) [inline]

Inline matrix subtraction.

double& Mat9d::operator[] ( const unsigned int  index ) [inline]

Read/write access to the indexth-component of this matrix.

const double& Mat9d::operator[] ( const unsigned int  index ) const [inline]

Read only access to the indexth-component of this matrix.

double Mat9d::trace (  ) const [inline]

Return the trace of this matrix by summing over the diagonal elements of this matrix, ie. ${\rm Tr}M$.


Member Data Documentation

double Mat9d::m1

Actual values of the matrix elements of Mat9d. See cleas documentation for more details.

double Mat9d::m2
double Mat9d::m3
double Mat9d::m4
double Mat9d::m5
double Mat9d::m6
double Mat9d::m7
double Mat9d::m8
double Mat9d::m9

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