Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

{type}LeastSq{method}



Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/flsch.h>  // FloatLeastSqCh, float Cholesky method
#include <rw/dlsch.h>  // DoubleLeastSqCh, double Cholesky method
#include <rw/clsch.h>  // DComplexLeastSqCh, complex Cholesky
// method #include <rw/flsqr.h> // FloatLeastSqQR, float QR method #include <rw/dlsqr.h> // DoubleLeastSqQR, double QR method #include <rw/clsqr.h> // DComplexLeastSqQR, complex QR method #include <rw/flssv.h> // FloatLeastSqSV, float SV method #include <rw/dlssv.h> // DoubleLeastSqSV, double SV method #include <rw/clssv.h> // DComplexLeastSqSV, complex SV method DoubleLeastSqSV SVD(A); // A is an RWGenMat<double> RWMathVec<double> x = SVD.solve(b); // b is an RWMathVec<double>

Description

A linear system of equations has the form Ax=b, where A contains more rows than columns and generally has no exact solution; it is overdetermined. The best that we can do is to find a solution vector x such that the norm of the residual vector, Ax-b, is made as small as possible. The vector x is then a solution in the least squares sense, and this sort of problem is called a least squares problem.

As shown in the Synopsis, there are nine classes in LAPACK.h++ for solving least squares problems. The approach is to construct a factorization of the matrix A that can be used to solve the problem. The classes {TYPE}LeastSq{METHOD} encapsulate this factorization object, where {TYPE} is a float, double, or DComplex, and {METHOD} encodes the type of factorization used. There are three methods provided:

Which method you choose depends on the tradeoff between speed and robustness that you want to make. As you move down the list, the methods decrease in speed, but increase in accuracy and robustness.

A system of equations Ax=b is underdetermined if the columns of A are linearly dependent. In this case, there are infinitely many solutions. Often, the one that is desired is the one with minimum norm. The classes {TYPE}LeastSqQR and {TYPE}LeastSqSV allow you to compute this solution.

Note that the classes {TYPE}LeastSqQR and {TYPE}LeastSqSV are publicly derived from their underlying decomposition types, so that advanced users can manipulate the underlying decomposition directly.

Example

Public Constructors

FloatLeastSqCh();
DoubleLeastSqCh();
DComplexLeastSqCh();
FloatLeastSqQR();
DoubleLeastSqQR();
DComplexLeastSqQR();
FloatLeastSqSV();
DoubleLeastSqSV();
DComplexLeastSqSV();
FloatLeastSqCh(const RWGenMat<float>& A);
DoubleLeastSqCh(const RWGenMat<double>& A);
DComplexLeastSqCh(const RWGenMat<DComplex>& A);
FloatLeastSqQR(const RWGenMat<float>& A, float tol=0);
DoubleLeastSqQR(const RWGenMat<double>& A, double tol=0);
DComplexLeastSqQR(const RWGenMat<DComplex>& A, double tol=0);
FloatLeastSqSV(const RWGenMat<float>& A, float tol=0);
DoubleLeastSqSV(const RWGenMat<double>& A, double tol=0);
DComplexLeastSqSV(const RWGenMat<DComplex>& A, double tol=0);
FloatLeastSqQR(const FloatQRDecomp& A, float tol=0);
DoubleLeastSqQR(const DoubleQRDecomp& A, double tol=0);
DComplexLeastSqQR(const DComplexQRDecomp& A, double tol=0);
FloatLeastSqQR(const FloatCODecomp& A);
DoubleLeastSqQR(const DoubleCODecomp& A);
DComplexLeastSqQR(const DComplexCODecomp& A);
FloatLeastSqSV(const FloatSVDecomp& A, float tol=0);
DoubleLeastSqSV(const DoubleSVDecomp& A, double tol=0);
DComplexLeastSqSV(const DComplexSVDecomp& A, double tol=0);

Public Member Functions

