20#ifndef _vctFixedSizeVector_h
21#define _vctFixedSizeVector_h
49template <
class _elementType, vct::
size_type _size>
51 _size, 1, _elementType,
52 typename vctFixedSizeVectorTraits<_elementType, _size, 1>::array
95 template <
class __elementType, str
ide_type __str
ide,
class __dataPtrType>
105 template <str
ide_type __str
ide>
111 template <str
ide_type __str
ide>
122 template <str
ide_type __str
ide,
class __dataPtrType>
132 template<
class __elementType>
148 template <
class __vectorOwnerType>
178 (*this)[0] = element0;
179 (*this)[1] = element1;
186 (*this)[0] = element0;
187 (*this)[1] = element1;
188 (*this)[2] = element2;
195 (*this)[0] = element0;
196 (*this)[1] = element1;
197 (*this)[2] = element2;
198 (*this)[3] = element3;
217 (*this)[0] = element0;
218 (*this)[1] = element1;
219 (*this)[2] = element2;
220 (*this)[3] = element3;
221 (*this)[4] = element4;
223 va_start(nextArg, element4);
224 for (index_type i = 5; i < _size; ++i) {
243 template <str
ide_type __str
ide,
class __elementType,
class __dataPtrType>
248 template <str
ide_type __str
ide>
253 template <str
ide_type __str
ide,
class __elementType>
270 _elementType temp[_size];
273 for (index = 0; index < _size; index++) {
274 inputStream >> temp[index];
275 if (inputStream.fail()) {
281 if (!isspace(delimiter)) {
282 if (index < _size-1) {
285 if (c != delimiter) {
294 for (index = 0; index < _size; index++)
295 (*
this)[index] = temp[index];
304 const size_type mySize = this->
size();
305 for (index = 0; index < mySize; ++index) {
326 result.
SumOf(vector1, vector2);
383template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
386 const _elementType & scalar)
389 result.
SumOf(vector, scalar);
394template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
397 const _elementType & scalar)
405template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
408 const _elementType & scalar)
416template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
419 const _elementType & scalar)
422 result.
RatioOf(vector, scalar);
434template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
441 result.
SumOf(scalar, vector);
446template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
457template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
468template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
474 result.
RatioOf(scalar, vector);
486template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
510 subvector1.Assign(vector1);
511 subvector2.Assign(vector2);
525template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
529 vctFixedSizeVectorRecursiveEngines<_size>::template
531 Unfold(result, *
this);
536template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
540 vctFixedSizeVectorRecursiveEngines<_size>::template
542 Unfold(result, *
this);
547template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
551 vctFixedSizeVectorRecursiveEngines<_size>::template
553 Unfold(result, *
this);
558template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
562 vctFixedSizeVectorRecursiveEngines<_size>::template
564 Unfold(result, *
this);
569template <vct::
size_type _size, vct::str
ide_type _str
ide,
class _elementType,
class _dataPtrType>
573 result.NormalizedSelf();
582 class _elementOperationType>
587 vctFixedSizeVectorRecursiveEngines<_size>::template
596 class _elementOperationType>
599 const _elementType & scalar) {
601 vctFixedSizeVectorRecursiveEngines<_size>::template
Implement operation of the form for fixed size vectors.
Definition vctFixedSizeVectorRecursiveEngines.h:455
static void Unfold(_outputVectorType &output, const _inputVectorType &inputVector, const _inputScalarType inputScalar)
Definition vctFixedSizeVectorRecursiveEngines.h:306
static void Unfold(_outputVectorType &output, const _inputVector1Type &input1, const _inputVector2Type &input2)
Definition vctFixedSizeVectorRecursiveEngines.h:143
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition cmnTypeTraits.h:155
cmnVaArgPromotion< value_type >::Type VaArgPromotion
Definition cmnTypeTraits.h:167
_elementType value_type
Definition mtsGenericObjectProxy.h:329
Definition vctForwardDeclarations.h:119
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
vctFixedSizeVector< _elementType, _size > VectorValueType
Definition vctFixedSizeConstVectorBase.h:152
VectorValueType Floor(void) const
Definition vctFixedSizeVector.h:549
VectorValueType Ceil(void) const
Definition vctFixedSizeVector.h:560
VectorValueType Abs(void) const
Definition vctFixedSizeVector.h:527
VectorValueType Negation(void) const
Definition vctFixedSizeVector.h:538
Definition vctForwardDeclarations.h:86
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeVectorBase.h:77
ThisType & RatioOf(const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &vector, const value_type scalar)
Definition vctFixedSizeVectorBase.h:1013
BaseType::CopyType CopyType
Definition vctFixedSizeVectorBase.h:90
ThisType & SumOf(const vctFixedSizeConstVectorBase< _size, __stride1, value_type, __dataPtrType1 > &vector1, const vctFixedSizeConstVectorBase< _size, __stride2, value_type, __dataPtrType2 > &vector2)
Definition vctFixedSizeVectorBase.h:809
ThisType & Assign(const vctFixedSizeConstVectorBase< _size, __stride, __elementType, __dataPtrType > &other)
Definition vctFixedSizeVectorBase.h:274
ThisType & DifferenceOf(const vctFixedSizeConstVectorBase< _size, __stride1, value_type, __dataPtrType1 > &vector1, const vctFixedSizeConstVectorBase< _size, __stride2, value_type, __dataPtrType2 > &vector2)
Definition vctFixedSizeVectorBase.h:820
reference Element(size_type index)
Definition vctFixedSizeVectorBase.h:213
ThisType & ProductOf(const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &vector, const value_type scalar)
Definition vctFixedSizeVectorBase.h:1003
ThisType & ConcatenationOf(const vctFixedSizeConstVectorBase< SIZEMINUSONE, __stride, __elementTypeVector, __dataPtrType > &other, __elementType last)
Definition vctFixedSizeVectorBase.h:527
ThisType & NegationOf(const vctFixedSizeConstVectorBase< _size, __stride, value_type, __dataPtrType > &otherVector)
Definition vctFixedSizeVectorBase.h:1286
pointer Pointer(size_type index=0)
Definition vctFixedSizeVectorBase.h:226
void CrossProductOf(const vctFixedSizeConstVectorBase< 3, __stride1, _elementType, __dataPtr1Type > &inputVector1, const vctFixedSizeConstVectorBase< 3, __stride2, _elementType, __dataPtr2Type > &inputVector2)
Definition vctFixedSizeVectorBase.h:782
value_type SetAll(const value_type &value)
Definition vctFixedSizeVectorBase.h:241
Implementation of a fixed-size vector using template metaprogramming.
Definition vctFixedSizeVector.h:54
vctFixedSizeVectorBase< _size, 1, value_type, typename VectorTraits::array > BaseType
Definition vctFixedSizeVector.h:66
vctFixedSizeVector(const ThisType &other)
Definition vctFixedSizeVector.h:79
vctFixedSizeVector(const vctFixedSizeConstVectorBase< SIZEMINUSONE, __stride, _elementType, __dataPtrType > &vector, value_type lastElement)
Definition vctFixedSizeVector.h:124
TypeTraits::VaArgPromotion ElementVaArgPromotion
Definition vctFixedSizeVector.h:70
vctFixedSizeVector(const vctFixedSizeConstVectorBase< _size, __stride, __elementType, __dataPtrType > &vector)
Definition vctFixedSizeVector.h:97
class cmnTypeTraits< value_type > TypeTraits
Definition vctFixedSizeVector.h:69
vctFixedSizeVector(const __elementType *elements)
Definition vctFixedSizeVector.h:134
ThisType & operator=(const ThisType &other)
Definition vctFixedSizeVector.h:239
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
bool FromStreamRaw(std::istream &inputStream, const char delimiter=' ')
Definition vctFixedSizeVector.h:268
vctFixedSizeVector(const value_type &element0, const value_type &element1, const value_type &element2, const value_type &element3)
Definition vctFixedSizeVector.h:192
vctFixedSizeVector(const vctFixedSizeVectorRef< _elementType, _size, __stride > &vector)
Definition vctFixedSizeVector.h:113
vctFixedSizeVector()
Definition vctFixedSizeVector.h:76
vctFixedSizeVectorTraits< value_type, _size, 1 > VectorTraits
Definition vctFixedSizeVector.h:62
void DeSerializeRaw(std::istream &inputStream)
Definition vctFixedSizeVector.h:301
vctFixedSizeVector(const value_type &element0, const value_type &element1, const value_type &element2)
Definition vctFixedSizeVector.h:183
vctFixedSizeVector(const value_type &value)
Definition vctFixedSizeVector.h:86
vctFixedSizeVector(const vctFixedSizeConstVectorRef< _elementType, _size, __stride > &vector)
Definition vctFixedSizeVector.h:107
vctFixedSizeVector< value_type, _size > ThisType
Definition vctFixedSizeVector.h:65
vctFixedSizeVector(const value_type &element0, const value_type &element1)
Definition vctFixedSizeVector.h:176
vctFixedSizeVector(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &vector)
Definition vctFixedSizeVector.h:149
vctFixedSizeVector(const value_type element0, const value_type element1, const value_type element2, const value_type element3, const value_type element4,...)
Definition vctFixedSizeVector.h:213
@ SIZEMINUSONE
Definition vctFixedSizeVector.h:72
BaseType::CopyType CopyType
Definition vctFixedSizeVector.h:67
Definition vctForwardDeclarations.h:89
Define common container related types based on the properties of a fixed size container.
Definition vctFixedSizeVectorTraits.h:46
#define CMN_ASSERT(expr)
Definition cmnAssert.h:97
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data) CISST_THROW(std
Definition cmnDeSerializer.h:82
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
size_t size_type
Definition vctContainerTraits.h:35
ptrdiff_t stride_type
Definition vctContainerTraits.h:37
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
vctReturnDynamicVector< _elementType > vctCrossProduct(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition vctDynamicVector.h:486
vctFixedSizeVector< bool, _size > vctFixedSizeVectorElementwiseCompareVector(const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &vector1, const vctFixedSizeConstVectorBase< _size, __stride, _elementType, __dataPtrType > &vector2)
Definition vctFixedSizeVector.h:584
vctFixedSizeVector< bool, _size > vctFixedSizeVectorElementwiseCompareScalar(const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &vector, const _elementType &scalar)
Definition vctFixedSizeVector.h:598
vctFixedSizeVector< _elementType, _size > operator*(const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &vector, const _elementType &scalar)
Definition vctFixedSizeVector.h:407
vctFixedSizeVector< _elementType, _size > operator-(const vctFixedSizeConstVectorBase< _size, _vector1Stride, _elementType, _vector1Data > &vector1, const vctFixedSizeConstVectorBase< _size, _vector2Stride, _elementType, _vector2Data > &vector2)
Definition vctFixedSizeVector.h:334
vctFixedSizeVector< _elementType, 3 > operator%(const vctFixedSizeConstVectorBase< 3, _vector1Stride, _elementType, _vector1Data > &vector1, const vctFixedSizeConstVectorBase< 3, _vector2Stride, _elementType, _vector2Data > &vector2)
Definition vctFixedSizeVector.h:368
vctFixedSizeVector< _elementType, _size > operator/(const vctFixedSizeConstVectorBase< _size, _stride, _elementType, _dataPtrType > &vector, const _elementType &scalar)
Definition vctFixedSizeVector.h:418
vctFixedSizeVector< _elementType, _size1+_size2 > operator&(const vctFixedSizeConstVectorBase< _size1, _stride1, _elementType, _dataPtr1 > &vector1, const vctFixedSizeConstVectorBase< _size2, _stride2, _elementType, _dataPtr2 > &vector2)
Definition vctFixedSizeVector.h:504
vctFixedSizeVector< _elementType, _size > operator+(const vctFixedSizeConstVectorBase< _size, _vector1Stride, _elementType, _vector1Data > &vector1, const vctFixedSizeConstVectorBase< _size, _vector2Stride, _elementType, _vector2Data > &vector2)
Definition vctFixedSizeVector.h:322
Declaration of vctFixedSizeVectorRef.