Class QRUpdater
java.lang.Object
org.hipparchus.optim.nonlinear.vector.constrained.QRUpdater
Updates a QR factorization when adding or removing constraints in active-set methods.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new QRUpdater given the lower triangular matrix L. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a constraint vector and updates the QR factorization via a backward Givens cascade.applyJActive(RealVector coeffs) Applies the active part of J (J1 * coeffs).Computes d = J^T * a.Computes z = J_inactive * d_inactive.voiddeleteConstraint(int index) Deletes the active constraint at the specified index.intgetIq()Get current number of active constraints.getJ()Get the full working matrix J.getR()Get the current active R factor.solveR(RealVector d) Solves R x = rhs using backward substitution.solveRT(RealVector rhs) Solves R^T * x = rhs using forward substitution.
-
Constructor Details
-
QRUpdater
Constructs a new QRUpdater given the lower triangular matrix L.J is initialized as L^T using matrix-level operations to preserve block-storage benefits if n is large.
- Parameters:
L- lower triangular matrix from Cholesky decomposition.
-
-
Method Details
-
addConstraint
Adds a constraint vector and updates the QR factorization via a backward Givens cascade.- Parameters:
d- constraint vector to add.- Returns:
trueif added successfully;falseif degenerate.
-
deleteConstraint
public void deleteConstraint(int index) Deletes the active constraint at the specified index.- Parameters:
index- index of the constraint to remove.
-
computeZ
Computes z = J_inactive * d_inactive.- Parameters:
d- vector containing inactive components from index iq.- Returns:
- resulting vector z of dimension n.
-
solveR
Solves R x = rhs using backward substitution.- Parameters:
d- right-hand side vector.- Returns:
- solution vector of dimension iq.
-
solveRT
Solves R^T * x = rhs using forward substitution.- Parameters:
rhs- right-hand side vector.- Returns:
- solution vector of dimension iq.
-
applyJActive
Applies the active part of J (J1 * coeffs).- Parameters:
coeffs- multipliers for active constraints.- Returns:
- resulting vector of dimension n.
-
getR
Get the current active R factor.- Returns:
- the current active R factor (submatrix if iq < n)
-
getJ
Get the full working matrix J.- Returns:
- the full working matrix J
-
getIq
public int getIq()Get current number of active constraints.- Returns:
- current number of active constraints.
-
computeD
Computes d = J^T * a.- Parameters:
a- a vector- Returns:
- d = J^T * a
-