OpenMS
Loading...
Searching...
No Matches
NonNegativeLeastSquaresSolver.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
12#include <vector>
13
14namespace OpenMS
15{
34 {
35public:
36
39 {
41 ITERATION_EXCEEDED
42 };
43
63 static Int solve(const Matrix<double>& A, const Matrix<double>& b, Matrix<double>& x);
64
97 static Int solve(double* A, int A_rows, int A_cols,
98 std::vector<double>& b, std::vector<double>& x);
99
121 static Int solve(Matrix<double>& A, std::vector<double>& b, std::vector<double>& x);
122 };
123
124} // namespace OpenMS
A 2D matrix class with efficient buffer access for NumPy interoperability.
Definition Matrix.h:35
Wrapper around the Lawson-Hanson non-negative least squares (NNLS) Fortran routine.
Definition NonNegativeLeastSquaresSolver.h:34
static Int solve(const Matrix< double > &A, const Matrix< double > &b, Matrix< double > &x)
Solve argmin_{x >= 0} ||Ax - b||_2 without modifying the inputs.
static Int solve(Matrix< double > &A, std::vector< double > &b, std::vector< double > &x)
In-place Matrix / std::vector overload of solve.
RETURN_STATUS
Return status of solve.
Definition NonNegativeLeastSquaresSolver.h:39
@ SOLVED
NNLS converged within the iteration limit; x holds the solution.
Definition NonNegativeLeastSquaresSolver.h:40
static Int solve(double *A, int A_rows, int A_cols, std::vector< double > &b, std::vector< double > &x)
In-place pointer overload of solve.
int Int
Signed integer type.
Definition Types.h:72
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19