Object NnlsSolver

  • All Implemented Interfaces:

    
    public class NnlsSolver
    
                        

    Non-negative least squares solver implementing the Lawson-Hanson algorithm.

    Solves: min ||Ax - b||^2 subject to x >= 0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static NnlsSolver INSTANCE
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Matrix lsqnonneg(Matrix A, Matrix b) Solve the NNLS problem: min ||Ax - b||^2 subject to x >= 0
      final static DoubleArray lsqnonneg(Array<DoubleArray> A, DoubleArray b) Solve NNLS with double array inputs: min ||Ax - b||^2 subject to x >= 0
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 n
        b - right-hand side as 1D double array m
        Returns:

        solution as 1D double array n