|
19 | 19 | #include "adjustment.h" |
20 | 20 | #include "constraints.h" |
21 | 21 | #include "global.h" |
| 22 | +#include "matfun.h" |
22 | 23 | #include "matrix.h" |
23 | 24 |
|
24 | 25 | #include <QString> |
|
27 | 28 | #include "qassert.h" |
28 | 29 | #include "qcontainerfwd.h" |
29 | 30 | #include "qlogging.h" |
30 | | -#include "qtdeprecationdefinitions.h" |
31 | 31 |
|
32 | 32 | #include <algorithm> |
33 | 33 | #include <cassert> |
34 | | -#include <cfloat> |
35 | 34 | #include <cmath> |
36 | 35 | #include <memory> |
37 | 36 | #include <numeric> |
@@ -67,48 +66,6 @@ Index AdjustmentFramework::indexOf(const Eigen::VectorXi &v, const Index i) |
67 | 66 | return std::distance( v.begin(), it); */ |
68 | 67 | } |
69 | 68 |
|
70 | | -MatrixXd AdjustmentFramework::Rot_ab(const VectorXd &a, const VectorXd &b) |
71 | | -{ |
72 | | - Q_ASSERT( a.size()==b.size()); |
73 | | -#ifdef QT_DEBUG |
74 | | - Q_ASSERT( fabs( a.norm()-1.) < FLT_EPSILON ); |
75 | | - Q_ASSERT( fabs( b.norm()-1.) < FLT_EPSILON ); |
76 | | -#endif |
77 | | - return MatrixXd::Identity( a.size(),a.size()) |
78 | | - +2*b*a.adjoint() |
79 | | - -(a+b)*(a+b).adjoint()/(1.+a.dot(b)); |
80 | | -} |
81 | | - |
82 | | -MatrixXd AdjustmentFramework::null(const VectorXd &xs) |
83 | | -{ |
84 | | - // cf. PCV, eq. (A.120) |
85 | | - |
86 | | - //if ( fabs(xs.norm()-1.) > T_ZERO ) |
87 | | - // qDebug() << xs; |
88 | | - |
89 | | -#ifdef QT_DEBUG |
90 | | - QString const what = QStringLiteral("norm(x) = %1").arg(QString::number(xs.norm())); |
91 | | - Q_ASSERT_X(std::fabs(xs.norm() - 1.) <= FLT_EPSILON, Q_FUNC_INFO, what.toStdString().data()); |
92 | | -#endif |
93 | | - Eigen::Index const N = xs.size(); |
94 | | - |
95 | | - VectorXd x0 = xs.head(N-1); |
96 | | - double xN = xs(N-1); |
97 | | - if ( xN < 0.0 ) { |
98 | | - x0 = -x0; |
99 | | - xN = -xN; |
100 | | - } |
101 | | - |
102 | | - MatrixXd JJ( N, N-1); |
103 | | - JJ.topRows(N-1) = MatrixXd::Identity(N-1,N-1) -x0*x0.adjoint()/(1.+xN); |
104 | | - JJ.bottomRows(1) = -x0.adjoint(); |
105 | | - |
106 | | - VectorXd const check = JJ.adjoint()*xs; |
107 | | -#ifdef QT_DEBUG |
108 | | - Q_ASSERT_X( check.norm() <= FLT_EPSILON, Q_FUNC_INFO, "not a zero vector"); |
109 | | -#endif |
110 | | - return JJ; |
111 | | -} |
112 | 69 |
|
113 | 70 | std::pair<VectorXd,MatrixXd > |
114 | 71 | AdjustmentFramework::getEntity( const Index s, |
@@ -433,10 +390,3 @@ void AdjustmentFramework::check_constraints( |
433 | 390 | } |
434 | 391 | } |
435 | 392 |
|
436 | | -//! check if the matrix AA is rank-deficient |
437 | | -bool AdjustmentFramework::is_rank_deficient( Eigen::SparseMatrix<double,Eigen::ColMajor> & AA, const double T ) |
438 | | -{ |
439 | | - Eigen::ColPivHouseholderQR<MatrixXd> qr(AA); |
440 | | - qr.setThreshold( T ); |
441 | | - return ( qr.rank() < AA.rows() ); |
442 | | -} |
0 commit comments