ibex::Space Class Reference

Space (Entity types & domains). More...

#include <IbexSpace.h>

Inheritance diagram for ibex::Space:

ibex::SharedObject

List of all members.

Public Member Functions

 Space (const Env &env)
 Space (const Space &d)
Spaceoperator= (const Space &s)
 Space (const SpaceFactory &builder)
 ~Space ()
void add_entity (int key, INTERVAL &x, EntityType type)
const Entityentity (const char *symbol) const
const Entityentity (int key) const
INTERVALdomain (int key)
const INTERVALdomain (int key) const
bool used (int key) const
int nb_var () const
int nb_epr () const
int nb_upr () const
int nb_syb () const
int nb (EntityType type) const
const char * var_name (int var) const
const char * epr_name (int epr) const
const char * upr_name (int upr) const
const char * syb_name (int syb) const
int key (EntityType type, int num) const
int component (int key) const
const INTERVAL_VECTORvec_domain (EntityType type) const
INTERVAL_VECTORvec_domain (EntityType type)
const INTERVALdomain (EntityType type, int num) const
INTERVALdomain (EntityType type, int num)
INTERVALdomain (const char *symbol)
const Entityent (EntityType type, int dom_num) const
int var (const char *symbol) const
int epr (const char *symbol) const
int upr (const char *symbol) const
int syb (const char *symbol) const
void set_output_flags (short flags) const
void sync (const Space &space, unsigned short flags=65535, bool logic_op=true)

Public Attributes

const Envenv
INTERVAL_VECTOR box
INTERVAL_VECTOR upx
INTERVAL_VECTOR epx
INTERVAL_VECTOR sbx

Static Public Attributes

static int default_flags_value = 12

Friends

std::ostream & operator<< (std::ostream &, const Space &space)


Detailed Description

Space (Entity types & domains).

A space contains the types and domains bound to some symbols of a given environment (e.g., the symbol "x" is a variable with domain [0,1]).

A space usually contains information on which symbols are used by an operator (contractor, bisector, etc.) and the types and domains bound to these symbols (e.g., the symbol "x" is a variable with domain [0,1]). Every contrator is working on a given space. Because operators only handle "flat" data, all the symbols handled in this class are zero-dimensional, not vector nor matrix symbols. In particular, a symbol argument of any of the above functions must be zero-dimensional. If A is a matrix, A[1][2] is an example of valid zero-dimensional symbol.

Warning:
If v is a 1-component vector, v is not considered as a zero-dimensional symbol (use v[1] instead). This also holds for one-rowed or one-columned matrices.
Author:
Gilles Chabert
Date:
October 2007

Constructor & Destructor Documentation

ibex::Space::Space ( const Env env  ) 

Create an empty space.

Warning:
This constructor should only be used by ibex::SpaceFactory.

ibex::Space::Space ( const Space d  ) 

Duplicate this instance. All members are passed by copy, expect the environment (passed by reference).

ibex::Space::Space ( const SpaceFactory builder  ) 

Create a space with a space factory.

ibex::Space::~Space (  ) 

Deletes this instance.


Member Function Documentation

Space & ibex::Space::operator= ( const Space s  ) 

Assignment operator. All members are passed by copy (except the environment).

Precondition:
Both spaces must be defined on the same environment.

void ibex::Space::add_entity ( int  key,
INTERVAL x,
EntityType  type 
)

Add an entity in the space.

const Entity & ibex::Space::entity ( const char *  symbol  )  const

Return the entity bound to a symbol.

Warning:
The entity domain is passed by reference. The method is declared "const" just for convenience.

const Entity& ibex::Space::entity ( int  key  )  const [inline]

Return the entity bound to a symbol.

Parameters:
key - the environment number of the symbol.

INTERVAL& ibex::Space::domain ( int  key  )  [inline]

Return the domain bound to a symbol.

Parameters:
key - the environment number of the symbol.

const INTERVAL& ibex::Space::domain ( int  key  )  const [inline]

Return the domain bound to a symbol.

Parameters:
key - the environment number of the symbol.

bool ibex::Space::used ( int  key  )  const [inline]

Return true if a symbol is bound to an entity inside this space.

int ibex::Space::nb_var (  )  const [inline]

Return the number of variables in the space

int ibex::Space::nb_epr (  )  const [inline]

Return the number of exist-params in the space

int ibex::Space::nb_upr (  )  const [inline]

Return the number of univ-params in the space

int ibex::Space::nb_syb (  )  const [inline]

Return the number of symbolic constants in the space

int ibex::Space::nb ( EntityType  type  )  const [inline]

Return the number of entities of a given type in the space

const char * ibex::Space::var_name ( int  var  )  const

Return the name of variable var.

Precondition:
0 <= var < nb_var().

const char * ibex::Space::epr_name ( int  epr  )  const

Return the name of the exist-param epr.

Precondition:
0 <= epr < nb_epr().

const char * ibex::Space::upr_name ( int  upr  )  const

Return the name of the univ-param upr.

Precondition:
0 <= upr < nb_upr().

const char * ibex::Space::syb_name ( int  syb  )  const

