[ library(range_eplex) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

lp_get(+Handle, ++ParamName, -Value)

Retrieve information about solver state and results for solver state Handle.
Handle
Handle to an existing solver state
ParamName
Name of parameter (atom or structure)
Value
Returned value for ParamName

Description

Retrieve information about solver state and results for the solver state represented by Handle. ParamName is the same as that for eplex_get/2, which retrieves the same information via the EplexInstance. It can be one of:

vars
Returns a term ''(X1,...,Xn) whose arity is the number of variables involved in the solver's constraint set, and whose arguments are these variables.

ints
Returns a list [Xi1,...,Xik] which is the subset of the problem variables that the solver considers to be integers.

constraints_norm
Returns a list of the problem constraints in normalised form. They may be simplified with respect to the original set that was passed to lp_setup/4.

constraints
Returns a list of the problem constraints in denormalised (readable) form. They may be simplified with respect to the original set that was passed to lp_setup/4.

objective
Returns a term min(E) or max(E), representing objective function and optimisation direction. E is a linear expression.

method
Returns the method (default, primal, dual, net_primal, net_dual, barrier, barrier_primal, barrier_dual) that is used to solve the problem. In case of MIP solving, this is the start algorithm (the one that is used to solve the initial relaxation).

status
Status that was returned by the most recent invocation of the external solver.

cost
Cost of the current solution. Fails if no solution has been computed yet.

typed_solution
Returns a term ''(X1,...,Xn) whose arguments are the properly typed (integer or float) solution values for the corresponding problem variables (vars). The floating point solutions are the same as returned by solution, the integers are obtained by rounding the corresponding floating-point solution to the nearest integer. To instantiate the problem variables to their solutions, unify this term with the corresponding term containing the variables:
    instantiate_solution(Handle) :-
        lp_get(Handle, vars, Vars),
        lp_get(Handle, typed_solution, Values),
        Vars = Values.

slack
Returns a list of floating-point values representing the constraint slacks. The order corresponds to the list order in constraints. Fails if no solution has been computed yet.

dual_solution
Returns a list of floating-point values representing the dual solutions. The order corresponds to the list order in constraints. Fails if no solution has been computed yet.

demon_tolerance
Returns a comma-separated pair (RealTol,IntTol) of floating-point values which specify how far outside a variable's range an lp-solution can fall before lp_demon_setup/6 re-triggers. The tolerances differ for real (default 0.00001) and integer (default 0.5) variables.

simplex_iterations
Returns the external solver's count of simplex iterations.

node_count
Returns the external MIP solver's node count.

statistics
Returns a list of counter values [Successes, Failures, Aborts], indicating how often lp_solve/2 was invoked on the Handle, and how many invocations succeeded, failed and aborted respectively.

optimizer_param(Param)
Returns the value of the external solver's parameter Param for the problem represented by Handle. The external solver has a number of parameters that affect the way they work, and this queries their values. If Param is not a valid parameter for the solver, an out of range exception is raised. See below for more details on the parameters.

post_equality_when_unified
Returns the value (yes or no) if an equality constraint will be posted to a solver if two variables in the solver's problem are unified.

pool
Returns the name of the eplex instance (if any) associated with the solver state. Fails otherwise. Only useful if called with lp_get/3.

handle
Returns the solver state handle (if any) associated with the eplex instance. Fails otherwise. Only useful if called with eplex_get/2.

Note that reduced_cost, slack, dual_solution can only be retrieved when previously requested in the option list of lp_setup/4 or with lp_set/3.

For the external solver's control parameter specified by optimizer_param(Param), Param must be an atom. The Value returned is either an integer, float or atom, depending on the parameter. The parameter is generally specific to a solver and version, and also, they may be problem specific, or global, again depending on the solver version. In all cases, the value returned by lp_get/3 is the current value for the parameter for the problem Handle. Refer to the solver documentation for details on the parameters. The names of the parameters are derived from the names of the parameters in the external solver. For CPLEX, take the parameter name from the CPLEX manual (or cplex.h), remove the CPX_PARAM_ prefix and convert the rest to lower case, e.g.

        CPX_PARAM_NODELIM becomes nodelim. 
For XPRESS-MP (version 13 and newer), take the parameter name from the manual (or xpresso.h), remove the XPRS_ prefix (if present) and convert the rest to lower case, e.g.
	MAXNODE or XPRS_MAXNODE becomes maxnode. 
(pre version 13, the parameter names are prefixed by N_ instead of XPRS_).

The following parameter names are additional aliases that work for either solver:

crash
CPX_PARAM_CRAIND (CPLEX) or XPRS_CRASH (XPRESS-MP) -integer
feasibility_tol
CPX_PARAM_EPRHS (CPLEX) or XPRS_FEASTOL (XPRESS-MP) - float
integrality
CPX_PARAM_EPINT (CPLEX) or XPRS_MIPTOL (XPRESS-MP) - float
iteration_limit
CPX_PARAM_ITLIM (CPLEX) or XPRS_LPITERLIMIT (XPRESS-MP) -integer
node_limit
CPX_PARAM_NODELIM (CPLEX) or XPRS_MAXNODE (XPRESS-MP) -integer
objdifference
CPX_PARAM_OBJDIF (CPLEX) or XPRS_MIPADDCUTOFF (XPRESS-MP) - float
refactor
CPX_PARAM_REINV (CPLEX) or XPRS_INVERTFREQ (XPRESS-MP) -integer
scrind
CPX_PARAM_SCRIND (CPLEX) or XPRS_OUTPUTLOG (XPRESS-MP) -integer
subalgorithm
CPX_PARAM_SUBALG (CPLEX) or XPRS_DEFAULTALG (XPRESS-MP) - integer

See Also

lp_setup / 4, lp_set / 3, eplex_get / 2