atomicrex  0.1
An advanced atomistic model building tool
Classes | Public Types | Public Member Functions | Related Functions | List of all members
atomicrex::Matrix_3< T > Class Template Reference

A 3x3 matrix. More...

#include <Matrix3.h>

Inheritance diagram for atomicrex::Matrix_3< T >:

Classes

struct  Identity
 An empty type that denotes the 3x3 identity matrix. More...
 
struct  Zero
 An empty type that denotes a 3x3 matrix with all elements equal to zero. More...
 

Public Types

typedef T element_type
 The type of a single element of the matrix.
 
typedef Vector_3< T > column_type
 The type of a single column of the matrix.
 

Public Member Functions

 Matrix_3 ()
 Empty default constructor that does not initialize the matrix elements (for performance reasons). The matrix elements will have an undefined value and need to be initialized later.
 
constexpr Matrix_3 (T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33)
 Constructor that initializes all 9 elements of the matrix to the given values. More...
 

Related Functions

(Note that these are not member functions.)

using Matrix3 = Matrix_3< FloatType >
 Instantiation of the Matrix_3 class template with the default floating-point type.
 
template<typename T >
constexpr Vector_3< T > operator* (const Matrix_3< T > &m, const Vector_3< T > &v)
 Computes the product of a matrix and a vector. More...
 
template<typename T >
constexpr Point_3< T > operator* (const Matrix_3< T > &m, const Point_3< T > &p)
 Computes the product of a matrix and a point. This is the same as a matrix-vector product. More...
 
template<typename T >
constexpr Matrix_3< T > operator* (const Matrix_3< T > &a, const Matrix_3< T > &b)
 Computes the product of two matrices. More...
 
template<typename T >
constexpr Matrix_3< T > operator* (const Matrix_3< T > &a, T s)
 Multiplies a matrix with a scalar value. More...
 
template<typename T >
constexpr Matrix_3< T > operator* (T s, const Matrix_3< T > &a)
 Multiplies a matrix with a scalar value. More...
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Matrix_3< T > &m)
 Prints a matrix to a text output stream. More...
 

Detailed Description

template<typename T>
class atomicrex::Matrix_3< T >

A 3x3 matrix.

The matrix is stored in column-major order. Matrix_3 is derived from std::array< Vector_3<T>, 3 >. Thus, it is an array of three column vectors.

Constructor & Destructor Documentation

◆ Matrix_3()

template<typename T>
constexpr atomicrex::Matrix_3< T >::Matrix_3 ( m11,
m12,
m13,
m21,
m22,
m23,
m31,
m32,
m33 
)
inline

Constructor that initializes all 9 elements of the matrix to the given values.

Note
Values are given in row-major order, i.e. row by row.

Friends And Related Function Documentation

◆ operator*() [1/5]

template<typename T >
constexpr Vector_3< T > operator* ( const Matrix_3< T > &  m,
const Vector_3< T > &  v 
)
related

Computes the product of a matrix and a vector.

◆ operator*() [2/5]

template<typename T >
constexpr Point_3< T > operator* ( const Matrix_3< T > &  m,
const Point_3< T > &  p 
)
related

Computes the product of a matrix and a point. This is the same as a matrix-vector product.

◆ operator*() [3/5]

template<typename T >
constexpr Matrix_3< T > operator* ( const Matrix_3< T > &  a,
const Matrix_3< T > &  b 
)
related

Computes the product of two matrices.

◆ operator*() [4/5]

template<typename T >
constexpr Matrix_3< T > operator* ( const Matrix_3< T > &  a,
s 
)
related

Multiplies a matrix with a scalar value.

◆ operator*() [5/5]

template<typename T >
constexpr Matrix_3< T > operator* ( s,
const Matrix_3< T > &  a 
)
related

Multiplies a matrix with a scalar value.

◆ operator<<()

template<typename T >
std::ostream & operator<< ( std::ostream &  os,
const Matrix_3< T > &  m 
)
related

Prints a matrix to a text output stream.


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