Class SparseLP
- All Implemented Interfaces:
Serializable,Cloneable
Class SparseLP uses an infeasible primal-dual interior-point
method to solve linear programming problems, i.e., problems of the form
$$\begin{array}{cll} \min{c^Tx} & \mbox{subject to} & b_l\le Ax\le b_u\\ {x\in {R}^n} && \\ & & x_l \le x \le x_u\\ \end{array}$$
where c is the objective coefficient vector, A is the coefficient matrix, and the vectors \(b_l\), \(b_u\), \(x_l\), and \(x_u\) are the lower and upper bounds on the constraints and the variables, respectively.
Internally, SparseLP transforms the problem given by the user
into a simpler form that is computationally more tractable. After redefining
the notation, the new form reads
$$\begin{array}{llrlrr} \min{c^Tx} & \mbox{subject to} & Ax&= b & & \\ & & x_i+s_i&=u_i, & x_i, s_i \ge 0, & i\in I_u \\ & & x_j&\ge 0, & & j\in I_s \end{array}$$
Here, \(I_u \cup I_s = \{1,\ldots,n\}\) is a partition of the index set \(\{1,\ldots,n\}\) into upper bounded and standard variables.
In order to simplify the description it is assumed in the following that the problem above contains only variables with upper bounds, i.e. is of the form
$$\begin{array}{cllc} (P) &\min{c^Tx}& \mbox{subject to} & Ax= b\\ &&& x+s=u,\\ &&& x,s\ge 0 \end{array}$$
The corresponding dual problem is
$$\begin{array}{cllr} (D)&\max{b^Ty-u^Tw} & \mbox{subject to} & A^Ty+z-w=c,\\ &&& z,w\ge 0 \end{array}$$
The Karush-Kuhn-Tucker (KKT) optimality conditions for (P) and (D) are
$$\begin{array}{rlr} Ax&=b,&\quad (1.1)\\ x+s&=u,&\quad (1.2)\\ A^Ty+z-w&=c,&\quad (1.3)\\ XZe&=0,&\quad (1.4)\\ SWe&=0,&\quad (1.5)\\ x,z,s,w&\ge 0,&\quad (1.6) \end{array}$$
where \(X=diag(x), Z=diag(z), S=diag(s), W=diag(w)\) are diagonal matrices and \(e=(1,\ldots,1)^T\) is a vector of ones.
Class SparseLP, like all infeasible interior-point methods,
generates a sequence
$$(x_k,s_k,y_k,z_k,w_k), \quad k=0,1,\ldots$$
of iterates that satisfy \((x_k,s_k,y_k,z_k,w_k)>0\) for all k, but are in general not feasible, i.e. the linear constraints (1.1)-(1.3) are only satisfied in the limiting case \(k \to \infty\).
The barrier parameter \(\mu\), defined by
$$\mu = \frac{x^Tz+s^Tw}{2n}$$
measures how good the complementarity conditions (1.4), (1.5) are satisfied.
Mehrotra's predictor-corrector algorithm is a variant of Newton's method
applied to the KKT conditions (1.1)-(1.5). Class SparseLP uses a
modified version of this algorithm to compute the iterates
\((x_k,s_k,y_k,z_k,w_k)\). In every step of the algorithm,
the search direction vector
$$\Delta := (\Delta x, \Delta s, \Delta y, \Delta z, \Delta w)$$
is decomposed into two parts, \(\Delta = \Delta_a + \Delta_c^{\omega}\), where \(\Delta_a\) and \(\Delta_c^{\omega}\) denote the affine-scaling and the weighted centering components, respectively. Here,
$$\Delta_c^{\omega}:=(\omega_P\Delta x_c, \omega_P\Delta s_c, \omega_D \Delta y_c, \omega_D \Delta z_c, \omega_D \Delta w_c)$$
where \(\omega_P\) and \(\omega_D\) denote the primal and dual corrector weights, respectively.
The vectors \(\Delta_a\) and \(\Delta_c := (\Delta x_c, \Delta s_c, \Delta y_c, \Delta z_c, \Delta w_c)\) are determined by solving the linear system
$$\begin{bmatrix} A & 0 & 0 & 0 & 0\\ I & 0 & I & 0 & 0\\ 0 & A^T & 0 & I & -I\\ Z & 0 & 0 & X & 0\\ 0 & 0 & W & 0 & S \end{bmatrix} \begin{bmatrix} \Delta x\\ \Delta y\\ \Delta s\\ \Delta z\\ \Delta w \end{bmatrix} = \begin{bmatrix} r_b\\ r_u\\ r_c\\ r_{xz}\\ r_{ws} \end{bmatrix} \quad (2)$$
for two different right-hand sides.
For \(\Delta_a\), the right-hand side is defined as
$$(r_b,r_u,r_c,r_{xz},r_{ws})=(b-Ax,u-x-s,c-A^Ty-z+w,-XZe,-WSe).$$
Here, \(r_b\) and \(r_u\) are the violations of the primal constraints and \(r_c\) defines the violations of the dual constraints.
The resulting direction \(\Delta_a\) is the pure Newton step applied to the system (1.1)-(1.5).
In order to obtain the corrector direction \(\Delta_c\), the maximum stepsizes \(\alpha_{Pa}\) in the primal and \(\alpha_{Da}\) in the dual space preserving nonnegativity of \((x,s)\) and \((z,w)\) respectively, are determined, and the predicted complementarity gap
$$g_a = (x+\alpha_{Pa}\Delta x_a)^T(z+\alpha_{Da}\Delta z_a)+ (s+\alpha_{Pa}\Delta s_a)^T(w+\alpha_{Da}\Delta w_a)$$
is computed. It is then used to determine the barrier parameter
$$\hat{\mu} = \left( \frac{g_a}{g} \right)^2 \frac{g_a}{2n},$$
where \(g=x^Tz+s^Tw\) denotes the current complementarity gap.
The direction \(\Delta_c\) is then computed by choosing
$$(r_b,r_u,r_c,r_{xz},r_{ws})=(0,0,0,\hat{\mu}e- \Delta X_a \Delta Z_a e,\hat{\mu} e-\Delta W_a \Delta S_ae)$$
as the right-hand side in the linear system (2).
Class SparseLP now uses a line search to find the optimal weight
\(\hat{\omega}=\left( \hat{\omega_P}, \hat{\omega_D} \right)\)
that maximizes the stepsizes \(\left( \alpha_P, \alpha_D \right)\)
in the primal and dual directions of
\(\Delta = \Delta_a + \Delta_c^{\omega}\), respectively.
A new iterate is then computed using a step reduction factor \(\alpha_0 = 0.99995\):
$$\begin{array}{cl} (x_{k+1},s_{k+1},y_{k+1},z_{k+1},w_{k+1}) \quad = & (x_k,s_k,y_k,z_k,w_k)+\\ & \quad \alpha_0 \left( \alpha_P \Delta x, \alpha_P \Delta s, \alpha_D \Delta y, \alpha_D \Delta z, \alpha_D \Delta w \right) \end{array}$$
In addition to the weighted Mehrotra predictor-corrector,
SparseLP also uses multiple centrality correctors to enlarge the
primal-dual stepsizes per iteration step and to reduce the overall number of
iterations required to solve an LP problem. The maximum number of centrality
corrections depends on the ratio of the factorization and solve efforts for
system (2) and is therefore problem dependent. For a detailed description of
multiple centrality correctors, refer to Gondzio (1994).
The linear system (2) can be reduced to more compact forms, the augmented system (AS)
$$\begin{bmatrix} -\Theta^{-1} & A^T\\ A & 0 \end{bmatrix} \begin{bmatrix} \Delta x\\ \Delta y \end{bmatrix} = \begin{bmatrix} r\\ h \end{bmatrix} \quad (3)$$
or further by elimination of \(\Delta x\) to the normal equations (NE) system
$$A \Theta A^T \Delta y = A \Theta r + h, \quad (4)$$
where
$$\Theta = \left( X^{-1}Z+S^{-1}W \right)^{-1}, r = r_c-X^{-1}r_{xz} +S^{-1}r_{ws}-S^{-1}Wr_u, h=r_b.$$
The matrix on the left-hand side of (3), which is symmetric indefinite, can be transformed into a symmetric quasidefinite matrix by regularization. Since these types of matrices allow for a Cholesky-like factorization, the resulting linear system can be solved easily for \((\Delta x, \Delta y)\) by triangular substitutions. For more information on the regularization technique, see Altman and Gondzio (1998). For the NE system, matrix \(A \Theta A^T\) is positive definite, and therefore a sparse Cholesky algorithm can be used to factor \(A \Theta A^T\) and solve the system for \(\Delta y\) by triangular substitutions with the Cholesky factor L.
In class SparseLP, both approaches are implemented. The AS
approach is chosen if A contains dense columns, if there are a
considerable number of columns in A that are much denser than the
remaining ones, or if there are many more rows than columns in the structural
part of A. Otherwise, the NE approach is selected.
Class SparseLP stops with optimal termination status if the
current iterate satisfies the following three conditions:
$$\frac{\mu}{1+0.5\left(\left|c^Tx\right|+\left|b^Ty-u^Tw\right|\right)} \le \mbox{optimalityTolerance}$$
$$\frac{\parallel \left(b-Ax,x+s-u\right)\parallel}{1+\parallel (b,u) \parallel} \le \mbox{primalTolerance}$$
and
$$\frac{\parallel c-A^Ty-z+w \parallel }{1+\parallel c \parallel} \le \mbox{dualTolerance}$$
where primalTolerance, dualTolerance and
optimalityTolerance are primal infeasibility, dual infeasibility
and optimality tolerances, respectively. The default value is 1.0e-10 for
optimalityTolerance and 1.0e-8 for the other two tolerances.
Class SparseLP is based on the code HOPDM developed by Jacek
Gondzio et al., see the HOPDM User's Guide (1995).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Cholesky factorization failed because of accuracy problems.static classA diagonal element of the diagonal weight matrix is too small.static classThe dual problem is infeasible.static classThe lower bound is greater than the upper bound.static classOne or more LP variables are falsely characterized by the internal presolver.static classOne or more LP variables are falsely characterized by the internal presolver.static classThe initial solution for the one-row linear program is infeasible.static classThe primal problem is infeasible.static classThe primal problem is unbounded.static classThe problem is unbounded.static classThe maximum number of iterations has been exceeded.static classA column of the constraint matrix has no entries.static classA row of the constraint matrix has no entries. -
Constructor Summary
ConstructorsConstructorDescriptionSparseLP(int[] colPtr, int[] rowInd, double[] values, double[] b, double[] c) Constructs aSparseLPobject using Compressed Sparse Column (CSC), or Harwell-Boeing format.Constructs aSparseLPobject using anMPSReaderobject.SparseLP(SparseMatrix a, double[] b, double[] c) Constructs aSparseLPobject. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of the constant term in the objective function.int[]Returns the types of general constraints in the matrix A.doubleReturns the dual infeasibility of the solution.doubleReturns the dual infeasibility tolerance.double[]Returns the dual solution.intReturns the number of iterations used by the primal-dual solver.doubleReturns the ratio of the largest complementarity product to the average.double[]Returns the lower bound on the variables.intReturns the maximum number of iterations allowed for the primal-dual solver.doubleReturns the optimal value of the objective function.intReturns the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrix.intReturns the presolve option.doubleReturns the primal infeasibility of the solution.doubleReturns the primal infeasibility tolerance.intReturns the print level.doubleReturns the relative optimality tolerance.doubleReturns the ratio of the smallest complementarity product to the average.double[]Returns the solution x of the linear programming problem.intReturns the termination status for the problem.double[]Returns the upper bound on the variables.double[]Returns the upper limit of the constraints that have both a lower and an upper bound.doubleReturns the violation of the variable bounds.voidsetConstant(double c0) Sets the value of the constant term in the objective function.voidsetConstraintType(int[] constraintType) Sets the types of general constraints in the matrix A.voidsetDualInfeasibilityTolerance(double dualTolerance) Sets the dual infeasibility tolerance.voidsetLowerBound(double[] lowerBound) Sets the lower bound on the variables.voidsetMaxIterations(int maxIterations) Sets the maximum number of iterations allowed for the primal-dual solver.voidsetPreordering(int preorder) Sets the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrix.voidsetPresolve(int presolve) Sets the presolve option.voidsetPrimalInfeasibilityTolerance(double primalTolerance) Sets the primal infeasibility tolerance.voidsetPrintLevel(int printLevel) Sets the print level.voidsetRelativeOptimalityTolerance(double optimalityTolerance) Sets the relative optimality tolerance.voidsetUpperBound(double[] upperBound) Sets the upper bound on the variables.voidsetUpperLimit(double[] bu) Sets the upper limit of the constraints that have both a lower and an upper bound.voidsolve()Solves the sparse linear programming problem by an infeasible primal-dual interior-point method.
-
Constructor Details
-
SparseLP
Constructs aSparseLPobject.- Parameters:
a- aSparseMatrixobject containing the location and value of each nonzero coefficient in the constraint matrix A. If there is no constraint matrix, seta = null.b- adoublearray of length m, the number of constraints, containing the right-hand side of the constraints. If there are limits on both sides of the constraints, thenbcontains the lower limit of the constraints.c- adoublearray of length n, the number of variables, containing the coefficients of the objective function
-
SparseLP
Constructs aSparseLPobject using anMPSReaderobject.- Parameters:
mps- anMPSReaderobject specifying the Linear Programming problem
-
SparseLP
public SparseLP(int[] colPtr, int[] rowInd, double[] values, double[] b, double[] c) Constructs aSparseLPobject using Compressed Sparse Column (CSC), or Harwell-Boeing format. See Compressed Sparse Column (CSC) Format, Chapter 1.- Parameters:
colPtr- anintarray containing the location invaluesin which to place the first nonzero value of each succeeding column of the constraint matrix A.colPtr,rowIndandvaluesspecify the location and value of each nonzero coefficient in the constraint matrix A in CSC format.rowInd- anintarray containing a list of the row indices of each column of the constraint matrix A.colPtr,rowIndandvaluesspecify the location and value of each nonzero coefficient in the constraint matrix A in CSC format.values- adoublearray containing the value of each nonzero coefficient in the constraint matrix A.colPtr,rowIndandvaluesspecify the location and value of each nonzero coefficient in the constraint matrix A in CSC format.b- adoublearray of length m, number of constraints, containing the right-hand side of the constraints; if there are limits on both sides of the constraints, thenbcontains the lower limit of the constraintsc- adoublearray of length n, the number of variables, containing the coefficients of the objective function
-
-
Method Details
-
solve
public void solve() throws SparseLP.DiagonalWeightMatrixException, SparseLP.CholeskyFactorizationAccuracyException, SparseLP.PrimalUnboundedException, SparseLP.PrimalInfeasibleException, SparseLP.DualInfeasibleException, SparseLP.InitialSolutionInfeasibleException, SparseLP.TooManyIterationsException, SparseLP.ProblemUnboundedException, SparseLP.ZeroColumnException, SparseLP.ZeroRowException, SparseLP.IncorrectlyEliminatedException, SparseLP.IncorrectlyActiveException, SparseLP.IllegalBoundsExceptionSolves the sparse linear programming problem by an infeasible primal-dual interior-point method.- Throws:
SparseLP.DiagonalWeightMatrixException- is thrown if a diagonal element of the diagonal weight matrix is too smallSparseLP.CholeskyFactorizationAccuracyException- is thrown if the Cholesky factorization failed because of accuracy problemsSparseLP.PrimalUnboundedException- is thrown if the primal problem is unboundedSparseLP.PrimalInfeasibleException- is thrown if the primal problem is infeasibleSparseLP.DualInfeasibleException- is thrown if the dual problem is infeasibleSparseLP.InitialSolutionInfeasibleException- is thrown if the initial solution for the one-row linear program is infeasibleSparseLP.TooManyIterationsException- is thrown if the maximum number of iterations has been exceededSparseLP.ProblemUnboundedException- is thrown if the problem is unboundedSparseLP.ZeroColumnException- is thrown if a column of the constraint matrix has no entriesSparseLP.ZeroRowException- is thrown if a row of the constraint matrix has no entriesSparseLP.IncorrectlyEliminatedException- is thrown if one or more LP variables are falsely characterized by the internal presolverSparseLP.IncorrectlyActiveException- is thrown if one or more LP variables are falsely characterized by the internal presolverSparseLP.IllegalBoundsException- is thrown if the lower bound is greater than the upper bound
-
setUpperBound
public void setUpperBound(double[] upperBound) Sets the upper bound on the variables.- Parameters:
upperBound- adoublearray of length n containing the upper bound \(x_u\) on the variables. If there is no upper bound on a variable, then 1.0e30 should be set as the upper bound.Default: None of the variables has an upper bound
-
getUpperBound
public double[] getUpperBound()Returns the upper bound on the variables.- Returns:
- a
doublearray containing the upper bound on the variables
-
setLowerBound
public void setLowerBound(double[] lowerBound) Sets the lower bound on the variables.- Parameters:
lowerBound- adoublearray of length n containing the lower bound \(x_l\) on the variables. If there is no lower bound on a variable, then -1.0e30 should be set as the lower bound.Default:
lowerBound[i] = 0
-
getLowerBound
public double[] getLowerBound()Returns the lower bound on the variables.- Returns:
- a
doublearray containing the lower bound on the variables
-
setConstraintType
public void setConstraintType(int[] constraintType) Sets the types of general constraints in the matrix A.- Parameters:
constraintType- anintarray of length m containing the types of general constraints in the matrix A. Let \(r_i = a_{i1}x_1 + \ldots + a_{in}x_n\). Then, the value ofconstraintType[i]signifies the following:constraintType
Constraint
0 \({\rm {r}}_i = {\rm {b}}_i\) 1 \({\rm {r}}_i \le {\rm {bu}}_i\) 2 \({\rm {r}}_i \ge {\rm {b}}_i\) 3 \({\rm {b}}_i \le {\rm {r}}_i \le {\rm {bu}}_i\) 4 Ignore this constraint
Note that
constraintType[i] = 3should only be used for constraintsiwith both a finite lower and a finite upper bound. For one-sided constraints, useconstraintType[i] = 1orconstraintType[i] = 2. For free constraints, useconstraintType[i] = 4.Default:
constraintType[i] = 0
-
getConstraintType
public int[] getConstraintType()Returns the types of general constraints in the matrix A. SeesetConstraintType.- Returns:
- an
intarray containing the types of general constraints in the matrix A
-
getOptimalValue
public double getOptimalValue()Returns the optimal value of the objective function.- Returns:
- a
doublescalar containing the optimal value of the objective function
-
getSolution
public double[] getSolution()Returns the solution x of the linear programming problem.- Returns:
- a
doublearray containing the solution x of the linear programming problem
-
setConstant
public void setConstant(double c0) Sets the value of the constant term in the objective function.- Parameters:
c0- adoublescalar containing the value of the constant term in the objective functionDefault:
c0 = 0
-
getConstant
public double getConstant()Returns the value of the constant term in the objective function.- Returns:
- a
doublescalar containing the value of the constant term in the objective function
-
setMaxIterations
public void setMaxIterations(int maxIterations) Sets the maximum number of iterations allowed for the primal-dual solver.- Parameters:
maxIterations- anintscalar containing the maximum number of iterations allowed for the primal-dual solverDefault:
maxIterations = 200
-
getMaxIterations
public int getMaxIterations()Returns the maximum number of iterations allowed for the primal-dual solver.- Returns:
- an
intscalar containing the maximum number of iterations allowed for the primal-dual solver
-
setRelativeOptimalityTolerance
public void setRelativeOptimalityTolerance(double optimalityTolerance) Sets the relative optimality tolerance.- Parameters:
optimalityTolerance- adoublescalar containing the relative optimality toleranceDefault:
optimalityTolerance = 1.0e-10
-
getRelativeOptimalityTolerance
public double getRelativeOptimalityTolerance()Returns the relative optimality tolerance.- Returns:
- a
doublescalar containing the relative optimality tolerance
-
setPrimalInfeasibilityTolerance
public void setPrimalInfeasibilityTolerance(double primalTolerance) Sets the primal infeasibility tolerance.- Parameters:
primalTolerance- adoublescalar containing the primal infeasibility toleranceDefault:
primalTolerance = 1.0e-8
-
getPrimalInfeasibilityTolerance
public double getPrimalInfeasibilityTolerance()Returns the primal infeasibility tolerance.- Returns:
- a
doublescalar containing the primal infeasibility tolerance
-
setDualInfeasibilityTolerance
public void setDualInfeasibilityTolerance(double dualTolerance) Sets the dual infeasibility tolerance.- Parameters:
dualTolerance- adoublescalar containing the dual infeasibility toleranceDefault:
dualTolerance = 1.0e-8
-
getDualInfeasibilityTolerance
public double getDualInfeasibilityTolerance()Returns the dual infeasibility tolerance.- Returns:
- a
doublescalar containing the dual infeasibility tolerance
-
setPreordering
public void setPreordering(int preorder) Sets the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrix.- Parameters:
preorder- anintscalar containing the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrixpreorder Method 0 A variant of the MDO algorithm using pivotal cliques. 1 A variant of George and Liu's Quotient Minimum Degree algorithm.
Default:
preorder = 0
-
getPreordering
public int getPreordering()Returns the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrix. SeesetPreordering.- Returns:
- an
intscalar containing the variant of the Minimum Degree Ordering (MDO) algorithm used in the preordering of the normal equations or augmented system matrix
-
setPrintLevel
public void setPrintLevel(int printLevel) Sets the print level.- Parameters:
printLevel- anintcontaining the print levelprintLevel Action 0 No printing. 1 Prints statistics on the LP problem and the solution process. Default:
printLevel = 0
-
getPrintLevel
public int getPrintLevel()Returns the print level. SeesetPrintLevel.- Returns:
- an
intscalar containing the print level
-
setPresolve
public void setPresolve(int presolve) Sets the presolve option.- Parameters:
presolve- anintcontaining the the presolve option to resolve the LP problem in order to reduce the problem size or to detect infeasibility or unboundedness of the problem. Depending on the number of presolve techniques used, different presolve levels can be chosen:presolve Description 0 No presolving. 1 Eliminate singleton rows. 2 In addition to 1, eliminate redundant (and forcing) rows. 3 In addition to 1 and 2, eliminate dominated variables. 4 In addition to 1, 2, and 3, eliminate singleton columns. 5 In addition to 1, 2, 3, and 4, eliminate doubleton rows. 6 In addition to 1, 2, 3, 4, and 5, eliminate aggregate columns. Default:
presolve = 0
-
getPresolve
public int getPresolve()Returns the presolve option. SeesetPresolve.- Returns:
- an
intscalar containing the presolve option
-
getIterationCount
public int getIterationCount()Returns the number of iterations used by the primal-dual solver.- Returns:
- an
intscalar containing the number of iterations used by the primal-dual solver
-
getTerminationStatus
public int getTerminationStatus()Returns the termination status for the problem.- Returns:
- an
intscalar containing the termination status for the problemstatus
Description
0 Optimal solution found. 1 The problem is primal infeasible (or dual unbounded). 2 The problem is primal unbounded (or dual infeasible). 3 Suboptimal solution found (accuracy problems). 4 Iterations limit maxIterationsexceeded.5 An error outside of the solution phase of the algorithm, e.g. a user input or a memory allocation error.
-
getDualSolution
public double[] getDualSolution()Returns the dual solution.- Returns:
- a
doublearray containing the dual solution
-
getSmallestCPRatio
public double getSmallestCPRatio()Returns the ratio of the smallest complementarity product to the average.- Returns:
- a
doublescalar containing the ratio of the smallest complementarity product to the average
-
getLargestCPRatio
public double getLargestCPRatio()Returns the ratio of the largest complementarity product to the average.- Returns:
- a
doublescalar containing the ratio of the largest complementarity product to the average
-
getDualInfeasibility
public double getDualInfeasibility()Returns the dual infeasibility of the solution.- Returns:
- a
doublescalar containing the dual infeasibility of the solution, \(\parallel c - A^Ty - z + w \parallel\)
-
setUpperLimit
public void setUpperLimit(double[] bu) Sets the upper limit of the constraints that have both a lower and an upper bound.- Parameters:
bu- adoublearray of length m containing the upper limit \(b_u\) of the constraints that have both a lower and an upper bound. If such a constraint exists, then methodsetConstraintTypemust be used to define the type of the constraints. IfconstraintType[i] != 3, i.e. if constraintiis not two-sided, then the corresponding entry inbu,bu[i], is ignored.Default: None of the constraints has an upper limit
-
getUpperLimit
public double[] getUpperLimit()Returns the upper limit of the constraints that have both a lower and an upper bound.- Returns:
- a
doublearray containing the upper limit of the constraints that have both a lower and an upper bound. Returnsnullif the upper limit has not been set.
-
getPrimalInfeasibility
public double getPrimalInfeasibility()Returns the primal infeasibility of the solution.- Returns:
- a
doublescalar containing the primal infeasibility of the solution, \(\parallel x + s - u \parallel\)
-
getViolation
public double getViolation()Returns the violation of the variable bounds.- Returns:
- a
doublescalar containing the violation of the variable bounds, \(\parallel b - Ax \parallel\)
-