OpenMS
NNLS.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/config.h>
12 
13 namespace OpenMS
14 {
15 
16  namespace NNLS
17  {
18  typedef int integer;
19 
20  /* SUBROUTINE NNLS (A,MDA,M,N,B,X,RNORM,W,ZZ,INDEX,MODE) */
21 
22  /* Algorithm NNLS: NONNEGATIVE LEAST SQUARES */
23 
24  /* The original version of this code was developed by */
25  /* Charles L. Lawson and Richard J. Hanson at Jet Propulsion Laboratory */
26  /* 1973 JUN 15, and published in the book */
27  /* "SOLVING LEAST SQUARES PROBLEMS", Prentice-Hall, 1974. */
28  /* Revised FEB 1995 to accompany reprinting of the book by SIAM. */
29 
30  /* GIVEN AN M BY N MATRIX, A, AND AN M-VECTOR, B, COMPUTE AN */
31  /* N-VECTOR, X, THAT SOLVES THE LEAST SQUARES PROBLEM */
32 
33  /* A * X = B SUBJECT TO X .GE. 0 */
34  /* ------------------------------------------------------------------ */
35  /* Subroutine Arguments */
36 
37  /* A(),MDA,M,N MDA IS THE FIRST DIMENSIONING PARAMETER FOR THE */
38  /* ARRAY, A(). ON ENTRY A() CONTAINS THE M BY N */
39  /* MATRIX, A. ON EXIT A() CONTAINS */
40  /* THE PRODUCT MATRIX, Q*A , WHERE Q IS AN */
41  /* M BY M ORTHOGONAL MATRIX GENERATED IMPLICITLY BY */
42  /* THIS SUBROUTINE. */
43  /* B() ON ENTRY B() CONTAINS THE M-VECTOR, B. ON EXIT B() CON- */
44  /* TAINS Q*B. */
45  /* X() ON ENTRY X() NEED NOT BE INITIALIZED. ON EXIT X() WILL */
46  /* CONTAIN THE SOLUTION VECTOR. */
47  /* RNORM ON EXIT RNORM CONTAINS THE EUCLIDEAN NORM OF THE */
48  /* RESIDUAL VECTOR. */
49  /* W() AN N-ARRAY OF WORKING SPACE. ON EXIT W() WILL CONTAIN */
50  /* THE DUAL SOLUTION VECTOR. W WILL SATISFY W(I) = 0. */
51  /* FOR ALL I IN SET P AND W(I) .LE. 0. FOR ALL I IN SET Z */
52  /* ZZ() AN M-ARRAY OF WORKING SPACE. */
53  /* INDEX() AN INTEGER WORKING ARRAY OF LENGTH AT LEAST N. */
54  /* ON EXIT THE CONTENTS OF THIS ARRAY DEFINE THE SETS */
55  /* P AND Z AS FOLLOWS.. */
56 
57  /* INDEX(1) THRU INDEX(NSETP) = SET P. */
58  /* INDEX(IZ1) THRU INDEX(IZ2) = SET Z. */
59  /* IZ1 = NSETP + 1 = NPP1 */
60  /* IZ2 = N */
61  /* MODE THIS IS A SUCCESS-FAILURE FLAG WITH THE FOLLOWING */
62  /* MEANINGS. */
63  /* 1 THE SOLUTION HAS BEEN COMPUTED SUCCESSFULLY. */
64  /* 2 THE DIMENSIONS OF THE PROBLEM ARE BAD. */
65  /* EITHER M .LE. 0 OR N .LE. 0. */
66  /* 3 ITERATION COUNT EXCEEDED. MORE THAN 3*N ITERATIONS. */
67  int OPENMS_DLLAPI nnls_(double * a, integer * mda, integer * m, integer *
68  n, double * b, double * x, double * rnorm, double * w,
69  double * zz, integer * index, integer * mode);
70 
71  /* Subroutine */
72  int OPENMS_DLLAPI g1_(double *, double *, double *, double *, double *);
73 
74  /* Subroutine */
75  int OPENMS_DLLAPI h12_(integer *, integer *, integer *, integer *, double *, integer *, double *, double *, integer *, integer *, integer *);
76 
77  /* Subroutine */
78  double OPENMS_DLLAPI diff_(double *, double *);
79 
80  /* Subroutine */
81  double OPENMS_DLLAPI d_sign_(double & a, double & b);
82  }
83 
84 }
85 
int h12_(integer *, integer *, integer *, integer *, double *, integer *, double *, double *, integer *, integer *, integer *)
int integer
Definition: NNLS.h:18
double diff_(double *, double *)
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 *)
double d_sign_(double &a, double &b)
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19