18 #ifndef itkVariableSizeMatrix_h
19 #define itkVariableSizeMatrix_h
23 #include "vnl/vnl_matrix_fixed.h"
24 #include "vnl/algo/vnl_matrix_inverse.h"
25 #include "vnl/vnl_transpose.h"
26 #include "vnl/vnl_matrix.h"
43 template<
typename T >
66 const Self & operator+=(
const Self & matrix);
71 const Self & operator-=(
const Self & matrix);
77 vnl_matrix< T >
operator *(
const vnl_matrix< T > & matrix)
const;
80 void operator*=(
const Self & matrix);
83 void operator*=(
const vnl_matrix< T > & matrix);
86 vnl_vector< T >
operator *(
const vnl_vector< T > & matrix)
const;
115 return m_Matrix(row, col);
119 inline const T &
operator()(
unsigned int row,
unsigned int col)
const
121 return m_Matrix(row, col);
151 m_Matrix.set_identity();
155 inline void Fill(
const T & value)
157 m_Matrix.fill(value);
168 inline bool operator==(
const Self & matrix)
const;
185 vnl_matrix< T > temp = vnl_matrix_inverse< T >(m_Matrix);
193 return m_Matrix.transpose();
205 inline unsigned int Rows()
const {
return m_Matrix.rows(); }
208 inline unsigned int Cols()
const {
return m_Matrix.cols(); }
211 inline bool SetSize(
unsigned int r,
unsigned int c) {
return m_Matrix.set_size(r, c); }
217 template<
typename T >
227 template<
typename T >
233 if ( ( matrix.
Rows() != this->Rows() )
234 || ( matrix.
Cols() != this->Cols() ) )
241 for (
unsigned int r = 0; r < this->Rows(); r++ )
243 for (
unsigned int c = 0; c < this->Cols(); c++ )
256 #ifndef ITK_MANUAL_INSTANTIATION
257 #include "itkVariableSizeMatrix.hxx"
Array class with size defined at construction time.
vnl_matrix< T > GetTranspose() const
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
unsigned int Rows() const
ConstNeighborhoodIterator< TImage > operator-(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
T * operator[](unsigned int i)
A templated class holding a M x N size Matrix.
Self operator/(const T &value)
const Self & operator=(const vnl_matrix< T > &matrix)
CovariantVector< T, NVectorDimension > operator*(const T &scalar, const CovariantVector< T, NVectorDimension > &v)
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
unsigned int Cols() const
const T * operator[](unsigned int i) const
vnl_matrix< T > GetInverse() const
const Self & operator=(const Self &matrix)
bool SetSize(unsigned int r, unsigned int c)
const InternalMatrixType & GetVnlMatrix() const
ConstNeighborhoodIterator< TImage > operator+(const ConstNeighborhoodIterator< TImage > &it, const typename ConstNeighborhoodIterator< TImage >::OffsetType &ind)
void operator/=(const T &value)
vnl_matrix< double > InternalMatrixType
const T & operator()(unsigned int row, unsigned int col) const
InternalMatrixType m_Matrix
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
VariableSizeMatrix(const Self &matrix)
Self operator*(const T &value)
void Fill(const T &value)
bool operator!=(const Self &matrix) const
bool operator==(const Self &matrix) const
T & operator()(unsigned int row, unsigned int col)
InternalMatrixType & GetVnlMatrix()
void operator*=(const T &value)