28 #ifndef _nmrIsOrthonormal_h
29 #define _nmrIsOrthonormal_h
63 template <
class _elementType>
104 if (allocateWorkspace) {
119 template <
typename __vectorOwnerTypeWorkspace>
122 throw(std::runtime_error)
124 if (
Size > inWorkspace.size()) {
125 cmnThrow(std::runtime_error(
"nmrIsOrthonormalDynamicData: Workspace is too small."));
127 if (!inWorkspace.IsCompact()) {
128 cmnThrow(std::runtime_error(
"nmrIsOrthonormalDynamicData: Workspace must be compact."));
158 template <
class __matrixOwnerTypeA>
227 template <
class __matrixOwnerTypeA>
246 template <
class __matrixOwnerTypeA,
class __vectorOwnerTypeWorkspace>
250 this->
SetRef(A, inWorkspace);
262 template <
class __matrixOwnerTypeA>
277 template <
class __matrixOwnerTypeA,
class __vectorOwnerTypeWorkspace>
333 template <
class _elementType, vct::
size_type _rows>
362 return Data.WorkspaceMember;
445 template <vct::
size_type _size, vct::str
ide_type _rowStr
ide, vct::str
ide_type _colStr
ide,
typename _elementType,
class _dataPtrType>
452 product.Diagonal().Subtract(_elementType(1));
453 return (product.LinfNorm() <= tolerance);
463 template <vct::
size_type _size, vct::str
ide_type _rowStr
ide, vct::str
ide_type _colStr
ide,
typename _elementType,
class _dataPtrType>
467 typedef typename InputType::MatrixValueType MatrixValueType;
468 MatrixValueType product;
470 product.Diagonal().Subtract(_elementType(1));
471 return (product.LinfNorm() <= tolerance);
482 template <
class _matrixOwnerTypeA,
class _elementType>
486 throw (std::runtime_error)
492 cmnThrow(std::runtime_error(
"nmrIsOrthonormal: Requires a square matrix."));
496 cmnThrow(std::runtime_error(
"nmrIsOrthonormal: The data provided is not large enough."));
502 return (product.
LinfNorm() <= tolerance);
512 template <
class _matrixOwnerTypeA,
typename _elementType>
515 throw (std::runtime_error)
530 template <
class _matrixOwnerTypeA,
class _vectorOwnerTypeWorkspace,
typename _elementType>
534 throw (std::runtime_error)
537 data.
SetRef(A, workspace);
543 #endif // _nmrIsOrthonormal_h
A template for a fixed size matrix with fixed spacing in memory.
Definition: vctFixedSizeConstMatrixBase.h:103
A vector object of dynamic size.
Definition: vctDynamicVector.h:127
Definition: nmrIsOrthonormal.h:173
Declaration of vctDynamicMatrix.
nmrIsOrthonormalFixedSizeData()
Definition: nmrIsOrthonormal.h:370
void Allocate(size_type m)
Definition: nmrIsOrthonormal.h:297
ThisType & Subtract(const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
Definition: vctDynamicVectorBase.h:825
Declaration of vctFixedSizeMatrix.
ThisType & ProductOf(const vctFixedSizeConstMatrixBase< _rows, _cols, __rowStride, __colStride, value_type, __dataPtrType > &matrix, const value_type scalar)
Definition: vctFixedSizeMatrixBase.h:909
size_type Size
Definition: nmrIsOrthonormal.h:138
Dynamic vector referencing existing memory.
Definition: vctDynamicVectorRef.h:77
Definition: nmrIsOrthonormal.h:355
size_t size_type
Definition: vctContainerTraits.h:35
VectorTypeWorkspace WorkspaceMember
Definition: nmrIsOrthonormal.h:345
Friend(nmrIsOrthonormalDynamicData &data)
Definition: nmrIsOrthonormal.h:177
Dynamic matrix referencing existing memory.
Definition: vctDynamicMatrixRef.h:74
Friend(nmrIsOrthonormalFixedSizeData< _elementType, _rows > &data)
Definition: nmrIsOrthonormal.h:359
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition: vctDynamicMatrixBase.h:971
Definition: vctDynamicConstMatrixBase.h:77
void AllocateWorkspace(bool allocateWorkspace)
Definition: nmrIsOrthonormal.h:102
void SetRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition: vctDynamicMatrixRef.h:217
Definition: nmrIsOrthonormal.h:338
vctDynamicVectorRef< _elementType > & Workspace(void)
Definition: nmrIsOrthonormal.h:179
bool nmrIsOrthonormal(const vctFixedSizeConstMatrixBase< _size, _size, _rowStride, _colStride, _elementType, _dataPtrType > &A, nmrIsOrthonormalFixedSizeData< _elementType, _size > &data, _elementType tolerance=cmnTypeTraits< _elementType >::Tolerance())
Definition: nmrIsOrthonormal.h:446
size_type rows() const
Definition: vctDynamicConstMatrixBase.h:238
An implementation of the ``abstract'' vctFixedSizeMatrixBase.
Definition: vctFixedSizeMatrixRef.h:46
size_type cols() const
Definition: vctDynamicConstMatrixBase.h:243
void Allocate(const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
Definition: nmrIsOrthonormal.h:263
size_type Size(void)
Definition: nmrIsOrthonormal.h:182
vctDynamicVector< _elementType > WorkspaceMemory
Definition: nmrIsOrthonormal.h:72
nmrIsOrthonormalDynamicData(size_type m)
Definition: nmrIsOrthonormal.h:213
ConstRefTransposeType TransposeRef(void) const
Definition: vctFixedSizeConstMatrixRef.h:172
#define cmnThrow(a)
Definition: MinimalCmn.h:4
Data (workspace) for nmrIsOrthonormal (Dynamic).
Definition: nmrIsOrthonormal.h:64
nmrIsOrthonormalDynamicData()
Definition: nmrIsOrthonormal.h:197
Data for nmrIsOrthonormal (Fixed size).
Definition: nmrIsOrthonormal.h:334
VectorTypeWorkspace & Workspace(void)
Definition: nmrIsOrthonormal.h:361
nmrIsOrthonormalDynamicData(const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
Definition: nmrIsOrthonormal.h:228
ConstRefTransposeType TransposeRef(void) const
Definition: vctDynamicConstMatrixBase.h:980
vct::size_type size_type
Definition: nmrIsOrthonormal.h:68
vctFixedSizeVector< _elementType, SIZE > VectorTypeWorkspace
Definition: nmrIsOrthonormal.h:342
pointer Pointer(size_type index=0)
Definition: vctFixedSizeVectorBase.h:226
void ThrowUnlessWorkspaceSizeIsCorrect(vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace) const
Definition: nmrIsOrthonormal.h:121
A collection of useful information about the C++ basic types, represented in a generic programming wa...
Definition: cmnTypeTraits.h:155
static size_type WorkspaceSize(size_type m)
Definition: nmrIsOrthonormal.h:148
DiagonalRefType Diagonal(void)
Definition: vctDynamicMatrixBase.h:239
static size_type WorkspaceSize(const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A)
Definition: nmrIsOrthonormal.h:159
value_type LinfNorm(void) const
Definition: vctDynamicConstMatrixBase.h:488
void SetRef(const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A, vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace)
Definition: nmrIsOrthonormal.h:278
nmrIsOrthonormalDynamicData(const vctDynamicConstMatrixBase< __matrixOwnerTypeA, _elementType > &A, vctDynamicVectorBase< __vectorOwnerTypeWorkspace, _elementType > &inWorkspace)
Definition: nmrIsOrthonormal.h:247
Definition: vctDynamicVectorBase.h:61
vctDynamicVectorRef< _elementType > WorkspaceReference
Definition: nmrIsOrthonormal.h:135
void SetDimension(size_type m)
Definition: nmrIsOrthonormal.h:77