|
ITK
5.1.0
Insight Toolkit
|
Go to the documentation of this file.
23 #include "vxl_version.h"
24 #include "vnl/vnl_vector.h"
46 template <
typename TValue>
47 class ITK_TEMPLATE_EXPORT
Array :
public vnl_vector<TValue>
80 #if defined(ITK_LEGACY_REMOVE)
87 #else // defined ( ITK_LEGACY_REMOVE )
98 template <
typename TArrayValue>
101 this->m_LetArrayManageMemory =
true;
105 this->operator[](i) = static_cast<TValue>(r[i]);
119 operator=(
const Self & rhs);
122 operator=(
const VnlVectorType & rhs);
128 return static_cast<SizeValueType>(this->size());
133 return static_cast<SizeValueType>(this->size());
141 return this->operator[](i);
148 this->operator[](i) = value;
158 return static_cast<SizeValueType>(this->size());
170 SetDataSameSize(TValue * datain,
bool LetArrayManageMemory =
false);
182 SetData(TValue * datain,
SizeValueType sz,
bool LetArrayManageMemory =
false);
184 #ifdef __INTEL_COMPILER
185 # pragma warning disable 444 // destructor for base class "itk::Array<>" is not virtual
191 #if !defined(ITK_LEGACY_REMOVE)
211 template <
typename TValue>
216 const unsigned int length = arr.size();
219 const unsigned int last = length - 1;
220 for (
unsigned int i = 0; i < last; ++i)
222 os << arr[i] <<
", ";
232 ITKCommon_EXPORT std::ostream &
operator<<<double>(std::ostream & os,
const Array<double> & arr);
234 ITKCommon_EXPORT std::ostream &
operator<<<float>(std::ostream & os,
const Array<float> & arr);
237 template <
typename T>
246 #ifndef ITK_MANUAL_INSTANTIATION
247 # include "itkArray.hxx"
void SetElement(SizeValueType i, const TValue &value)
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
const TValue & GetElement(SizeValueType i) const
ITKCommon_EXPORT std::ostream & operator<<<double >(std::ostream &os, const Array< double > &arr)
void swap(Array< T > &a, Array< T > &b)
Array(const Array< TArrayValue > &r)
typename vnl_vector< AccumulateType >::size_type SizeValueType
vnl_vector< AccumulateType > VnlVectorType
bool m_LetArrayManageMemory
SizeValueType GetSize() const
ITKCommon_EXPORT std::ostream & operator<<<float >(std::ostream &os, const Array< float > &arr)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Array class with size defined at construction time.
SizeValueType Size() const
unsigned long SizeValueType
unsigned int GetNumberOfElements() const
void Fill(TValue const &v)