22 #ifndef _vctDynamicMatrix_h
23 #define _vctDynamicMatrix_h
135 template <
class _elementType>
161 this->
SetSize(rows, cols, storageOrder);
165 this->
SetSize(matrixSize, storageOrder);
174 this->
SetSize(rows, cols, storageOrder);
179 this->
SetSize(matrixSize, storageOrder);
199 this->
Assign(otherMatrix);
206 template <
class __matrixOwnerType,
typename __otherMatrixElementType>
209 this->
Assign(otherMatrix);
217 template <
class __matrixOwnerType>
220 this->
Assign(otherMatrix);
229 template <
class __matrixOwnerType,
typename __otherMatrixElementType>
232 this->
Assign(otherMatrix);
239 class __elementType,
class __dataPtrType>
241 __rowStride, __colStride,
242 __elementType, __dataPtrType> & other) {
254 template <
class __matrixOwnerType,
typename __elementType>
257 this->
Assign(otherMatrix);
269 this->
Assign(otherMatrix);
278 class __elementType,
class __dataPtrType>
280 __rowStride, __colStride,
281 __elementType, __dataPtrType> & other) {
305 template <
class __matrixOwnerType,
typename __elementType>
315 class __elementType,
class __dataPtrType>
317 __rowStride, __colStride,
318 __elementType, __dataPtrType> & other) {
319 this->
SetSize(other.sizes(), other.StorageOrder());
339 this->
resize(nsize_type(rows, cols));
342 void resize(
const nsize_type & newSizes) {
343 if (newSizes == this->
sizes())
347 ThisType newData(newSizes, isRowMajor);
348 const nsize_type corner(0);
350 minSizes.ElementwiseMinOf(this->
sizes(), newSizes);
353 newDataMinSpaceRef.
Assign(myDataMinSpaceRef);
355 this->
Matrix.Own(newSizes, isRowMajor, newData.
Matrix.Release());
365 this->
Matrix.SetSize(rows, cols, storageOrder);
368 void SetSize(
const nsize_type & matrixSize,
bool storageOrder) {
369 this->
Matrix.SetSize(matrixSize, storageOrder);
393 for (indexRow = 0; indexRow < myRows; ++indexRow) {
394 for (indexCol = 0; indexCol < myCols; ++indexCol) {
418 template <
class _elementType>
433 this->
Matrix.Own(rows, cols, storageOrder, nonConstOther.
Matrix.Release());
439 template <
class _elementType>
447 this->Matrix.Own(rows, cols, storageOrder, nonConstOther.
Matrix.
Release());
452 template <
class _elementType>
461 this->Matrix.Disown();
462 this->Matrix.Own(rows, cols, storageOrder, nonConstOther.
Matrix.
Release());
474 template <
class _matrixOwnerType1,
class _matrixOwnerType2,
class _elementType>
478 typedef _elementType value_type;
480 resultStorage.
Add(inputMatrix2);
485 template <
class _matrixOwnerType1,
class _matrixOwnerType2,
class _elementType>
489 typedef _elementType value_type;
491 resultStorage.
Subtract(inputMatrix2);
506 template <
class _matrixOwnerType,
class _elementType>
509 const _elementType & inputScalar) {
510 typedef _elementType value_type;
512 resultStorage.
Add(inputScalar);
517 template <
class _matrixOwnerType,
class _elementType>
520 const _elementType & inputScalar) {
521 typedef _elementType value_type;
523 resultStorage.
Subtract(inputScalar);
528 template <
class _matrixOwnerType,
class _elementType>
531 const _elementType & inputScalar) {
532 typedef _elementType value_type;
534 resultStorage.
Multiply(inputScalar);
539 template <
class _matrixOwnerType,
class _elementType>
542 const _elementType & inputScalar) {
543 typedef _elementType value_type;
545 resultStorage.
Divide(inputScalar);
560 template <
class _matrixOwnerType,
class _elementType>
564 typedef _elementType value_type;
566 resultStorage.
SumOf(inputScalar, inputMatrix);
571 template <
class _matrixOwnerType,
class _elementType>
575 typedef _elementType value_type;
582 template <
class _matrixOwnerType,
class _elementType>
586 typedef _elementType value_type;
588 resultStorage.
ProductOf(inputScalar, inputMatrix);
593 template <
class _matrixOwnerType,
class _elementType>
597 typedef _elementType value_type;
599 resultStorage.
RatioOf(inputScalar, inputMatrix);
611 template <
class _matrixOwnerType,
class _elementType>
614 typedef _elementType value_type;
624 template <
class _matrixOwnerType1,
class _matrixOwnerType2,
class _elementType>
628 typedef _elementType value_type;
630 resultStorage.
ProductOf(inputMatrix1, inputMatrix2);
635 template <
class _matrixOwnerType,
class _vectorOwnerType,
class _elementType>
639 typedef _elementType value_type;
641 resultStorage.
ProductOf(inputMatrix, inputVector);
646 template <
class _vectorOwnerType,
class _matrixOwnerType,
class _elementType>
650 typedef _elementType value_type;
652 resultStorage.
ProductOf(inputVector, inputMatrix);
664 template <
class _matrixOwnerType,
class _elementType>
667 typedef _elementType value_type;
671 Run(resultStorage, *
this);
676 template <
class _matrixOwnerType,
class _elementType>
679 typedef _elementType value_type;
683 Run(resultStorage, *
this);
688 template <
class _matrixOwnerType,
class _elementType>
691 typedef _elementType value_type;
695 Run(resultStorage, *
this);
700 template <
class _matrixOwnerType,
class _elementType>
703 typedef _elementType value_type;
707 Run(resultStorage, *
this);
712 template <
class _matrixOwnerType,
class _elementType>
716 resultStorage.
SetAll(_elementType(0));
722 template <
class _matrixOwnerType,
class __matrixOwnerType,
class _elementType,
723 class _elementOperationType>
734 template <
class _matrixOwnerType,
class _elementType,
735 class _elementOperationType>
738 const _elementType & scalar) {
748 #endif // _vctDynamicMatrix_h
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
vctDynamicMatrix< _elementType > BaseType
Definition: vctDynamicMatrix.h:422
ThisType & Subtract(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
Definition: vctDynamicMatrixBase.h:878
Definition: vctDynamicMatrixBase.h:42
vctDynamicMatrix(const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &otherMatrix)
Definition: vctDynamicMatrix.h:230
vctDynamicMatrix(const vctDynamicConstMatrixBase< __matrixOwnerType, __otherMatrixElementType > &otherMatrix, bool storageOrder)
Definition: vctDynamicMatrix.h:207
pointer Release()
Definition: vctDynamicMatrixOwner.h:192
vctReturnDynamicMatrix< _elementType > operator+(const vctDynamicConstMatrixBase< _matrixOwnerType1, _elementType > &inputMatrix1, const vctDynamicConstMatrixBase< _matrixOwnerType2, _elementType > &inputMatrix2)
Definition: vctDynamicMatrix.h:476
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareScalar(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix, const _elementType &scalar)
Definition: vctDynamicMatrix.h:737
Definition: vctDynamicMatrixLoopEngines.h:168
static void Run(_outputMatrixType &outputMatrix, const _inputMatrixType &inputMatrix, const _inputScalarType inputScalar)
Definition: vctDynamicMatrixLoopEngines.h:343
MatrixReturnType Negation(void) const
Definition: vctDynamicMatrix.h:678
void cmnDeSerializeSizeRaw(std::istream &inputStream, size_t &data)
Definition: cmnDeSerializer.h:96
vctDynamicMatrix(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &otherMatrix)
Definition: vctDynamicMatrix.h:218
vctDynamicMatrixBase< vctDynamicMatrixOwner< _elementType >, _elementType > BaseType
Definition: vctDynamicMatrix.h:146
A matrix object of dynamic size.
Definition: vctDynamicMatrix.h:136
ThisType & Add(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
Definition: vctDynamicMatrixBase.h:869
OwnerType Matrix
Definition: vctDynamicConstMatrixBase.h:167
vctDynamicMatrix< _elementType > ThisType
Definition: vctDynamicMatrix.h:147
size_t size_type
Definition: vctContainerTraits.h:35
ThisType & ForceAssign(const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &other)
Definition: vctDynamicMatrix.h:306
bool StorageOrder(void) const
Definition: vctDynamicConstMatrixBase.h:656
const bool VCT_DEFAULT_STORAGE
Definition: vctForwardDeclarations.h:49
vctReturnDynamicMatrix< _elementType > operator-(const vctDynamicConstMatrixBase< _matrixOwnerType1, _elementType > &inputMatrix1, const vctDynamicConstMatrixBase< _matrixOwnerType2, _elementType > &inputMatrix2)
Definition: vctDynamicMatrix.h:487
void SetSize(const nsize_type &matrixSize)
Definition: vctDynamicMatrix.h:376
vctDynamicMatrix()
Definition: vctDynamicMatrix.h:151
Dynamic matrix referencing existing memory.
Definition: vctDynamicMatrixRef.h:74
MatrixReturnType Ceil(void) const
Definition: vctDynamicMatrix.h:702
vctDynamicMatrix(const nsize_type &matrixSize, value_type value, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrix.h:178
void resize(size_type rows, size_type cols)
Definition: vctDynamicMatrix.h:338
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition: vctDynamicMatrixBase.h:971
Definition: vctDynamicConstMatrixBase.h:77
void DeSerializeRaw(std::istream &inputStream)
Definition: vctDynamicMatrix.h:382
vctReturnDynamicMatrix(const BaseType &other)
Definition: vctDynamicMatrix.h:426
Declaration of vctDynamicVector.
Definition: vctDynamicMatrix.h:419
void SetSize(const nsize_type &matrixSize, bool storageOrder)
Definition: vctDynamicMatrix.h:368
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
ThisType & SumOf(const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
Definition: vctDynamicMatrixBase.h:791
Dynamic matrix referencing existing memory (const)
Definition: vctDynamicConstMatrixRef.h:79
value_type SetAll(const value_type value)
Definition: vctDynamicMatrixBase.h:452
Definition: vctDynamicVector.h:392
Declaration of vctDynamicMatrixOwner.
void cmnDeSerializeRaw(std::istream &inputStream, _elementType &data)
Definition: cmnDeSerializer.h:82
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
vctReturnDynamicMatrix< _elementType > operator/(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &inputMatrix, const _elementType &inputScalar)
Definition: vctDynamicMatrix.h:541
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
static void Run(_outputMatrixType &outputMatrix, const _input1MatrixType &input1Matrix, const _input2MatrixType &input2Matrix)
Definition: vctDynamicMatrixLoopEngines.h:92
Declaration of vctDynamicMatrixBase.
VCT_CONTAINER_TRAITS_TYPEDEFS(_elementType)
vctDynamicMatrix(size_type rows, size_type cols, value_type value, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrix.h:173
vctReturnDynamicMatrix< bool > vctDynamicMatrixElementwiseCompareMatrix(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix1, const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &matrix2)
Definition: vctDynamicMatrix.h:725
bool IsRowMajor(void) const
Definition: vctDynamicConstMatrixBase.h:635
Declaration of vctDynamicMatrixRef.
void resize(const nsize_type &newSizes)
Definition: vctDynamicMatrix.h:342
ThisType & DifferenceOf(const vctDynamicConstMatrixBase< __matrixOwnerType1, _elementType > &matrix1, const vctDynamicConstMatrixBase< __matrixOwnerType2, _elementType > &matrix2)
Definition: vctDynamicMatrixBase.h:801
void SetSize(size_type rows, size_type cols, bool storageOrder)
Definition: vctDynamicMatrix.h:364
VCT_NARRAY_TRAITS_TYPEDEFS(DIMENSION)
ThisType & Divide(const value_type scalar)
Definition: vctDynamicMatrixBase.h:1128
vctDynamicMatrix(const nsize_type &matrixSize, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrix.h:164
reference Element(size_type rowIndex, size_type colIndex)
Definition: vctDynamicMatrixBase.h:214
MatrixReturnType Floor(void) const
Definition: vctDynamicMatrix.h:690
vctReturnDynamicMatrix< _elementType > operator*(const vctDynamicConstMatrixBase< _matrixOwnerType, _elementType > &inputMatrix, const _elementType &inputScalar)
Definition: vctDynamicMatrix.h:530
value_type SetAll(const value_type value)
Definition: vctDynamicVectorBase.h:209
ThisType & Assign(const vctDynamicConstMatrixBase< __matrixOwnerType, value_type > &other)
Definition: vctDynamicMatrixBase.h:509
Definition: vctDynamicMatrix.h:143
ThisType & RatioOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition: vctDynamicMatrixBase.h:981
static MatrixReturnType Eye(size_type size)
Definition: vctDynamicMatrix.h:714
ptrdiff_t stride_type
Definition: vctContainerTraits.h:37
ThisType & ForceAssign(const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition: vctDynamicMatrix.h:316
Definition: vctDynamicConstVectorBase.h:77
vctDynamicMatrix(size_type rows, size_type cols, bool storageOrder=VCT_DEFAULT_STORAGE)
Definition: vctDynamicMatrix.h:160
MatrixReturnType Abs(void) const
Definition: vctDynamicMatrix.h:666
vctDynamicMatrix(const vctFixedSizeConstMatrixBase< __rows, __cols, __rowStride, __colStride, __elementType, __dataPtrType > &other)
Definition: vctDynamicMatrix.h:240
DiagonalRefType Diagonal(void)
Definition: vctDynamicMatrixBase.h:239
ThisType & Multiply(const value_type scalar)
Definition: vctDynamicMatrixBase.h:1120
vctDynamicMatrix(const ThisType &otherMatrix)
Definition: vctDynamicMatrix.h:195
const nsize_type & sizes(void) const
Definition: vctDynamicConstMatrixBase.h:233
ThisType & operator=(const vctDynamicConstMatrixBase< __matrixOwnerType, __elementType > &otherMatrix)
Definition: vctDynamicMatrix.h:255
ThisType & ProductOf(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
Definition: vctDynamicVectorBase.h:941
ThisType & NegationOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix)
Definition: vctDynamicMatrixBase.h:1222
void SetSize(size_type rows, size_type cols)
Definition: vctDynamicMatrix.h:372