CPXCALLBACKINFO
typedef enum {
CPXCALLBACKINFO_THREADID,
CPXCALLBACKINFO_NODECOUNT,
CPXCALLBACKINFO_ITCOUNT,
CPXCALLBACKINFO_BEST_SOL,
CPXCALLBACKINFO_BEST_BND,
CPXCALLBACKINFO_THREADS,
CPXCALLBACKINFO_FEASIBLE,
CPXCALLBACKINFO_TIME,
CPXCALLBACKINFO_DETTIME,
CPXCALLBACKINFO_NODEUID,
CPXCALLBACKINFO_NODEDEPTH,
CPXCALLBACKINFO_CANDIDATE_SOURCE,
CPXCALLBACKINFO_RESTARTS,
CPXCALLBACKINFO_AFTERCUTLOOP,
CPXCALLBACKINFO_NODESLEFT
} CPXCALLBACKINFO;
Description
The
CPXCALLBACKINFO
enumeration specifies the information
that can be queried from an invocation of the generic callback by means of these
routines:
value | type | description |
CPXCALLBACKINFO_THREADID |
CPXINT or CPXLONG |
A unique identifier for the calling thread. The identifiers range from 0 (zero) through N-1, where N is the maximum number of threads CPLEX is allowed to allocate for the solve. The thread on which the user started the solve always has identifier 0 (zero). |
CPXCALLBACKINFO_NODECOUNT |
CPXINT or CPXLONG |
Number of nodes processed so far |
CPXCALLBACKINFO_ITCOUNT |
CPXINT or CPXLONG |
Simplex iterations executed so far |
CPXCALLBACKINFO_BEST_SOL |
double |
Objective value of the best known feasible solution.
May be infinite if no feasible solution is known.
Warning:
This best known solution is global only if the
callback is invoked in context
CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS.
In all other cases, this is a thread-local value which may be
different from the best known globally valid value.
|
CPXCALLBACKINFO_BEST_BND |
double |
The best known bound on the optimal objective function value.
For MIP, this bound is usually the objective value
of the best open node. The value may be infinite if no better information
is currently available.
Important:
This bound may be infinite (
-CPX_INFBOUND or
CPX_INFBOUND , depending on the objective sense)
if no bound has been computed yet, or if no bound is available for the
calling thread.
Warning:
Note that the best bound may exceed the value of the best feasible
solution when optimality is proven.
|
CPXCALLBACKINFO_FEASIBLE |
CPXINT or CPXLONG |
Returns a true value (nonzero)if a feasible solution is known, false (zero) otherwise. |
CPXCALLBACKINFO_THREADS |
CPXINT or CPXLONG |
Number of threads allocated by CPLEX for the current solve. |
CPXCALLBACKINFO_TIME |
double |
Returns a timestamp. Depending on clock type for computation time, this timeis either wallclock or CPU time. This value is the equivalent of CPXXgettime and CPXgettime. |
CPXCALLBACKINFO_DETTIME |
double |
Returns a deterministic timestamp. This value is equivalent to
CPXXgetdettime and CPXgetdettime.
Warning:
In threads that execute speculative code, this function may
return infinity (a number for which
isinf()
returns true and fpclassify() returns
FP_INFINITE ) when invoked in the
context CPX_CALLBACKCONTEXT_THREAD_DOWN.
|
CPXCALLBACKINFO_NODEUID |
long |
Returns a unique identifier for the current MIP search tree
node. If the callback is invoked in a situation where there is
no current node, then the query produces an error.
Therefore, this information can only be queried in the contexts:
Note:
The very first node processed during tree search has unique id 0.
For any other node, no assumption about the unique id should be
made other than that the value is unique.
|
CPXCALLBACKINFO_NODEDEPTH |
long |
Returns the depth of the current node in the MIP search tree.
If the callback is invoked in a situation where there is
no current node, then the query produces an error.
Therefore, this information can only be queried in the contexts:
|
CPXCALLBACKINFO_CANDIDATE_SOURCE |
int |
Returns the source of the current candidate solution.
This information can only be queried in the
CPX_CALLBACKCONTEXT_CANDIDATE
context. In all other contexts, querying this information will return an error.
The source of the current candidate solution is one of the following:
|
CPXCALLBACKINFO_RESTARTS |
int |
Returns the number of restarts performed so far. This information cannot be queried from the CPX_CALLBACKCONTEXT_THREAD_UP or CPX_CALLBACKCONTEXT_THREAD_DOWN context. |
CPXCALLBACKINFO_AFTERCUTLOOP |
int |
Returns true if the callback is invoked after CPLEX has completed its cut loop and false otherwise. This information can only be queried from the CPX_CALLBACKCONTEXT_RELAXATION context. |
CPXCALLBACKINFO_NODESLEFT |
long |
Returns the number of open nodes left. Note that this number can only be an estimate for the real number of open nodes since the calling thread cannot inspect the actual number of open nodes in other threads. This information can not be queried in all contexts (most notably not in CPX_CALLBACKCONTEXT_THREAD_UP or CPX_CALLBACKCONTEXT_THREAD_DOWN). |
See also
CPXXcallbacksetfunc and CPXcallbacksetfunc
CPXXcallbackgetinfodbl and CPXcallbackgetinfodbl