java.lang.Object
org.hipparchus.optim.nonlinear.vector.constrained.QRUpdater

public class QRUpdater extends Object
Updates a QR factorization when adding or removing constraints in active-set methods.
See Also:
  • "J. W. Daniel, W. B. Gragg, L. Kaufman and G. W. Stewart, Reorthogonalization and Stable Algorithms for Updating the Gram-Schmidt QR Factorization"
  • Constructor Details

    • QRUpdater

      public QRUpdater(RealMatrix L)
      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

      public boolean addConstraint(RealVector d)
      Adds a constraint vector and updates the QR factorization via a backward Givens cascade.
      Parameters:
      d - constraint vector to add.
      Returns:
      true if added successfully; false if degenerate.
    • deleteConstraint

      public void deleteConstraint(int index)
      Deletes the active constraint at the specified index.
      Parameters:
      index - index of the constraint to remove.
    • computeZ

      public RealVector computeZ(RealVector d)
      Computes z = J_inactive * d_inactive.
      Parameters:
      d - vector containing inactive components from index iq.
      Returns:
      resulting vector z of dimension n.
    • solveR

      public RealVector solveR(RealVector d)
      Solves R x = rhs using backward substitution.
      Parameters:
      d - right-hand side vector.
      Returns:
      solution vector of dimension iq.
    • solveRT

      public RealVector solveRT(RealVector rhs)
      Solves R^T * x = rhs using forward substitution.
      Parameters:
      rhs - right-hand side vector.
      Returns:
      solution vector of dimension iq.
    • applyJActive

      public RealVector applyJActive(RealVector coeffs)
      Applies the active part of J (J1 * coeffs).
      Parameters:
      coeffs - multipliers for active constraints.
      Returns:
      resulting vector of dimension n.
    • getR

      public RealMatrix getR()
      Get the current active R factor.
      Returns:
      the current active R factor (submatrix if iq < n)
    • getJ

      public RealMatrix 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

      public RealVector computeD(RealVector a)
      Computes d = J^T * a.
      Parameters:
      a - a vector
      Returns:
      d = J^T * a