[GIT] ppl/ppl(pip): Added 2 more functions for the C interface to the PIP_Problem class.

Module: ppl/ppl Branch: pip Commit: 57c81a9ac76f4ec249259a5216f24bc3529bfc30 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=57c81a9ac76f4...
Author: Patricia Hill p.m.hill@leeds.ac.uk Date: Wed Oct 7 16:00:42 2009 +0100
Added 2 more functions for the C interface to the PIP_Problem class.
---
interfaces/C/ppl_c_header.h | 1 + interfaces/C/ppl_c_implementation_common.cc | 16 ++++++++++++++++ .../C/ppl_c_implementation_common.inlines.hh | 2 ++ 3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/interfaces/C/ppl_c_header.h b/interfaces/C/ppl_c_header.h index 1bb8c4e..070f380 100644 --- a/interfaces/C/ppl_c_header.h +++ b/interfaces/C/ppl_c_header.h @@ -694,6 +694,7 @@ PPL_TYPE_DECLARATION(MIP_Problem) towards \extref{Parma_Polyhedra_Library::PIP_Problem, PIP_Problem}. */ PPL_TYPE_DECLARATION(PIP_Problem) +PPL_TYPE_DECLARATION(PIP_Tree_Node)
#undef PPL_DECLARE_PRINT_FUNCTIONS diff --git a/interfaces/C/ppl_c_implementation_common.cc b/interfaces/C/ppl_c_implementation_common.cc index 875d4cd..f5c4a38 100644 --- a/interfaces/C/ppl_c_implementation_common.cc +++ b/interfaces/C/ppl_c_implementation_common.cc @@ -2220,6 +2220,22 @@ ppl_PIP_Problem_solve(ppl_const_PIP_Problem_t mip) try { CATCH_ALL
int +ppl_PIP_Problem_solution(ppl_const_PIP_Problem_t pip, + ppl_const_PIP_Tree_Node_t* ppip_tree) try { + *ppip_tree = to_const(to_const(pip)->solution()); + return 0; +} +CATCH_ALL + +int +ppl_PIP_Problem_optimizing_solution(ppl_const_PIP_Problem_t pip, + ppl_const_PIP_Tree_Node_t* ppip_tree) try { + *ppip_tree = to_const(to_const(pip)->optimizing_solution()); + return 0; +} +CATCH_ALL + +int ppl_PIP_Problem_OK(ppl_const_PIP_Problem_t mip) try { return to_const(mip)->OK() ? 1 : 0; } diff --git a/interfaces/C/ppl_c_implementation_common.inlines.hh b/interfaces/C/ppl_c_implementation_common.inlines.hh index 6137b23..2065879 100644 --- a/interfaces/C/ppl_c_implementation_common.inlines.hh +++ b/interfaces/C/ppl_c_implementation_common.inlines.hh @@ -79,6 +79,8 @@ DECLARE_CONVERSIONS(MIP_Problem, MIP_Problem)
DECLARE_CONVERSIONS(PIP_Problem, PIP_Problem)
+DECLARE_CONVERSIONS(PIP_Tree_Node, PIP_Tree_Node) + inline Relation_Symbol relation_symbol(enum ppl_enum_Constraint_Type t) { switch (t) {
participants (1)
-
Patricia Hill