eLynx SDK v3.3.0
C++ image processing API reference
Static Public Member Functions

eLynx::Math::LeastSquares Class Reference

Least squares problems solver. More...

#include <LeastSquares.h>

List of all members.

Static Public Member Functions

static void Solve (const IMatrix &iA, const IVector &iB, IVector &oX, double iTau=1e-9)
 Solves given least squares problems using HFTI method.

Detailed Description

Least squares problems solver.

The class implements HFTI method to solve overdetermined least squares problems using Householder transformations. The method is taken from 'Solving Least Squares Problems' by Charles L. Lawson and Richard J. Hanson. Author of this code does not pretend he understands how the method works :-). He is happy enough with the fact he is able to implement the algorithm, to create inputs and to understand the outputs. The problem is described by the set of M linear equations with N variables, where M is typically greater than N. The system of linear equations is represented (as usual) by the M x N matrix A (the matrix of the coefficients) and the M-size vector B (the vector of the right sides). The solution is N-size vector X, while euclidean length ||A*X-B|| is minimized. The method is able to deal with possible problems like linear dependency between rows of the matrix A (even when the problem is caused by floating point precision deficiency).


Member Function Documentation

static void eLynx::Math::LeastSquares::Solve ( const IMatrix iA,
const IVector iB,
IVector oX,
double  iTau = 1e-9 
) [static]

Solves given least squares problems using HFTI method.

The input is the system of linear equations Ax=B and the floating point precision constant tau - numbers, whose absolute value is less than tau are considered to be zero. The output is vector X (solution of the problem).

Parameters:
iAthe M x N matrix of coefficients of the system of linear equations
iBthe M-size vector of the right sides of the system of linear equations
oXthe N-size vector, where the solution will be stored
iTauthe floating point precision constant

The documentation for this class was generated from the following file:

Generated on Thu Dec 9 2010 by doxygen 1.7.2