|
ITK
5.2.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>
85 #if defined(ITK_LEGACY_REMOVE)
92 #else // defined ( ITK_LEGACY_REMOVE )
103 template <
typename TArrayValue>
106 this->m_LetArrayManageMemory =
true;
110 this->operator[](i) = static_cast<TValue>(r[i]);
124 operator=(
const Self & rhs);
127 operator=(
const VnlVectorType & rhs);
133 return static_cast<SizeValueType>(this->size());
138 return static_cast<SizeValueType>(this->size());
146 return this->operator[](i);
153 this->operator[](i) = value;
163 return static_cast<SizeValueType>(this->size());
175 SetDataSameSize(TValue * datain,
bool LetArrayManageMemory =
false);
187 SetData(TValue * datain,
SizeValueType sz,
bool LetArrayManageMemory =
false);
189 #ifdef __INTEL_COMPILER
190 # pragma warning disable 444 // destructor for base class "itk::Array<>" is not virtual
196 #if !defined(ITK_LEGACY_REMOVE)
216 template <
typename TValue>
221 const unsigned int length = arr.size();
224 const unsigned int last = length - 1;
225 for (
unsigned int i = 0; i < last; ++i)
227 os << arr[i] <<
", ";
237 ITKCommon_EXPORT std::ostream &
operator<<<double>(std::ostream & os,
const Array<double> & arr);
239 ITKCommon_EXPORT std::ostream &
operator<<<float>(std::ostream & os,
const Array<float> & arr);
242 template <
typename T>
251 #ifndef ITK_MANUAL_INSTANTIATION
252 # 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)