Base class for an optimization oracle for a polyhedron and all its faces. The oracle is either exact or it is associated to another optimization oracle, called the next oracle and called heuristic. The next oracle in turn need not be exact. All oracles reachable by going to the next one are called associated. The isExact()
method indicates whether the oracle is exact or not and the thisHeuristic()
method indicates the number of associated oracles (being zero if exact). The goal of this concept is to allow the implementation of quick heuristcs or approximation algorithms that forward a query to the next oracle if its own answer is not satisfactory.
An instance has a reference to a Space that manages the ambient space of , and that must agree for all associated oracles. An actual implementation of an oracle (or heuristic) must inherit from this class and implement the maximize() and setFace() methods. If there is no direct way to implement the optimization over arbitrary faces, consider inheriting from FaceOracleBase instead.
A call to any of the maximize() methods to optimize objective over the current face (setFace()
) with improveValue
and requested maxHeuristic
and minHeuristic
must obey the following rules, where we denote by and the sets of returned points
and rays
, respectively. The returned OracleResult is denoted by result
.
result.heuristic
must be at least minHeuristic
and at most maxHeuristic
, or equal to 0.
 One of and (or both) must be empty.
 If , then
result.heuristic
must be equal to 0 and must hold.
 Every satisfies .
 If
result.heuristic
is equal to 0, then holds if and only if there exists a ray with (given ).
 If
result.heuristic
is equal to 0 and holds, then or must hold.
 If and
result.heuristic
is equal to zero, then must hold.
 If and
result.heuristic
is positive, then must hold or must contain at most one element (to certify feasibility).
void ipo::OracleBase::maximize 
( 
OracleResult & 
result, 


const soplex::VectorRational & 
objective, 


const ObjectiveBound & 
objectiveBound = ObjectiveBound() , 


std::size_t 
minHeuristic = 0 , 


std::size_t 
maxHeuristic = std::numeric_limits< std::size_t >::max() 

) 
 
Runs the optimization oracle to maximize the given dense rational objective
over the current face (see setFace()) and returns result
. If maxHeuristic
is less than thisHeuristic() or if the objective value requested by objectiveBound
is not exceeded, then the call must be forwarded to the next oracle.
This implementation initializes the result
data structure, calls the maximizeController() method (with a dense objective vector), and finally postprocesses the result object.
 Parameters

result  After the call, contains the oracle's answer. 
objective  Objective vector to be maximized. 
objectiveBound  Objective value that should be exceeded. 
minHeuristic  Requested minimum heuristic level. 
maxHeuristic  Requested maximum heuristic level. 
For requirements on the behavior, see Detailed Description of OracleBase.
void ipo::OracleBase::maximize 
( 
OracleResult & 
result, 


const Vector & 
objective, 


const ObjectiveBound & 
objectiveBound = ObjectiveBound() , 


std::size_t 
minHeuristic = 0 , 


std::size_t 
maxHeuristic = std::numeric_limits< std::size_t >::max() 

) 
 
Runs the optimization oracle to maximize the given sparse rational objective
over the current face (see setFace()) and returns result
. If maxHeuristic
is less than thisHeuristic() or if the objective value requested by objectiveBound
is not exceeded, then the call must be forwarded to the next oracle.
This implementation initializes the result
data structure, calls the maximizeController() method (with a dense objective vector), and finally postprocesses the result object.
 Parameters

result  After the call, contains the oracle's answer. 
objective  Objective vector to be maximized. 
objectiveBound  Objective value that should be exceeded. 
minHeuristic  Requested minimum heuristic level. 
maxHeuristic  Requested maximum heuristic level. 
For requirements on the behavior, see Detailed Description of OracleBase.
virtual std::size_t ipo::OracleBase::maximizeController 
( 
OracleResult & 
result, 


const soplex::VectorRational & 
objective, 


const ObjectiveBound & 
objectiveBound, 


std::size_t 
maxHeuristic, 


std::size_t 
minHeuristic, 


bool & 
sort, 


bool & 
checkDups 

) 
 

protectedvirtual 
This method is called by maximize(), forwards the call to the next oracle if requested, calls the maximizeImplementation() method, and finally forwards the call to the next oracle if necessary.
 Parameters

result  After the call, contains the oracle's answer. 
objective  Objective vector to be maximized. 
objectiveBound  Objective value that should be exceeded. 
sort  Set this variable to true if points must be sorted. 
checkDups  Set this variable to true if points or rays must be checked for duplicates. 
For requirements on the behavior, see Detailed Description of OracleBase.
Reimplemented in ipo::FaceOracleBase.