[PPL-devel] [GIT] ppl/ppl(termination): Added the rest of the termination functions to the C interface.

Patricia Hill p.m.hill at leeds.ac.uk
Mon Mar 8 14:35:39 CET 2010


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

Author: Patricia Hill <p.m.hill at leeds.ac.uk>
Date:   Mon Mar  8 13:34:53 2010 +0000

Added the rest of the termination functions to the C interface.

---

 interfaces/C/ppl_interface_generator_c_cc_code.m4  |   35 ++++++++++++++++++--
 interfaces/C/ppl_interface_generator_c_h_code.m4   |   25 +++++++++++++-
 ...l_interface_generator_c_procedure_generators.m4 |    4 ++-
 3 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/interfaces/C/ppl_interface_generator_c_cc_code.m4 b/interfaces/C/ppl_interface_generator_c_cc_code.m4
index 22ddd23..c6fbd79 100644
--- a/interfaces/C/ppl_interface_generator_c_cc_code.m4
+++ b/interfaces/C/ppl_interface_generator_c_cc_code.m4
@@ -1156,13 +1156,42 @@ CATCH_ALL
 
 ')
 
-m4_define(`ppl_ at CLASS@_termination_test_MS_code',
+m4_define(`ppl_ at CLASS@_termination_test_ at TERMINATION_ID@_code',
 `dnl
 int
-ppl_ at CLASS@_termination_test_MS
+ppl_ at CLASS@_termination_test_ at TERMINATION_ID@
 (ppl_const_ at CLASS@_t x) try {
   const @CPP_CLASS@& xx = *to_const(x);
-  return termination_test_MS(xx);
+  return termination_test_ at TERMINATION_ID@(xx);
+}
+CATCH_ALL
+
+')
+
+m4_define(`ppl_ at CLASS@_one_affine_ranking_function_ at TERMINATION_ID@_code',
+`int
+ppl_ at CLASS@_one_affine_ranking_function_ at TERMINATION_ID@
+(ppl_const_ at CLASS@_t x,
+ ppl_Generator_t point) try {
+  const @CPP_CLASS@& xx = *to_const(x);
+  Generator& ppoint = *to_nonconst(point);
+  bool ok = one_affine_ranking_function_ at TERMINATION_ID@(xx, ppoint);
+  return ok ? 1 : 0;
+}
+CATCH_ALL
+
+')
+
+m4_define(`ppl_ at CLASS@_all_affine_ranking_functions_ at TERMINATION_ID@_code',
+`int
+ppl_ at CLASS@_all_affine_ranking_functions_ at TERMINATION_ID@
+(ppl_const_ at CLASS@_t x,
+ ppl_Polyhedron_t ph) try {
+  const @CPP_CLASS@& xx = *to_const(x);
+  all_affine_ranking_functions_ at TERMINATION_ID@(xx,
+                                                *static_cast<C_Polyhedron*>
+                                                    (to_nonconst(ph)));
+  return 0;
 }
 CATCH_ALL
 
diff --git a/interfaces/C/ppl_interface_generator_c_h_code.m4 b/interfaces/C/ppl_interface_generator_c_h_code.m4
index 39f717e..2a1ecdd 100644
--- a/interfaces/C/ppl_interface_generator_c_h_code.m4
+++ b/interfaces/C/ppl_interface_generator_c_h_code.m4
@@ -34,15 +34,36 @@ dnl There is no code at present for these procedures in the C interface.
 dnl Remove the macro if its definition is added.
 dnl
 
-m4_define(`ppl_ at CLASS@_termination_test_MS_code',
+m4_define(`ppl_ at CLASS@_termination_test_ at TERMINATION_ID@_code',
 `dnl
 /*! \relates ppl_ at CLASS@_tag */
 int
-ppl_ at CLASS@_termination_test_MS
+ppl_ at CLASS@_termination_test_ at TERMINATION_ID@
 PPL_PROTO((ppl_const_ at CLASS@_t x));
 
 ')
 
+m4_define(`ppl_ at CLASS@_one_affine_ranking_function_ at TERMINATION_ID@_code',
+`dnl
+/*! \relates ppl_ at CLASS@_tag */
+int
+ppl_ at CLASS@_one_affine_ranking_function_ at TERMINATION_ID@
+PPL_PROTO((ppl_const_ at CLASS@_t x,
+           ppl_Generator_t point));
+
+')
+
+m4_define(`ppl_ at CLASS@_all_affine_ranking_functions_ at TERMINATION_ID@_code',
+`dnl
+/*! \relates ppl_ at CLASS@_tag */
+int
+ppl_ at CLASS@_all_affine_ranking_functions_ at TERMINATION_ID@
+PPL_PROTO((ppl_const_ at CLASS@_t x,
+           ppl_Polyhedron_t ph));
+
+')
+
+
 m4_define(`ppl_ at CLASS@_linear_ at PARTITION@_code',
 `dnl
 /*! \relates ppl_ at CLASS@_tag */
diff --git a/interfaces/C/ppl_interface_generator_c_procedure_generators.m4 b/interfaces/C/ppl_interface_generator_c_procedure_generators.m4
index 7f590d7..fba9565 100644
--- a/interfaces/C/ppl_interface_generator_c_procedure_generators.m4
+++ b/interfaces/C/ppl_interface_generator_c_procedure_generators.m4
@@ -44,6 +44,8 @@ ppl_new_ at TOPOLOGY@@CLASS at _recycle_@BUILD_REPRESENT at s +simple,
 ppl_assign_ at TOPOLOGY@@CLASS at _from_@TOPOLOGY@@CLASS@ +simple,
 ppl_ at CLASS@_add_recycled_ at CLASS_REPRESENT@s +simple,
 ppl_ at CLASS@_wrap_assign +simple,
-ppl_ at CLASS@_termination_test_MS +simple,
+ppl_ at CLASS@_termination_test_ at TERMINATION_ID@ +simple,
+ppl_ at CLASS@_one_affine_ranking_function_ at TERMINATION_ID@ +simple,
+ppl_ at CLASS@_all_affine_ranking_functions_ at TERMINATION_ID@ +simple,
 )
 ')




More information about the PPL-devel mailing list