ibex::Paver Class Reference
[Paver]

Paver. More...

#include <IbexPaver.h>

List of all members.

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 PavingNoderesult ()
long nb_cells ()
long nb_boxes (int ctc)
const INTERVAL_VECTORbox (int ctc, int i) const
const INTERVAL_VECTORrej (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
Spacespace


Detailed Description

Paver.

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]

Author:
Gilles Chabert
Date:
March 2007

Constructor & Destructor Documentation

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.


Member Function Documentation

void ibex::Paver::restart (  ) 

(Re)initializes the exploration.

See also:
next_box() and explore().

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.

Returns:
the contractor number or -1 if the exploration is over.
Exceptions:
ibex::OverflowException - if the total paving size exceeds capacity.
ibex::TimeOutException - if the number of cells created exceeds cell_limit.
See also:
restart().

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.

Note:
This methods automatically calls restart(): if an exploration is in hand, it is abandoned.
Returns:
the total time spent in seconds.
See also:
next_box() for details about exceptions.
Performs a complete exploration of the search space and calculate the time spent.

Note:
This methods automatically calls restart(): if an exploration is in hand, it is abandoned.
Returns:
the total time spent in seconds (Time is equivalent to double).
See also:
next_box() for details about exceptions.

void ibex::Paver::report (  ) 

Displays on standard output a report of the last exploration.

Information provided:

  • number of boxes successfully contracted by each contractor.
  • total number of cells created during the exploration
  • total running time

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.

See also:
solver_mode.

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.

See also:
solver_mode.

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.


Member Data Documentation

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).

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/true to switch from paver mode to solver mode respectively. Default value is false.

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).

Number of contractors


The documentation for this class was generated from the following files:

Generated on Sun Jun 27 15:52:00 2010 for IBEX by  doxygen 1.5.5