23 #include "vxl_version.h"
24 #if VXL_VERSION_DATE_FULL < 20110428
25 #error "System installed VXL version is too old. Please make sure the version date is later than 2011-04-28."
28 #include "vnl/vnl_vector.h"
49 template<
typename TValueType >
50 class Array :
public vnl_vector< TValueType >
88 bool LetArrayManageMemory =
false);
91 template<
class TArrayValue >
98 this->operator[](i) =
static_cast< TValueType
>( r[i] );
104 void Fill(TValueType
const & v)
123 {
return this->operator[](i); }
127 { this->operator[](i) = value; }
140 void SetData(TValueType *data,
bool LetArrayManageMemory =
false);
152 bool LetArrayManageMemory =
false);
155 #ifdef __INTEL_COMPILER
156 #pragma warning disable 444 //destructor for base class "itk::Array<>" is not virtual
167 template<
typename TValueType >
168 std::ostream & operator<<(std::ostream & os, const Array< TValueType > & arr)
171 const unsigned int length = arr.size();
174 const unsigned int last = length - 1;
175 for (
unsigned int i = 0; i < last; ++i )
177 os << arr[i] <<
", ";
186 template<> ITKCommon_EXPORT std::ostream &
operator<< <double> (std::ostream & os,
const Array< double > & arr);
187 template<> ITKCommon_EXPORT std::ostream &
operator<< <float> (std::ostream & os,
const Array< float > & arr);
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkArray.hxx"