#include <IbexPaver.h>
Public Member Functions | |
| Paver (Space &space, vector< const Contractor * > &ctc, const Bisector &bsc) | |
| Paver (const Contractor &_ctc, const Bisector &bsc, REAL prec=Bisector::default_prec) | |
| ~Paver () | |
| void | restart () |
| int | next_box () |
| double | explore () |
| void | report () |
| const PavingNode & | result () |
| long | nb_cells () |
| long | nb_boxes (int ctc) |
| const INTERVAL_VECTOR & | box (int ctc, int i) const |
| const INTERVAL_VECTOR & | rej (int ctc, int i) const |
| void | select (int ctc) |
| void | unselect (int ctc) |
| void | interrupt () |
Public Attributes | |
| long | capacity |
| long | cell_limit |
| bool | trace |
| bool | solver_mode |
| void(* | new_ctc_node_func )(const ContractorNode &) |
| const int | nb_ctc |
| Space & | space |
This class implements a classical branch & bound algorithm (with depth-first search). It allows to apply alternatively a list of contractors and a bisector until the stack gets empty. See the description of this algorithm in [cha09]
| ibex::Paver::Paver | ( | Space & | space, | |
| vector< const Contractor * > & | ctc, | |||
| const Bisector & | bsc | |||
| ) |
Create a solver on a given space with (a copy of) a list of contractor and a bisector.
| ibex::Paver::Paver | ( | const Contractor & | _ctc, | |
| const Bisector & | bsc, | |||
| REAL | prec = Bisector::default_prec | |||
| ) |
Create a "standard" solver with a contractor and a bisector. The space of the solver is a reference to the space of the contractor in argument.
| ibex::Paver::~Paver | ( | ) |
Deletes this instance.
| void ibex::Paver::restart | ( | ) |
(Re)initializes the exploration.
| int ibex::Paver::next_box | ( | ) |
Continues exploration until another box gets entirely contracted. The method returns the number of the last contractor being called before the box gets empty.
| ibex::OverflowException | - if the total paving size exceeds capacity. | |
| ibex::TimeOutException | - if the number of cells created exceeds cell_limit. |
| double ibex::Paver::explore | ( | ) |
Performs a complete exploration of the search space (with the list of contractors given in argument of the constructors and calculates the time spent.
Time is equivalent to double). | void ibex::Paver::report | ( | ) |
Displays on standard output a report of the last exploration.
Information provided:
| const PavingNode& ibex::Paver::result | ( | ) | [inline] |
Return the paving of the last exploration (NULL if solver_mode was true)
| long ibex::Paver::nb_cells | ( | ) | [inline] |
Return the total number of cells created since the last call to restart() (i.e., since the begining of the last exploration. Each cell corresponds to one node in the search tree.
| long ibex::Paver::nb_boxes | ( | int | ctc | ) | [inline] |
Return the number of boxes "accepted" (contracted successfully) by contractor n°ctc since the last call to restart().
| const INTERVAL_VECTOR& ibex::Paver::box | ( | int | ctc, | |
| int | i | |||
| ) | const [inline] |
Return the ith "accepted" (contracted successfully) by contractor n°ctc since the last call to restart().
| const INTERVAL_VECTOR & ibex::Paver::rej | ( | int | ctc, | |
| int | i | |||
| ) | const |
Return the ith "rejected" (i.e., uncontracted) part of the ith box contracted by contractor n°ctc. If the latter is a leaf, the function simply returns a reference to it.
| void ibex::Paver::select | ( | int | ctc | ) | [inline] |
This function is only effective if solver_mode is on. select(i) will make the subsequent calls to explore() storing the leaves of the subpaving of contractor n°i. By default, all the contractors except instances of ibex::Precision are not selected.
| void ibex::Paver::unselect | ( | int | ctc | ) | [inline] |
This function is only effective if solver_mode is on. unselect(i) will make the subsequent calls to explore() discarding the whole subpaving of contractor n°i (this will save memory). By default, all the contractors except instances of ibex::Precision are not selected.
| void ibex::Paver::interrupt | ( | ) | [inline] |
Interrupts the paving process. This function can be called from the callback function new_ctc_node_func, leaving the paver in a consistent state. This allows to interrupt the paving process.
Capacity of the solver, i.e., the total number of boxes that can be stored. This parameter allows to bound space complexity. The value can be fixed by the user. By default, it is -1 (no limit). Combined with solver_mode, this field allows to bound the number of solutions.
Maximal number of cells created by the solver. This parameter allows to bound time complexity. The value can be fixed by the user. By default, it is -1 (no limit).
| bool ibex::Paver::trace |
A flag for printing the trace. If set, the top of the stack is printed on the standard output each time a new cell is created. Default value is false.
In this mode, the paver behabes as a standard solver: this means that pavings are not generated by explore(): only the leaves of the subpavings related to some "selected" contractors (typically, the precision or certification contractor) are kept. The solver mode allows to save memory.
To select a contractor, use select(int).
If contractor n°i is selected, a call to nb_boxes(i) will return the number of leaves, and box(i,j) will return the jth leaf of contractor n°i. If the contractor n°i is not selected, then a call to nb_boxes(i) will return 0.
You can directly set this member to false/ switch from paver mode to solver mode respectively. Default value is true tofalse.
| void(* ibex::Paver::new_ctc_node_func)(const ContractorNode &) |
Callback (e.g., for displaying nodes online). This callback is invoked each time a new contractor node is created, provided that it is not NULL and solver_mode is false. Default value is null (no external call is made).
| const int ibex::Paver::nb_ctc |
Number of contractors
1.5.5