Package de.labathome.trustconstr.sparse
Class DenseSolve
java.lang.Object
de.labathome.trustconstr.sparse.DenseSolve
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classFactorisation of a square matrixAready to repeatedlyDenseSolve.LUFactor.solve(double[])against right-hand sides. -
Method Summary
Modifier and TypeMethodDescriptionstatic DenseSolve.LUFactorfactor(double[][] a) Factor a densen x nmatrixAvia LAPACKdgetrf.static double[]solveLU(double[][] a, double[] b) Convenience: factor and solve in one step.
-
Method Details
-
factor
Factor a densen x nmatrixAvia LAPACKdgetrf. 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- ifAis singular (LAPACK info > 0)
-
solveLU
public static double[] solveLU(double[][] a, double[] b) Convenience: factor and solve in one step. Equivalent tofactor(a).solve(b)but reuses the factorisation only once, so preferfactor(double[][])when you have multiple right-hand sides.- Parameters:
a- square row-major matrix to factorb- length-nright-hand side- Returns:
- length-
nsolutionxofA x = b
-