ibex::Contractor Class Reference
[Contractors]

Contractor base class. More...

#include <IbexContractor.h>

Inheritance diagram for ibex::Contractor:

ibex::Operator ibex::BoxNarrow ibex::Certification ibex::HC4Revise ibex::Minimizer ibex::Newton ibex::Octum ibex::Precision ibex::Propagation ibex::Sequence ibex::Shaving ibex::Slicer ibex::UnivNewton

List of all members.

Public Member Functions

 Contractor (const Contractor &c)
virtual void contract ()=0
virtual ~Contractor ()
void contract (const Indicators &p)
void contract (Space &space, const Indicators &p)
void contract (Space &space)
bool contract (Cell &cell, const Indicators &p)
virtual Contractorcopy () const =0
virtual bool involves (int ent) const
Cellcurrent_cell ()
const Indicatorscurrent_indic ()

Static Public Member Functions

static Indicators scope (int x)
static Indicators impact (int x)

Public Attributes

REAL contract_floor

Static Public Attributes

static const int ALL_VARS = -1
static const int NO_VAR = -2
static const REAL default_contract_floor = 0.02

Classes

class  Indicators
 Indicators structure for contractors. More...


Detailed Description

Contractor base class.

Author:
Gilles Chabert
Date:
November 2007

Constructor & Destructor Documentation

ibex::Contractor::Contractor ( const Contractor c  )  [inline]

Copy constructor.

virtual ibex::Contractor::~Contractor (  )  [inline, virtual]

Delete this instance.


Member Function Documentation

virtual void ibex::Contractor::contract (  )  [pure virtual]

Perform a contraction (in the default space space).

the current_cell() method can be used to get the current cell when this method is called from a paver.

the current_indic() method can be used to get the current indicators when this method is called from a paver, from contract(const Indicators& p) or contract(Space& space,const Indicators& p).

Exceptions:
Must throw an ibex::UnfeasibilityException is the space box is contracted to the empty set.

Implemented in ibex::BoxNarrow, ibex::Certification, ibex::HC4Revise, ibex::Newton, ibex::Octum, ibex::Precision, ibex::Minimizer, ibex::Propagation, ibex::Sequence, ibex::Shaving, ibex::Slicer, and ibex::UnivNewton.

void ibex::Contractor::contract ( const Indicators p  ) 

Perform a contraction (in the space space) with indicators p.

See also:
contract().

void ibex::Contractor::contract ( Space space,
const Indicators p 
)

Perform contraction on a space space with indicators p.

Synchronizes (local) space with the (argument) space and calls contract(const Indicators&). The (argument) space is then synchronized back with space, before returning.

Note:
Only the domains of variables should be impacted by this procedure. The domain of any other entity is left unchanged.
See also:
ibex::Cell::space, contract(const Indicators& p).

void ibex::Contractor::contract ( Space space  ) 

Perform contraction on a space space.

Synchronizes (local) space with the (argument) space and calls contract(). The (argument) space is then synchronized back with space, before returning.

Note:
Only the domains of variables should be impacted by this procedure. The domain of any other entity is left unchanged.
See also:
ibex::Cell::space, contract().

bool ibex::Contractor::contract ( Cell cell,
const Indicators p 
)

Performs contraction on cell with indicators p. This function is called from an ibex::Paver.

When the virtual method contract() is called from this method the current_cell() method can be used to get the current cell. the current_indic() method can be used to get the current indicators.

  • Synchronizes (local) space with the space of the cell
  • calls contract()
  • if contract_floor > 0, perform the following check: if the contraction ratio is greater then synchronize spaces back and return true. Otherwise, restore previous state of the cell and return true.
Ignore all other information of the cell.

Returns:
true when the contraction is effective (see contract_floor). In the case of a non-effective contraction, the space is rollbacked and the function returns false.
See also:
ibex::Cell::space, contract(Space&, const Indicators& p).

virtual Contractor* ibex::Contractor::copy (  )  const [pure virtual]

virtual bool ibex::Contractor::involves ( int  ent  )  const [inline, virtual]

Return true if the entity ent may be impacted by this contractor.

Default implementation: returns true if the entity is in the space.

This function is typically used by ibex::Adjacency to calculate the adjacency list of contractors.

Reimplemented in ibex::BoxNarrow, ibex::HC4Revise, and ibex::Sequence.

Cell* ibex::Contractor::current_cell (  )  [inline]

Return the current cell (NULL pointer if none).

const Indicators* ibex::Contractor::current_indic (  )  [inline]

Return the current indicator structure (NULL pointer if none).

static Indicators ibex::Contractor::scope ( int  x  )  [inline, static]

Create a contractor indicators structure with the scope set to x. (This function is just a kind of macro).

static Indicators ibex::Contractor::impact ( int  x  )  [inline, static]

Create a contractor indicators structure with the impact set to x. (This function is just a kind of macro).


Member Data Documentation

const int ibex::Contractor::ALL_VARS = -1 [static]

See also:
Indicators . Its value means "all the variables".

const int ibex::Contractor::NO_VAR = -2 [static]

See also:
Indicators . Its value means "no variable".

Tuning parameter for contraction. A contraction B1->B2 (where B1 is the initial box and B2 the resulting box) is considered to be effective when the maximal ratio between diam(B1[i])/diam(B1[i] \ B2[i])\ > contract_floor. Default value is default_contract_floor. This member can be directly modified.

Note:
if contract_floor is <=0, then contract(Cell&,const Indicators&) will always return true, without checking anything and without making temporary copies of the space box. Setting contract_floor to 0 is then a way to avoid an expensive copy in case of numerous variables.
See also:
INTERVAL_VECTOR::maxratiodelta(const INTERVAL_VECTOR&) const.

const REAL ibex::Contractor::default_contract_floor = 0.02 [static]

Default contraction ceil (used by contract()), set to 0.02.


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