24 #include "ppl-config.h"
28 namespace Parma_Polyhedra_Library {
30 namespace Implementation {
32 namespace Termination {
41 i_end = cs_in.
end(); i != i_end; ++i) {
69 i_end = ph_cs.
end(); i != i_end; ++i) {
138 output_function_MS_n = n;
139 output_function_MS_m = m;
141 std::cout <<
"*** cs ***" << std::endl;
142 output_function_MS_which = 0;
143 using namespace IO_Operators;
144 std::cout << cs << std::endl;
148 dimension_type z_begin = y_begin + ((&cs_out1 == &cs_out2) ? m : 0);
155 std::vector<Linear_Expression> y_les(2*n, y_le);
156 std::vector<Linear_Expression> z_les(2*n + 1, z_le);
161 cs_end = cs.
end(); i != cs_end; ++i) {
178 Coefficient_traits::const_reference a_i_j = *j;
191 cs_out1.
insert(y_le >= 1);
192 cs_out2.
insert(z_le >= 0);
201 cs_out2.
insert(z_les[j] == 0);
206 if (&cs_out1 == &cs_out2) {
207 std::cout <<
"*** cs_mip ***" << std::endl;
208 output_function_MS_which = 3;
209 using namespace IO_Operators;
210 std::cout << cs_mip << std::endl;
213 std::cout <<
"*** cs_out1 ***" << std::endl;
214 output_function_MS_which = 1;
215 using namespace IO_Operators;
216 std::cout << cs_out1 << std::endl;
218 std::cout <<
"*** cs_out2 ***" << std::endl;
219 output_function_MS_which = 2;
220 using namespace IO_Operators;
221 std::cout << cs_out2 << std::endl;
354 std::vector<Linear_Expression> les_eq(2*n, le_out);
358 cs_before_end = cs_before.
end();
365 j = e_i.
begin(), j_end = e_i.
end(); j != j_end; ++j) {
366 Coefficient_traits::const_reference A_ij_B = *j;
382 cs_after_end = cs_after.
end();
389 i_end = e_i.
end(); i != i_end; ++i) {
390 Coefficient_traits::const_reference A_ij_C = *i;
399 Coefficient_traits::const_reference Ap_ij_C = *i;
414 cs_out.
insert(les_eq[j] == 0);
428 std::vector<Linear_Expression> les_eq(3*n, le_out);
434 const Variable lambda1_i(row_index);
435 const Variable lambda2_i(m + row_index);
438 Coefficient_traits::const_reference Ap_ij = *i;
447 i_end = e_i.
end(); i != i_end; ++i) {
448 Coefficient_traits::const_reference A_ij = *i;
467 cs_out.
insert(les_eq[j] == 0);
515 output_function_MS_n = n;
518 std::cout <<
"*** ph1 projected ***" << std::endl;
519 output_function_MS_which = 4;
520 using namespace IO_Operators;
523 std::cout <<
"*** ph2 projected ***" << std::endl;
530 std::cout <<
"*** intersection ***" << std::endl;
531 using namespace IO_Operators;
560 output_function_MS_n = n;
563 std::cout <<
"*** ph1 projected ***" << std::endl;
564 output_function_MS_which = 4;
565 using namespace IO_Operators;
568 std::cout <<
"*** ph2 projected ***" << std::endl;
574 decreasing_mu_space.
m_swap(ph1);
575 bounded_mu_space.
m_swap(ph2);
587 cs_mip.insert(le_ineq <= -1);
608 std::cout <<
"*** cs_mip ***" << std::endl;
609 using namespace IO_Operators;
610 std::cout << cs_mip << std::endl;
611 std::cout <<
"*** le_ineq ***" << std::endl;
612 std::cout << le_ineq << std::endl;
618 cs_mip.
insert(le_ineq <= -1);
674 std::cout <<
"*** cs_mip ***" << std::endl;
675 using namespace IO_Operators;
676 std::cout << cs_mip << std::endl;
677 std::cout <<
"*** le_ineq ***" << std::endl;
678 std::cout << le_ineq << std::endl;
684 cs_mip.
insert(le_ineq <= -1);
687 if (!mip.is_satisfiable())
690 const Generator& fp = mip.feasible_point();
697 le.set_space_dimension(1 + n);
701 cs_after_end = cs_after.
end();
704 Coefficient_traits::const_reference
707 le.linear_combine(i->expr, 1, -fp_i, 1, n + 1);
728 std::cout <<
"*** cs_mip ***" << std::endl;
729 using namespace IO_Operators;
730 std::cout << cs_mip << std::endl;
731 std::cout <<
"*** le_ineq ***" << std::endl;
732 std::cout << le_ineq << std::endl;
736 cs_mip.
insert(le_ineq <= -1);
739 if (!mip.is_satisfiable())
742 const Generator& fp = mip.feasible_point();
746 le.set_space_dimension(1 + n);
753 Coefficient_traits::const_reference fp_i = fp.coefficient(lambda_2);
755 le.linear_combine(i->expr, 1, -fp_i, 1, n + 1);
780 std::cout <<
"*** cs_eqs ***" << std::endl;
781 using namespace IO_Operators;
782 std::cout << cs_eqs << std::endl;
783 std::cout <<
"*** le_ineq ***" << std::endl;
784 std::cout << le_ineq << std::endl;
794 std::cout <<
"*** ph ***" << std::endl;
795 std::cout << ph << std::endl;
806 if (gs_in_it == gs_in_end)
810 for ( ; gs_in_it != gs_in_end; ++gs_in_it) {
817 cs_after_end = cs_after.
end();
820 Coefficient_traits::const_reference
830 gs_out.insert(line(le));
834 gs_out.insert(ray(le));
837 gs_out.insert(point(le, g.
divisor()));
840 gs_out.insert(closure_point(le, g.
divisor()));
878 std::cout <<
"*** ph ***" << std::endl;
879 std::cout << ph << std::endl;
887 if (gs_in_it == gs_in_end)
892 for ( ; gs_in_it != gs_in_end; ++gs_in_it) {
901 Coefficient_traits::const_reference g_i = g.
coefficient(lambda2_i);