[GIT] ppl/ppl(termination): Added OCaml interface for Linear_Expression:: is_zero() and

Module: ppl/ppl Branch: termination Commit: 866c0a278c0373dfc2ac3809ca894f366251a0a0 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=866c0a278c037...
Author: Patricia Hill p.m.hill@leeds.ac.uk Date: Sat Mar 20 21:27:54 2010 +0000
Added OCaml interface for Linear_Expression::is_zero() and all_homogeneous_terms_are_zero().
---
interfaces/OCaml/ppl_ocaml_common.cc | 20 ++++++++++++++++++++ interfaces/OCaml/ppl_ocaml_globals.ml | 7 +++++++ interfaces/OCaml/ppl_ocaml_globals.mli | 6 ++++++ 3 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/interfaces/OCaml/ppl_ocaml_common.cc b/interfaces/OCaml/ppl_ocaml_common.cc index 62b67d5..e574656 100644 --- a/interfaces/OCaml/ppl_ocaml_common.cc +++ b/interfaces/OCaml/ppl_ocaml_common.cc @@ -1204,6 +1204,26 @@ CATCH_ALL
extern "C" CAMLprim value +ppl_Linear_Expression_is_zero(value ocaml_le) try { + CAMLparam1(ocaml_le); + Linear_Expression ppl_le = build_ppl_Linear_Expression(ocaml_le); + CAMLreturn(ppl_le.is_zero() + ? Val_true : Val_false); +} +CATCH_ALL + +extern "C" +CAMLprim value +ppl_Linear_Expression_all_homogeneous_terms_are_zero(value ocaml_le) try { + CAMLparam1(ocaml_le); + Linear_Expression ppl_le = build_ppl_Linear_Expression(ocaml_le); + CAMLreturn(ppl_le.all_homogeneous_terms_are_zero() + ? Val_true : Val_false); +} +CATCH_ALL + +extern "C" +CAMLprim value ppl_set_rounding_for_PPL(value unit) try { CAMLparam1(unit); set_rounding_for_PPL(); diff --git a/interfaces/OCaml/ppl_ocaml_globals.ml b/interfaces/OCaml/ppl_ocaml_globals.ml index c8995eb..cd263d5 100644 --- a/interfaces/OCaml/ppl_ocaml_globals.ml +++ b/interfaces/OCaml/ppl_ocaml_globals.ml @@ -152,6 +152,13 @@ unit -> Z.t = "ppl_Coefficient_max" external ppl_Coefficient_min: unit -> Z.t = "ppl_Coefficient_min"
+external ppl_Linear_Expression_is_zero: +linear_expression -> bool = "ppl_Linear_Expression_is_zero" + +external ppl_Linear_Expression_all_homogeneous_terms_are_zero: +linear_expression -> bool + = "ppl_Linear_Expression_all_homogeneous_terms_are_zero" + external ppl_set_rounding_for_PPL: unit -> unit = "ppl_set_rounding_for_PPL"
diff --git a/interfaces/OCaml/ppl_ocaml_globals.mli b/interfaces/OCaml/ppl_ocaml_globals.mli index a95ac64..f806f0d 100644 --- a/interfaces/OCaml/ppl_ocaml_globals.mli +++ b/interfaces/OCaml/ppl_ocaml_globals.mli @@ -137,6 +137,12 @@ val ppl_Coefficient_max: val ppl_Coefficient_min: unit -> Z.t
+val ppl_Linear_Expression_is_zero: + linear_expression -> bool + +val ppl_Linear_Expression_all_homogeneous_terms_are_zero: + linear_expression -> bool + val ppl_set_rounding_for_PPL: unit -> unit
participants (1)
-
Patricia Hill