cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
nmrLSMinNorm.h File Reference
#include <cisstNumerical/nmrNetlib.h>
#include <cisstVector/vctDynamicMatrix.h>
#include <cisstNumerical/nmrExport.h>

Go to the source code of this file.

Classes

class  nmrLSMinNorm
 
class  nmrLSMinNorm::Data
 

Functions

vctDynamicMatrix< double >
CISST_EXPORT 
nmrLSMinNorm (vctDynamicMatrix< double > &A, vctDynamicMatrix< double > &b, CISSTNETLIB_DOUBLE r=-1.0)
 Computes the minimum norm solution to a real linear least squares problem. More...
 
vctDynamicMatrix< double >
CISST_EXPORT 
nmrLSMinNorm (vctDynamicMatrix< double > &A, vctDynamicMatrix< double > &b, nmrLSMinNorm::Data &data, CISSTNETLIB_DOUBLE r=-1.0)
 Computes the minimum norm solution to a real linear least squares problem. More...
 

Function Documentation

vctDynamicMatrix<double> CISST_EXPORT nmrLSMinNorm ( vctDynamicMatrix< double > &  A,
vctDynamicMatrix< double > &  b,
CISSTNETLIB_DOUBLE  r = -1.0 
)

Computes the minimum norm solution to a real linear least squares problem.

Computes the minimum norm solution to a real linear least squares problem: $ \min_{\mathbf{x}} \| \mathbf{b} - A\mathbf{x} \| $

Parameters
[in]AThe $ M \times N $ column major matrix.
[out]AThe first $ \min ( M \times N ) $ right singular vectors.
[in]bThe $ M \times O $ column major matrix. The matrix can be overwritten.
rUsed to determine the effective rank of A. Singular values $ \sigma_i \leq r\sigma_1 $ are treated as zero (low rank approximation). If $ r<0 $, machine precision is used instead.
Returns
The $ N \times O $ minimum norm solutions $ \mathbf{x} $.
vctDynamicMatrix<double> CISST_EXPORT nmrLSMinNorm ( vctDynamicMatrix< double > &  A,
vctDynamicMatrix< double > &  b,
nmrLSMinNorm::Data data,
CISSTNETLIB_DOUBLE  r = -1.0 
)

Computes the minimum norm solution to a real linear least squares problem.

Computes the minimum norm solution to a real linear least squares problem: $ \min_{\mathbf{x}} \| \mathbf{b} - A\mathbf{x} \| $

Parameters
[in]AA $ M \times N $ column major matrix.
[out]AThe first $ \min ( M \times N ) $ right singular vectors.
[in]bA $ M \times O $ column major matrix. The matrix can be overwritten.
[in]dataProvide pre-allocated workspace. If the workspace is not adequate it will be reallocated.
rUsed to determine the effective rank of A. Singular values $ \sigma_i \leq r\sigma_1 $ are treated as zero (low rank approximation). If $ r<0 $, machine precision is used instead.
Returns
The $ N \times O $ minimum norm solutions $ \mathbf{x} $.