Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
NNLS.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2017.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_MATH_MISC_NNLS_NNLS_H
36 #define OPENMS_MATH_MISC_NNLS_NNLS_H
37 
38 #include <OpenMS/config.h>
39 
40 namespace OpenMS
41 {
42 
43  namespace NNLS
44  {
45  typedef int integer;
46 
47  /* SUBROUTINE NNLS (A,MDA,M,N,B,X,RNORM,W,ZZ,INDEX,MODE) */
48 
49  /* Algorithm NNLS: NONNEGATIVE LEAST SQUARES */
50 
51  /* The original version of this code was developed by */
52  /* Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory */
53  /* 1973 JUN 15, and published in the book */
54  /* "SOLVING LEAST SQUARES PROBLEMS", Prentice-Hall, 1974. */
55  /* Revised FEB 1995 to accompany reprinting of the book by SIAM. */
56 
57  /* GIVEN AN M BY N MATRIX, A, AND AN M-VECTOR, B, COMPUTE AN */
58  /* N-VECTOR, X, THAT SOLVES THE LEAST SQUARES PROBLEM */
59 
60  /* A * X = B SUBJECT TO X .GE. 0 */
61  /* ------------------------------------------------------------------ */
62  /* Subroutine Arguments */
63 
64  /* A(),MDA,M,N MDA IS THE FIRST DIMENSIONING PARAMETER FOR THE */
65  /* ARRAY, A(). ON ENTRY A() CONTAINS THE M BY N */
66  /* MATRIX, A. ON EXIT A() CONTAINS */
67  /* THE PRODUCT MATRIX, Q*A , WHERE Q IS AN */
68  /* M BY M ORTHOGONAL MATRIX GENERATED IMPLICITLY BY */
69  /* THIS SUBROUTINE. */
70  /* B() ON ENTRY B() CONTAINS THE M-VECTOR, B. ON EXIT B() CON- */
71  /* TAINS Q*B. */
72  /* X() ON ENTRY X() NEED NOT BE INITIALIZED. ON EXIT X() WILL */
73  /* CONTAIN THE SOLUTION VECTOR. */
74  /* RNORM ON EXIT RNORM CONTAINS THE EUCLIDEAN NORM OF THE */
75  /* RESIDUAL VECTOR. */
76  /* W() AN N-ARRAY OF WORKING SPACE. ON EXIT W() WILL CONTAIN */
77  /* THE DUAL SOLUTION VECTOR. W WILL SATISFY W(I) = 0. */
78  /* FOR ALL I IN SET P AND W(I) .LE. 0. FOR ALL I IN SET Z */
79  /* ZZ() AN M-ARRAY OF WORKING SPACE. */
80  /* INDEX() AN INTEGER WORKING ARRAY OF LENGTH AT LEAST N. */
81  /* ON EXIT THE CONTENTS OF THIS ARRAY DEFINE THE SETS */
82  /* P AND Z AS FOLLOWS.. */
83 
84  /* INDEX(1) THRU INDEX(NSETP) = SET P. */
85  /* INDEX(IZ1) THRU INDEX(IZ2) = SET Z. */
86  /* IZ1 = NSETP + 1 = NPP1 */
87  /* IZ2 = N */
88  /* MODE THIS IS A SUCCESS-FAILURE FLAG WITH THE FOLLOWING */
89  /* MEANINGS. */
90  /* 1 THE SOLUTION HAS BEEN COMPUTED SUCCESSFULLY. */
91  /* 2 THE DIMENSIONS OF THE PROBLEM ARE BAD. */
92  /* EITHER M .LE. 0 OR N .LE. 0. */
93  /* 3 ITERATION COUNT EXCEEDED. MORE THAN 3*N ITERATIONS. */
94  int OPENMS_DLLAPI nnls_(double * a, integer * mda, integer * m, integer *
95  n, double * b, double * x, double * rnorm, double * w,
96  double * zz, integer * index, integer * mode);
97 
98  /* Subroutine */
99  int OPENMS_DLLAPI g1_(double *, double *, double *, double *, double *);
100 
101  /* Subroutine */
102  int OPENMS_DLLAPI h12_(integer *, integer *, integer *, integer *, double *, integer *, double *, double *, integer *, integer *, integer *);
103 
104  /* Subroutine */
105  double OPENMS_DLLAPI diff_(double *, double *);
106 
107  /* Subroutine */
108  double OPENMS_DLLAPI d_sign_(double & a, double & b);
109  }
110 
111 }
112 
113 #endif //OPENMS_MATH_MISC_NNLS_NNLS_H
double diff_(double *, double *)
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
int h12_(integer *, integer *, integer *, integer *, double *, integer *, double *, double *, integer *, integer *, integer *)
double d_sign_(double &a, double &b)
int integer
Definition: NNLS.h:45
int nnls_(double *a, integer *mda, integer *m, integer *n, double *b, double *x, double *rnorm, double *w, double *zz, integer *index, integer *mode)
int g1_(double *, double *, double *, double *, double *)

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:02 using doxygen 1.8.13