Generated on Wed Jan 4 17:49:18 2006 for Gecode by doxygen 1.4.6

Gecode::ViewArray< View > Class Template Reference
[Programming actors]

List of all members.

Detailed Description

template<class View>
class Gecode::ViewArray< View >

View arrays.

View arrays store views. They are typically used for storing the views with which propagators and branchings compute.

Definition at line 103 of file array.icc.

Constructors and initialization

 ViewArray (void)
 Default constructor (array of size 0).
 ViewArray (Space *, int m)
 Allocate array with m variables.
 ViewArray (const ViewArray< View > &a)
 Initialize from view array a (share elements).
 ViewArray (Space *, const ViewArray< View > &a)
 Initialize from view array a (copy elements).
const ViewArray< View > & operator= (const ViewArray< View > &a)
 Initialize from view array a (share elements).
template<class Var>
 ViewArray (Space *home, const VarArgArray< Var > &a)
 Initialize from variable argument array a (copy elements).

Array size

int size (void) const
 Return size of array (number of elements).
void size (int n)
 Decrease size of array (number of elements).

Array elements

View & operator[] (int i)
 Return view at position i.
const View & operator[] (int i) const
 Return view at position i.

Dependencies

void subscribe (Space *, Propagator *p, PropCond pc)
 Subscribe propagator p with propagation condition pc to all views.
void cancel (Propagator *p, PropCond pc)
 Cancel subscription of propagator p with propagation condition pc to all views.

Cloning

void update (Space *, bool share, ViewArray< View > &a)
 Update array to be a clone of array a.

Moving elements

void move_fst (int i)
 Move assigned view from position 0 to position i (shift elements to the left).
void move_lst (int i)
 Move assigned view from position size()-1 to position i (truncate array by one).
void move_fst (int i, Propagator *p, PropCond pc)
 Move view from position 0 to position i (shift elements to the left).
void move_lst (int i, Propagator *p, PropCond pc)
 Move view from position size()-1 to position i (truncate array by one).

Dropping elements

void drop_fst (int i)
 Drop assigned views from positions 0 to i-1 from array.
void drop_lst (int i)
 Drop assigned views from positions i+1 to size()-1 from array.
void drop_fst (int i, Propagator *p, PropCond pc)
 Drop views from positions 0 to i-1 from array.
void drop_lst (int i, Propagator *p, PropCond pc)
 Drop assigned views from positions i+1 to size()-1 from array.

View equality

bool same (void) const
 Test whether array has same views.
bool same (const View &y) const
 Test whether array contains a view being the same as y.
void unique (void)
 Remove all duplicate views from array (changes element order).

View sharing

bool shared (void) const
 Test whether array has shared views.
bool shared (const View &y) const
 Test whether array contains view shared with y.


Constructor & Destructor Documentation

template<class View>
Gecode::ViewArray< View >::ViewArray void   )  [inline]
 

Default constructor (array of size 0).

Definition at line 470 of file array.icc.

template<class View>
Gecode::ViewArray< View >::ViewArray Space ,
int  m
[inline]
 

Allocate array with m variables.

Definition at line 474 of file array.icc.

template<class View>
Gecode::ViewArray< View >::ViewArray const ViewArray< View > &  a  )  [inline]
 

Initialize from view array a (share elements).

Definition at line 493 of file array.icc.

template<class View>
Gecode::ViewArray< View >::ViewArray Space ,
const ViewArray< View > &  a
 

Initialize from view array a (copy elements).

Definition at line 480 of file array.icc.

template<class View>
template<class Var>
Gecode::ViewArray< View >::ViewArray Space home,
const VarArgArray< Var > &  a
[inline]
 

Initialize from variable argument array a (copy elements).

Note that the view type View must provide a constructor for the associated Var type.

Definition at line 136 of file array.icc.


Member Function Documentation

template<class View>
const ViewArray< View > & Gecode::ViewArray< View >::operator= const ViewArray< View > &  a  )  [inline]
 

Initialize from view array a (share elements).

Definition at line 498 of file array.icc.

template<class View>
int Gecode::ViewArray< View >::size void   )  const [inline]
 

Return size of array (number of elements).

Definition at line 505 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::size int  n  )  [inline]
 

Decrease size of array (number of elements).

Definition at line 511 of file array.icc.

template<class View>
View & Gecode::ViewArray< View >::operator[] int  i  )  [inline]
 

Return view at position i.

Definition at line 517 of file array.icc.

template<class View>
const View & Gecode::ViewArray< View >::operator[] int  i  )  const [inline]
 

Return view at position i.

Definition at line 524 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::subscribe Space ,
Propagator p,
PropCond  pc
 

Subscribe propagator p with propagation condition pc to all views.

Definition at line 612 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::cancel Propagator p,
PropCond  pc
 

Cancel subscription of propagator p with propagation condition pc to all views.

Definition at line 619 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::update Space ,
bool  share,
ViewArray< View > &  a
 

Update array to be a clone of array a.

If share is true, sharing is retained for all shared data structures. Otherwise, for each of them an independent copy is created.

Definition at line 599 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::move_fst int  i  )  [inline]
 

Move assigned view from position 0 to position i (shift elements to the left).

Definition at line 531 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::move_lst int  i  )  [inline]
 

Move assigned view from position size()-1 to position i (truncate array by one).

Definition at line 539 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::move_fst int  i,
Propagator p,
PropCond  pc
[inline]
 

Move view from position 0 to position i (shift elements to the left).

Before moving, cancel subscription of propagator p with propagation condition pc to view at position i.

Definition at line 563 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::move_lst int  i,
Propagator p,
PropCond  pc
[inline]
 

Move view from position size()-1 to position i (truncate array by one).

Before moving, cancel subscription of propagator p with propagation condition pc to view at position i.

Definition at line 571 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::drop_fst int  i  )  [inline]
 

Drop assigned views from positions 0 to i-1 from array.

Definition at line 547 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::drop_lst int  i  )  [inline]
 

Drop assigned views from positions i+1 to size()-1 from array.

Definition at line 555 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::drop_fst int  i,
Propagator p,
PropCond  pc
 

Drop views from positions 0 to i-1 from array.

Before moving, cancel subscription of propagator p with propagation condition pc to views at positions 0 to i-1.

Definition at line 579 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::drop_lst int  i,
Propagator p,
PropCond  pc
 

Drop assigned views from positions i+1 to size()-1 from array.

Before moving, cancel subscription of propagator p with propagation condition pc to views at positions i+1 to size()-1.

Definition at line 589 of file array.icc.

template<class View>
bool Gecode::ViewArray< View >::same void   )  const
 

Test whether array has same views.

Definition at line 656 of file array.icc.

template<class View>
bool Gecode::ViewArray< View >::same const View &  y  )  const
 

Test whether array contains a view being the same as y.

Definition at line 671 of file array.icc.

template<class View>
void Gecode::ViewArray< View >::unique void   ) 
 

Remove all duplicate views from array (changes element order).

Definition at line 680 of file array.icc.

template<class View>
bool Gecode::ViewArray< View >::shared void   )  const
 

Test whether array has shared views.

Definition at line 693 of file array.icc.

template<class View>
bool Gecode::ViewArray< View >::shared const View &  y  )  const
 

Test whether array contains view shared with y.

Definition at line 708 of file array.icc.


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