[PPL-devel] [GIT] ppl/ppl(pip): Implemented the art_parameter_count method; updated the C interface.

François Galea francois.galea at uvsq.fr
Tue Nov 3 10:29:32 CET 2009


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

Author: François Galea <francois.galea at uvsq.fr>
Date:   Tue Nov  3 09:53:10 2009 +0100

Implemented the art_parameter_count method; updated the C interface.

---

 interfaces/C/ppl_c_header.h                 |    9 +++++++++
 interfaces/C/ppl_c_implementation_common.cc |    9 +++++++++
 src/PIP_Tree.defs.hh                        |    3 +++
 src/PIP_Tree.inlines.hh                     |    5 +++++
 4 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/interfaces/C/ppl_c_header.h b/interfaces/C/ppl_c_header.h
index 6913c87..b69093e 100644
--- a/interfaces/C/ppl_c_header.h
+++ b/interfaces/C/ppl_c_header.h
@@ -2836,6 +2836,15 @@ int
 ppl_PIP_Tree_Node_OK PPL_PROTO((ppl_const_PIP_Tree_Node_t pip));
 
 /*! \relates ppl_PIP_Tree_Node_tag \brief
+  Writes to \p m the number of elements in the artificial parameter sequence
+  in the pip tree node \p pip_tree.
+*/
+int
+ppl_PIP_Tree_Node_number_of_artificials
+PPL_PROTO((ppl_const_PIP_Tree_Node_t pip_tree,
+           ppl_dimension_type* m));
+
+/*! \relates ppl_PIP_Tree_Node_tag \brief
   Assigns to \p pit a const iterator "pointing" to the beginning of
   the artificial parameter sequence in the pip tree node \p pip_tree.
 */
diff --git a/interfaces/C/ppl_c_implementation_common.cc b/interfaces/C/ppl_c_implementation_common.cc
index 810f291..3eb44f7 100644
--- a/interfaces/C/ppl_c_implementation_common.cc
+++ b/interfaces/C/ppl_c_implementation_common.cc
@@ -2299,6 +2299,15 @@ ppl_PIP_Tree_Node_OK(ppl_const_PIP_Tree_Node_t pip_tree) try {
 CATCH_ALL
 
 int
+ppl_PIP_Tree_Node_number_of_artificials(ppl_const_PIP_Tree_Node_t pip_tree,
+					ppl_dimension_type* m) try {
+  const PIP_Tree_Node& node = *to_const(pip_tree);
+  *m = node.art_parameter_count();
+  return 0;
+}
+CATCH_ALL
+
+int
 ppl_PIP_Tree_Node_begin
 (ppl_const_PIP_Tree_Node_t pip_tree,
  ppl_Artificial_Parameter_Sequence_const_iterator_t pit) try {
diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh
index 40400ac..c9d3d1d 100644
--- a/src/PIP_Tree.defs.hh
+++ b/src/PIP_Tree.defs.hh
@@ -101,6 +101,9 @@ public:
   //! Returns a const_iterator to the end of local artificial parameters.
   Artificial_Parameter_Sequence::const_iterator art_parameter_end() const;
 
+  //! Returns the number of local artificial parameters.
+  dimension_type art_parameter_count() const;
+
   /*! \brief
     Inserts in parameter set \p params the parameter indices corresponding to
     local artificials.
diff --git a/src/PIP_Tree.inlines.hh b/src/PIP_Tree.inlines.hh
index 88fdd5d..8901588 100644
--- a/src/PIP_Tree.inlines.hh
+++ b/src/PIP_Tree.inlines.hh
@@ -82,6 +82,11 @@ PIP_Tree_Node::art_parameter_end() const {
   return artificial_parameters.end();
 }
 
+inline dimension_type
+PIP_Tree_Node::art_parameter_count() const {
+  return artificial_parameters.size();
+}
+
 inline
 const PIP_Tree_Node*
 PIP_Decision_Node::child_node(bool v) const {




More information about the PPL-devel mailing list