[PPL-devel] [GIT] ppl/ppl(floating_point): Added a first version of class Variable_Floating_Point_Expression.

Fabio Bossi bossi at cs.unipr.it
Tue Sep 1 10:39:02 CEST 2009


Module: ppl/ppl
Branch: floating_point
Commit: bc1a412d5547c459473918f13c22328758bf5e84
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=bc1a412d5547c459473918f13c22328758bf5e84

Author: Fabio Bossi <bossi at cs.unipr.it>
Date:   Tue Sep  1 10:40:11 2009 +0200

Added a first version of class Variable_Floating_Point_Expression.

---

 src/Makefile.am                                   |    5 +-
 src/Variable_Floating_Point_Expression.defs.hh    |   71 +++++++++++++++++++++
 src/Variable_Floating_Point_Expression.inlines.hh |   53 +++++++++++++++
 src/Variable_Floating_Point_Expression.types.hh   |   22 +++++++
 4 files changed, 150 insertions(+), 1 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index c49ff90..89c9d1e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -346,7 +346,10 @@ Floating_Point_Expression.defs.hh \
 Floating_Point_Expression.inlines.hh \
 Constant_Floating_Point_Expression.types.hh \
 Constant_Floating_Point_Expression.defs.hh \
-Constant_Floating_Point_Expression.inlines.hh
+Constant_Floating_Point_Expression.inlines.hh \
+Variable_Floating_Point_Expression.types.hh \
+Variable_Floating_Point_Expression.defs.hh \
+Variable_Floating_Point_Expression.inlines.hh
 #Any_Pointset.types.hh \
 #Any_Pointset.defs.hh \
 #Any_Pointset.inlines.hh \
diff --git a/src/Variable_Floating_Point_Expression.defs.hh b/src/Variable_Floating_Point_Expression.defs.hh
new file mode 100644
index 0000000..30819e8
--- /dev/null
+++ b/src/Variable_Floating_Point_Expression.defs.hh
@@ -0,0 +1,71 @@
+/* Declarations for the Variable_Floating_Point_Expression class and
+   its constituents.
+   Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://www.cs.unipr.it/ppl/ . */
+
+#ifndef PPL_Variable_Floating_Point_Expression_defs_hh
+#define PPL_Variable_Floating_Point_Expression_defs_hh 1
+
+#include "Floating_Point_Expression.defs.hh"
+#include "globals.defs.hh"
+#include "Variable_Floating_Point_Expression.types.hh"
+#include <map>
+
+namespace Parma_Polyhedra_Library {
+
+template <typename FP_Interval_Type, typename FP_Format>
+class Variable_Floating_Point_Expression
+: public virtual Floating_Point_Expression<FP_Interval_Type, FP_Format> {
+
+public:
+
+  typedef typename
+  Floating_Point_Expression<FP_Interval_Type, FP_Format>::
+  FP_Linear_Form FP_Linear_Form;
+
+  typedef typename
+  Floating_Point_Expression<FP_Interval_Type, FP_Format>::
+  FP_Interval_Abstract_Store FP_Interval_Abstract_Store;
+
+  typedef typename
+  Floating_Point_Expression<FP_Interval_Type, FP_Format>::boundary_type
+  boundary_type;
+
+  typedef typename
+  Floating_Point_Expression<FP_Interval_Type, FP_Format>::info_type info_type;
+
+  Variable_Floating_Point_Expression(const dimension_type v_index);
+
+  ~Variable_Floating_Point_Expression();
+
+  FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
+
+private:
+
+  dimension_type variable_index;
+
+}; // class Variable_Floating_Point_Expression
+
+} // namespace Parma_Polyhedra_Library
+
+#include "Variable_Floating_Point_Expression.inlines.hh"
+
+#endif // !defined(PPL_Variable_Floating_Point_Expression_defs_hh)
diff --git a/src/Variable_Floating_Point_Expression.inlines.hh b/src/Variable_Floating_Point_Expression.inlines.hh
new file mode 100644
index 0000000..f2a9a90
--- /dev/null
+++ b/src/Variable_Floating_Point_Expression.inlines.hh
@@ -0,0 +1,53 @@
+/* Variable_Floating_Point_Expression class implementation: inline functions.
+   Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://www.cs.unipr.it/ppl/ . */
+
+#ifndef PPL_Variable_Floating_Point_Expression_inlines_hh
+#define PPL_Variable_Floating_Point_Expression_inlines_hh 1
+
+#include "globals.defs.hh"
+
+namespace Parma_Polyhedra_Library {
+
+template <typename FP_Interval_Type, typename FP_Format>
+inline
+Variable_Floating_Point_Expression<FP_Interval_Type, FP_Format>::
+Variable_Floating_Point_Expression(const dimension_type v_index) {
+  variable_index = v_index;
+}
+
+template <typename FP_Interval_Type, typename FP_Format>
+inline
+Variable_Floating_Point_Expression<FP_Interval_Type, FP_Format>::
+~Variable_Floating_Point_Expression() {}
+
+template <typename FP_Interval_Type, typename FP_Format>
+inline typename Variable_Floating_Point_Expression<FP_Interval_Type,
+                                                   FP_Format>::FP_Linear_Form
+Variable_Floating_Point_Expression<FP_Interval_Type, FP_Format>::linearize(
+const FP_Interval_Abstract_Store& store) const {
+  FP_Linear_Form result = FP_Linear_Form(Variable(variable_index));
+  return result;
+}
+
+} // namespace Parma_Polyhedra_Library
+
+#endif // !defined(PPL_Variable_Floating_Point_Expression_inlines_hh)
diff --git a/src/Variable_Floating_Point_Expression.types.hh b/src/Variable_Floating_Point_Expression.types.hh
new file mode 100644
index 0000000..ca6b373
--- /dev/null
+++ b/src/Variable_Floating_Point_Expression.types.hh
@@ -0,0 +1,22 @@
+/* Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+
+This file is free software; as a special exception the author gives
+unlimited permission to copy and/or distribute it, with or without
+modifications, as long as this notice is preserved.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. */
+
+#ifndef PPL_Variable_Floating_Point_Expression_types_hh
+#define PPL_Variable_Floating_Point_Expression_types_hh 1
+
+namespace Parma_Polyhedra_Library {
+
+template <typename FP_Interval_Type, typename FP_Format>
+class Variable_Floating_Point_Expression;
+
+} // namespace Parma_Polyhedra_Library
+
+#endif // !defined(PPL_Variable_Floating_Point_Expression_types_hh)




More information about the PPL-devel mailing list