18 #ifndef __itkArray2D_h
19 #define __itkArray2D_h
22 #include "vnl/vnl_matrix.h"
43 template<
typename TValueType >
56 Array2D(
unsigned int rows,
unsigned int cols);
64 void Fill(TValueType
const & v) { this->fill(v); }
67 void SetSize(
unsigned int m,
unsigned int n);
74 template<
typename TValueType >
75 std::ostream & operator<<(std::ostream & os, const Array2D< TValueType > & arr)
77 const unsigned int numberOfColumns = arr.cols();
78 const unsigned int numberOfRows = arr.rows();
79 const signed int lastColumn = (
signed int)numberOfColumns - 1;
81 for (
unsigned int r = 0; r < numberOfRows; ++r )
84 for (
signed int c = 0; c < lastColumn; ++c )
86 os << arr(r, c) <<
", ";
88 if ( numberOfColumns >= 1 )
90 os << arr(r, lastColumn);
92 os <<
"]" << std::endl;
99 #ifndef ITK_MANUAL_INSTANTIATION
100 #include "itkArray2D.hxx"