 |
ITK
5.4.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 )
101 template <
typename TArrayValue>
107 this->operator[](i) = static_cast<TValue>(r[i]);
121 operator=(
const Self & rhs);
124 operator=(
const VnlVectorType & rhs);
130 return static_cast<SizeValueType>(this->size());
135 return static_cast<SizeValueType>(this->size());
143 return this->operator[](i);
150 this->operator[](i) = value;
160 return static_cast<SizeValueType>(this->size());
172 SetDataSameSize(TValue * datain,
bool LetArrayManageMemory =
false);
184 SetData(TValue * datain,
SizeValueType sz,
bool LetArrayManageMemory =
false);
186 #ifdef __INTEL_COMPILER
187 # pragma warning disable 444 // destructor for base class "itk::Array<>" is not virtual
193 #if !defined(ITK_LEGACY_REMOVE)
211 bool m_LetArrayManageMemory{
true };
214 template <
typename TValue>
219 const unsigned int length = arr.size();
222 const unsigned int last = length - 1;
223 for (
unsigned int i = 0; i < last; ++i)
225 os << arr[i] <<
", ";
235 ITKCommon_EXPORT std::ostream &
operator<<<double>(std::ostream & os,
const Array<double> & arr);
237 ITKCommon_EXPORT std::ostream &
operator<<<float>(std::ostream & os,
const Array<float> & arr);
240 template <
typename T>
249 #ifndef ITK_MANUAL_INSTANTIATION
250 # 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)