Return the name of the symbolic constant syb.

Precondition:
0 <= syb < nb_syb().

int ibex::Space::key ( EntityType  type,
int  num 
) const [inline]

Return the key (environment number) of an entity symbol.

Parameters:
type - the entity type.
num - the domain (component) number.

int ibex::Space::component ( int  key  )  const [inline]

Return the component number of an entity in the corresponding domain array .

const INTERVAL_VECTOR& ibex::Space::vec_domain ( EntityType  type  )  const [inline]

Return a reference to the domain of a given type. This reference is either box, upx, epx or sbx.

INTERVAL_VECTOR& ibex::Space::vec_domain ( EntityType  type  )  [inline]

Return a reference to the domain of a given type. This reference is either box, upx, epx or sbx.

const INTERVAL& ibex::Space::domain ( EntityType  type,
int  num 
) const [inline]

Return a const reference to the domain of an entity. This reference is either a component of box, upx, epx or sbx.

Parameters:
type - the entity type.
num - the domain (component) number.

INTERVAL& ibex::Space::domain ( EntityType  type,
int  num 
) [inline]

Return a reference to the domain of an entity. This reference is either a component of box, upx, epx or sbx.

Parameters:
type - the entity type.
num - the domain (component) number.

INTERVAL& ibex::Space::domain ( const char *  symbol  )  [inline]

Return (by reference) the domain of an entity bound to a symbol. This reference is either a component of box, upx, epx or sbx.

const Entity& ibex::Space::ent ( EntityType  type,
int  dom_num 
) const [inline]

Return the entity associated to a domain (component) number.

Parameters:
type - the entity type.
dom_num - the domain (component) number.

int ibex::Space::var ( const char *  symbol  )  const [inline]

Return the domain number of a variable.

Parameters:
symbol - the variable symbol.

int ibex::Space::epr ( const char *  symbol  )  const [inline]

Return the domain (component) number of an exist param.

Parameters:
symbol - the exist param symbol.

int ibex::Space::upr ( const char *  symbol  )  const [inline]

Return the domain (component) number of a univ param.

Parameters:
symbol - the univ param symbol.

int ibex::Space::syb ( const char *  symbol  )  const [inline]

Return the domain (component) number of a symbolic constant.

Parameters:
symbol - the symbol.

void ibex::Space::set_output_flags ( short  flags  )  const [inline]

Enables/disables output flags. This method allows to control which data is outputted when an instruction such as cout << space is used.

Parameters:
flags - an array of 5 bits: (from most to least significant)
  • if bit 3 is set, spaces of variables will be streamed out (default value is set).
  • if bit 2 is set, spaces of univ-params will be streamed out (default value is unset).
  • if bit 1 is set, spaces of exist-params will be streamed out (default value is set).
  • if bit 0 is set, spaces of symbolic constants will be streamed out (default value is unset).
Note:
Components of an interval vector are aligned by columns, displayed with the current digits precision along with their associated entity names. There is a "hidden" 4th bit. If set, internal structures will be also displayed.

void ibex::Space::sync ( const Space space,
unsigned short  flags = 65535,
bool  logic_op = true 
)

Synchronizes with another space space. The complexity is linear in the number of entities in the source space (i.e., this object).

Parameters:
space - the space to synchronize with.
flags - an array of 16 bits specifying which type of entity must be synchronized. The following table shows all the combinaisons of entity types with their associated bit. For example, if bit 10 is set, then any entity x that is a symbolic constant (SYB) in the current space and an exist-parameter (EPR) in space will be synchronized, i.e., the domain of x in space will overwrite the current domain of x. By default, all bits are set (65535).
logic_op - if true (=AND), an entity domain is simply set to the corresponding domain in space, erasing any previous assignment. If false (=OR), the domain of an entity is set to the hull of its current interval value with the corresponding domain in space.
Bits controling entities to be synchronized (1=least significant bit)
 VAREPRSYBUPR
VAR1234
EPR5678
SYB9101112
UPR13141516
Precondition:
Both spaces must have been built from the same environment (which is automatic with transformations). E.g., this means that you should not call this method with spaces loaded from different files.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Space space 
) [friend]

Streams out the space.


Member Data Documentation

The environment.

The current box (domain) of variables and exist-params.

This field can be directly read/written.

Warning:
All Bias/Profil functions start indexes from 1. E.g., box(1) is the interval of the first variable. box(0) returns an undefined result.

The box (domain) of univ-params

This field can be directly read/written.

Warning:
All Bias/Profil functions start indexes from 1. E.g., upx(1) is the interval of the first univ-param. upx(0) returns an undefined result.

The box (domain) of exist-params.

This field can be directly read/written.

Warning:
All Bias/Profil functions start indexes from 1. E.g., epx(1) is the interval of the first exist-param. epx(0) returns an undefined result.

The box (domain) of symbolic constants.

This field can be directly read/written.

Warning:
All Bias/Profil functions start indexes from 1. E.g., sbx(1) is the interval of the first symbolic constant. sbx(0) returns an undefined result.

Default output flags value (12).


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