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<
typename 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] <<
", ";
191 #ifndef ITK_MANUAL_INSTANTIATION
192 #include "itkArray.hxx"
Array class with size defined at construction time.
vnl_vector< TValueType >::size_type SizeValueType
bool m_LetArrayManageMemory
unsigned int GetNumberOfElements(void) const
void SetElement(SizeValueType i, const TValueType &value)
const TValueType & GetElement(SizeValueType i) const
void SetData(TValueType *data, bool LetArrayManageMemory=false)
unsigned long SizeValueType
Array(const Array< TArrayValue > &r)
const Self & operator=(const Self &rhs)
SizeValueType GetSize(void) const
void SetSize(SizeValueType sz)
vnl_vector< TValueType > VnlVectorType
ITKCommon_EXPORT std::ostream & operator<< < double >(std::ostream &os, const Array< double > &arr)
void Fill(TValueType const &v)
ITKCommon_EXPORT std::ostream & operator<< < float >(std::ostream &os, const Array< float > &arr)
SizeValueType Size(void) const