23 #include "vxl_version.h"
24 #include "vnl/vnl_vector.h"
45 template<
typename TValue >
46 class ITK_TEMPLATE_EXPORT
Array :
public vnl_vector< TValue >
77 #if defined ( ITK_LEGACY_REMOVE )
84 #else // defined ( ITK_LEGACY_REMOVE )
92 bool LetArrayManageMemory =
false);
96 template<
typename TArrayValue >
99 this->m_LetArrayManageMemory =
true;
103 this->operator[](i) =
static_cast< TValue
>( r[i] );
115 const Self & operator=(
const Self & rhs);
117 const Self & operator=(
const VnlVectorType & rhs);
128 {
return this->operator[](i); }
132 { this->operator[](i) = value; }
148 void SetDataSameSize(TValue *data,
bool LetArrayManageMemory =
false);
159 void SetData(TValue *data,
SizeValueType sz,
bool LetArrayManageMemory =
false);
161 #ifdef __INTEL_COMPILER
162 #pragma warning disable 444 //destructor for base class "itk::Array<>" is not virtual
168 #if ! defined ( ITK_LEGACY_REMOVE )
187 template<
typename TValue >
188 std::ostream & operator<<(std::ostream & os, const Array< TValue > & arr)
191 const unsigned int length = arr.size();
194 const unsigned int last = length - 1;
195 for (
unsigned int i = 0; i < last; ++i )
197 os << arr[i] <<
", ";
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkArray.hxx"
Array class with size defined at construction time.
unsigned int GetNumberOfElements() const
unsigned long SizeValueType
void SetElement(SizeValueType i, const TValue &value)
bool m_LetArrayManageMemory
void Fill(TValue const &v)
void swap(Array< T > &a, Array< T > &b)
vnl_vector< AccumulateType > VnlVectorType
SizeValueType Size() 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 GetSize() const
const TValue & GetElement(SizeValueType i) const
Array(const Array< TArrayValue > &r)
typename vnl_vector< AccumulateType >::size_type SizeValueType