unsigned    FloatLeastSqCh::cols();
unsigned    DoubleLeastSqCh::cols();
unsigned    DComplexLeastSqCh::cols();
unsigned    FloatLeastSqQR::cols();
unsigned    DoubleLeastSqQR::cols();
unsigned    DComplexLeastSqQR::cols();
unsigned    FloatLeastSqSV::cols();
unsigned    DoubleLeastSqSV::cols();
unsigned    DComplexLeastSqSV::cols();
void
FloatLeastSqCh::factor(const RWGenMat<float>& A);
void
DoubleLeastSqCh::factor(const RWGenMat<double>& A);
void
DComplexLeastSqCh::factor(const RWGenMat<DComplex>& A);
void
FloatLeastSqQR::factor(const RWGenMat<float>& A, float tol=0);
void
DoubleLeastSqQR::factor(const RWGenMat<double>& A, double tol=0);
void
DComplexLeastSqQR::factor(const RWGenMat<DComplex>& A, double tol=0);
void
FloatLeastSqSV::factor(const RWGenMat<float>& A, float tol=0);
void
DoubleLeastSqSV::factor(const RWGenMat<double>& A, double tol=0);
void
DComplexLeastSqSV::factor(const RWGenMat<DComplex>& A, double tol=0);
void
FloatLeastSqQR::factor(const FloatQRDecomp& A, float tol=0);
void
DoubleLeastSqQR::factor(const DoubleQRDecomp& A,double tol=0);
void    
DComplexLeastSqQR::factor(const DComplexQRDecomp&, double tol=0);
void    
FloatLeastSqQR::factor(const FloatCODecomp& A);
void    
DoubleLeastSqQR::factor(const DoubleCODecomp& A);
void    
DComplexLeastSqQR::factor(const DComplexCODecomp& A);
void    
FloatLeastSqSV::factor(const FloatSVDecomp& A, float tol=0);
void    
DoubleLeastSqSV::factor(const DoubleSVDecomp& A, double tol=0);
void    
DComplexLeastSqSV::factor(const DComplexSVDecomp&, double tol=0);
unsigned    FloatLeastSqCh::fail();
unsigned    DoubleLeastSqCh::fail();
unsigned    DComplexLeastSqCh::fail();
unsigned    FloatLeastSqSV::fail();
unsigned    DoubleLeastSqSV::fail();
unsigned    DComplexLeastSqSV::fail();
unsigned    FloatLeastSqCh::good();
unsigned    DoubleLeastSqCh::good();
unsigned    DComplexLeastSqCh::good();
unsigned    FloatLeastSqSV::good();
unsigned    DoubleLeastSqSV::good();
unsigned    DComplexLeastSqSV::good();
unsigned    FloatLeastSqCh::rank();
unsigned    DoubleLeastSqCh::rank();
unsigned    DComplexLeastSqCh::rank();
unsigned    FloatLeastSqQR::rank();
unsigned    DoubleLeastSqQR::rank();
unsigned    DComplexLeastSqQR::rank();
unsigned    FloatLeastSqSV::rank();
unsigned    DoubleLeastSqSV::rank();
unsigned    DComplexLeastSqSV::rank();
unsigned    FloatLeastSqCh::rows();
unsigned    DoubleLeastSqCh::rows();
unsigned    DComplexLeastSqCh::rows();
unsigned    FloatLeastSqQR::rows();
unsigned    DoubleLeastSqQR::rows();
unsigned    DComplexLeastSqQR::rows();
unsigned    FloatLeastSqSV::rows();
unsigned    DoubleLeastSqSV::rows();
unsigned    DComplexLeastSqSV::rows();
void
FloatLeastSqSV::truncate(float tol);
unsigned
DoubleLeastSqSV::truncate(double tol);
unsigned
DComplexLeastSqSV::truncate(double tol);
unsigned 
FloatLeastSqCh::residual(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqCh::residual(const RWMathVec<double>& b);
unsigned 
DComplexLeastSqCh::residual(const RWMathVec<DComplex>& b);
unsigned
FloatLeastSqQR::residual(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqQR::residual(const RWMathVec<double>& b);
unsigned 
DComplexLeastSqQR::residual(const RWMathVec<DComplex>& b);
unsigned 
FloatLeastSqSV::residual(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqSV::residual(const RWMathVec<double>& b);
unsigned 
DComplexLeastSqSV::residual(const RWMathVec<DComplex>& b);
unsigned 
FloatLeastSqCh::residualNorm(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqCh::residualNorm(const RWMathVec<double>& b);
unsigned 
DComplexLeastSqCh::residualNorm(const RWMathVec<DComplex>& b);
unsigned 
FloatLeastSqQR::residualNorm(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqQR::residualNorm(const RWMathVec<double>& b);
unsigned
DComplexLeastSqQR::residualNorm(const RWMathVec<DComplex>& b);
unsigned 
FloatLeastSqSV::residualNorm(const RWMathVec<float>& b);
unsigned 
DoubleLeastSqSV::residualNorm(const RWMathVec<double>& b);
unsigned 
DComplexLeastSqSV::residualNorm(const RWMathVec<DComplex>& b);
RWMathVec<float>
FloatLeastSqCh::solve(const RWMathVec<float>& b);
RWMathVec<double>
DoubleLeastSqCh::solve(const RWMathVec<double>& b);
RWMathVec<DComplex>
DComplexLeastSqCh::solve(const RWMathVec<DComplex>& b);
RWMathVec<float>
FloatLeastSqQR::solve(const RWMathVec<float>& b);
RWMathVec<double>
DoubleLeastSqQR::solve(const RWMathVec<double>& b);
RWMathVec<DComplex>
DComplexLeastSqQR::solve(const RWMathVec<DComplex>& b);
RWMathVec<float>
FloatLeastSqSV::solve(const RWMathVec<float>& b);
RWMathVec<double>
DoubleLeastSqSV::solve(const RWMathVec<double>& b);
RWMathVec<DComplex>
DComplexLeastSqSV::solve(const RWMathVec<DComplex>& b);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.