#include <MathAlgo/SVD.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 | |
| 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 |
| use our naming convention | |
| 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. | |
| SVD (bool AbsoluteZeroThreshold=true) | |
| creates an empty svd without automatically decomposing any matrix | |
| SVD (const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD, bool AbsoluteZeroThreshold=true) | |
| solve the general eigenproblem of the rectangular matrix M or with other words, make the U*S*V^T decomposition | |
| virtual | ~SVD () |
Static Public Member Functions | |
| static long int | GetGlobalDebugLevel () |
| static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
| 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 |
M = U S V't.
The singular vectors vi and (right) singular values sigma_i satisfy the equation: A vi = sigma_i vi
The Vector S_ stores the singular values of A in decreasing order (smallest is last)
The columns of U are the left singular vectors of A and form an orthonormal basis of A which corresponds to the nonzero singular values. while the columns of U corresponding to (nearly) zero values are the nullspace.
This function is a base class and not a member in Matrix because:
You can create the svd object either in relative or in absolute mode: if AbsoluteZeroThreshold is true, a singular value is compared to the threshold "absolutely", otherwise the ratio of the largest and the current singular value is compared against the threshold. Usually you want AbsoluteZeroThreshold = false, but for the sake of interface stability/downwards compatibility, the default is true
Example7Point.cpp, ExampleHdr.cpp, ExampleLapack.cpp, ExampleRegressionPlane.cpp, ExampleSparseMatrix.cpp, ExampleSparseMatrix2.cpp, ExampleSVD.cpp, ExampleSVD3x3.cpp, InvestigatePRelations.cpp, and ProjectionError.cpp.
Definition at line 90 of file SVD.hh.
| SVD::SVD | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD, |
|||
| bool | AbsoluteZeroThreshold = true | |||
| ) |
solve the general eigenproblem of the rectangular matrix M or with other words, make the U*S*V^T decomposition
| M | matrix to decompose | |
| ZeroThreshold | for nullspace determination, if a singular value is lower than ZeroThreshold, define the corresponding vector in V^T to be a null-vector (also sing.vals are treated this way) | |
| AbsoluteZeroThreshold | if true, a singular value is compared to the threshold "absoultely", otherwise the ratio of the largest and the current singular value is compared against the threshold. Usually you want AbsoluteZeroThreshold = false, but for the sake of interface stability/downwards compatibility, the default is true |
Definition at line 40 of file SVD.cpp.
References AbsoluteZeroThreshold_, Compute(), and Decomposed_.
| BIAS::SVD::SVD | ( | bool | AbsoluteZeroThreshold = true |
) | [inline] |
creates an empty svd without automatically decomposing any matrix
| AbsoluteZeroThreshold | if true, a singular value is compared to the threshold "absolutely", otherwise the ratio of the largest and the current singular value is compared against the threshold. Usually you want AbsoluteZeroThreshold = false, but for the sake of interface stability/downwards compatibility, the default is true |
| const int SVD::AbsLeftNullspaceDim | ( | ) | const |
returns the dim of the matrix's left nullspace, using absolute threshold criterion
Definition at line 380 of file SVD.cpp.
References A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), and ZeroThreshold_.
| const int SVD::AbsNullspaceDim | ( | ) | const |
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 A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), and ZeroThreshold_.
Referenced by AbsRightNullspaceDim().
| const int SVD::AbsRightNullspaceDim | ( | ) | const |
returns the dim of the matrix's right nullspace, using absolute threshold criterion
Definition at line 372 of file SVD.cpp.
References AbsNullspaceDim().
| void BIAS::Debug::AddDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::AddDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Reimplemented in BIAS::GLProjectionParametersBase.
Definition at line 356 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::RANSAC< SolutionType >::RANSAC(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
| int BIAS::SVD::compute | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD | |||
| ) | [inline] |
use our naming convention
Definition at line 129 of file SVD.hh.
Referenced by BIAS::PMatrix::MakeSVD_().
| int SVD::Compute | ( | const Matrix< double > & | M, | |
| double | ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD | |||
| ) |
set a new matrix and compute its decomposition.
solves the general eigenproblem of the rectangular matrix M
Reimplemented in BIAS::SVD3x3.
Definition at line 48 of file SVD.cpp.
References Decomposed_, General_Eigenproblem_GeneralMatrix_Lapack(), and ZeroThreshold_.
Referenced by BIAS::CovMatrix3x3::_Decompose(), BIAS::ImageAlignment::Align(), BIAS::HMatrix::FactorizeAffineMatrixRLeft(), BIAS::HMatrix::FactorizeAffineMatrixRRight(), BIAS::EMatrix::GetRotationTranslation(), BIAS::Interpolator::InitSpline3(), Invert(), BIAS::LeastSquaresSVD::Solve(), Solve(), Sqrt(), SqrtT(), and SVD().
| 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 342 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::Rescale< InputStorageType, OutputStorageType >::_ApplyMeanFilter(), 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::Rescale< InputStorageType, OutputStorageType >::_FillInterpolated(), BIAS::Rescale< InputStorageType, OutputStorageType >::_FillInterpolatedColor(), BIAS::Rescale< InputStorageType, OutputStorageType >::_FillInterpolatedGrey(), 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(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), and BIAS::MonteCarloTransform::Transform().
| int SVD::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 .
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 A_, Decomposed_, General_singular_value_decomposition(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), U_, and VT_.
Referenced by Compute().
| int BIAS::Debug::GetDebugLevel | ( | ) | const [inline, inherited] |
Definition at line 333 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::ImageAlignment::Align(), BIAS::ExampleDebug::func(), BIAS::FMatrix::GetEpipoles(), 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 406 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::RANSAC< SolutionType >::GenerateSamplesRandom(), and BIAS::GuiGTK::MouseMotionCallback_().
| BIAS::Vector< double > SVD::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.
Definition at line 486 of file SVD.cpp.
References A_, BIAS::Matrix< T >::GetRow(), BIAS::Matrix< T >::GetRows(), and VT_.
Referenced by BIAS::CamPoseCalib::SolveLM_().
| static long int BIAS::Debug::GetGlobalDebugLevel | ( | ) | [inline, static, inherited] |
Definition at line 432 of file Debug.hh.
Referenced by BIAS::ExampleDebug::func(), and BIAS::ExampleDebug::ResetDebugLevelFromGlobal().
| Vector< double > BIAS::SVD::GetLeftNullvector | ( | const int | last_offset = 0 |
) | [inline] |
same as above but returning vector
Definition at line 419 of file SVD.hh.
References GetLeftNullvector(), TNT::Matrix< T >::num_rows(), and VT_.
| bool BIAS::SVD::GetLeftNullvector | ( | Vector< double > & | nv, | |
| const int | last_offset = 0 | |||
| ) | [inline] |
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 TNT::Vector< T >::newsize(), NullspaceDim(), TNT::Matrix< T >::num_rows(), S_, U_, and VT_.
Referenced by BIAS::TrifocalTensor::ComputeEpipoles(), BIAS::TrifocalTensor::GetEpipolarLines(), BIAS::FMatrix::GetEpipoles(), and GetLeftNullvector().
| bool BIAS::SVD::GetNullvector | ( | Vector< double > & | NullVec, | |
| const int | last_offset = 0 | |||
| ) | [inline] |
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(), NullspaceDim(), TNT::Matrix< T >::num_cols(), and VT_.
| Vector< double > BIAS::SVD::GetNullvector | ( | const int | last_offset = 0 |
) | [inline] |
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 VT_.
Referenced by BIAS::TrifocalTensor::ComputeEpipoles(), BIAS::ProjectionParametersProjective::GetC(), 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] |
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(), BIAS::FMatrix::GetEpipoles(), BIAS::PMatrix::GetPseudoInverse(), BIAS::Quadric3D::GetSignature(), BIAS::Conic2D::GetSignature(), BIAS::PMatrix::GetSVD(), BIAS::EMatrix::InitFromF(), Lapack_LLS_QR_linear_solve(), BIAS::Quadric3D::Quadric3D(), Solve(), and BIAS::LeastSquaresSVD::Solve().
| const double BIAS::SVD::GetSingularValue | ( | int | index | ) | const [inline] |
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 S_, TNT::Vector< T >::size(), and size().
Referenced by BIAS::CamPoseCalib::outputPose_(), and RelLeftNullspaceDim().
| const Matrix<double>& BIAS::SVD::GetU | ( | ) | const [inline] |
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(), BIAS::Quadric3D::Quadric3D(), Solve(), and BIAS::LeastSquaresSVD::Solve().
| Matrix< double > BIAS::SVD::GetV | ( | ) | const [inline] |
return V
Definition at line 381 of file SVD.hh.
References BIAS::Matrix< T >::Transpose(), and VT_.
Referenced by BIAS::Conic2D::GetDualConic(), BIAS::PMatrix::GetPseudoInverse(), and BIAS::Quadric3D::Quadric3D().
| const Matrix<double>& BIAS::SVD::GetVT | ( | ) | const [inline] |
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(), Solve(), BIAS::LeastSquaresSVD::Solve(), and BIAS::Triangulation::TriangulateLinear().
| double BIAS::SVD::GetZeroThreshold | ( | ) | const [inline] |
return zerothresh currently used
Definition at line 147 of file SVD.hh.
Referenced by BIAS::PMatrixLinear::Compute().
| Matrix< double > SVD::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
Definition at line 156 of file SVD.cpp.
References Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, BIAS::Matrix< T >::SetZero(), TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), U_, and VT_.
| Matrix< double > SVD::Invert | ( | ) |
returns pseudoinverse of A = U * S * V^T A^+ = V * S^+ * U^T
Definition at line 127 of file SVD.cpp.
References AbsoluteZeroThreshold_, Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, BIAS::Matrix< T >::SetZero(), TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), U_, VT_, and ZeroThreshold_.
Referenced by BIAS::ImageAlignment::Align(), BIAS::TextureTransformAffine::ComposeWithInverseDeltaP(), BIAS::ImageBlender::ComputeCylCamGeometry(), BIAS::ProjectionError::ComputeDiff(), BIAS::GaussHelmert::ComputeNormalSystem_(), BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix(), BIAS::ContourDetectorBSpline< StorageType >::Fit_(), BIAS::PMatrix::GetCanonicalH(), BIAS::Triangulation::GetCovarianceProjective(), BIAS::CamPoseCalib::GetCoVarMatrix(), BIAS::Conic2D::GetDualConic(), BIAS::Quadric3D::GetDualQuadric(), BIAS::Interpolator::InitSpline3(), Invert(), 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] |
| 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 475 of file Debug.hh.
Referenced by BIAS::Condensation::Condensation(), BIAS::COSAC< SolutionType >::COSAC(), BIAS::Histogram::Histogram(), BIAS::MonteCarloTransform::MonteCarloTransform(), myclass::myclass(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PMatrixLinear::PMatrixLinear(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSAC< SolutionType >::RANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
| const int BIAS::SVD::NullspaceDim | ( | ) | const [inline] |
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(), GetLeftNullvector(), GetNullvector(), BIAS::FMatrix::IsValid(), Rank(), and RelLeftNullspaceDim().
| void BIAS::Debug::PrintDebugLevel | ( | std::ostream & | os = std::cout |
) | const [inline, inherited] |
| unsigned int SVD::Rank | ( | ) |
returns the rank of A_
Definition at line 419 of file SVD.cpp.
References A_, NullspaceDim(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, and BIAS::Vector< T >::Size().
Referenced by Lapack_LLS_QR_linear_solve(), and BIAS::PlaneRANSAC::RefineSolution().
| const int SVD::RelLeftNullspaceDim | ( | ) | const |
Definition at line 398 of file SVD.cpp.
References A_, GetSingularValue(), NullspaceDim(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), and ZeroThreshold_.
| const int SVD::RelNullspaceDim | ( | ) | const |
compare singular values against greatest, not absolute
Definition at line 346 of file SVD.cpp.
References A_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), and ZeroThreshold_.
Referenced by BIAS::PMatrixLinear::Compute(), BIAS::Conic2D::GetDualConic(), and RelRightNullspaceDim().
| const int SVD::RelRightNullspaceDim | ( | ) | const |
| 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] |
| void BIAS::Debug::SetDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::SetDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Reimplemented in BIAS::GLProjectionParametersBase.
Definition at line 319 of file Debug.hh.
Referenced by BIAS::Interpolator::Interpolator(), BIAS::ExampleDebug::ResetDebugLevelFromGlobal(), BIAS::MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), 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] |
return the length of the singular value vector inline const int size() const
Definition at line 179 of file SVD.hh.
Referenced by 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 AbsoluteZeroThreshold_, Compute(), GetS(), BIAS::Matrix< T >::GetSystemMatrix(), GetU(), GetVT(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, BIAS::Matrix< T >::Transpose(), and ZeroThreshold_.
Definition at line 81 of file SVD.cpp.
References Decomposed_, TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), BIAS::Matrix< T >::Transpose(), U_, VT_, and ZeroThreshold_.
Referenced by BIAS::CamPoseCalib::Estimate(), BIAS::PolynomialSolve::FitPolynomial(), BIAS::PMatrix::GetCanonicalH(), BIAS::UnVignette::PrepareLeastSquaresMin_(), BIAS::GaussHelmert::Solve(), BIAS::CamPoseCalib::Solve_(), and BIAS::TrackerBaseAffine< StorageType >::TrackAffine_().
| Matrix< double > SVD::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.
The result is only valid when the M *is* symmetric positive definite.
Definition at line 189 of file SVD.cpp.
References A_, AbsoluteZeroThreshold_, Compute(), Decomposed_, BIAS::Matrix< T >::GetCols(), BIAS::Matrix< T >::GetRows(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), U_, Upper_symmetric_eigenvalue_solve(), VT_, and ZeroThreshold_.
Referenced by Sqrt().
| Matrix< double > SVD::SqrtT | ( | ) |
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 A_, AbsoluteZeroThreshold_, Compute(), Decomposed_, BIAS::Matrix< T >::GetCols(), BIAS::Matrix< T >::GetRows(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), S_, TNT::Vector< T >::size(), U_, Upper_symmetric_eigenvalue_solve(), VT_, and ZeroThreshold_.
Referenced by BIAS::UnscentedTransform::ComputeSigmaPoints_(), and SqrtT().
long int BIAS::Debug::_liDebugLevel [protected, inherited] |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::GuiGTK::DeleteEvent_(), BIAS::GuiGTK::Destroy_(), BIAS::GuiGTK::DrawingAreaExposeCallback_(), BIAS::GuiGTK::GtkMain(), BIAS::GuiGTK::KeyPressEventCallback_(), BIAS::GuiGTK::LabelExposeCallback_(), BIAS::GuiGTK::MouseButtonPressCallback_(), BIAS::GuiGTK::MouseButtonReleaseCallback_(), BIAS::GuiGTK::MouseMotionCallback_(), BIAS::Image< StorageType >::operator=(), BIAS::ImageBase::operator=(), and BIAS::Debug::operator=().
long int BIAS::Debug::_liNextDebugLevel [protected, inherited] |
new concept, debuglevel are managed here in the debug class
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
std::map<std::string, long int> BIAS::Debug::_String2Debuglevel [protected, inherited] |
std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited] |
Definition at line 512 of file Debug.hh.
Referenced by BIAS::GuiGTK::DeleteEvent_(), BIAS::GuiGTK::Destroy_(), BIAS::GuiGTK::DrawingAreaExposeCallback_(), BIAS::GuiGTK::GtkMain(), BIAS::GuiGTK::KeyPressEventCallback_(), BIAS::GuiGTK::LabelExposeCallback_(), BIAS::GuiGTK::MouseButtonPressCallback_(), BIAS::GuiGTK::MouseButtonReleaseCallback_(), BIAS::GuiGTK::MouseMotionCallback_(), and BIAS::Debug::operator=().
Matrix<double> BIAS::SVD::A_ [protected] |
data members: original matrix (to be decomposed)
Definition at line 340 of file SVD.hh.
Referenced by AbsLeftNullspaceDim(), AbsNullspaceDim(), BIAS::SVD3x3::Compute(), General_Eigenproblem_GeneralMatrix_Lapack(), GetEigenValues(), Rank(), RelLeftNullspaceDim(), RelNullspaceDim(), Sqrt(), SqrtT(), and BIAS::SVD3x3::SVD3x3().
bool BIAS::SVD::AbsoluteZeroThreshold_ [protected] |
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)
Definition at line 357 of file SVD.hh.
Referenced by Invert(), Solve(), Sqrt(), SqrtT(), and SVD().
bool BIAS::SVD::Decomposed_ [protected] |
flag for holding decomposed matrix
Definition at line 363 of file SVD.hh.
Referenced by BIAS::SVD3x3::Compute(), Compute(), General_Eigenproblem_GeneralMatrix_Lapack(), Invert(), Solve(), Sqrt(), SqrtT(), SVD(), and BIAS::SVD3x3::SVD3x3().
long int BIAS::Debug::GlobalDebugLevel = 0 [static, protected, inherited] |
Vector<double> BIAS::SVD::S_ [protected] |
contains the singular values of A_ corresponding to the i'th column in descending order.
Definition at line 344 of file SVD.hh.
Referenced by AbsLeftNullspaceDim(), AbsNullspaceDim(), BIAS::SVD3x3::Compute(), General_Eigenproblem_GeneralMatrix_Lapack(), GetLeftNullvector(), GetSingularValue(), Invert(), Rank(), RelLeftNullspaceDim(), RelNullspaceDim(), Solve(), Sqrt(), SqrtT(), and BIAS::SVD3x3::SVD3x3().
Matrix<double> BIAS::SVD::U_ [protected] |
contains columnwise the left singular vectors of A_ corresponding to the i'th singular value
Definition at line 348 of file SVD.hh.
Referenced by BIAS::SVD3x3::Compute(), General_Eigenproblem_GeneralMatrix_Lapack(), GetLeftNullvector(), Invert(), Solve(), Sqrt(), SqrtT(), and BIAS::SVD3x3::SVD3x3().
Matrix<double> BIAS::SVD::VT_ [protected] |
contains the right singular vectors of A- in rows [beause VT is transpose(V) ]
Definition at line 352 of file SVD.hh.
Referenced by BIAS::SVD3x3::Compute(), General_Eigenproblem_GeneralMatrix_Lapack(), GetEigenValues(), GetLeftNullvector(), GetNullvector(), GetV(), Invert(), Solve(), Sqrt(), SqrtT(), and BIAS::SVD3x3::SVD3x3().
double BIAS::SVD::ZeroThreshold_ [protected] |
values below this threshold are treated as zero
Definition at line 360 of file SVD.hh.
Referenced by AbsLeftNullspaceDim(), AbsNullspaceDim(), Compute(), BIAS::SVD3x3::Compute(), Invert(), RelLeftNullspaceDim(), RelNullspaceDim(), Solve(), Sqrt(), SqrtT(), and BIAS::SVD3x3::SVD3x3().
1.5.6