22 #ifndef _vctDynamicVector_h
23 #define _vctDynamicVector_h
126 template <
class _elementType>
173 cmnThrow(std::runtime_error(
"vctDynamicVector: Constructor from va_list requires size >= 2"));
176 this->
at(0) = element0;
177 this->
at(1) = element1;
179 va_start(nextArg, element1);
208 this->
Assign(otherVector);
215 template <
class _otherVectorOwnerType>
218 this->
Assign(otherVector);
226 template <
class _otherVectorOwnerType,
typename _otherVectorElementType>
229 this->
Assign(otherVector);
233 template <
size_type __size, str
ide_type __str
ide,
class __elementType,
class __dataPtrType>
236 this->
Assign(fixedVector);
244 template <
class __vectorOwnerType,
typename __elementType>
247 this->
Assign(otherVector);
279 template <
class __vectorOwnerType,
typename __elementType>
287 template <
size_type __size, str
ide_type __str
ide,
class __elementType,
class __dataPtrType>
304 size_type minSizes = std::min(size, oldSize);
308 newDataMinSpaceRef.
Assign(myDataMinSpaceRef);
316 this->
Vector.SetSize(size);
325 _elementType *temp =
new _elementType[
size];
328 for (index = 0; index <
size; index++) {
329 inputStream >> temp[index];
330 if (inputStream.fail()) {
336 if (!isspace(delimiter)) {
337 if (index < size-1) {
340 if (c != delimiter) {
349 for (index = 0; index <
size; index++)
350 (*
this)[index] = temp[index];
366 for (index = 0; index < mySize; ++index) {
391 template <
class _elementType>
406 template <
class _elementType>
412 this->Vector.Own(size, nonConstOther.
Vector.Release());
417 template <
class _elementType>
424 this->Vector.Disown();
425 this->Vector.Own(size, nonConstOther.
Vector.Release());
437 template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
441 typedef _elementType value_type;
443 resultStorage.
Add(inputVector2);
448 template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
452 typedef _elementType value_type;
454 resultStorage.
Subtract(inputVector2);
471 template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
475 typedef _elementType value_type;
481 template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
485 typedef _elementType value_type;
502 template <
class _vectorOwnerType,
class _elementType>
505 const _elementType & inputScalar) {
506 typedef _elementType value_type;
508 resultStorage.
Add(inputScalar);
513 template <
class _vectorOwnerType,
class _elementType>
516 const _elementType & inputScalar) {
517 typedef _elementType value_type;
519 resultStorage.
Subtract(inputScalar);
524 template <
class _vectorOwnerType,
class _elementType>
527 const _elementType & inputScalar) {
528 typedef _elementType value_type;
530 resultStorage.
Multiply(inputScalar);
535 template <
class _vectorOwnerType,
class _elementType>
538 const _elementType & inputScalar) {
539 typedef _elementType value_type;
541 resultStorage.
Divide(inputScalar);
556 template <
class _vectorOwnerType,
class _elementType>
560 typedef _elementType value_type;
562 resultStorage.
SumOf(inputScalar, inputVector);
567 template <
class _vectorOwnerType,
class _elementType>
571 typedef _elementType value_type;
578 template <
class _vectorOwnerType,
class _elementType>
582 typedef _elementType value_type;
584 resultStorage.
ProductOf(inputScalar, inputVector);
589 template <
class _vectorOwnerType,
class _elementType>
593 typedef _elementType value_type;
595 resultStorage.
RatioOf(inputScalar, inputVector);
607 template <
class _vectorOwnerType,
class _elementType>
610 typedef _elementType value_type;
625 template <
class _vectorOwnerType,
class _elementType>
628 typedef _elementType value_type;
632 Run(resultStorage, *
this);
637 template <
class _vectorOwnerType,
class _elementType>
640 typedef _elementType value_type;
644 Run(resultStorage, *
this);
649 template <
class _vectorOwnerType,
class _elementType>
652 typedef _elementType value_type;
656 Run(resultStorage, *
this);
661 template <
class _vectorOwnerType,
class _elementType>
664 typedef _elementType value_type;
668 Run(resultStorage, *
this);
673 template <
class _vectorOwnerType,
class _elementType>
682 template <
class _vectorOwnerType,
class __vectorOwnerType,
class _elementType,
683 class _elementOperationType>
694 template <
class _vectorOwnerType,
class _elementType,
class _elementOperationType>
697 const _elementType & scalar) {
706 #endif // _vctDynamicVector_h
size_t index_type
Definition: vctContainerTraits.h:36
OwnerType Vector
Definition: vctDynamicConstVectorBase.h:126
vctDynamicVector(size_type size, value_type element0, value_type element1,...)
Definition: vctDynamicVector.h:171
A vector object of dynamic size.
Definition: vctDynamicVector.h:127
Declaration of vctDynamicVectorOwner.
vctReturnDynamicVector(const BaseType &other)
Definition: vctDynamicVector.h:396
VectorReturnType Ceil(void) const
Definition: vctDynamicVector.h:663
Dynamic vector referencing existing memory (const)
Definition: vctDynamicConstVectorRef.h:79
ThisType & Subtract(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:825
static void Run(_outputVectorType &outputVector, const _inputVectorType &inputVector, const _inputScalarType inputScalar)
Definition: vctDynamicVectorLoopEngines.h:337
static void Run(_outputVectorType &outputVector, const _input1VectorType &input1Vector, const _input2VectorType &input2Vector)
Definition: vctDynamicVectorLoopEngines.h:105
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector2)
Definition: vctDynamicVector.h:685
BaseType::ElementVaArgPromotion ElementVaArgPromotion
Definition: vctDynamicVector.h:138
vctDynamicVector(const vctDynamicConstVectorBase< _otherVectorOwnerType, value_type > &otherVector)
Definition: vctDynamicVector.h:216
void cmnDeSerializeSizeRaw(std::istream &inputStream, size_t &data)
Definition: cmnDeSerializer.h:96
ThisType & SumOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:728
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
Definition: vctDynamicVectorBase.h:242
Dynamic vector referencing existing memory.
Definition: vctDynamicVectorRef.h:77
Implement operation of the form for dynamic vectors.
Definition: vctDynamicVectorLoopEngines.h:535
size_t size_type
Definition: vctContainerTraits.h:35
vctDynamicVector< _elementType > BaseType
Definition: vctDynamicVector.h:395
TypeTraits::VaArgPromotion ElementVaArgPromotion
Definition: vctDynamicVectorBase.h:85
vctDynamicVector()
Definition: vctDynamicVector.h:141
vctDynamicVector(const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &fixedVector)
Definition: vctDynamicVector.h:234
void SetSize(size_type size)
Definition: vctDynamicVector.h:315
vctReturnDynamicVector< _elementType > operator-(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVector.h:450
void DeSerializeRaw(std::istream &inputStream)
Definition: vctDynamicVector.h:357
ThisType & ForceAssign(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
Definition: vctDynamicVector.h:280
ThisType & Divide(const value_type scalar)
Definition: vctDynamicVectorBase.h:1118
BaseType::TypeTraits TypeTraits
Definition: vctDynamicVector.h:137
size_type size(void) const
Definition: vctDynamicConstVectorBase.h:164
ThisType & RatioOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:951
vctReturnDynamicVector< _elementType > operator*(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &inputVector, const _elementType &inputScalar)
Definition: vctDynamicVector.h:526
vctDynamicVector(const ThisType &otherVector)
Definition: vctDynamicVector.h:204
reference at(index_type index)
Definition: vctDynamicVectorBase.h:170
Definition: vctDynamicVector.h:392
void resize(size_type size)
Definition: vctDynamicVector.h:299
reference Element(index_type index)
Definition: vctDynamicVectorBase.h:195
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data)
Definition: cmnDeSerializer.h:82
ThisType & operator=(const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &otherVector)
Definition: vctDynamicVector.h:245
size_type size(void) const
Definition: vctFixedSizeConstVectorBase.h:205
VectorReturnType Negation(void) const
Definition: vctDynamicVector.h:639
ThisType & NormalizedSelf(void)
Definition: vctDynamicVectorBase.h:1361
ThisType & Add(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:816
VectorReturnType Floor(void) const
Definition: vctDynamicVector.h:651
#define cmnThrow(a)
Definition: MinimalCmn.h:4
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const _elementType &scalar)
Definition: vctDynamicVector.h:696
Declaration of vctDynamicVectorBase.
ThisType & ForceAssign(const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
Definition: vctDynamicVector.h:288
Declaration of vctDynamicVectorRef.
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
value_type SetAll(const value_type value)
Definition: vctDynamicVectorBase.h:209
vctReturnDynamicVector< _elementType > vctCrossProduct(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVector.h:483
vctDynamicVector(size_type size)
Definition: vctDynamicVector.h:148
VectorReturnType Normalized(void) const
Definition: vctDynamicVector.h:675
vctDynamicVectorBase< vctDynamicVectorOwner< _elementType >, _elementType > BaseType
Definition: vctDynamicVector.h:135
ThisType & DifferenceOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
Definition: vctDynamicVectorBase.h:738
ThisType & Multiply(const value_type scalar)
Definition: vctDynamicVectorBase.h:1110
Definition: vctDynamicConstVectorBase.h:77
vctReturnDynamicVector< _elementType > operator%(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVector.h:473
A template for a fixed length vector with fixed spacing in memory.
Definition: vctFixedSizeConstVectorBase.h:107
BaseType::CopyType CopyType
Definition: vctDynamicVector.h:136
Declaration of cmnDeSerializer and functions cmnDeSerializeRaw.
VectorReturnType Abs(void) const
Definition: vctDynamicVector.h:627
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
bool FromStreamRaw(std::istream &inputStream, const char delimiter= ' ')
Definition: vctDynamicVector.h:322
ThisType & NegationOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:1285
vctDynamicVector(const vctDynamicConstVectorBase< _otherVectorOwnerType, _otherVectorElementType > &otherVector)
Definition: vctDynamicVector.h:227
void CrossProductOf(const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVectorBase.h:695
vctDynamicVector(size_type size, const value_type *values)
Definition: vctDynamicVector.h:188
ThisType & ProductOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:941
vctDynamicVector(size_type size, value_type value)
Definition: vctDynamicVector.h:154
vctReturnDynamicVector< _elementType > operator+(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition: vctDynamicVector.h:439
vctDynamicVector< _elementType > ThisType
Definition: vctDynamicVector.h:134
vctReturnDynamicVector< _elementType > operator/(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &inputVector, const _elementType &inputScalar)
Definition: vctDynamicVector.h:537
Definition: vctDynamicVectorBase.h:61