ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
itk::Matrix< T, NRows, NColumns > Class Template Reference

#include <itkMatrix.h>

+ Inheritance diagram for itk::Matrix< T, NRows, NColumns >:

Detailed Description

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
class itk::Matrix< T, NRows, NColumns >

A templated class holding a M x N size Matrix.

This class contains a vnl_matrix_fixed in order to make all the vnl mathematical methods available.

Wiki Examples:
Examples:
Examples/DataRepresentation/Image/Image4.cxx, Examples/DataRepresentation/Mesh/MeshTraits.cxx, SphinxExamples/src/Core/Transform/ApplyAffineTransformFromHomogeneousMatrixAndResample/Code.cxx, WikiExamples/Math/Matrix.cxx, and WikiExamples/Math/MatrixInverse.cxx.

Definition at line 49 of file itkMatrix.h.

Public Types

using CompatibleSquareMatrixType = Matrix< T, NColumns, NColumns >
 
using ComponentType = T
 
using InternalMatrixType = vnl_matrix_fixed< T, NRows, NColumns >
 
using Self = Matrix
 
using ValueType = T
 

Public Member Functions

void Fill (const T &value)
 
vnl_matrix_fixed< T, NColumns,
NRows > 
GetTranspose () const
 
InternalMatrixTypeGetVnlMatrix ()
 
const InternalMatrixTypeGetVnlMatrix () const
 
 Matrix (const vnl_matrix< T > &matrix)
 
 Matrix (const InternalMatrixType &matrix)
 
 Matrix ()
 
 Matrix (const Self &matrix)
 
bool operator!= (const Self &matrix) const
 
T & operator() (unsigned int row, unsigned int col)
 
const T & operator() (unsigned int row, unsigned int col) const
 
Vector< T, NRows > operator* (const Vector< T, NColumns > &vector) const
 
Point< T, NRows > operator* (const Point< T, NColumns > &vector) const
 
CovariantVector< T, NRows > operator* (const CovariantVector< T, NColumns > &vector) const
 
vnl_vector_fixed< T, NRows > operator* (const vnl_vector_fixed< T, NColumns > &vector) const
 
Self operator* (const CompatibleSquareMatrixType &matrix) const
 
template<unsigned int OuterDim>
Matrix< T, NRows, OuterDim > operator* (const vnl_matrix_fixed< T, NRows, OuterDim > &matrix) const
 
vnl_matrix< T > operator* (const vnl_matrix< T > &matrix) const
 
vnl_vector< T > operator* (const vnl_vector< T > &matrix) const
 
Self operator* (const T &value) const
 
void operator*= (const CompatibleSquareMatrixType &matrix)
 
void operator*= (const vnl_matrix< T > &matrix)
 
void operator*= (const T &value)
 
Self operator+ (const Self &matrix) const
 
const Selfoperator+= (const Self &matrix)
 
Self operator- (const Self &matrix) const
 
const Selfoperator-= (const Self &matrix)
 
Self operator/ (const T &value) const
 
void operator/= (const T &value)
 
const Selfoperator= (const vnl_matrix< T > &matrix)
 
const Selfoperator= (const InternalMatrixType &matrix)
 
const Selfoperator= (const Self &matrix)
 
bool operator== (const Self &matrix) const
 
T * operator[] (unsigned int i)
 
const T * operator[] (unsigned int i) const
 
void SetIdentity ()
 
void swap (Self &other)
 
vnl_matrix_fixed< T, NColumns,
NRows > 
GetInverse () const
 

Static Public Attributes

static constexpr unsigned int ColumnDimensions = NColumns
 
static constexpr unsigned int RowDimensions = NRows
 

Private Attributes

InternalMatrixType m_Matrix
 

Member Typedef Documentation

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
using itk::Matrix< T, NRows, NColumns >::CompatibleSquareMatrixType = Matrix<T, NColumns, NColumns>

Compatible square matrix. This is currently used by operator* to help with wrapping.

Todo:
In the future, the method should be templated to allow multiplication by NColumns by XRows.

Definition at line 69 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
using itk::Matrix< T, NRows, NColumns >::ComponentType = T

Definition at line 57 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
using itk::Matrix< T, NRows, NColumns >::InternalMatrixType = vnl_matrix_fixed< T, NRows, NColumns >

Internal matrix type

Definition at line 64 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
using itk::Matrix< T, NRows, NColumns >::Self = Matrix

Standard class type aliases.

Definition at line 53 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
using itk::Matrix< T, NRows, NColumns >::ValueType = T

Component value type

Definition at line 56 of file itkMatrix.h.

Constructor & Destructor Documentation

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
itk::Matrix< T, NRows, NColumns >::Matrix ( const vnl_matrix< T > &  matrix)
inline

For every operator=, there should be an equivalent copy constructor.

Definition at line 199 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
itk::Matrix< T, NRows, NColumns >::Matrix ( const InternalMatrixType matrix)
inlineexplicit

For every operator=, there should be an equivalent copy constructor.

Definition at line 235 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
itk::Matrix< T, NRows, NColumns >::Matrix ( )
inline

Default constructor.

Definition at line 266 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
itk::Matrix< T, NRows, NColumns >::Matrix ( const Self matrix)
inline

Copy constructor.

Definition at line 269 of file itkMatrix.h.

Member Function Documentation

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::Fill ( const T &  value)
inline
template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
vnl_matrix_fixed< T, NColumns, NRows > itk::Matrix< T, NRows, NColumns >::GetInverse ( ) const
inline

