[PPL-devel] const Constraint_System& T::constraints()

Roberto Bagnara bagnara at cs.unipr.it
Tue Jan 31 14:02:07 CET 2006


The polyhedra classes all provided such a method.  The original
reason is that it seemed the natural thing to do, since it provided
the required information without requiring external storage.

The new semantic objects of the PPL cannot provide a sensible
implementation of such a method, so, for consistency, they
should provide the following method (BD_Shape<T> does it, Grids does
not do it yet):

   //! Returns a system of constraints defining \p *this.
   Constraint_System constraints() const;

Such a method, however, requires the creation of a temporary
that the compiler normally is not able to elide.  Of course,
the above is valid also for generators, congruences and grid-generators.
I thus propose to augment the interface of all the PPL semantic
objects with methods of the form

   /*! \brief
     Assigns to \p cs a system of constraints defining the smallest
     convex polyhedron that contains \p *this.
   */
   void constraints(Constraint_System& cs)

This way, it is the caller to provide storage for the result
and copies can be avoided.
Comments are welcome.
Ciao,

    Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the PPL-devel mailing list