public class MurtyLCPSolver extends java.lang.Object implements LCPSolver
LCPSolver.Status
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_ALL |
static int |
SHOW_BLOCK_PIVOT_CHANGE |
static int |
SHOW_NONE |
static int |
SHOW_PIVOTS |
static int |
SHOW_RETURNS |
static int |
SHOW_TOL_UPDATE |
static int |
SHOW_VARIABLES |
INF, W_VAR_LOWER, W_VAR_UPPER, Z_VAR
Constructor and Description |
---|
MurtyLCPSolver() |
Modifier and Type | Method and Description |
---|---|
boolean |
getBlockPivoting() |
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.
|
boolean |
getLastBlockPivoting() |
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 |
setBlockPivoting(boolean enable) |
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_TOL_UPDATE
public static final int SHOW_BLOCK_PIVOT_CHANGE
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.
Setting a negative value will cause the solver to choose its
own tolerance based on the input data. This can then be retrieved,
after the solve, using getLastSolveTol()
.
tol
- new numeric tolerance. Negative numbers will be truncated to 0.getTolerance()
public boolean getBlockPivoting()
public void setBlockPivoting(boolean enable)
public boolean getLastBlockPivoting()
public double getLastSolveTol()
getLastSolveTol
in interface LCPSolver
public int numFailedPivots()
numFailedPivots
in interface LCPSolver
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 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 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.