[PPL-devel] [GIT] ppl/ppl(floating_point): Added more documentation
Fabio Biselli
fabio.biselli at studenti.unipr.it
Fri Sep 4 17:06:49 CEST 2009
Module: ppl/ppl
Branch: floating_point
Commit: da78c30d4893169e3a095e9b91fd0a411fb00947
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=da78c30d4893169e3a095e9b91fd0a411fb00947
Author: Fabio Biselli <fabio.biselli at studenti.unipr.it>
Date: Fri Sep 4 19:05:11 2009 +0200
Added more documentation
---
src/Constant_Floating_Point_Expression.defs.hh | 11 ++++++++++-
src/Difference_Floating_Point_Expression.defs.hh | 15 ++++++++++++++-
src/Floating_Point_Expression.defs.hh | 19 ++++++++++++++++---
...ultiplication_Floating_Point_Expression.defs.hh | 11 ++++++++++-
src/Opposite_Floating_Point_Expression.defs.hh | 5 ++++-
src/Sum_Floating_Point_Expression.defs.hh | 15 ++++++++++++++-
src/Variable_Floating_Point_Expression.defs.hh | 9 ++++++---
7 files changed, 74 insertions(+), 11 deletions(-)
diff --git a/src/Constant_Floating_Point_Expression.defs.hh b/src/Constant_Floating_Point_Expression.defs.hh
index b189dcf..5301c17 100644
--- a/src/Constant_Floating_Point_Expression.defs.hh
+++ b/src/Constant_Floating_Point_Expression.defs.hh
@@ -101,9 +101,18 @@ public:
//@} // Constructors and Destructor
- // TODO: comment
+ // FIXME: Modify documentation when exceptions are fixed
+ /* \brief
+ Returns a linear form in the abstract store \p store corresponding to
+ an inhomogenous term which over-approximates the value of
+ <CODE>this</CODE> argument.
+
+ \exception Parma_Polyhedra_Library::Linearization_Failed
+ Thrown if the method <CODE>linearize</CODE> fails.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
+ //! Swaps \p *this with \p y.
void swap(Constant_Floating_Point_Expression& y);
private:
diff --git a/src/Difference_Floating_Point_Expression.defs.hh b/src/Difference_Floating_Point_Expression.defs.hh
index 397191b..ac7240f 100644
--- a/src/Difference_Floating_Point_Expression.defs.hh
+++ b/src/Difference_Floating_Point_Expression.defs.hh
@@ -105,7 +105,20 @@ public:
//@} // Constructors and Destructor
- //TODO: comment
+ // FIXME: Modify documentation when exceptions are fixed
+ /* \brief
+ Returns a linear form in the abstract store \p store constructed by
+ adding the following linear forms:
+
+ - the linearization of the <CODE>first_operand</CODE> minus the
+ linearization of the <CODE>second_operand</CODE>;
+ - the relative error related to the <CODE>first_operand</CODE>;
+ - the relative error related to the <CODE>second_operand</CODE>;
+ - the absolute error.
+
+ \exception Parma_Polyhedra_Library::Linearization_Failed
+ Thrown if the method <CODE>linearize</CODE> fails.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
//! Swaps \p *this with \p y.
diff --git a/src/Floating_Point_Expression.defs.hh b/src/Floating_Point_Expression.defs.hh
index 5513daa..48de2a8 100644
--- a/src/Floating_Point_Expression.defs.hh
+++ b/src/Floating_Point_Expression.defs.hh
@@ -96,6 +96,11 @@ public:
const FP_Interval_Abstract_Store& store) const = 0;
//! Absolute error.
+ /* \brief
+ Initialized by computing the smallest non-zero positive
+ number in the less precise format between the analyzer and the analyzed
+ format.
+ */
static boundary_type absolute_error;
/* \brief
@@ -104,14 +109,22 @@ public:
*/ // FIXME: this may not be the best place for them.
static bool overflows(const FP_Linear_Form& lf);
- static FP_Linear_Form relative_error(const FP_Linear_Form&);
+ /* \brief
+ Returns a linear form that is used by <CODE>linearize</CODE> to account
+ for the relative errors on \p lf.
+ */
+ static FP_Linear_Form relative_error(const FP_Linear_Form& lf);
- static FP_Interval_Type intervalize(const FP_Linear_Form&,
+ /* \brief
+ Returns an interval that over approximates the range of \p lf in
+ the apstract store \p store.
+ */
+ static FP_Interval_Type intervalize(const FP_Linear_Form& lf,
const FP_Interval_Abstract_Store& store);
}; // class Floating_Point_Expression
-//! Initialize static members of the class.
+
template <typename FP_Interval_Type, typename FP_Format>
typename Floating_Point_Expression<FP_Interval_Type, FP_Format>::boundary_type
Floating_Point_Expression<FP_Interval_Type, FP_Format>::absolute_error =
diff --git a/src/Multiplication_Floating_Point_Expression.defs.hh b/src/Multiplication_Floating_Point_Expression.defs.hh
index d574dd1..a46ca0d 100644
--- a/src/Multiplication_Floating_Point_Expression.defs.hh
+++ b/src/Multiplication_Floating_Point_Expression.defs.hh
@@ -105,7 +105,16 @@ public:
//@} // Constructors and Destructor.
- // TODO: comment
+ // FIXME: Modify documentation when exceptions are fixed
+ // FIXME: Add complete description of method
+ /* \brief
+ Returns a linear form in the abstract store \p store constructed by
+ adding the following linear forms:
+
+
+ \exception Parma_Polyhedra_Library::Linearization_Failed
+ Thrown if the method <CODE>linearize</CODE> fails.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
//! Swaps \p *this with \p y.
diff --git a/src/Opposite_Floating_Point_Expression.defs.hh b/src/Opposite_Floating_Point_Expression.defs.hh
index f2660b5..7ad2991 100644
--- a/src/Opposite_Floating_Point_Expression.defs.hh
+++ b/src/Opposite_Floating_Point_Expression.defs.hh
@@ -102,7 +102,10 @@ public:
//@} // Constructors and Destructor
- // TODO: comment
+ /* \brief
+ Returns a linear form in the abstract store \p store that simply
+ represents the opposite of the operand linearization.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
//! Swaps \p *this with \p y.
diff --git a/src/Sum_Floating_Point_Expression.defs.hh b/src/Sum_Floating_Point_Expression.defs.hh
index 92d9d6d..c359526 100644
--- a/src/Sum_Floating_Point_Expression.defs.hh
+++ b/src/Sum_Floating_Point_Expression.defs.hh
@@ -103,7 +103,20 @@ public:
//@} // Constructors and Destructor
- // TODO: comment
+ // FIXME: Modify documentation when exceptions are fixed
+ /* \brief
+ Returns a linear form in the abstract store \p store constructed by
+ adding the following linear forms:
+
+ - the linearization of the <CODE>first_operand</CODE>;
+ - the linearization of the <CODE>second_operand</CODE>;
+ - the relative error related to the <CODE>first_operand</CODE>;
+ - the relative error related to the <CODE>second_operand</CODE>;
+ - the absolute error.
+
+ \exception Parma_Polyhedra_Library::Linearization_Failed
+ Thrown if the method <CODE>linearize</CODE> fails.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
//! Swaps \p *this with \p y.
diff --git a/src/Variable_Floating_Point_Expression.defs.hh b/src/Variable_Floating_Point_Expression.defs.hh
index 0dc0038..bc8e5a5 100644
--- a/src/Variable_Floating_Point_Expression.defs.hh
+++ b/src/Variable_Floating_Point_Expression.defs.hh
@@ -89,8 +89,8 @@ public:
//! \name Constructors and Destructor
//@{
/*! \brief
- Constructor with a parameter: builds the variable floating point expression
- from \p v_index corresponding to the variable index.
+ Constructor with a parameter: builds the variable floating point
+ expression from \p v_index corresponding to the variable index.
*/
explicit Variable_Floating_Point_Expression(const dimension_type v_index);
@@ -99,7 +99,10 @@ public:
//@} // Constructors and Destructor
- // TODO: comment
+ /* \brief
+ Returns a linear form in the abstract store \p store corresponding to
+ <CODE>this</CODE> variable with coefficent \f$[1,1]\f$.
+ */
FP_Linear_Form linearize(const FP_Interval_Abstract_Store& store) const;
//! Swaps \p *this with \p y.
More information about the PPL-devel
mailing list