24 #include <vxl_version.h>
25 #include "vnl/vnl_matrix_fixed.hxx"
26 #include "vnl/vnl_transpose.h"
27 #include "vnl/algo/vnl_matrix_inverse.h"
28 #include "vnl/vnl_matrix.h"
29 #include "vnl/algo/vnl_determinant.h"
48 template<
typename T,
unsigned int NRows = 3,
unsigned int NColumns = 3 >
60 static constexpr
unsigned int RowDimensions = NRows;
61 static constexpr
unsigned int ColumnDimensions = NColumns;
81 vnl_vector_fixed<T,NRows>
operator *(
const vnl_vector_fixed< T, NColumns > & vector)
const;
86 template<
unsigned int OuterDim>
94 Self
operator+(
const Self & matrix)
const;
96 const Self & operator+=(
const Self & matrix);
99 Self
operator-(
const Self & matrix)
const;
101 const Self & operator-=(
const Self & matrix);
104 vnl_matrix< T >
operator *(
const vnl_matrix< T > & matrix)
const;
107 void operator*=(
const CompatibleSquareMatrixType & matrix);
110 void operator*=(
const vnl_matrix< T > & matrix);
113 vnl_vector< T >
operator *(
const vnl_vector< T > & matrix)
const;
117 { m_Matrix *= value; }
146 return m_Matrix(row, col);
150 inline const T &
operator()(
unsigned int row,
unsigned int col)
const
152 return m_Matrix(row, col);
182 m_Matrix.set_identity();
186 inline void Fill(
const T & value)
188 m_Matrix.fill(value);
199 inline Matrix(
const vnl_matrix< T > & matrix)
201 this->operator=(matrix);
209 for (
unsigned int r = 0; r < NRows; r++ )
211 for (
unsigned int c = 0; c < NColumns; c++ )
230 this->m_Matrix = matrix;
237 this->operator=(matrix);
248 inline vnl_matrix_fixed< T, NColumns, NRows >
GetInverse()
const
252 itkGenericExceptionMacro(<<
"Singular matrix. Determinant is 0.");
254 vnl_matrix< T > temp = vnl_matrix_inverse< T >(m_Matrix);
262 return m_Matrix.transpose();
281 template<
typename T,
unsigned int NRows,
unsigned int NColumns >
282 std::ostream & operator<<(std::ostream & os, const Matrix< T, NRows, NColumns > & v)
284 os << v.GetVnlMatrix();
289 template<
typename T,
unsigned int NRows,
unsigned int NColumns >
297 #ifndef ITK_MANUAL_INSTANTIATION
298 #include "itkMatrix.hxx"
const Self & operator=(const vnl_matrix< T > &matrix)
const Self & operator=(const InternalMatrixType &matrix)
A templated class holding a M x N size Matrix.
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
void operator*=(const T &value)
Matrix(const Self &matrix)
bool operator!=(const Self &matrix) const
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
Define numeric traits for std::vector.
T & operator()(unsigned int row, unsigned int col)
vnl_matrix_fixed< T, NColumns, NRows > GetTranspose() const
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
InternalMatrixType m_Matrix
Self operator*(const T &value) const
Matrix(const InternalMatrixType &matrix)
const T & operator()(unsigned int row, unsigned int col) const
const InternalMatrixType & GetVnlMatrix() const
const Self & operator=(const Self &matrix)
void swap(Array< T > &a, Array< T > &b)
Matrix< T, NRows, OuterDim > operator*(const vnl_matrix_fixed< T, NRows, OuterDim > &matrix) const
T * operator[](unsigned int i)
A templated class holding a n-Dimensional vector.
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
bool operator==(const Self &matrix) const
Self operator/(const T &value) const
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
InternalMatrixType & GetVnlMatrix()
void Fill(const T &value)
Matrix(const vnl_matrix< T > &matrix)
vnl_matrix_fixed< T, NColumns, NRows > GetInverse() const
A templated class holding a geometric point in n-Dimensional space.
A templated class holding a n-Dimensional covariant vector.
vnl_matrix_fixed< double, NRows, NColumns > InternalMatrixType
const T * operator[](unsigned int i) const
void operator/=(const T &value)