BIAS::SVD3x3 Class Reference
[Algorithms]

singular value decomposition for 3x3 matrices More...

#include <MathAlgo/SVD3x3.hh>

Inheritance diagram for BIAS::SVD3x3:

Inheritance graph
[legend]
Collaboration diagram for BIAS::SVD3x3:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

singular value decomposition for 3x3 matrices

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.

Author:
woelk 08/2004

Definition at line 74 of file SVD3x3.hh.


Constructor & Destructor Documentation

SVD3x3::SVD3x3 (  ) 

SVD3x3::SVD3x3 ( const Matrix< double > &  M,
double  ZeroThreshold = DEFAULT_DOUBLE_ZERO_THRESHOLD 
)

constructor solve the general eigenproblem of the rectangular matrix M

Author:
woelk 07/2004
Bug:
does not always converge when general svd does

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_.

virtual BIAS::SVD3x3::~SVD3x3 (  )  [inline, virtual]

Definition at line 86 of file SVD3x3.hh.


Member Function Documentation

void BIAS::SVD3x3::_Swap ( int  a,
int  b 
) [inline, protected]

Definition at line 97 of file SVD3x3.hh.

Referenced by Compute().

const int SVD::AbsLeftNullspaceDim (  )  const [inherited]

returns the dim of the matrix's left nullspace, using absolute threshold criterion

Author:
woelk 04 2003

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

Author:
Jan Woetzel 04/04/2002

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

Author:
woelk 04 2003

Definition at line 372 of file SVD.cpp.

References BIAS::SVD::AbsNullspaceDim().

void BIAS::Debug::AddDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 354 of file Debug.hh.

void BIAS::Debug::AddDebugLevel ( const long int  lv  )  [inline, inherited]

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

Bug:
does not always converge when general svd does
Author:
woelk 07/2004

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_.

Referenced by main(), and SVD3x3().

long BIAS::Debug::ConsumeNextFreeDebuglevel_ (  )  [inline, protected, inherited]

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 513 of file Debug.hh.

References ABORT.

bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name  )  const [inline, inherited]

Definition at line 342 of file Debug.hh.

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.

Author:
Jan Woetzel (04/04/2002)

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]

void BIAS::Debug::GetDebugStream ( std::ostream &  os  )  const [inline, inherited]

Definition at line 406 of file Debug.hh.

std::ostream& BIAS::Debug::GetDebugStream (  )  const [inline, inherited]

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.

Author:
grest, July 2006

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]

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

Author:
JMF/koeser

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].

Author:
Jan Woetzel (08/08/2002), JMF

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].

Author:
Jan Woetzel(08/08/2002), JMF

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]

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)

Author:
Jan Woetzel 04/04/2002

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]

Matrix< double > BIAS::SVD::GetV (  )  const [inline, inherited]

return V

Author:
Jan Woetzel (04/04/2002)

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]

double BIAS::SVD::GetZeroThreshold (  )  const [inline, inherited]

return zerothresh currently used

Author:
koeser

Definition at line 147 of file SVD.hh.

Referenced by BIAS::PMatrixLinear::Compute().

Matrix< double > SVD::Invert ( Matrix< double >  A  )  [inherited]

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

Author:
Christian Beder

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]

const int BIAS::SVD::LeftNullspaceDim (  )  const [inline, inherited]

returns the dim of the matrix's left nullspace

Author:
woelk 04 2003

Definition at line 210 of file SVD.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name  )  const [inline, inherited]

looks up a debuglevel in the internal map, returns 0 if not found

Author:
woelk 09/2006

Definition at line 446 of file Debug.hh.

References it.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name  )  [inline, inherited]

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

Author:
Jan Woetzel 04/04/2002

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]

Definition at line 375 of file Debug.hh.

References WS.

Referenced by main().

unsigned int SVD::Rank (  )  [inherited]

const int SVD::RelLeftNullspaceDim (  )  const [inherited]

const int SVD::RelNullspaceDim (  )  const [inherited]

compare singular values against greatest, not absolute

Author:
Christian Buck changed criterion for insignificant singular values according to hartley/zisserman from s_i<ZeroThreshold to s_i/s_0<ZeroThreshold. fallback to old criterion iff s_0=0.

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]

Definition at line 376 of file SVD.cpp.

References BIAS::SVD::RelNullspaceDim().

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 368 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv  )  [inline, inherited]

Definition at line 361 of file Debug.hh.

const int BIAS::SVD::RightNullspaceDim (  )  const [inline, inherited]

returns the dim of the matrix's right nullspace

Author:
woelk 04 2003

Definition at line 203 of file SVD.hh.

void BIAS::Debug::SetDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 317 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv  )  [inline, inherited]

void BIAS::Debug::SetDebugStream ( const std::ostream &  os  )  [inline, inherited]

Definition at line 390 of file Debug.hh.

Referenced by main().

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev  )  [inline, static, inherited]

Definition at line 416 of file Debug.hh.

Referenced by main().

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout  )  const [inline, inherited]

prints all internally known debuglevels

Author:
woelk 09/2006

Definition at line 488 of file Debug.hh.

References it.

Referenced by main().

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().

Vector<double> BIAS::SVD::solve ( const Vector< double > &  y  )  const [inline, inherited]

use our naming convention

Definition at line 280 of file SVD.hh.

int SVD::Solve ( Matrix< double > &  A,
Vector< double > &  B,
Vector< double > &  X 
) [inherited]

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$.

Author:
woelk 07/2004

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_.

Vector< double > SVD::Solve ( const Vector< double > &  y  )  const [inherited]

Matrix< double > SVD::Sqrt ( const Matrix< double > &  A  )  [inherited]

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.

Author:
woelk 01/2006

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().

Matrix< double > SVD::SqrtT ( const Matrix< double > &  A  )  [inherited]

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.

Author:
woelk 01/2006

Definition at line 257 of file SVD.cpp.

References BIAS::SVD::A_, BIAS::SV