cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nmrLSMinNorm.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5  $Id: nmrLSMinNorm.h 4267 2013-06-11 14:01:21Z sleonar7 $
6 
7  Author(s): Simon Leonard
8  Created on: 2013-06-11
9 
10  (C) Copyright 2004-2007 Johns Hopkins University (JHU), All Rights
11  Reserved.
12 
13 --- begin cisst license - do not edit ---
14 
15 This software is provided "as is" under an open source license, with
16 no warranty. The complete license can be found in license.txt and
17 http://www.cisst.org/cisst/license.txt.
18 
19 --- end cisst license ---
20 */
21 
22 #ifndef _nmrLSMinNorm_h
23 #define _nmrLSMinNorm_h
24 
27 
29 
31 
32 public:
33 
34  class Data{
35 
36  public:
37 
38  CISSTNETLIB_INTEGER M; // number of rows of matrix A
39  CISSTNETLIB_INTEGER N; // number of columns of matrix A
40  CISSTNETLIB_INTEGER NRHS;// number of right hand side vectors (columns of b)
41 
42  CISSTNETLIB_INTEGER LDA; // lead dimension of matrix A (column stride)
43  CISSTNETLIB_INTEGER LDB; // lead dimension of matrix B (column stride)
44  // LDB = max( M, N )
45 
46  CISSTNETLIB_DOUBLE* S; // vector of singular values
47  CISSTNETLIB_DOUBLE RCOND;// used to determine the effective rank of A
48  CISSTNETLIB_INTEGER RANK;// effective rank of A
49 
50  CISSTNETLIB_DOUBLE* WORK;// work space
51  CISSTNETLIB_INTEGER LWORK; // size of work space (determined by dgless)
52 
53  CISSTNETLIB_INTEGER INFO;// error number
54 
55  // if A is underdetermined, we need to reallocate b to a LDBxNRHS matrix
56  // and copy b into the upper MxNRHS block
59 
60  Data();
61 
62  // fill in the values
63  Data( const vctDynamicMatrix<double>& A,
64  const vctDynamicMatrix<double>& b,
65  double rcond = -1 );
66 
67  ~Data();
68 
70  const vctDynamicMatrix<double>& b ) const;
71 
72  void CheckInfo() const;
73 
74  };
75 
76 };
77 
79 
94  CISSTNETLIB_DOUBLE r = -1.0);
95 
97 
114  nmrLSMinNorm::Data& data,
115  CISSTNETLIB_DOUBLE r = -1.0);
116 
117 #endif
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
CISSTNETLIB_INTEGER N
Definition: nmrLSMinNorm.h:39
Declaration of vctDynamicMatrix.
Definition: nmrLSMinNorm.h:30
vctDynamicMatrix< double > B
Definition: nmrLSMinNorm.h:58
CISSTNETLIB_DOUBLE RCOND
Definition: nmrLSMinNorm.h:47
bool underdetermined
Definition: nmrLSMinNorm.h:57
CISSTNETLIB_DOUBLE * S
Definition: nmrLSMinNorm.h:46
CISSTNETLIB_DOUBLE * WORK
Definition: nmrLSMinNorm.h:50
CISSTNETLIB_INTEGER LDB
Definition: nmrLSMinNorm.h:43
void CheckInfo() const
void CheckSystem(const vctDynamicMatrix< double > &A, const vctDynamicMatrix< double > &b) const
CISSTNETLIB_INTEGER LWORK
Definition: nmrLSMinNorm.h:51
CISSTNETLIB_INTEGER M
Definition: nmrLSMinNorm.h:38
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.
CISSTNETLIB_INTEGER LDA
Definition: nmrLSMinNorm.h:42
CISSTNETLIB_INTEGER NRHS
Definition: nmrLSMinNorm.h:40
CISSTNETLIB_INTEGER RANK
Definition: nmrLSMinNorm.h:48
Rules of exporting.
Definition: nmrLSMinNorm.h:34
CISSTNETLIB_INTEGER INFO
Definition: nmrLSMinNorm.h:53