public class KellerLCPSolver 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 |
Z_FREE |
static int |
Z_LOWER_BOUNDED |
static int |
Z_UPPER_BOUNDED |
INF, W_VAR_LOWER, W_VAR_UPPER, Z_VAR
Constructor and Description |
---|
KellerLCPSolver()
Creates a new Keller solver.
|
Modifier and Type | Method and Description |
---|---|
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 |
getTolerance()
Returns the numeric tolerance 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.
|
void |
mulPivotedMatrix(double[] res,
double[] vec)
Multiplies the pivoted system matrix, produced by the last solve, by a
vector.
|
void |
mulPivotedMatrix(MatrixNd MR,
MatrixNd M1)
Multiplies the pivoted system matrix, produced by the last solve, by
another matrix.
|
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 |
setDebug(int code) |
void |
setIterationLimit(int limit)
Sets the iteration limit for this solver.
|
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)
Returns
Status#UNIMPLEMENTED since BLCP problems are not
supported by this solver class. |
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_ALL
public static final int Z_FREE
public static final int Z_UPPER_BOUNDED
public static final int Z_LOWER_BOUNDED
public int getDebug()
public void setDebug(int code)
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 LCPSolver.Status solve(VectorNd z, VectorNd w, VectorNi state, MatrixNd M, VectorNd q, VectorNd lo, VectorNd hi, int nub)
Status#UNIMPLEMENTED
since BLCP problems are not
supported by this solver class.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.public void mulPivotedMatrix(double[] res, double[] vec)
res
- used to store resultvec
- vector to be multiplied