18 #ifndef __itkVariableLengthVector_h
19 #define __itkVariableLengthVector_h
75 template<
typename TValueType >
103 bool LetArrayManageMemory =
false);
112 bool LetArrayManageMemory =
false);
141 void Fill(TValueType
const & v);
148 if (
m_Data == static_cast< void * >( const_cast< T * >
194 void SetSize(
unsigned int sz,
bool destroyExistingData =
true);
207 void SetData(TValueType *data,
bool LetArrayManageMemory =
false);
218 void SetData(TValueType *data,
unsigned int sz,
bool LetArrayManageMemory =
false);
258 result[i] = ( *this )[i] +
static_cast< ValueType >( v[i] );
285 result[i] = ( *this )[i] -
static_cast< ValueType >( v[i] );
319 / static_cast< RealValueType >( s ) );
331 result[i] =
m_Data[i] + s;
343 result[i] =
m_Data[i] - s;
400 inline Self &
operator-=
430 inline Self &
operator+=
477 / static_cast< RealValueType >( s ) );
507 template<
class TValueType,
class T >
515 template<
typename TValueType >
516 std::ostream & operator<<(std::ostream & os, const VariableLengthVector< TValueType > & arr)
518 const unsigned int length = arr.
Size();
519 const signed int last = (
unsigned int)length - 1;
522 for (
signed int i = 0; i < last; ++i )
524 os << arr[i] <<
", ";
538 #define ITK_TEMPLATE_VariableLengthVector(_, EXPORT, TypeX, TypeY) \
541 _( 1 ( class EXPORT VariableLengthVector< ITK_TEMPLATE_1 TypeX > ) ) \
542 namespace Templates \
544 typedef VariableLengthVector< ITK_TEMPLATE_1 TypeX > VariableLengthVector##TypeY; \
548 #if ITK_TEMPLATE_EXPLICIT
549 #include "Templates/itkVariableLengthVector+-.h"
553 #include "itkVariableLengthVector.hxx"