cisst-saw
Loading...
Searching...
No Matches
nmrPInverse.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4/*
5 Author(s): Ankur Kapoor
6 Created on: 2005-10-18
7
8 (C) Copyright 2005-2019 Johns Hopkins University (JHU), All Rights Reserved.
9
10--- begin cisst license - do not edit ---
11
12This software is provided "as is" under an open source license, with
13no warranty. The complete license can be found in license.txt and
14http://www.cisst.org/cisst/license.txt.
15
16--- end cisst license ---
17*/
18
19
24
25
26#ifndef _nmrPInverse_h
27#define _nmrPInverse_h
28
34
35// Always include last
37
38/*
39 ****************************************************************************
40 DYNAMIC SIZE
41 ****************************************************************************
42 */
43
47
48public:
55
56protected:
79
87
92 inline void SetDimension(size_type m, size_type n, bool storageOrder)
93 {
94 StorageOrderMember = storageOrder;
95 MMember = m;
96 NMember = n;
97 }
98
112 inline void AllocateOutputWorkspace(bool allocateOutput, bool allocateWorkspace)
113 {
114 // allocate output
115 if (allocateOutput) {
116 OutputMemory.SetSize(MMember * NMember);
120 OutputMemory.Pointer());
121 } else {
122 OutputMemory.SetSize(0);
123 }
124 // allocate workspace
125 if (allocateWorkspace) {
126 this->WorkspaceMemory.SetSize(WorkspaceSize(MMember, NMember));
127 this->SetRefSVD(this->WorkspaceMemory);
128 } else {
129 this->WorkspaceMemory.SetSize(0);
130 }
131 }
132
133
140 template <class _vectorOwnerTypeWorkspace>
142 {
143 const size_type minmn = (MMember < NMember) ? MMember : NMember;
144 size_type current = 0;
148 workspace.Pointer(current));
149 current += (MMember * MMember);
153 workspace.Pointer(current));
154 current += (NMember * NMember);
155 SReference.SetRef(minmn,
156 workspace.Pointer(current),
157 1);
158 current += minmn;
160 workspace.Pointer(current),
161 1);
162 }
163
164
165
172 template <typename _matrixOwnerTypePInverse>
174 CISST_THROW(std::runtime_error)
175 {
176 // check sizes and storage order
177 if ((MMember != pInverse.cols()) || (NMember != pInverse.rows())) {
178 cmnThrow(std::runtime_error("nmrPInverseDynamicData: Size of matrix pInverse is incorrect."));
179 }
180 if (pInverse.StorageOrder() != StorageOrderMember) {
181 cmnThrow(std::runtime_error("nmrPInverseDynamicData: Storage order of pInverse is incorrect."));
182 }
183 }
184
192 template <typename _vectorOwnerTypeWorkspace>
193 inline void
195 CISST_THROW(std::runtime_error)
196 {
198 if (lwork > workspace.size()) {
199 cmnThrow(std::runtime_error("nmrPInverseDynamicData: Workspace is too small."));
200 }
201 if (!workspace.IsCompact()) {
202 cmnThrow(std::runtime_error("nmrPInverseDynamicData: Workspace must be compact."));
203 }
204 }
205
206
207public:
214 {
215 const size_type minmn = (m < n) ? m : n;
216 const size_type maxmn = (m > n) ? m : n;
217 const size_type lwork_1 = 3 * minmn + maxmn;
218 const size_type lwork_2 = 5 * minmn;
219 const size_type lwork = (lwork_1 > lwork_2) ? lwork_1 : lwork_2;
220 // u vt s workspace p = s^+ ut
221 return m * m + n * n + minmn + lwork + n * m;
222 }
223
229 template <class _matrixOwnerTypeA>
234
235#ifndef SWIG
236#ifndef DOXYGEN
243 class Friend {
244 private:
246 public:
247 Friend(nmrPInverseDynamicData &data): Data(data) {
248 }
250 return Data.SReference;
251 }
253 return Data.PInverseReference;
254 }
256 return Data.UReference;
257 }
259 return Data.VtReference;
260 }
262 return Data.WorkspaceReference;
263 }
264 inline size_type M(void) {
265 return Data.MMember;
266 }
267 inline size_type N(void) {
268 return Data.NMember;
269 }
270 inline bool StorageOrder(void) {
271 return Data.StorageOrderMember;
272 }
273 };
274 friend class Friend;
275#endif // DOXYGEN
276#endif // #ifndef SWIG
277
285 MMember(static_cast<size_type>(0)),
286 NMember(static_cast<size_type>(0)),
288 {
289 AllocateOutputWorkspace(false, false);
290 };
291
292
300 template <class _matrixOwnerTypeA>
302 {
303 this->Allocate(A.rows(), A.cols(), A.StorageOrder());
304 }
305
315 template <class _matrixOwnerTypeA, class _vectorOwnerTypeWorkspace>
321
331 template <class _matrixOwnerTypeA,
332 class _matrixOwnerTypePInverse,
333 class _vectorOwnerTypeWorkspace>
340
352 template <class _matrixOwnerTypeA, class _matrixOwnerTypePInverse>
358
359
371 template <class _matrixOwnerTypeA>
373 {
374 this->SetDimension(A.rows(), A.cols(), A.StorageOrder());
375 this->AllocateOutputWorkspace(true, true);
376 }
377
378
397 template <class _matrixOwnerTypeA, class _vectorOwnerTypeWorkspace>
400 {
401 this->SetDimension(A.rows(), A.cols(), A.StorageOrder());
402 this->AllocateOutputWorkspace(true, false);
403 // call helper method to set references for SVD components
404 this->ThrowUnlessWorkspaceSizeIsCorrect(workspace);
405 this->SetRefSVD(workspace);
406 }
407
418 template <class _matrixOwnerTypePInverse,
419 class _vectorOwnerTypeWorkspace>
422 {
423 this->SetDimension(pInverse.cols(), pInverse.rows(), pInverse.StorageOrder());
424 this->AllocateOutputWorkspace(false, false);
425 // set reference on output
426 this->ThrowUnlessOutputSizeIsCorrect(pInverse);
427 this->PInverseReference.SetRef(pInverse);
428 // set reference on workspace
429 this->ThrowUnlessWorkspaceSizeIsCorrect(workspace);
430 this->SetRefSVD(workspace);
431 }
432
447 template <class _matrixOwnerTypePInverse>
449 {
450 this->SetDimension(pInverse.cols(), pInverse.rows(), pInverse.StorageOrder());
451 this->AllocateOutputWorkspace(false, true);
452 this->ThrowUnlessOutputSizeIsCorrect(pInverse);
453 this->PInverseReference.SetRef(pInverse);
454 }
455
456
457
458public:
467 inline const vctDynamicVectorRef<CISSTNETLIB_DOUBLE> &S(void) const {
468 return SReference;
469 }
470 inline const vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> &U(void) const {
471 return UReference;
472 }
473 inline const vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> &Vt(void) const {
474 return VtReference;
475 }
477 return PInverseReference;
478 }
479
480};
481
482
483#ifndef SWIG
484/*
485 ****************************************************************************
486 FIXED SIZE
487 ****************************************************************************
488 */
489
496template <vct::size_type _rows, vct::size_type _cols, bool _storageOrder>
498{
499public:
501#ifndef DOXYGEN
502 enum {MIN_MN = (_rows < _cols) ? _rows : _cols};
503 enum {LWORK_1 = (3 * MIN_MN + (_rows > _cols)) ? _rows : _cols};
504 enum {LWORK_2 = 5 * MIN_MN};
505 enum {LWORK_3 =
506 (static_cast<size_type>(LWORK_1) > static_cast<size_type>(LWORK_2))
507 ?
508 static_cast<size_type>(LWORK_1)
509 :
510 static_cast<size_type>(LWORK_2)};
511 enum {LWORK = _rows * _rows + _cols * _cols + static_cast<size_type>(MIN_MN) + static_cast<size_type>(LWORK_3) + _rows * _cols};
512#endif // DOXYGEN
513
529private:
531 MatrixTypePInverse PInverseMember;
532
536 VectorTypeWorkspace WorkspaceMember;
537
540 MatrixTypeU UReference;
541 MatrixTypeVt VtReference;
542 VectorTypeS SReference;
543 VectorTypeSVDWorkspace SVDWorkspaceReference;
544 MatrixTypeP PReference;
545 //*}
546
547public:
548
549#ifndef DOXYGEN
550 /* This class is not intended to be a top-level API. It has been
551 provided to avoid making the templated PInverse function as a
552 friend of this class, which turns out to be not so easy with
553 Visual C++ 7. Instead the Friend class provides a cumbersome way
554 to get non-const references to the private data. In order to
555 get non-const references the user has to first create a object
556 of nmrPInverseFixedSizeData::Friend and then user get* method on
557 that object. Our philosophy here is that this should be deterent
558 for a general user and should ring alarm bells in a reasonable
559 programmer.
560 */
561 class Friend {
562 private:
564 public:
568 return Data.PInverseMember;
569 }
570 inline VectorTypeS & S(void) {
571 return Data.SReference;
572 }
573 inline MatrixTypeU & U(void) {
574 return Data.UReference;
575 }
576 inline MatrixTypeVt & Vt(void) {
577 return Data.VtReference;
578 }
580 return Data.WorkspaceMember;
581 }
582 inline MatrixTypeP & P(void) {
583 return Data.PReference;
584 }
585 };
586 friend class Friend;
587#endif
588
594 UReference(WorkspaceMember.Pointer(0)),
595 VtReference(WorkspaceMember.Pointer(_rows * _rows)),
596 SReference(WorkspaceMember.Pointer(_rows * _rows + _cols * _cols)),
597 SVDWorkspaceReference(WorkspaceMember.Pointer(_rows * _rows + _cols * _cols + MIN_MN)),
598 PReference(WorkspaceMember.Pointer(_rows * _rows + _cols * _cols + MIN_MN + LWORK_3))
599 {};
600
609 inline const MatrixTypePInverse & PInverse(void) const {
610 return PInverseMember;
611 }
612 inline const VectorTypeS & S(void) const {
613 return SReference;
614 }
615 inline const MatrixTypeU & U(void) const {
616 return UReference;
617 }
618 inline const MatrixTypeVt & Vt(void) const {
619 return VtReference;
620 }
621 inline const MatrixTypeP & P(void) const {
622 return PReference;
623 }
624
625};
626#endif // #ifndef SWIG
627
628
763
783template <class _matrixOwnerType>
785{
786 typedef vct::size_type size_type;
787
788 typename nmrPInverseDynamicData::Friend dataFriend(data);
789 CISSTNETLIB_INTEGER ret_value;
790 /* check that the size and storage order matches with Allocate() */
791 if (A.StorageOrder() != dataFriend.StorageOrder()) {
792 cmnThrow(std::runtime_error("nmrPInverse Solve: Storage order used for Allocate was different"));
793 }
794 if ((A.rows() != dataFriend.M()) || (A.cols() != dataFriend.N())) {
795 cmnThrow(std::runtime_error("nmrPInverse Solve: Size used for Allocate was different"));
796 }
797 const size_type rows = A.rows();
798 const size_type cols = A.cols();
799 const size_type minmn = (rows < cols) ? rows : cols;
800 const size_type maxmn = (rows > cols) ? rows : cols;
801
802 ret_value = nmrSVD(A, dataFriend.U(), dataFriend.S(),
803 dataFriend.Vt(), dataFriend.Workspace());
804 const CISSTNETLIB_DOUBLE eps = cmnTypeTraits<CISSTNETLIB_DOUBLE>::Tolerance() * dataFriend.S().at(0) * maxmn;
805
806 dataFriend.PInverse().SetAll(0);
807 CISSTNETLIB_DOUBLE singularValue;
808 size_type irank, i, j;
809 for (irank = 0; irank < minmn; irank++) {
810 if ((singularValue = dataFriend.S().at(irank)) > eps) {
811 for (j = 0; j < rows; j++) {
812 for (i = 0; i < cols; i++) {
813 dataFriend.PInverse().at(i, j) = dataFriend.PInverse().at(i, j)
814 + dataFriend.Vt().at(irank, i) * dataFriend.U().at(j, irank) / singularValue;
815 }
816 }
817 }
818 }
819 return ret_value;
820}
821
822
839template <class _matrixOwnerTypeA, class _matrixOwnerTypePInverse, class _vectorOwnerTypeWorkspace>
842{
843 nmrPInverseDynamicData svdData(A, PInverse, Workspace);
844 CISSTNETLIB_INTEGER ret_value = nmrPInverse(A, svdData);
845 return ret_value;
846}
847
848
862
863template <class _matrixOwnerTypeA, class _matrixOwnerTypePInverse>
866{
867 nmrPInverseDynamicData svdData(A, PInverse);
868 CISSTNETLIB_INTEGER ret_value = nmrPInverse(A, svdData);
869 return ret_value;
870}
871
872
873#ifndef SWIG
891template <vct::size_type _rows, vct::size_type _cols, vct::size_type _work, bool _storageOrder, class _dataPtrType>
895{
896 typedef vct::size_type size_type;
897#if CMN_ASSERT_IS_DEFINED
899#endif
902 const size_type maxmn = (_rows > _cols) ? _rows : _cols;
903 //Assert if requirement is greater than size provided!
904 CMN_ASSERT(lwork <= _work);
905 // split Work into submatrices and vectors
906 // for this we simply use the nmrSVD with dynamic ref as parameters as we dont have
907 // nmrSVD with fixedsizeref as parameters
910 (_storageOrder) ? _rows : 1,
911 (_storageOrder) ? 1 : _rows,
912 workspace.Pointer(0));
914 (_storageOrder) ? _cols : 1,
915 (_storageOrder) ? 1 : _cols,
916 workspace.Pointer(_rows*_rows));
918 workspace.Pointer(_rows * _rows + _cols * _cols));
919 vctDynamicVectorRef<CISSTNETLIB_DOUBLE> SVDWorkspaceRef(lwork_3,
920 workspace.Pointer(_rows * _rows + _cols * _cols + minmn));
921 vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> PRef(_cols, _rows, (_storageOrder) ? _rows : 1, (_storageOrder) ? 1 : _cols,
922 workspace.Pointer(_rows * _rows + _cols * _cols + minmn + lwork_3));
923 vctDynamicMatrixRef<CISSTNETLIB_DOUBLE> pInverseRef(pInverse);
924 CISSTNETLIB_INTEGER ret_value;
925 ret_value = nmrSVD(ARef, URef, SRef, VtRef, SVDWorkspaceRef);
926 const CISSTNETLIB_DOUBLE eps = cmnTypeTraits<CISSTNETLIB_DOUBLE>::Tolerance() * SRef(0) * maxmn;
927 /*
928 vctDynamicMatrix<CISSTNETLIB_DOUBLE> SM (_cols, _rows, _storageOrder);
929 SM.SetAll(0.);
930 for (size_type irank = 0; irank < minmn; irank++) {
931 if (SRef(irank) > eps) {
932 SM(irank, irank) = 1.0/SRef(irank);
933 }
934 }
935 PRef.ProductOf(SM, URef.Transpose());
936 */
937 size_type irank;
938 PRef.SetAll(0.);
939 for (irank = 0; irank < minmn; irank++) {
940 if (SRef(irank) > eps) {
941 PRef.Row(irank).ProductOf(URef.Transpose().Row(irank), 1.0/SRef(irank));
942 } else {
943 PRef.Row(irank).SetAll(0.);
944 }
945 }
946 pInverseRef.ProductOf(VtRef.Transpose(), PRef);
947
948 return ret_value;
949}
950
966template <vct::size_type _rows, vct::size_type _cols, bool _storageOrder>
969{
971 CISSTNETLIB_INTEGER ret_value = nmrPInverse(A, pInverse, workspace);
972 return ret_value;
973}
974
995template <vct::size_type _rows, vct::size_type _cols, bool _storageOrder>
998{
1000 /* all the checking is done by SVD */
1001 CISSTNETLIB_INTEGER ret_value = nmrPInverse(A, dataFriend.PInverse(), dataFriend.Workspace());
1002 return ret_value;
1003}
1004#endif // #ifndef SWIG
1005
1007
1008
1009#endif
static Type Tolerance(void)
Definition cmnTypeTraits.h:170
Definition nmrPInverse.h:243
size_type N(void)
Definition nmrPInverse.h:267
size_type M(void)
Definition nmrPInverse.h:264
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & U(void)
Definition nmrPInverse.h:255
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & PInverse(void)
Definition nmrPInverse.h:252
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & Vt(void)
Definition nmrPInverse.h:258
vctDynamicVectorRef< CISSTNETLIB_DOUBLE > & Workspace(void)
Definition nmrPInverse.h:261
vctDynamicVectorRef< CISSTNETLIB_DOUBLE > & S(void)
Definition nmrPInverse.h:249
bool StorageOrder(void)
Definition nmrPInverse.h:270
Friend(nmrPInverseDynamicData &data)
Definition nmrPInverse.h:247
Definition nmrPInverse.h:46
void SetRef(vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
Definition nmrPInverse.h:420
vct::size_type size_type
Definition nmrPInverse.h:54
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > PInverseReference
Definition nmrPInverse.h:73
const vctDynamicVectorRef< CISSTNETLIB_DOUBLE > & S(void) const
Definition nmrPInverse.h:467
size_type NMember
Definition nmrPInverse.h:84
void SetRefWorkspace(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
Definition nmrPInverse.h:398
nmrPInverseDynamicData()
Definition nmrPInverse.h:284
const vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & Vt(void) const
Definition nmrPInverse.h:473
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > UReference
Definition nmrPInverse.h:74
void AllocateOutputWorkspace(bool allocateOutput, bool allocateWorkspace)
Definition nmrPInverse.h:112
void ThrowUnlessWorkspaceSizeIsCorrect(vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace) const CISST_THROW(std
Definition nmrPInverse.h:194
void SetDimension(size_type m, size_type n, bool storageOrder)
Definition nmrPInverse.h:92
size_type MMember
Definition nmrPInverse.h:83
vctDynamicVector< CISSTNETLIB_DOUBLE > WorkspaceMemory
Definition nmrPInverse.h:64
vctDynamicVectorRef< CISSTNETLIB_DOUBLE > SReference
Definition nmrPInverse.h:76
vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > VtReference
Definition nmrPInverse.h:75
void SetRefOutput(vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse)
Definition nmrPInverse.h:448
nmrPInverseDynamicData(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &CMN_UNUSED(A), vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
Definition nmrPInverse.h:334
static size_type WorkspaceSize(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A)
Definition nmrPInverse.h:230
void Allocate(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A)
Definition nmrPInverse.h:372
bool StorageOrderMember
Definition nmrPInverse.h:85
void SetRefSVD(vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
Definition nmrPInverse.h:141
const vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & PInverse(void) const
Definition nmrPInverse.h:476
nmrPInverseDynamicData(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &CMN_UNUSED(A), vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse)
Definition nmrPInverse.h:353
void ThrowUnlessOutputSizeIsCorrect(vctDynamicMatrixBase< _matrixOwnerTypePInverse, CISSTNETLIB_DOUBLE > &pInverse) const CISST_THROW(std
Definition nmrPInverse.h:173
nmrPInverseDynamicData(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A)
Definition nmrPInverse.h:301
vctDynamicVector< CISSTNETLIB_DOUBLE > OutputMemory
Definition nmrPInverse.h:68
const vctDynamicMatrixRef< CISSTNETLIB_DOUBLE > & U(void) const
Definition nmrPInverse.h:470
nmrPInverseDynamicData(vctDynamicMatrixBase< _matrixOwnerTypeA, CISSTNETLIB_DOUBLE > &A, vctDynamicVectorBase< _vectorOwnerTypeWorkspace, CISSTNETLIB_DOUBLE > &workspace)
Definition nmrPInverse.h:316
static size_type WorkspaceSize(size_type m, size_type n)
Definition nmrPInverse.h:213
vctDynamicVectorRef< CISSTNETLIB_DOUBLE > WorkspaceReference
Definition nmrPInverse.h:77
Definition nmrPInverse.h:561
MatrixTypePInverse & PInverse(void)
Definition nmrPInverse.h:567
MatrixTypeP & P(void)
Definition nmrPInverse.h:582
VectorTypeS & S(void)
Definition nmrPInverse.h:570
MatrixTypeU & U(void)
Definition nmrPInverse.h:573
MatrixTypeVt & Vt(void)
Definition nmrPInverse.h:576
Friend(nmrPInverseFixedSizeData< _rows, _cols, _storageOrder > &data)
Definition nmrPInverse.h:565
VectorTypeWorkspace & Workspace(void)
Definition nmrPInverse.h:579
Definition nmrPInverse.h:498
vct::size_type size_type
Definition nmrPInverse.h:500
@ LWORK_1
Definition nmrPInverse.h:503
@ LWORK_3
Definition nmrPInverse.h:505
vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _rows, _cols, _storageOrder > MatrixTypeA
Definition nmrPInverse.h:515
const MatrixTypeU & U(void) const
Definition nmrPInverse.h:615
nmrPInverseFixedSizeData()
Definition nmrPInverse.h:593
const VectorTypeS & S(void) const
Definition nmrPInverse.h:612
vctFixedSizeVectorRef< CISSTNETLIB_DOUBLE, MIN_MN, 1 > VectorTypeS
Definition nmrPInverse.h:525
vctFixedSizeMatrixRef< CISSTNETLIB_DOUBLE, _cols, _cols, _storageOrder ? _cols :1, _storageOrder ? 1 :_cols > MatrixTypeVt
Definition nmrPInverse.h:523
@ LWORK
Definition nmrPInverse.h:511
vctFixedSizeMatrix< CISSTNETLIB_DOUBLE, _cols, _rows, _storageOrder > MatrixTypePInverse
Definition nmrPInverse.h:517
const MatrixTypePInverse & PInverse(void) const
Definition nmrPInverse.h:609
vctFixedSizeVector< CISSTNETLIB_DOUBLE, LWORK > VectorTypeWorkspace
Definition nmrPInverse.h:519
const MatrixTypeP & P(void) const
Definition nmrPInverse.h:621
@ MIN_MN
Definition nmrPInverse.h:502
vctFixedSizeMatrixRef< CISSTNETLIB_DOUBLE, _cols, _rows, _storageOrder? _cols :1, _storageOrder ? 1 :_rows > MatrixTypeP
Definition nmrPInverse.h:528
const MatrixTypeVt & Vt(void) const
Definition nmrPInverse.h:618
@ LWORK_2
Definition nmrPInverse.h:504
vctFixedSizeVectorRef< CISSTNETLIB_DOUBLE, LWORK_3, 1 > VectorTypeSVDWorkspace
Definition nmrPInverse.h:527
vctFixedSizeMatrixRef< CISSTNETLIB_DOUBLE, _rows, _rows, _storageOrder ? _rows :1, _storageOrder ? 1 :_rows > MatrixTypeU
Definition nmrPInverse.h:521
static size_type WorkspaceSize(size_type m, size_type n)
Definition nmrSVD.h:296
Definition vctDynamicMatrixBase.h:43
RowRefType Row(size_type index) CISST_THROW(std
Definition vctDynamicMatrixBase.h:227
reference at(size_type index) CISST_THROW(std
Definition vctDynamicMatrixBase.h:171
value_type SetAll(const value_type value)
Definition vctDynamicMatrixBase.h:452
ThisType & ProductOf(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &matrix, const value_type scalar)
Definition vctDynamicMatrixBase.h:971
Dynamic matrix referencing existing memory.
Definition vctDynamicMatrixRef.h:75
void SetRef(size_type rows, size_type cols, stride_type rowStride, stride_type colStride, pointer dataPointer)
Definition vctDynamicMatrixRef.h:217
Definition vctDynamicVectorBase.h:62
pointer Pointer(index_type index=0)
Definition vctDynamicVectorBase.h:155
reference at(index_type index) CISST_THROW(std
Definition vctDynamicVectorBase.h:170
Definition vctForwardDeclarations.h:131
Dynamic vector referencing existing memory.
Definition vctDynamicVectorRef.h:78
void SetRef(size_type size, pointer data, stride_type stride=1)
Definition vctDynamicVectorRef.h:156
Implementation of a fixed-size matrix using template metaprogramming.
Definition vctFixedSizeMatrix.h:54
Definition vctForwardDeclarations.h:110
A template for a fixed length vector with fixed spacing in memory.
Definition vctFixedSizeVectorBase.h:77
pointer Pointer(size_type index=0)
Definition vctFixedSizeVectorBase.h:226
Implementation of a fixed-size vector using template metaprogramming.
Definition vctFixedSizeVector.h:54
Definition vctForwardDeclarations.h:89
#define CMN_ASSERT(expr)
Definition cmnAssert.h:97
#define CMN_UNUSED(argument)
Definition cmnPortability.h:497
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
Declaration of the template function cmnThrow.
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition cmnThrow.h:76
size_t size_type
Definition vctContainerTraits.h:35
Rules of exporting.
CISSTNETLIB_INTEGER nmrPInverse(vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A, nmrPInverseDynamicData &data) CISST_THROW(std
Definition nmrPInverse.h:784
Declaration of nmrSVD.
CISSTNETLIB_INTEGER nmrSVD(vctDynamicMatrixBase< _matrixOwnerType, CISSTNETLIB_DOUBLE > &A, nmrSVDDynamicData &data) CISST_THROW(std
Definition nmrSVD.h:998
size_type cols() const
Definition vctDynamicConstMatrixBase.h:243
const_pointer Pointer(index_type rowIndex, index_type colIndex) const
Definition vctDynamicConstMatrixBase.h:306
size_type rows() const
Definition vctDynamicConstMatrixBase.h:238
Declaration of vctDynamicMatrix.
Declaration of vctFixedSizeMatrix.
const bool VCT_COL_MAJOR
Definition vctForwardDeclarations.h:44