|  | 
|  | Grid_Generator_System (Representation r=default_representation) | 
|  | Default constructor: builds an empty system of generators. 
 | 
|  | 
|  | Grid_Generator_System (const Grid_Generator &g, Representation r=default_representation) | 
|  | Builds the singleton system containing only generator g.
 | 
|  | 
|  | Grid_Generator_System (dimension_type dim, Representation r=default_representation) | 
|  | Builds an empty system of generators of dimension dim.
 | 
|  | 
|  | Grid_Generator_System (const Grid_Generator_System &gs) | 
|  | 
|  | Grid_Generator_System (const Grid_Generator_System &gs, Representation r) | 
|  | Copy constructor with specified representation. 
 | 
|  | 
|  | ~Grid_Generator_System () | 
|  | Destructor. 
 | 
|  | 
| Grid_Generator_System & | operator= (const Grid_Generator_System &y) | 
|  | Assignment operator. 
 | 
|  | 
| Representation | representation () const | 
|  | Returns the current representation of *this. 
 | 
|  | 
| void | set_representation (Representation r) | 
|  | Converts *this to the specified representation. 
 | 
|  | 
| dimension_type | space_dimension () const | 
|  | Returns the dimension of the vector space enclosing *this.
 | 
|  | 
| void | clear () | 
|  | Removes all the generators from the generator system and sets its space dimension to 0. 
 | 
|  | 
| void | insert (const Grid_Generator &g) | 
|  | Inserts into *thisa copy of the generatorg, increasing the number of space dimensions if needed.  More...
 | 
|  | 
| void | insert (Grid_Generator &g, Recycle_Input) | 
|  | Inserts into *thisthe generatorg, increasing the number of space dimensions if needed.
 | 
|  | 
| void | insert (Grid_Generator_System &gs, Recycle_Input) | 
|  | Inserts into *thisthe generators ings, increasing the number of space dimensions if needed.
 | 
|  | 
| bool | empty () const | 
|  | Returns trueif and only if*thishas no generators.
 | 
|  | 
| const_iterator | begin () const | 
|  | Returns the const_iterator pointing to the first generator, if thisis not empty; otherwise, returns the past-the-end const_iterator.
 | 
|  | 
| const_iterator | end () const | 
|  | Returns the past-the-end const_iterator. 
 | 
|  | 
| dimension_type | num_rows () const | 
|  | Returns the number of rows (generators) in the system. 
 | 
|  | 
| dimension_type | num_parameters () const | 
|  | Returns the number of parameters in the system. 
 | 
|  | 
| dimension_type | num_lines () const | 
|  | Returns the number of lines in the system. 
 | 
|  | 
| bool | has_points () const | 
|  | Returns trueif and only if*thiscontains one or more points.
 | 
|  | 
| bool | is_equal_to (const Grid_Generator_System &y) const | 
|  | Returns trueif*thisis identical toy.
 | 
|  | 
| bool | OK () const | 
|  | Checks if all the invariants are satisfied. 
 | 
|  | 
| void | ascii_dump () const | 
|  | Writes to std::cerran ASCII representation of*this.
 | 
|  | 
| void | ascii_dump (std::ostream &s) const | 
|  | Writes to san ASCII representation of*this.
 | 
|  | 
| void | print () const | 
|  | Prints *thistostd::cerrusingoperator<<.
 | 
|  | 
| bool | ascii_load (std::istream &s) | 
|  | Loads from san ASCII representation (as produced by ascii_dump(std::ostream&) const) and sets*thisaccordingly. Returnstrueif successful,falseotherwise.  More...
 | 
|  | 
| memory_size_type | total_memory_in_bytes () const | 
|  | Returns the total size in bytes of the memory occupied by *this.
 | 
|  | 
| memory_size_type | external_memory_in_bytes () const | 
|  | Returns the size in bytes of the memory managed by *this.
 | 
|  | 
| void | m_swap (Grid_Generator_System &y) | 
|  | Swaps *thiswithy.
 | 
|  | 
A system of grid generators. 
An object of the class Grid_Generator_System is a system of grid generators, i.e., a multiset of objects of the class Grid_Generator (lines, parameters and points). When inserting generators in a system, space dimensions are automatically adjusted so that all the generators in the system are defined on the same vector space. A system of grid generators which is meant to define a non-empty grid must include at least one point: the reason is that lines and parameters need a supporting point (lines only specify directions while parameters only specify direction and distance.
- In all the examples it is assumed that variables xandyare defined as follows:Variable x(0); Variable y(1); 
- Example 1
- The following code defines the line having the same direction as the  axis (i.e., the first Cartesian axis) in axis (i.e., the first Cartesian axis) in : :
gs.insert(grid_line(x + 0*y)); 
 As said above, this system of generators corresponds to an empty grid, because the line has no supporting point. To define a system of generators that does correspond to the axis, we can add the following code which inserts the origin of the space as a point: axis, we can add the following code which inserts the origin of the space as a point:gs.insert(grid_point(0*x + 0*y)); 
gs.insert(grid_point(0*x)); 
 axis through the point axis through the point . .gs.insert(grid_point(0*x + 1*y)); 
- Example 2
- The following code builds a system of generators corresponding to the grid consisting of all the integral points on the  axes; that is, all points satisfying the congruence relation axes; that is, all points satisfying the congruence relation
![\[ \bigl\{\, (x, 0)^\transpose \in \Rset^2 \bigm| x \pmod{1}\ 0 \,\bigr\}, \]](form_578.png)  
 
gs.insert(parameter(x + 0*y)); gs.insert(grid_point(0*x + 0*y)); 
 
- Example 3
- The following code builds a system of generators having three points corresponding to a non-relational grid consisting of all points whose coordinates are integer multiple of 3. 
gs.insert(grid_point(0*x + 0*y)); gs.insert(grid_point(0*x + 3*y)); gs.insert(grid_point(3*x + 0*y)); 
 
- Example 4
- By using parameters instead of two of the points we can define the same grid as that defined in the previous example. Note that there has to be at least one point and, for this purpose, any point in the grid could be considered. Thus the following code builds two identical grids from the grid generator systems gsandgs1.
gs.insert(grid_point(0*x + 0*y)); gs.insert(parameter(0*x + 3*y)); gs.insert(parameter(3*x + 0*y)); gs1.insert(grid_point(3*x + 3*y)); gs1.insert(parameter(0*x + 3*y)); gs1.insert(parameter(3*x + 0*y)); 
 
- Example 5
- The following code builds a system of generators having one point and a parameter corresponding to all the integral points that lie on  in in  
gs.insert(grid_point(1*x + 1*y)); gs.insert(parameter(1*x - 1*y)); 
 
- Note
- After inserting a multiset of generators in a grid generator system, there are no guarantees that an exact copy of them can be retrieved: in general, only an equivalent grid generator system will be available, where original generators may have been reordered, removed (if they are duplicate or redundant), etc.