20#ifndef _vctDynamicVector_h
21#define _vctDynamicVector_h
124template <
class _elementType>
134 typedef typename BaseType::CopyType
CopyType;
135 typedef typename BaseType::TypeTraits
TypeTraits;
136 typedef typename BaseType::ElementVaArgPromotion ElementVaArgPromotion;
171 cmnThrow(std::runtime_error(
"vctDynamicVector: Constructor from va_list requires size >= 2"));
174 this->
at(0) = element0;
175 this->
at(1) = element1;
177 va_start(nextArg, element1);
178 for (index_type i = 2; i <
size; ++i) {
179 this->
at(i) =
value_type( va_arg(nextArg, ElementVaArgPromotion) );
188 this->Assign(values);
205 this->
SetSize(otherVector.size());
206 this->Assign(otherVector);
213 template <
class _otherVectorOwnerType>
215 this->
SetSize(otherVector.size());
216 this->Assign(otherVector);
224 template <
class _otherVectorOwnerType,
typename _otherVectorElementType>
226 this->
SetSize(otherVector.size());
227 this->Assign(otherVector);
231 template <
size_type __size, str
ide_type __str
ide,
class __elementType,
class __dataPtrType>
234 this->Assign(fixedVector);
242 template <
class __vectorOwnerType,
typename __elementType>
244 this->
SetSize(otherVector.size());
245 this->Assign(otherVector);
277 template <
class __vectorOwnerType,
typename __elementType>
285 template <
size_type __size, str
ide_type __str
ide,
class __elementType,
class __dataPtrType>
298 const size_type oldSize = this->size();
302 size_type minSizes = std::min(
size, oldSize);
303 const size_type corner = 0;
306 newDataMinSpaceRef.
Assign(myDataMinSpaceRef);
308 this->
Vector.Own(
size, newData.Vector.Release());
319 this->SetAll(newValue);
327 size_type
size = this->size();
328 _elementType *temp =
new _elementType[
size];
331 for (index = 0; index <
size; index++) {
332 inputStream >> temp[index];
333 if (inputStream.fail()) {
339 if (!isspace(delimiter)) {
340 if (index <
size-1) {
343 if (c != delimiter) {
352 for (index = 0; index <
size; index++)
353 (*
this)[index] = temp[index];
363 size_type mySize = 0;
369 for (index = 0; index < mySize; ++index) {
394template <
class _elementType>
403 this->
Vector.Own(
size, nonConstOther.Vector.Release());
409template <
class _elementType>
415 this->
Vector.Own(
size, nonConstOther.Vector.Release());
420template <
class _elementType>
428 this->
Vector.Own(
size, nonConstOther.Vector.Release());
440template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
446 resultStorage.Add(inputVector2);
451template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
457 resultStorage.Subtract(inputVector2);
474template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
480 resultStorage.CrossProductOf(inputVector1, inputVector2);
484template <
class _vectorOwnerType1,
class _vectorOwnerType2,
class _elementType>
490 resultStorage.CrossProductOf(inputVector1, inputVector2);
505template <
class _vectorOwnerType,
class _elementType>
508 const _elementType & inputScalar) {
511 resultStorage.Add(inputScalar);
516template <
class _vectorOwnerType,
class _elementType>
519 const _elementType & inputScalar) {
522 resultStorage.Subtract(inputScalar);
527template <
class _vectorOwnerType,
class _elementType>
530 const _elementType & inputScalar) {
533 resultStorage.Multiply(inputScalar);
538template <
class _vectorOwnerType,
class _elementType>
541 const _elementType & inputScalar) {
544 resultStorage.Divide(inputScalar);
559template <
class _vectorOwnerType,
class _elementType>
565 resultStorage.SumOf(inputScalar, inputVector);
570template <
class _vectorOwnerType,
class _elementType>
576 resultStorage.DifferenceOf(inputScalar, inputVector);
581template <
class _vectorOwnerType,
class _elementType>
587 resultStorage.ProductOf(inputScalar, inputVector);
592template <
class _vectorOwnerType,
class _elementType>
598 resultStorage.RatioOf(inputScalar, inputVector);
610template <
class _vectorOwnerType,
class _elementType>
615 resultStorage.NegationOf(inputVector);
628template <
class _vectorOwnerType,
class _elementType>
633 vctDynamicVectorLoopEngines::
634 VoVi<typename vctUnaryOperations<value_type>::AbsValue>::
635 Run(resultStorage, *
this);
640template <
class _vectorOwnerType,
class _elementType>
645 vctDynamicVectorLoopEngines::
646 VoVi<typename vctUnaryOperations<value_type>::Negation>::
647 Run(resultStorage, *
this);
652template <
class _vectorOwnerType,
class _elementType>
657 vctDynamicVectorLoopEngines::
658 VoVi<typename vctUnaryOperations<value_type>::Floor>::
659 Run(resultStorage, *
this);
664template <
class _vectorOwnerType,
class _elementType>
669 vctDynamicVectorLoopEngines::
670 VoVi<typename vctUnaryOperations<value_type>::Ceil>::
671 Run(resultStorage, *
this);
676template <
class _vectorOwnerType,
class _elementType>
680 resultStorage.NormalizedSelf();
685template <
class _vectorOwnerType,
class __vectorOwnerType,
class _elementType,
686 class _elementOperationType>
697template <
class _vectorOwnerType,
class _elementType,
class _elementOperationType>
700 const _elementType & scalar) {
_elementType value_type
Definition mtsGenericObjectProxy.h:329
Definition vctForwardDeclarations.h:119
Dynamic vector referencing existing memory (const).
Definition vctDynamicConstVectorRef.h:79
Definition vctDynamicVectorBase.h:62
ThisType & Assign(const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
Definition vctDynamicVectorBase.h:242
Definition vctForwardDeclarations.h:131
static void Run(_outputVectorType &outputVector, const _inputVectorType &inputVector, const _inputScalarType inputScalar)
Definition vctDynamicVectorLoopEngines.h:339
static void Run(_outputVectorType &outputVector, const _input1VectorType &input1Vector, const _input2VectorType &input2Vector)
Definition vctDynamicVectorLoopEngines.h:106
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeConstVectorBase.h:108
size_type size(void) const
Definition vctFixedSizeConstVectorBase.h:205
Definition vctDynamicVector.h:395
vctReturnDynamicVector(const BaseType &other)
Definition vctDynamicVector.h:399
vctDynamicVector< BoolType > BaseType
Definition vctDynamicVector.h:398
Declaration of cmnDeSerializer and functions cmnDeSerializeRaw.
void cmnDeSerializeSizeRaw(std::istream &inputStream, size_t &data) CISST_THROW(std
Definition cmnDeSerializer.h:96
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
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76
vctDynamicVector()
A vector object of dynamic size.
Definition vctDynamicVector.h:139
size_t size_type
Definition vctContainerTraits.h:35
#define VCT_CONTAINER_TRAITS_TYPEDEFS(type)
Definition vctContainerTraits.h:50
const_reference at(size_type index) const CISST_THROW(std
Definition vctDynamicConstMatrixBase.h:289
cmnTypeTraits< value_type > TypeTraits
Definition vctDynamicConstMatrixBase.h:147
size_type size(void) const
Definition vctDynamicConstMatrixBase.h:228
const_reference Element(size_type rowIndex, size_type colIndex) const
Definition vctDynamicConstMatrixBase.h:362
vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > ThisType
Definition vctDynamicConstMatrixBase.h:86
OwnerType Vector
Definition vctDynamicConstVectorBase.h:126
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareScalar(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector, const _elementType &scalar)
Definition vctDynamicVector.h:699
vctReturnDynamicVector< bool > vctDynamicVectorElementwiseCompareVector(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector1, const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &vector2)
Definition vctDynamicVector.h:688
vctDynamicVector< _elementType > CopyType
Definition vctDynamicConstVectorBase.h:102
ThisType & ForceAssign(const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
Definition vctDynamicMatrix.h:306
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition vctDynamicMatrix.h:364
void resize(size_type rows, size_type cols)
Definition vctDynamicMatrix.h:338
void DeSerializeRaw(std::istream &inputStream)
Definition vctDynamicMatrix.h:382
ThisType & operator=(const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &otherMatrix)
Definition vctDynamicMatrix.h:255
vctDynamicNArrayBase< vctDynamicNArrayOwner< _elementType, _dimension >, _elementType, _dimension > BaseType
Definition vctDynamicNArray.h:133
vctReturnDynamicVector< _elementType > operator-(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition vctDynamicVector.h:453
bool FromStreamRaw(std::istream &inputStream, const char delimiter=' ')
Definition vctDynamicVector.h:325
vctReturnDynamicVector< _elementType > operator%(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition vctDynamicVector.h:476
vctReturnDynamicVector< _elementType > vctCrossProduct(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition vctDynamicVector.h:486
vctReturnDynamicVector< _elementType > operator+(const vctDynamicConstVectorBase< _vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< _vectorOwnerType2, _elementType > &inputVector2)
Definition vctDynamicVector.h:442
vctReturnDynamicVector< _elementType > operator/(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &inputVector, const _elementType &inputScalar)
Definition vctDynamicVector.h:540
vctReturnDynamicVector< _elementType > operator*(const vctDynamicConstVectorBase< _vectorOwnerType, _elementType > &inputVector, const _elementType &inputScalar)
Definition vctDynamicVector.h:529
Declaration of vctDynamicVectorBase.
Declaration of vctDynamicVectorOwner.
Declaration of vctDynamicVectorRef.