24 #include <vxl_version.h>
25 #if VXL_VERSION_DATE_FULL < 20160229
26 #include "vnl/vnl_matrix_fixed.txx"
28 #include "vnl/vnl_matrix_fixed.hxx"
30 #include "vnl/vnl_transpose.h"
31 #include "vnl/algo/vnl_matrix_inverse.h"
32 #include "vnl/vnl_matrix.h"
33 #include "vnl/algo/vnl_determinant.h"
52 template<
typename T,
unsigned int NRows = 3,
unsigned int NColumns = 3 >
64 itkStaticConstMacro(RowDimensions,
unsigned int, NRows);
65 itkStaticConstMacro(ColumnDimensions,
unsigned int, NColumns);
86 vnl_vector_fixed<T,NRows>
operator *(
const vnl_vector_fixed< T, NColumns > & vector)
const;
91 template<
unsigned int OuterDim>
99 Self
operator+(
const Self & matrix)
const;
101 const Self & operator+=(
const Self & matrix);
104 Self
operator-(
const Self & matrix)
const;
106 const Self & operator-=(
const Self & matrix);
109 vnl_matrix< T >
operator *(
const vnl_matrix< T > & matrix)
const;
112 void operator*=(
const CompatibleSquareMatrixType & matrix);
115 void operator*=(
const vnl_matrix< T > & matrix);
118 vnl_vector< T >
operator *(
const vnl_vector< T > & matrix)
const;
122 { m_Matrix *= value; }
151 return m_Matrix(row, col);
155 inline const T &
operator()(
unsigned int row,
unsigned int col)
const
157 return m_Matrix(row, col);
187 m_Matrix.set_identity();
191 inline void Fill(
const T & value)
193 m_Matrix.fill(value);
204 inline Matrix(
const vnl_matrix< T > & matrix)
206 this->operator=(matrix);
214 for (
unsigned int r = 0; r < NRows; r++ )
216 for (
unsigned int c = 0; c < NColumns; c++ )
235 this->m_Matrix = matrix;
242 this->operator=(matrix);
253 inline vnl_matrix_fixed< T, NColumns, NRows >
GetInverse(
void)
const
255 if ( vnl_determinant(m_Matrix) == 0.0 )
257 itkGenericExceptionMacro(<<
"Singular matrix. Determinant is 0.");
259 vnl_matrix< T > temp = vnl_matrix_inverse< T >(m_Matrix);
267 return m_Matrix.transpose();
280 template<
typename T,
unsigned int NRows,
unsigned int NColumns >
281 std::ostream & operator<<(std::ostream & os, const Matrix< T, NRows, NColumns > & v)
283 os << v.GetVnlMatrix();
288 #ifndef ITK_MANUAL_INSTANTIATION
289 #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.
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)
vnl_matrix_fixed< T, NColumns, NRows > GetInverse(void) const
T & operator()(unsigned int row, unsigned int col)
vnl_matrix_fixed< T, NRows, NColumns > InternalMatrixType
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
const InternalMatrixType & GetVnlMatrix(void) const
InternalMatrixType m_Matrix
Self operator*(const T &value) const
Matrix(const InternalMatrixType &matrix)
Matrix< T, NColumns, NColumns > CompatibleSquareMatrixType
const T & operator()(unsigned int row, unsigned int col) const
const Self & operator=(const Self &matrix)
vnl_matrix_fixed< T, NColumns, NRows > GetTranspose(void) const
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)
void Fill(const T &value)
Matrix(const vnl_matrix< T > &matrix)
Define additional traits for native types such as int or float.
A templated class holding a geometric point in n-Dimensional space.
A templated class holding a n-Dimensional covariant vector.
bool ITKIOXML_EXPORT operator==(itk::FancyString &s, const std::string &)
const T * operator[](unsigned int i) const
void operator/=(const T &value)