ConicBundle
|
Base class for informing oracles (or the solver) about dynamic changes in the number and sorting of the variables, if such changes occur at all. More...
#include <CBSolver.hxx>
Public Member Functions | |
virtual int | get_old_vardim () const =0 |
returns the old dimension (before the changes occured), a value >=0 | |
virtual int | get_new_vardim () const =0 |
returns the current dimension (after the changes occured), a value >=0 | |
virtual int | get_appended_vardim () const =0 |
returns the number of variables appended, a value >=0 | |
virtual const int * | get_map_to_old_variables () const =0 |
returns get_new_vardim() many distinct indices out of 0 ... get_old_vardim()+get_appended_vardim()-1, so "old" here refers to old plus appended variables; if this returns 0, there are no rearrangements | |
virtual int | incorporate (const OracleModification &next_modification)=0 |
incorporate the next_modification in this one so that this one now performs both More... | |
virtual OracleModification * | new_initial_oraclemodification (int old_var_dim) const =0 |
returns a new object on the heap, that allows to incorporate this but starts off from a function whose input argument dimension is old_var_dim | |
virtual int | add_append_variables (int append_dim)=0 |
append append_dim further variables at the end of the argument vector (without specifying their effect, they may e.g. be ignored by the function) | |
virtual int | add_reassign_variables (int new_dim, const int *map_to_old_indices)=0 |
reorder and resize the variables as given by the first new_dim entries of map_to_old_indices; each former index may appear at most once in this list, so new_dim < get_new_vardim() | |
virtual bool | no_modification () const =0 |
returns true if no modifications need to be executed | |
virtual int | set_append_to_old (bool)=0 |
if set to true, no deletions/reassignments may be present or specified in the future, only appensions are allowed | |
virtual bool | append_to_old () const =0 |
returns true if this only contains appending operations | |
Base class for informing oracles (or the solver) about dynamic changes in the number and sorting of the variables, if such changes occur at all.
This base class may either be extended by the user to inform her/his oracles via the solver on how to adapt dynamically, or it is used by the solver to inform an oracle about changes that it is was asked to perform on the variables (and only if such occured) in order to ensure that the oracle works consistently with this. E.g. for a FunctionOracle the solver uses the routine ConicBundle::FunctionOracle::apply_modification() for this. Via its return values there the oracle should then tell the model/solver how to react to these changes.
Any changes can always be regrouped so that they result in two steps
So the base class only returns this information:
|
pure virtual |
incorporate the next_modification in this one so that this one now performs both
In order to allow collecting several modifications in one, this routine must change the current modification so that its application results in the equivalent of its current and then the next_modification; this may fail if sequence of modification or the implemented types are not compatible;
Typically the next_modification can only be incorporated if its old variable dimension matches the new variable dimension after the application of *this. However, if in new_modifications append_to_old() returns true (it then only consist of appending operation set up for the old dimensio of this), then both need to have the same old variable dimension and the appending operations of next_modification are carried out so that the stored reassignments in *this only affect to old coordinates of the appended information of next_modifcation, the new coordinates added by *this are inserted as zeros in the appensions stored in next_modification and the new coordinates of next_modification are appended at the end.
Implemented in ConicBundle::PSCAffineModification, ConicBundle::AFTModification, ConicBundle::GroundsetModification, ConicBundle::NNCBoxSupportModification, ConicBundle::SOCSupportModification, and ConicBundle::LPGroundsetModification.