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 TValue >
50 class Array :
public vnl_vector< TValue >
81 #if defined ( ITK_FUTURE_LEGACY_REMOVE )
88 #else // defined ( ITK_FUTURE_LEGACY_REMOVE )
96 bool LetArrayManageMemory =
false);
100 template<
typename TArrayValue >
107 this->operator[](i) =
static_cast< TValue
>( r[i] );
132 {
return this->operator[](i); }
136 { this->operator[](i) = value; }
149 void SetData(TValue *data,
bool LetArrayManageMemory =
false);
161 bool LetArrayManageMemory =
false);
164 #ifdef __INTEL_COMPILER
165 #pragma warning disable 444 //destructor for base class "itk::Array<>" is not virtual
171 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
190 template<
typename TValue >
191 std::ostream & operator<<(std::ostream & os, const Array< TValue > & arr)
194 const unsigned int length = arr.size();
197 const unsigned int last = length - 1;
198 for (
unsigned int i = 0; i < last; ++i )
200 os << arr[i] <<
", ";
221 #ifndef ITK_MANUAL_INSTANTIATION
222 #include "itkArray.hxx"
Array class with size defined at construction time.
const Self & operator=(const Self &rhs)
void SetData(TValue *data, bool LetArrayManageMemory=false)
vnl_vector< TValue > VnlVectorType
void SetElement(SizeValueType i, const TValue &value)
unsigned long SizeValueType
bool m_LetArrayManageMemory
void Fill(TValue const &v)
void swap(Array< T > &a, Array< T > &b)
unsigned int GetNumberOfElements(void) const
void SetSize(SizeValueType sz)
SizeValueType GetSize(void) const
ITKCommon_EXPORT std::ostream & operator<< < double >(std::ostream &os, const Array< double > &arr)
ITKCommon_EXPORT std::ostream & operator<< < float >(std::ostream &os, const Array< float > &arr)
SizeValueType Size(void) const
vnl_vector< TValue >::size_type SizeValueType
const TValue & GetElement(SizeValueType i) const
Array(const Array< TArrayValue > &r)