Class DenseSolve

java.lang.Object
de.labathome.trustconstr.sparse.DenseSolve

public final class DenseSolve extends Object
Thin wrapper around LAPACK direct linear solvers for the trust-constr KKT path.

The trust-region constrained algorithm needs to solve the augmented KKT system

     [ I    A^T ] [ x ]   [ b1 ]
     [ A     0  ] [ y ] = [ b2 ]
 
inside both the AugmentedSystem projection (projections.py:96-176) and eqp_kktfact (qp_subproblem.py:50-58). The Python implementation uses scipy.sparse.linalg.splu on the assembled CSC matrix; here we assemble in CSR/CSC, materialise to dense, and call LAPACK dgesv via LAPACK. This keeps the project pure-Java and unblocks the end-to-end algorithm -- replacing this with a real sparse LU is a single-call-site upgrade in Projections.augmentedSystem and QPSubproblem.eqpKktFact.
  • Method Details

    • factor

      public static DenseSolve.LUFactor factor(double[][] a)
      Factor a dense n x n matrix A via LAPACK dgetrf. The input is given in row-major form and is not modified.
      Parameters:
      a - square row-major matrix to factor
      Returns:
      the captured LU factorisation
      Throws:
      ArithmeticException - if A is singular (LAPACK info > 0)
    • solveLU

      public static double[] solveLU(double[][] a, double[] b)
      Convenience: factor and solve in one step. Equivalent to factor(a).solve(b) but reuses the factorisation only once, so prefer factor(double[][]) when you have multiple right-hand sides.
      Parameters:
      a - square row-major matrix to factor
      b - length-n right-hand side
      Returns:
      length-n solution x of A x = b