public class DantzigLCPSolver extends java.lang.Object implements LCPSolver
LCPSolver.Status
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_ALL |
static int |
SHOW_MIN_RATIO |
static int |
SHOW_NONE |
static int |
SHOW_PIVOTS |
static int |
SHOW_QM |
static int |
SHOW_RETURNS |
static int |
SHOW_VARIABLES |
INF, W_VAR_LOWER, W_VAR_UPPER, Z_VAR
Constructor and Description |
---|
DantzigLCPSolver()
Creates a new Dantzig solver.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getComputeResidual() |
int |
getDebug() |
int |
getIterationCount()
Returns the number of iterations that were used in the most recent
solution operation.
|
int |
getIterationLimit()
Gets the iteration limit for this solver.
|
double |
getLastSolveTol()
Returns the numeric tolerance used to determine complementarity for the
most recent solution.
|
int |
getPivotCount()
Returns the number of pivots that were used in the most recent solution
operation.
|
double |
getResidual() |
boolean |
getSilent() |
double |
getTolerance()
Returns the numeric tolerence for this solver.
|
boolean |
isBLCPSupported()
Queries whether this solver supported the solution of bounded linear
complementarity problems (BLCPs).
|
boolean |
isWarmStartSupported()
Queries whether this solver supports warm starts.
|
int |
numFailedPivots()
Returns the number of pivots that were attempted and rejected because
they would have resulted in a basis matrix that was not SPD.
|
void |
resolve(VectorNd z,
VectorNd q,
int[] state)
Solves the system
|
void |
setComputeResidual(boolean enable) |
void |
setDebug(int code) |
void |
setIterationLimit(int limit)
Sets the iteration limit for this solver.
|
void |
setSilent(boolean code) |
void |
setTolerance(double tol)
Sets the numeric tolerance for this solver.
|
LCPSolver.Status |
solve(VectorNd z,
VectorNd w,
VectorNi state,
MatrixNd M,
VectorNd q,
VectorNd lo,
VectorNd hi,
int nub)
If
LCPSolver.isBLCPSupported() returns true , solves the BLCP |
LCPSolver.Status |
solve(VectorNd z,
VectorNi state,
MatrixNd M,
VectorNd q)
Solves the LCP
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearState, stateToChar, stateToString, stateToString, stateToString, stringToState
public static final int SHOW_NONE
public static final int SHOW_PIVOTS
public static final int SHOW_MIN_RATIO
public static final int SHOW_QM
public static final int SHOW_VARIABLES
public static final int SHOW_RETURNS
public static final int SHOW_ALL
public int getDebug()
public void setDebug(int code)
public boolean getSilent()
public void setSilent(boolean code)
public boolean getComputeResidual()
public void setComputeResidual(boolean enable)
public double getResidual()
public double getTolerance()
setTolerance(double)
public void setTolerance(double tol)
>=
0, as described in the class documentation. In particular, a
solution will be considered found whenever q' >=
-tol.tol
- new numeric tolerance. Negative numbers will be truncated to 0.getTolerance()
public int getIterationLimit()
public void setIterationLimit(int limit)
limit
- new iteration limitpublic int getIterationCount()
getIterationCount
in interface LCPSolver
public int getPivotCount()
getPivotCount
in interface LCPSolver
public double getLastSolveTol()
getLastSolveTol
in interface LCPSolver
public int numFailedPivots()
numFailedPivots
in interface LCPSolver
public LCPSolver.Status solve(VectorNd z, VectorNi state, MatrixNd M, VectorNd q)
w = M z + qwhere M is a matrix whose characteristics should match the capabilities of the solver.
solve
in interface LCPSolver
z
- returns the solution for zstate
- optional argument, which if non-null
, returns the
state vector resulting from the LCP solve. For solvers capable of warm
starts (i.e., if LCPSolver.isWarmStartSupported()
returns true
), the
value of this vector on input will also specify the initial starting
state.M
- system matrixq
- system vectorpublic void resolve(VectorNd z, VectorNd q, int[] state)
w = M z + qusing the same matrix M and active set that was determined in the previous call to solve. Non-active z variables are set to 0.
z
- returns the solution for zq
- system vectorstate
- (optional) if specified, returns which z variables are basic in the
solution.public LCPSolver.Status solve(VectorNd z, VectorNd w, VectorNi state, MatrixNd M, VectorNd q, VectorNd lo, VectorNd hi, int nub)
LCPSolver.isBLCPSupported()
returns true
, solves the BLCP
w = M z + q = wpos - wneg, 0 ≤ hi - z perp wneg ≥ 0, 0 ≤ z - lo perp wpos ≥ 0,where M is a matrix whose characteristics should match the capabilities of the solver. If BLCPs are not supported, then this method returns
LCPSolver.Status.UNIMPLEMENTED
.solve
in interface LCPSolver
z
- returns the solution for zw
- returns the solution for wstate
- optional argument, which if non-null
, returns the
state vector resulting from the LCP solve. For solvers capable of warm
starts (i.e., if LCPSolver.isWarmStartSupported()
returns true
), the
value of this vector on input will also specify the initial starting
state.M
- system matrixq
- system vectorlo
- lower bounds for the z variableshi
- upper bounds for the z variablesnub
- number of unbounded variables (corresponding to bilateral constraints).
If nub > 0
, then the first nub
entries of lo
and hi
must be negative and positive infinity, respectively.public boolean isBLCPSupported()
isBLCPSupported
in interface LCPSolver
true
if BLCPs are supported.public boolean isWarmStartSupported()
isWarmStartSupported
in interface LCPSolver
true
if warm starts are supported.