[GIT] ppl/ppl(termination): Simplified OCaml code for all_zero() and all_homogeneous_terms_are_zero()

Module: ppl/ppl Branch: termination Commit: 636c546843046a5cfa6d27a1aa4a8171d7e537ab URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=636c546843046...
Author: Patricia Hill p.m.hill@leeds.ac.uk Date: Sat Mar 20 21:44:54 2010 +0000
Simplified OCaml code for all_zero() and all_homogeneous_terms_are_zero()
---
interfaces/OCaml/ppl_ocaml_common.cc | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/interfaces/OCaml/ppl_ocaml_common.cc b/interfaces/OCaml/ppl_ocaml_common.cc index e574656..8592046 100644 --- a/interfaces/OCaml/ppl_ocaml_common.cc +++ b/interfaces/OCaml/ppl_ocaml_common.cc @@ -1206,8 +1206,7 @@ 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() + CAMLreturn(build_ppl_Linear_Expression(ocaml_le).is_zero() ? Val_true : Val_false); } CATCH_ALL @@ -1216,8 +1215,8 @@ 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() + CAMLreturn(build_ppl_Linear_Expression(ocaml_le). + all_homogeneous_terms_are_zero() ? Val_true : Val_false); } CATCH_ALL
participants (1)
-
Patricia Hill