CVB++ 14.0
Matrix3DH Class Referencefinal

Double precision row-major 4x4 matrix. More...

#include <cvb/matrix_3d_h.hpp>

Public Member Functions

 Matrix3DH () noexcept=default
 Default constructor for empty matrix. More...
 
template<std::size_t N>
 Matrix3DH (const double(&list)[N]) noexcept
 Construct a 3x3 matrix with an initializer list. More...
 
 Matrix3DH (const Matrix3D &matrix) noexcept
 Create a homogeneous matrix from a matrix. More...
 
const double * operator[] (int row) const noexcept
 Index based element access. More...
 
double * operator[] (int row) noexcept
 Index based element access. More...
 
const double & At (int row, int column) const noexcept
 Index based element access. More...
 
double & At (int row, int column) noexcept
 Index based element access. More...
 
bool operator== (const Matrix3DH &matrix) const noexcept
 Compares to an other matrix. More...
 
bool operator!= (const Matrix3DH &matrix) const noexcept
 Compares to an other matrix. More...
 
Matrix3DHoperator+= (const Matrix3DH &matrix) noexcept
 Adds and assigns to this matrix. More...
 
Matrix3DHoperator-= (const Matrix3DH &matrix) noexcept
 Subtracts and assigns to this matrix. More...
 
Matrix3DHoperator*= (const double &value) noexcept
 Multiplies and assigns to this matrix. More...
 
Matrix3DHoperator/= (const double &value) noexcept
 Divides each element of this matrix by the given value. More...
 

Static Public Member Functions

static Matrix3DH Identity () noexcept
 The identity element. More...
 

Related Functions

(Note that these are not member functions.)

Matrix3DH operator+ (const Matrix3DH &lhs, const Matrix3DH &rhs)
 Add two matrices. More...
 
Matrix3DH operator- (const Matrix3DH &lhs, const Matrix3DH &rhs)
 Subtract two matrices. More...
 
Point3DH< double > operator* (const Matrix3DH &lhs, const Point3DH< double > &rhs)
 Multiply matrix with 3D point (homogeneous). More...
 
Matrix3DH operator* (const Matrix3DH &lhs, const double &rhs)
 Multiply matrix with scalar. More...
 
Matrix3DH operator* (const double &lhs, const Matrix3DH &rhs)
 Multiply scalar with matrix . More...
 
Matrix3DH operator/ (const Matrix3DH &lhs, const double &rhs)
 Divide matrix by scalar. More...
 

Detailed Description

Double precision row-major 4x4 matrix.

This matrix is used for general homography transformation including perspective(pinhole camera model).

Constructor & Destructor Documentation

◆ Matrix3DH() [1/3]

Matrix3DH ( )
defaultnoexcept

Default constructor for empty matrix.

Exceptions
Doesnot throw any exception.

◆ Matrix3DH() [2/3]

Matrix3DH ( const double(&)  list[N])
inlinenoexcept

Construct a 3x3 matrix with an initializer list.

Parameters
[in]listContaining exactly 16 elements.
Exceptions
Doesnot throw any exception.

◆ Matrix3DH() [3/3]

Matrix3DH ( const Matrix3D matrix)
inlinenoexcept

Create a homogeneous matrix from a matrix.

Parameters
[in]matrix3x3 matrix.
Exceptions
Doesnot throw any exception.

Member Function Documentation

◆ At() [1/2]

const double & At ( int  row,
int  column 
) const
inlinenoexcept

Index based element access.

Parameters
[in]rowThe row to access.
[in]columnThe column to access.
Returns
The matrix element.
Exceptions
Doesnot throw any exception.

◆ At() [2/2]

double & At ( int  row,
int  column 
)
inlinenoexcept

Index based element access.

Parameters
[in]rowThe row to access.
[in]columnThe column to access.
Returns
The matrix element.
Exceptions
Doesnot throw any exception.

◆ Identity()

static Matrix3DH Identity ( )
inlinestaticnoexcept

The identity element.

Returns
An identity matrix.
Exceptions
Doesnot throw any exception.

◆ operator!=()

bool operator!= ( const Matrix3DH matrix) const
inlinenoexcept

Compares to an other matrix.

Parameters
[in]matrixOther matrix.
Returns
True if not equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator*=()

Matrix3DH & operator*= ( const double &  value)
inlinenoexcept

Multiplies and assigns to this matrix.

Parameters
[in]valueFactor.
Returns
This matrix.
Exceptions
Doesnot throw any exception.

◆ operator+=()

Matrix3DH & operator+= ( const Matrix3DH matrix)
inlinenoexcept

Adds and assigns to this matrix.

Parameters
[in]matrixOther matrix.
Returns
This matrix.
Exceptions
Doesnot throw any exception.

◆ operator-=()

Matrix3DH & operator-= ( const Matrix3DH matrix)
inlinenoexcept

Subtracts and assigns to this matrix.

Parameters
[in]matrixOther matrix.
Returns
This matrix.
Exceptions
Doesnot throw any exception.

◆ operator/=()

Matrix3DH & operator/= ( const double &  value)
inlinenoexcept

Divides each element of this matrix by the given value.

Parameters
[in]valueDivisor.
Returns
This matrix.
Exceptions
Doesnot throw any exception.

◆ operator==()

bool operator== ( const Matrix3DH matrix) const
inlinenoexcept

Compares to an other matrix.

Parameters
[in]matrixOther matrix.
Returns
True if equal, otherwise false.
Exceptions
Doesnot throw any exception.

◆ operator[]() [1/2]

const double * operator[] ( int  row) const
inlinenoexcept

Index based element access.

Parameters
[in]row
Returns
A raw pointer to the row
Exceptions
Doesnot throw any exception.

◆ operator[]() [2/2]

double * operator[] ( int  row)
inlinenoexcept

Index based element access.

Parameters
[in]row
Returns
A raw pointer to the row
Exceptions
Doesnot throw any exception.

Friends And Related Function Documentation

◆ operator*() [1/3]

Matrix3DH operator* ( const double &  lhs,
const Matrix3DH rhs 
)
related

Multiply scalar with matrix .

Parameters
[in]lhsRight hand side value.
[in]rhsLeft hand side matrix.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator*() [2/3]

Matrix3DH operator* ( const Matrix3DH lhs,
const double &  rhs 
)
related

Multiply matrix with scalar.

Parameters
[in]lhsRight hand side matrix.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator*() [3/3]

Point3DH< double > operator* ( const Matrix3DH lhs,
const Point3DH< double > &  rhs 
)
related

Multiply matrix with 3D point (homogeneous).

Parameters
[in]lhsRight hand side matrix.
[in]rhsLeft hand side point.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator+()

Matrix3DH operator+ ( const Matrix3DH lhs,
const Matrix3DH rhs 
)
related

Add two matrices.

Parameters
[in]lhsRight hand side matrix.
[in]rhsLeft hand side matrix.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator-()

Matrix3DH operator- ( const Matrix3DH lhs,
const Matrix3DH rhs 
)
related

Subtract two matrices.

Parameters
[in]lhsRight hand side matrix.
[in]rhsLeft hand side matrix.
Returns
The computation result.
Exceptions
Doesnot throw any exception.

◆ operator/()

Matrix3DH operator/ ( const Matrix3DH lhs,
const double &  rhs 
)
related

Divide matrix by scalar.

Parameters
[in]lhsRight hand side matrix.
[in]rhsLeft hand side value.
Returns
The computation result.
Exceptions
Doesnot throw any exception.