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 ITK_TEMPLATE_EXPORT
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 >
103 this->m_LetArrayManageMemory =
true;
107 this->operator[](i) =
static_cast< TValue
>( r[i] );
119 const Self & operator=(
const Self & rhs);
121 const Self & operator=(
const VnlVectorType & rhs);
132 {
return this->operator[](i); }
136 { this->operator[](i) = value; }
152 void SetDataSameSize(TValue *data,
bool LetArrayManageMemory =
false);
163 void SetData(TValue *data,
SizeValueType sz,
bool LetArrayManageMemory =
false);
165 #ifdef __INTEL_COMPILER
166 #pragma warning disable 444 //destructor for base class "itk::Array<>" is not virtual
172 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
191 template<
typename TValue >
192 std::ostream & operator<<(std::ostream & os, const Array< TValue > & arr)
195 const unsigned int length = arr.size();
198 const unsigned int last = length - 1;
199 for (
unsigned int i = 0; i < last; ++i )
201 os << arr[i] <<
", ";
222 #ifndef ITK_MANUAL_INSTANTIATION
223 #include "itkArray.hxx"
Array class with size defined at construction time.
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
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)