[PPL-devel] [GIT] ppl/ppl(master): Changed the way of accessing the underlying expression in classes
Enea Zaffanella
zaffanella at cs.unipr.it
Tue Aug 14 12:19:39 CEST 2012
Module: ppl/ppl
Branch: master
Commit: 9e4c9c57ae8ffca73bb9ee6c75a43d6ed6cd4096
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=9e4c9c57ae8ffca73bb9ee6c75a43d6ed6cd4096
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Tue Aug 14 11:35:55 2012 +0200
Changed the way of accessing the underlying expression in classes
Constraint, Generator, Congruence and Grid_Generator.
The public methods expression() systematically returns (a const reference to)
an expression adapter derived from template Expression_Adapter (including
Expression_Hide_Inhomo and Expression_Hide_Last). These adapters provide
a *read-only* interface enabling most (but not all) of the operations
that can be performed on a Linear_Expression.
Added four templatic constructors to Linear_Expression accepting any
such adapter. Removed a dozen specific constructors that were tailored
to the four classes Constraint, Generator, Congruence and Grid_Generator.
As a consequence previous code such as
Linear_Expression expr(gen);
will no longer compile and should be replaced by
Linear_Expression expr(gen.expression());
The systematic use of the new adapters, besides removing some indirections,
also decreases the memory overhead of classes Constraint, Generator and
Grid_Generator, as we no longer need members `wrapped_expr' and
`semi_wrapped_expr'.
While at it, corrected a few latent bugs in adapter Expression_Hide_Inhomo
(these could not manifest as real failures because currently the Hide_Inhomo
adapter is always re-wrapped using the Expression_Hide_Last adapter).
---
interfaces/C/ppl_c_implementation_common.cc | 6 +-
src/BD_Shape.templates.hh | 20 ++-
src/Box.templates.hh | 6 +-
src/C_Polyhedron.cc | 7 +-
src/Congruence.defs.hh | 12 +-
src/Congruence.inlines.hh | 14 ++-
src/Constraint.cc | 11 +-
src/Constraint.defs.hh | 12 +-
src/Constraint.inlines.hh | 34 ++--
src/Expression_Adapter.defs.hh | 200 ++++++++++++++++++++
src/Expression_Adapter.inlines.hh | 229 +++++++++++++++++++++++
src/Expression_Adapter.types.hh | 22 +++
src/Expression_Hide_Inhomo.defs.hh | 99 ++--------
src/Expression_Hide_Inhomo.inlines.hh | 262 +++++++-------------------
src/Expression_Hide_Inhomo.types.hh | 2 +-
src/Expression_Hide_Last.defs.hh | 80 ++------
src/Expression_Hide_Last.inlines.hh | 261 ++++++++++-----------------
src/Expression_Hide_Last.types.hh | 2 +-
src/Generator.cc | 4 +-
src/Generator.defs.hh | 19 +-
src/Generator.inlines.hh | 42 ++---
src/Grid_Generator.defs.hh | 14 +-
src/Grid_Generator.inlines.hh | 32 ++--
src/Grid_nonpublic.cc | 6 +-
src/Grid_public.cc | 6 +-
src/Grid_widenings.cc | 7 +-
src/Linear_Expression.cc | 95 ----------
src/Linear_Expression.defs.hh | 241 +++++--------------------
src/Linear_Expression.inlines.hh | 130 ++++----------
src/Linear_Expression_Impl.defs.hh | 14 +--
src/Linear_Expression_Impl.templates.hh | 15 +-
src/Makefile.am | 3 +
src/Octagonal_Shape.templates.hh | 10 +-
src/Partially_Reduced_Product.templates.hh | 20 +-
src/Pointset_Powerset.cc | 2 +-
src/Pointset_Powerset.templates.hh | 4 +-
src/Polyhedron_nonpublic.cc | 7 +-
src/Polyhedron_public.cc | 24 ++--
src/Polyhedron_widenings.cc | 2 +-
src/Scalar_Products.cc | 14 +-
src/termination.cc | 16 +-
tests/Grid/congruence1.cc | 34 ++--
tests/Grid/generator1.cc | 47 +++---
tests/Grid/partition1.cc | 2 +-
tests/Polyhedron/bhrz03widening3.cc | 22 ++-
tests/Polyhedron/disjoint1.cc | 2 +-
tests/Polyhedron/disjoint2.cc | 2 +-
47 files changed, 993 insertions(+), 1122 deletions(-)
Diff: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commitdiff;h=9e4c9c57ae8ffca73bb9ee6c75a43d6ed6cd4096
More information about the PPL-devel
mailing list