Return the inverse matrix.

Definition at line 248 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
vnl_matrix_fixed< T, NColumns, NRows > itk::Matrix< T, NRows, NColumns >::GetTranspose ( ) const
inline

Return the transposed matrix.

Definition at line 260 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
InternalMatrixType& itk::Matrix< T, NRows, NColumns >::GetVnlMatrix ( )
inline
template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const InternalMatrixType& itk::Matrix< T, NRows, NColumns >::GetVnlMatrix ( ) const
inline

Return the matrix.

Definition at line 174 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
bool itk::Matrix< T, NRows, NColumns >::operator!= ( const Self matrix) const
inline

Definition at line 223 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
T& itk::Matrix< T, NRows, NColumns >::operator() ( unsigned int  row,
unsigned int  col 
)
inline

Return an element of the matrix.

Definition at line 144 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const T& itk::Matrix< T, NRows, NColumns >::operator() ( unsigned int  row,
unsigned int  col 
) const
inline

Return an element of the matrix.

Definition at line 150 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Vector< T, NRows > itk::Matrix< T, NRows, NColumns >::operator* ( const Vector< T, NColumns > &  vector) const

Matrix by Vector multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Point< T, NRows > itk::Matrix< T, NRows, NColumns >::operator* ( const Point< T, NColumns > &  vector) const

Matrix by Point multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
CovariantVector< T, NRows > itk::Matrix< T, NRows, NColumns >::operator* ( const CovariantVector< T, NColumns > &  vector) const

Matrix by CovariantVector multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
vnl_vector_fixed<T,NRows> itk::Matrix< T, NRows, NColumns >::operator* ( const vnl_vector_fixed< T, NColumns > &  vector) const

Matrix by vnl_vector_fixed multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Self itk::Matrix< T, NRows, NColumns >::operator* ( const CompatibleSquareMatrixType matrix) const

Matrix by Matrix multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
template<unsigned int OuterDim>
Matrix<T, NRows, OuterDim> itk::Matrix< T, NRows, NColumns >::operator* ( const vnl_matrix_fixed< T, NRows, OuterDim > &  matrix) const
inline

Definition at line 87 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
vnl_matrix< T > itk::Matrix< T, NRows, NColumns >::operator* ( const vnl_matrix< T > &  matrix) const

Matrix by vnl_matrix multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
vnl_vector< T > itk::Matrix< T, NRows, NColumns >::operator* ( const vnl_vector< T > &  matrix) const

Matrix by vnl_vector multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Self itk::Matrix< T, NRows, NColumns >::operator* ( const T &  value) const
inline

Matrix by scalar multiplication.

Definition at line 120 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::operator*= ( const CompatibleSquareMatrixType matrix)

Matrix by Matrix multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::operator*= ( const vnl_matrix< T > &  matrix)

Matrix by vnl_matrix multiplication.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::operator*= ( const T &  value)
inline

Matrix by scalar multiplication.

Definition at line 116 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Self itk::Matrix< T, NRows, NColumns >::operator+ ( const Self matrix) const

Matrix addition.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const Self& itk::Matrix< T, NRows, NColumns >::operator+= ( const Self matrix)
template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Self itk::Matrix< T, NRows, NColumns >::operator- ( const Self matrix) const

Matrix addition.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const Self& itk::Matrix< T, NRows, NColumns >::operator-= ( const Self matrix)
template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
Self itk::Matrix< T, NRows, NColumns >::operator/ ( const T &  value) const
inline

Matrix by scalar division.

Definition at line 135 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::operator/= ( const T &  value)
inline

Matrix by scalar division.

Definition at line 129 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const Self& itk::Matrix< T, NRows, NColumns >::operator= ( const vnl_matrix< T > &  matrix)
inline

Assignment operator.

Definition at line 192 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const Self& itk::Matrix< T, NRows, NColumns >::operator= ( const InternalMatrixType matrix)
inline

Definition at line 228 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const Self& itk::Matrix< T, NRows, NColumns >::operator= ( const Self matrix)
inline

Assignment operator.

Definition at line 241 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
bool itk::Matrix< T, NRows, NColumns >::operator== ( const Self matrix) const
inline

Comparison operators.

Definition at line 205 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
T* itk::Matrix< T, NRows, NColumns >::operator[] ( unsigned int  i)
inline

Return a row of the matrix.

Definition at line 156 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
const T* itk::Matrix< T, NRows, NColumns >::operator[] ( unsigned int  i) const
inline

Return a row of the matrix.

Definition at line 162 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::SetIdentity ( )
inline

Set the matrix to identity.

Definition at line 180 of file itkMatrix.h.

Referenced by itk::IOTestHelper::SetIdentityDirection().

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
void itk::Matrix< T, NRows, NColumns >::swap ( Self other)
inline

Definition at line 271 of file itkMatrix.h.

Referenced by itk::swap().

Member Data Documentation

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
constexpr unsigned int itk::Matrix< T, NRows, NColumns >::ColumnDimensions = NColumns
static

Definition at line 61 of file itkMatrix.h.

template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
InternalMatrixType itk::Matrix< T, NRows, NColumns >::m_Matrix
private
template<typename T, unsigned int NRows = 3, unsigned int NColumns = 3>
constexpr unsigned int itk::Matrix< T, NRows, NColumns >::RowDimensions = NRows
static

Number Of Columns and Rows.

Definition at line 60 of file itkMatrix.h.


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