Package jline.inference.util
Object NnlsSolver
-
- All Implemented Interfaces:
public class NnlsSolverNon-negative least squares solver implementing the Lawson-Hanson algorithm.
Solves: min ||Ax - b||^2 subject to x >= 0
-
-
Field Summary
Fields Modifier and Type Field Description public final static NnlsSolverINSTANCE
-
Method Summary
Modifier and Type Method Description final static Matrixlsqnonneg(Matrix A, Matrix b)Solve the NNLS problem: min ||Ax - b||^2 subject to x >= 0 final static DoubleArraylsqnonneg(Array<DoubleArray> A, DoubleArray b)Solve NNLS with double array inputs: min ||Ax - b||^2 subject to x >= 0 -
-
Method Detail
-
lsqnonneg
final static Matrix lsqnonneg(Matrix A, Matrix b)
Solve the NNLS problem: min ||Ax - b||^2 subject to x >= 0
- Parameters:
A- coefficient matrix (m x n)b- right-hand side vector (m x 1)- Returns:
solution vector x (n x 1)
-
lsqnonneg
final static DoubleArray lsqnonneg(Array<DoubleArray> A, DoubleArray b)
Solve NNLS with double array inputs: min ||Ax - b||^2 subject to x >= 0
- Parameters:
A- coefficient matrix as 2D double array nb- right-hand side as 1D double array m- Returns:
solution as 1D double array n
-
-
-
-