#include <MathAlgo/SVD3x3.hh>


Public Member Functions | |
| const int | AbsLeftNullspaceDim () const |
| returns the dim of the matrix's left nullspace, using absolute threshold criterion | |
| const int | AbsNullspaceDim () const |
| returns dim of nullspace using the absolute threshold criterion | |
| const int | AbsRightNullspaceDim () const |
| returns the dim of the matrix's right nullspace, using absolute threshold criterion | |
| void | AddDebugLevel (const std::string &name) |
| void | AddDebugLevel (const long int lv) |
| int | compute (const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD) |
| use our naming convention | |
| int | Compute (const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD) |
| set a new matrix and compute its decomposition. | |
| bool | DebugLevelIsSet (const std::string &name) const |
| bool | DebugLevelIsSet (const long int lv) const |
| int | General_Eigenproblem_GeneralMatrix_Lapack (const Matrix< double > &M) |
| solve the general (non-special) eigenvalue/eigenvector problem of a general (non-symmetric) matrix M calls the extern liblapack routine dgesvd . | |
| int | GetDebugLevel () const |
| void | GetDebugStream (std::ostream &os) const |
| std::ostream & | GetDebugStream () const |
| BIAS::Vector< double > | GetEigenValues () |
| Call this after Compute(), returns the eigenvalues of the matrix in ascending order (smallest first), which are NOT the singular values! Works only, if the original Matrix was symmetric. | |
| Vector< double > | GetLeftNullvector (const int last_offset=0) |
| same as above but returning vector | |
| bool | GetLeftNullvector (Vector< double > &nv, const int last_offset=0) |
| Return one of the left nullvectors. | |
| bool | GetNullvector (Vector< double > &NullVec, const int last_offset=0) |
| Returns one of the nullvectors in argument and true if Nullvector exists. | |
| Vector< double > | GetNullvector (const int last_offset=0) |
| return one of the nullvectors. | |
| const Vector< double > & | GetS () const |
| return S which is a vector of the singular values of A in descending order. | |
| const double | GetSingularValue (int index) const |
| return one singular value (which may be zero). | |
| const Matrix< double > & | GetU () const |
| return U U is a m x m orthogonal matrix | |
| Matrix< double > | GetV () const |
| return V | |
| const Matrix< double > & | GetVT () const |
| return VT (=transposed(V)) | |
| double | GetZeroThreshold () const |
| return zerothresh currently used | |
| Matrix< double > | Invert (Matrix< double > A) |
| as above, but compute new svd for a | |
| Matrix< double > | Invert (int rank) |
| returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T the first "rank" elements of S are inverted the others are set to zero | |
| Matrix< double > | Invert () |
| returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T | |
| const int | LeftNullspaceDim () const |
| returns the dim of the matrix's left nullspace | |
| long int | Name2DebugLevel (const std::string &name) const |
| looks up a debuglevel in the internal map, returns 0 if not found | |
| long int | NewDebugLevel (const std::string &name) |
| creates a new debuglevel | |
| const int | NullspaceDim () const |
| return the dim of the nullspace. | |
| void | PrintDebugLevel (std::ostream &os=std::cout) const |
| unsigned int | Rank () |
| returns the rank of A_ | |
| const int | RelLeftNullspaceDim () const |
| const int | RelNullspaceDim () const |
| compare singular values against greatest, not absolute | |
| const int | RelRightNullspaceDim () const |
| void | RemoveDebugLevel (const std::string &name) |
| void | RemoveDebugLevel (const long int lv) |
| const int | RightNullspaceDim () const |
| returns the dim of the matrix's right nullspace | |
| void | SetDebugLevel (const std::string &name) |
| void | SetDebugLevel (const long int lv) |
| void | SetDebugStream (const std::ostream &os) |
| void | ShowDebugLevel (std::ostream &os=std::cout) const |
| prints all internally known debuglevels | |
| int | size () const |
| return the length of the singular value vector inline const int size() const | |
| Vector< double > | solve (const Vector< double > &y) const |
| use our naming convention | |
| int | Solve (Matrix< double > &A, Vector< double > &B, Vector< double > &X) |
| solves the overdetermined linear system $AX=B$ with the unknown $X$, where $A$ is an $m x n$ matrix ($m>n$)and B is a vector of size $m$. | |
| Vector< double > | Solve (const Vector< double > &y) const |
| Matrix< double > | Sqrt (const Matrix< double > &A) |
| as above, but compute new svd for a | |
| Matrix< double > | Sqrt () |
| returns the square root of a symmetric positive definite matrix M A = sqrt(M) = U * sqrt(S) * V_T, such that A*A = M. | |
| Matrix< double > | SqrtT (const Matrix< double > &A) |
| as above, but compute new svd for a | |
| Matrix< double > | SqrtT () |
| returns the square root of a symmetric positive definite matrix M A = sqrt(M) = U * sqrt(S), such that A*A^T = M. | |
| SVD3x3 (const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD) | |
| constructor solve the general eigenproblem of the rectangular matrix M | |
| SVD3x3 () | |
| virtual | ~SVD3x3 () |
Static Public Member Functions | |
| static long int | GetGlobalDebugLevel () |
| static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
| void | _Swap (int a, int b) |
| long | ConsumeNextFreeDebuglevel_ () |
| returns the next available debuglevel | |
Protected Attributes | |
| long int | _liDebugLevel |
| long int | _liNextDebugLevel |
| new concept, debuglevel are managed here in the debug class | |
| std::map< std::string, long int > | _String2Debuglevel |
| Matrix< double > | A_ |
| data members: original matrix (to be decomposed) | |
| bool | AbsoluteZeroThreshold_ |
| determines whether we compare singular-values directly (absolute) to the zero threshold or whether we compare the ratio of the sing-value under inspection and the largest one to the threshold (relative) | |
| bool | Decomposed_ |
| flag for holding decomposed matrix | |
| Vector< double > | S_ |
| contains the singular values of A_ corresponding to the i'th column in descending order. | |
| Matrix< double > | U_ |
| contains columnwise the left singular vectors of A_ corresponding to the i'th singular value | |
| Matrix< double > | VT_ |
| contains the right singular vectors of A- in rows [beause VT is transpose(V) ] | |
| double | ZeroThreshold_ |
| values below this threshold are treated as zero | |
Static Protected Attributes | |
| static std::ostream | _zDebugStream |
| static long int | GlobalDebugLevel = 0 |
koeser: There is an example matrix F[0][0] =0.00075284066373225704; F[0][1] =-0.099906426438442303; F[0][2] =0.16267766990357244; F[1][0] =0.10333163045064053; F[1][1] =0.0014727467665194025; F[1][2] =0.6803859609102173; F[2][0] =-0.16234020366691171; F[2][1] =-0.68087420277635458; F[2][2] =0.0021896762792443826; where the svd fails (at least) on p4 systems with gcc 3.3.1 and 3.3.3 with -O3 (independent of march-flag), but where it does not fail with O2. SVD3x3 is implemented as an algorithm, which computes each singular value and corresponding vector by iterating until some error measure e becomes small compared to a reference value ref: if (ref+e==ref) then converged=true; With O3 this condition never becomes true for the second singular value, because the difference of lhs and rhs stays at 1e-18, while in O2 this converges after two iterations to zero. We have problems here in the order of machine precision, the question is now whether this different behaviour of O2 and O3 is due to a compiler error or an algorithmic weakness. When tracing back the two execution branches of ExampleSVD3x3 (O2 and O3), which uses the above matrix one finds that in the very beginning, s and a[k][i] are absolutely the same before the line: s += a[k][i]*a[k][i]; and after this line s differs by the last digit. Such effects sum up and result in the failing of the convergence of the SVD. Debugging in O3 is complicated because every cout causes a side-effect and changes execution order and results, so I found that even adding one simple cout at some line made the algorithm converge for that example.
In my opinion this means that the svd algorihtm makes some convergence assumptions about values in the order of machine precision which are not always fulfilled, therefore it does not converge. This is just one example which happens with O3 but there may also be one for O2, which we have not found ? It may however also be an optimization "error" of gcc.
Definition at line 74 of file SVD3x3.hh.
| SVD3x3::SVD3x3 | ( | ) |
Definition at line 40 of file SVD3x3.cpp.
References BIAS::SVD::A_, BIAS::SVD::Decomposed_, DEFAULT_DOUBLE_ZERO_THRESHOLD, TNT::Vector< T >::newsize(), TNT::Matrix< T >::newsize(), BIAS::SVD::S_, BIAS::SVD::U_, BIAS::SVD::VT_, and BIAS::SVD::ZeroThreshold_.
| SVD3x3::SVD3x3 | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD | |||
| ) |
constructor solve the general eigenproblem of the rectangular matrix M
Definition at line 50 of file SVD3x3.cpp.
References BIAS::SVD::A_, Compute(), TNT::Vector< T >::newsize(), TNT::Matrix< T >::newsize(), BIAS::SVD::S_, BIAS::SVD::U_, and BIAS::SVD::VT_.
| void BIAS::SVD3x3::_Swap | ( | int | a, | |
| int | b | |||
| ) | [inline, protected] |
| const int SVD::AbsLeftNullspaceDim | ( | ) | const [inherited] |
returns the dim of the matrix's left nullspace, using absolute threshold criterion
Definition at line 380 of file SVD.cpp.
References BIAS::SVD::A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, TNT::Vector< T >::size(), and BIAS::SVD::ZeroThreshold_.
| const int SVD::AbsNullspaceDim | ( | ) | const [inherited] |
returns dim of nullspace using the absolute threshold criterion
For rectangular matrices this is the number of singular values which are (about) zero. The nullspace is spaned by the singular vectors corresponding to the zero singular values. woelk 4 2003: changed API, diffentiate between Left and Right Nullspace
Definition at line 328 of file SVD.cpp.
References BIAS::SVD::A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, TNT::Vector< T >::size(), and BIAS::SVD::ZeroThreshold_.
Referenced by BIAS::SVD::AbsRightNullspaceDim().
| const int SVD::AbsRightNullspaceDim | ( | ) | const [inherited] |
returns the dim of the matrix's right nullspace, using absolute threshold criterion
Definition at line 372 of file SVD.cpp.
References BIAS::SVD::AbsNullspaceDim().
| void BIAS::Debug::AddDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::AddDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Definition at line 347 of file Debug.hh.
Referenced by BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), main(), BIAS::PMDImageProc::PreparePolyDepthCalibration(), and BIAS::RANSAC< SolutionType >::RANSAC().
| int BIAS::SVD::compute | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD | |||
| ) | [inline, inherited] |
use our naming convention
Definition at line 129 of file SVD.hh.
Referenced by BIAS::PMatrix::MakeSVD_().
| int SVD3x3::Compute | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD | |||
| ) |
set a new matrix and compute its decomposition.
this function is based on svdcmp from the numerical recipes in C
solves the general eigenproblem of the rectangular matrix M
Reimplemented from BIAS::SVD.
Definition at line 69 of file SVD3x3.cpp.
References _Swap(), BIAS::SVD::A_, BIASASSERT, BIASERR, BIAS::SVD::Decomposed_, BIAS::Vector< T >::GetData(), BIAS::Matrix< T >::GetDataArray1(), j, MAX, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), PYTHAG, res, BIAS::SVD::S_, SIGN, SVD_MAX_ITERATIONS, BIAS::SVD::U_, BIAS::SVD::VT_, and BIAS::SVD::ZeroThreshold_.
| long BIAS::Debug::ConsumeNextFreeDebuglevel_ | ( | ) | [inline, protected, inherited] |
| bool BIAS::Debug::DebugLevelIsSet | ( | const std::string & | name | ) | const [inline, inherited] |
| bool BIAS::Debug::DebugLevelIsSet | ( | const long int | lv | ) | const [inline, inherited] |
Definition at line 333 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::_CalcCornerness(), BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_CalculateKernels(), BIAS::Gauss< InputStorageType, OutputStorageType >::_CalculateKernels(), BIAS::LinearRegionDetector< StorageType, CalculationType >::_ComputeCornerness(), BIAS::CornerDetectorKLT< StorageType, CalculationType >::_ComputeCornerness(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::ImageBlender::BlendImages(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor3x3(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensorValid(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::Rescale< InputStorageType, OutputStorageType >::DownsampleBy2Color(), BIAS::Binomial< InputStorageType, OutputStorageType >::Filter3x3ValidGreyFloat(), BIAS::Binomial< InputStorageType, OutputStorageType >::Filter5x5ValidGreyFloat(), BIAS::Convolution< InputStorageType, OutputStorageType >::FilterFloat(), BIAS::Convolution< InputStorageType, OutputStorageType >::FilterInt(), BIAS::RANSAC< SolutionType >::GenerateSamplesRandom(), BIAS::GenSynthMatches::GetGTNormalizedF(), main(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), and BIAS::MonteCarloTransform::Transform().
| int SVD::General_Eigenproblem_GeneralMatrix_Lapack | ( | const Matrix< double > & | M | ) | [inherited] |
solve the general (non-special) eigenvalue/eigenvector problem of a general (non-symmetric) matrix M calls the extern liblapack routine dgesvd .
computes the genral singular value decomposition with M = U * Sigma(S) * VT with Sigma(S) is the qudratic, symmetric matrix which contains the singular vales in the diagonal and zero and zero else. U, VT as described in the data mambers.
Definition at line 56 of file SVD.cpp.
References BIAS::SVD::A_, BIAS::SVD::Decomposed_, General_singular_value_decomposition(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), res, BIAS::SVD::S_, TNT::Vector< T >::size(), BIAS::SVD::U_, and BIAS::SVD::VT_.
Referenced by BIAS::SVD::Compute().
| int BIAS::Debug::GetDebugLevel | ( | ) | const [inline, inherited] |
Definition at line 324 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::ImageAlignment::Align(), BIAS::ExampleDebug::func(), BIAS::FMatrix::GetEpipoles(), BIAS::listenthread(), main(), BIAS::GuiGTK::MouseMotionCallback_(), BIAS::Image< StorageType >::operator=(), BIAS::ImageBase::operator=(), BIAS::ExampleDebug::ResetDebugLevelFromGlobal(), BIAS::TrackerBaseAffine2< StorageType >::TrackAffine_(), and BIAS::TrackerBaseAffine< StorageType >::TrackAffine_().
| void BIAS::Debug::GetDebugStream | ( | std::ostream & | os | ) | const [inline, inherited] |
| std::ostream& BIAS::Debug::GetDebugStream | ( | ) | const [inline, inherited] |
Definition at line 397 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::RANSAC< SolutionType >::GenerateSamplesRandom(), and BIAS::GuiGTK::MouseMotionCallback_().
| BIAS::Vector< double > SVD::GetEigenValues | ( | ) | [inherited] |
Call this after Compute(), returns the eigenvalues of the matrix in ascending order (smallest first), which are NOT the singular values! Works only, if the original Matrix was symmetric.
Definition at line 486 of file SVD.cpp.
References BIAS::SVD::A_, BIAS::Matrix< T >::GetRow(), BIAS::Matrix< T >::GetRows(), and BIAS::SVD::VT_.
Referenced by BIAS::CamPoseCalib::SolveLM_().
| static long int BIAS::Debug::GetGlobalDebugLevel | ( | ) | [inline, static, inherited] |
Definition at line 423 of file Debug.hh.
Referenced by BIAS::ExampleDebug::func(), and BIAS::ExampleDebug::ResetDebugLevelFromGlobal().
| Vector< double > BIAS::SVD::GetLeftNullvector | ( | const int | last_offset = 0 |
) | [inline, inherited] |
same as above but returning vector
Definition at line 419 of file SVD.hh.
References BIASERR, BIAS::SVD::GetLeftNullvector(), TNT::Matrix< T >::num_rows(), and BIAS::SVD::VT_.
| bool BIAS::SVD::GetLeftNullvector | ( | Vector< double > & | nv, | |
| const int | last_offset = 0 | |||
| ) | [inline, inherited] |
Return one of the left nullvectors.
If last_offset=0 then the last nullvector (corresponding to the smallest singular value) is returned, if last_offset=1 then the last but one nullvector is returned, and so on. The last_offset must be in [0..NullspaceDim-1] otherwise 0 is returned
Definition at line 428 of file SVD.hh.
References BIASERR, TNT::Vector< T >::newsize(), BIAS::SVD::NullspaceDim(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, BIAS::SVD::U_, and BIAS::SVD::VT_.
Referenced by BIAS::TrifocalTensor::ComputeEpipoles(), BIAS::TrifocalTensor::GetEpipolarLines(), BIAS::FMatrix::GetEpipoles(), and BIAS::SVD::GetLeftNullvector().
| bool BIAS::SVD::GetNullvector | ( | Vector< double > & | NullVec, | |
| const int | last_offset = 0 | |||
| ) | [inline, inherited] |
Returns one of the nullvectors in argument and true if Nullvector exists.
if last_offset=0 then the last nullvector (corresponding to the smallest singular value) is returned, if last_offset=1 then the last but one nullvector is returned, and so on. The last_offset must be in [0..NullspaceDim-1].
Definition at line 398 of file SVD.hh.
References TNT::Vector< T >::newsize(), BIAS::SVD::NullspaceDim(), TNT::Matrix< T >::num_cols(), and BIAS::SVD::VT_.
| Vector< double > BIAS::SVD::GetNullvector | ( | const int | last_offset = 0 |
) | [inline, inherited] |
return one of the nullvectors.
if last_offset=0 then the last nullvector (corresponding to the smallest singular value) is returned, if last_offset=1 then the last but one nullvector is returned, and so on. The last_offset must be in [0..NullspaceDim-1].
Definition at line 389 of file SVD.hh.
References TNT::Matrix< T >::num_cols(), and BIAS::SVD::VT_.
Referenced by calc_Regressionsebene(), BIAS::TrifocalTensor::ComputeEpipoles(), BIAS::TrifocalTensor::GetEpipolarLines(), BIAS::FMatrix::GetEpipoles(), BIAS::PMatrix::GetNullVector(), BIAS::Conic2D::GetPoint(), BIAS::PlaneRANSAC::RefineSolution(), and BIAS::FMatrixEstimation::SevenPoint().
| const Vector<double>& BIAS::SVD::GetS | ( | ) | const [inline, inherited] |
return S which is a vector of the singular values of A in descending order.
The diagonalelements of Sigma are the singular values of A.
Definition at line 154 of file SVD.hh.
Referenced by BIAS::CovMatrix3x3::_Decompose(), BIAS::ImageAlignment::Align(), BIAS::PMatrixLinear::Compute(), BIAS::PMatrixEstimation::ComputeFromFDirect(), BIAS::FMatrixEstimation::EnforceMaxRank2(), BIAS::HMatrix::FactorizeAffineMatrixRLeft(), BIAS::HMatrix::FactorizeAffineMatrixRRight(), GetBaseLevel(), BIAS::FMatrix::GetEpipoles(), BIAS::PMatrix::GetPseudoInverse(), BIAS::Quadric3D::GetSignature(), BIAS::Conic2D::GetSignature(), BIAS::PMatrix::GetSVD(), BIAS::EMatrix::InitFromF(), Lapack_LLS_QR_linear_solve(), main(), Print(), BIAS::Quadric3D::Quadric3D(), BIAS::SVD::Solve(), and BIAS::LeastSquaresSVD::Solve().
| const double BIAS::SVD::GetSingularValue | ( | int | index | ) | const [inline, inherited] |
return one singular value (which may be zero).
inline implementations
the index runs from 0.. (size-1)
Definition at line 371 of file SVD.hh.
References BIASASSERT, BIAS::SVD::S_, TNT::Vector< T >::size(), and BIAS::SVD::size().
Referenced by BIAS::CamPoseCalib::outputPose_(), and BIAS::SVD::RelLeftNullspaceDim().
| const Matrix<double>& BIAS::SVD::GetU | ( | ) | const [inline, inherited] |
return U U is a m x m orthogonal matrix
Definition at line 174 of file SVD.hh.
Referenced by BIAS::CovMatrix3x3::_Decompose(), BIAS::FMatrixEstimation::EnforceMaxRank2(), BIAS::RMatrix::EnforceRConstraints(), BIAS::HMatrix::FactorizeAffineMatrixRLeft(), BIAS::HMatrix::FactorizeAffineMatrixRRight(), BIAS::Conic2D::GetDualConic(), BIAS::FMatrix::GetEpipoles(), BIAS::PMatrix::GetPseudoInverse(), BIAS::EMatrix::GetRotationTranslation(), BIAS::PMatrix::GetSVD(), BIAS::EMatrix::InitFromF(), main(), Print(), BIAS::Quadric3D::Quadric3D(), BIAS::SVD::Solve(), and BIAS::LeastSquaresSVD::Solve().
| Matrix< double > BIAS::SVD::GetV | ( | ) | const [inline, inherited] |
return V
Definition at line 381 of file SVD.hh.
References BIAS::Matrix< T >::Transpose(), and BIAS::SVD::VT_.
Referenced by BIAS::Conic2D::GetDualConic(), BIAS::PMatrix::GetPseudoInverse(), Print(), and BIAS::Quadric3D::Quadric3D().
| const Matrix<double>& BIAS::SVD::GetVT | ( | ) | const [inline, inherited] |
return VT (=transposed(V))
Definition at line 164 of file SVD.hh.
Referenced by BIAS::CovMatrix3x3::_Decompose(), BIAS::PMatrixLinear::Compute(), BIAS::ImageBlender::ComputeCylCamGeometry(), BIAS::FMatrixEstimation::EnforceMaxRank2(), BIAS::RMatrix::EnforceRConstraints(), BIAS::HMatrix::FactorizeAffineMatrixRLeft(), BIAS::HMatrix::FactorizeAffineMatrixRRight(), BIAS::Triangulation::GetCovarianceProjective(), BIAS::FMatrix::GetEpipoles(), BIAS::EMatrix::GetRotationTranslation(), BIAS::Quadric3D::GetSignature(), BIAS::Conic2D::GetSignature(), BIAS::PMatrix::GetSVD(), BIAS::EMatrix::InitFromF(), BIAS::FMatrixEstimation::Linear(), main(), BIAS::SVD::Solve(), BIAS::LeastSquaresSVD::Solve(), and BIAS::Triangulation::TriangulateLinear().
| double BIAS::SVD::GetZeroThreshold | ( | ) | const [inline, inherited] |
return zerothresh currently used
Definition at line 147 of file SVD.hh.
Referenced by BIAS::PMatrixLinear::Compute().
as above, but compute new svd for a
Definition at line 181 of file SVD.cpp.
References BIAS::SVD::Compute(), and BIAS::SVD::Invert().
| Matrix< double > SVD::Invert | ( | int | rank | ) | [inherited] |
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T the first "rank" elements of S are inverted the others are set to zero
Definition at line 156 of file SVD.cpp.
References BIAS::SVD::Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), res, BIAS::SVD::S_, BIAS::Matrix< T >::SetZero(), TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), BIAS::SVD::U_, and BIAS::SVD::VT_.
| Matrix< double > SVD::Invert | ( | ) | [inherited] |
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T
Definition at line 127 of file SVD.cpp.
References BIAS::SVD::AbsoluteZeroThreshold_, BIAS::SVD::Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), res, BIAS::SVD::S_, BIAS::Matrix< T >::SetZero(), TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), BIAS::SVD::U_, BIAS::SVD::VT_, and BIAS::SVD::ZeroThreshold_.
Referenced by BIAS::ImageAlignment::Align(), BIAS::TextureTransformAffine::ComposeWithInverseDeltaP(), BIAS::ImageBlender::ComputeCylCamGeometry(), BIAS::GaussHelmert::ComputeNormalSystem_(), BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix(), BIAS::ColorFilter< InputStorageType, OutputStorageType >::FindWaterExp(), BIAS::ContourDetectorBSpline< StorageType >::Fit_(), BIAS::PMatrix::GetCanonicalH(), BIAS::Triangulation::GetCovarianceProjective(), BIAS::CamPoseCalib::GetCoVarMatrix(), BIAS::Conic2D::GetDualConic(), BIAS::Quadric3D::GetDualQuadric(), BIAS::Interpolator::InitSpline3(), BIAS::SVD::Invert(), main(), BIAS::GaussHelmert::Solve(), BIAS::TrackerBaseAffine2< StorageType >::TrackAffine_(), BIAS::TrackerBaseAffine< StorageType >::TrackAffine_(), BIAS::Kalman::Update(), and BIAS::ExtendedKalman::Update().
| const int BIAS::SVD::LeftNullspaceDim | ( | ) | const [inline, inherited] |
| long int BIAS::Debug::Name2DebugLevel | ( | const std::string & | name | ) | const [inline, inherited] |
| long int BIAS::Debug::NewDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
creates a new debuglevel
Definition at line 466 of file Debug.hh.
References ABORT, it, and res.
Referenced by BIAS::Condensation::Condensation(), BIAS::Histogram::Histogram(), BIAS::MonteCarloTransform::MonteCarloTransform(), myclass::myclass(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSAC< SolutionType >::RANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
| const int BIAS::SVD::NullspaceDim | ( | ) | const [inline, inherited] |
return the dim of the nullspace.
For rectangular matrices this is the number of singular values which are (about) zero. The nullspace is spaned by the singular vectors corresponding to the zero singular values. woelk 4 2003: changed API, diffentiate between Left and Right Nullspace koeser 01/2005: rel/abs handled by flag: AbsoluteZeroThreshold_ determines whther we compare absolute or relative singular values against the threshold
Definition at line 196 of file SVD.hh.
Referenced by BIAS::FMatrix::GetEpipoles(), BIAS::SVD::GetLeftNullvector(), BIAS::SVD::GetNullvector(), BIAS::FMatrix::IsValid(), main(), BIAS::SVD::Rank(), and BIAS::SVD::RelLeftNullspaceDim().
| void BIAS::Debug::PrintDebugLevel | ( | std::ostream & | os = std::cout |
) | const [inline, inherited] |
| unsigned int SVD::Rank | ( | ) | [inherited] |
returns the rank of A_
Definition at line 419 of file SVD.cpp.
References BIAS::SVD::A_, BIASDOUT, D_SVD_RANK, BIAS::SVD::NullspaceDim(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, and BIAS::Vector< T >::Size().
Referenced by Lapack_LLS_QR_linear_solve(), and BIAS::PlaneRANSAC::RefineSolution().
| const int SVD::RelLeftNullspaceDim | ( | ) | const [inherited] |
Definition at line 398 of file SVD.cpp.
References BIAS::SVD::A_, BIAS::SVD::GetSingularValue(), BIAS::SVD::NullspaceDim(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, TNT::Vector< T >::size(), and BIAS::SVD::ZeroThreshold_.
| const int SVD::RelNullspaceDim | ( | ) | const [inherited] |
compare singular values against greatest, not absolute
Definition at line 346 of file SVD.cpp.
References BIAS::SVD::A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, TNT::Vector< T >::size(), and BIAS::SVD::ZeroThreshold_.
Referenced by BIAS::PMatrixLinear::Compute(), BIAS::Conic2D::GetDualConic(), and BIAS::SVD::RelRightNullspaceDim().
| const int SVD::RelRightNullspaceDim | ( | ) | const [inherited] |
| void BIAS::Debug::RemoveDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::RemoveDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
| const int BIAS::SVD::RightNullspaceDim | ( | ) | const [inline, inherited] |
| void BIAS::Debug::SetDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::SetDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Definition at line 310 of file Debug.hh.
Referenced by main(), BIAS::ExampleDebug::ResetDebugLevelFromGlobal(), BIAS::MDcam::ScanBus(), BIAS::MDcam::SetDebugLevelDcam(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
| void BIAS::Debug::SetDebugStream | ( | const std::ostream & | os | ) | [inline, inherited] |
| static void BIAS::Debug::SetGlobalDebugLevel | ( | long int | lev | ) | [inline, static, inherited] |
| void BIAS::Debug::ShowDebugLevel | ( | std::ostream & | os = std::cout |
) | const [inline, inherited] |
| int BIAS::SVD::size | ( | ) | const [inline, inherited] |
return the length of the singular value vector inline const int size() const
Definition at line 179 of file SVD.hh.
Referenced by BIAS::SVD::GetSingularValue().
solves the overdetermined linear system $AX=B$ with the unknown $X$, where $A$ is an $m x n$ matrix ($m>n$)and B is a vector of size $m$.
Definition at line 429 of file SVD.cpp.
References BIAS::SVD::AbsoluteZeroThreshold_, BIASCDOUT, BIASDOUT, BIAS::SVD::Compute(), D_SVD_SOLVE, BIAS::SVD::GetS(), BIAS::Matrix< T >::GetSystemMatrix(), BIAS::SVD::GetU(), BIAS::SVD::GetVT(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), res, BIAS::SVD::S_, BIAS::Matrix< T >::Transpose(), and BIAS::SVD::ZeroThreshold_.
Definition at line 81 of file SVD.cpp.
References BEXCEPTION, BIASERR, BIAS::SVD::Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::SVD::S_, TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), BIAS::SVD::U_, BIAS::SVD::VT_, and BIAS::SVD::ZeroThreshold_.
Referenced by BIAS::CamPoseCalib::Estimate(), BIAS::PolynomialSolve::FitPolynomial(), FitPolynomialWithoutLinearMonomial(), BIAS::PMatrix::GetCanonicalH(), gsolve(), main(), BIAS::UnVignette::PrepareLeastSquaresMin_(), BIAS::PMDImageProc::PreparePolyDepthCalibration(), BIAS::GaussHelmert::Solve(), BIAS::CamPoseCalib::Solve_(), and BIAS::TrackerBaseAffine< StorageType >::TrackAffine_().
as above, but compute new svd for a
Definition at line 250 of file SVD.cpp.
References BIAS::SVD::Compute(), and BIAS::SVD::Sqrt().
| Matrix< double > SVD::Sqrt | ( | ) | [inherited] |
returns the square root of a symmetric positive definite matrix M A = sqrt(M) = U * sqrt(S) * V_T, such that A*A = M.
The result is only valid when the M *is* symmetric positive definite.
Definition at line 189 of file SVD.cpp.
References BIAS::SVD::A_, BIAS::SVD::AbsoluteZeroThreshold_, BEXCEPTION, BIASERR, BIAS::SVD::Compute(), BIAS::SVD::Decomposed_, BIAS::Equal(), BIAS::Matrix< T >::GetCols(), BIAS::Matrix< T >::GetRows(), BIAS::GreaterEqual(), BIAS::MatrixZero, num, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), r, res, BIAS::SVD::S_, TNT::Vector< T >::size(), BIAS::SVD::U_, Upper_symmetric_eigenvalue_solve(), BIAS::SVD::VT_, and BIAS::SVD::ZeroThreshold_.
Referenced by MatrixSqrt(), and BIAS::SVD::Sqrt().
as above, but compute new svd for a
Definition at line 320 of file SVD.cpp.
References BIAS::SVD::Compute(), and BIAS::SVD::SqrtT().
| Matrix< double > SVD::SqrtT | ( | ) | [inherited] |
returns the square root of a symmetric positive definite matrix M A = sqrt(M) = U * sqrt(S), such that A*A^T = M.
The result is only valid when the M *is* symmetric positive definite.
Definition at line 257 of file SVD.cpp.
References BIAS::SVD::A_, BIAS::SV