From 9a93f7798e7639d1b7b09540a6c5e1e42bf0302b Mon Sep 17 00:00:00 2001 From: skimo Date: Mon, 9 Aug 2004 14:24:02 +0000 Subject: [PATCH] code reuse --- barvinok.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/barvinok.cc b/barvinok.cc index db57fc2..8ae31b7 100644 --- a/barvinok.cc +++ b/barvinok.cc @@ -2796,11 +2796,7 @@ static evalue* barvinok_enumerate_e_r(Polyhedron *P, value_multiply(f, f, P->Constraint[l][nvar+i+1]); value_substract(row->p[len-1], row->p[len-1], f); value_decrement(row->p[len-1], row->p[len-1]); - Vector_Gcd(row->p+1, len - 2, &f); - if (value_notone_p(f)) { - Vector_AntiScale(row->p+1, row->p+1, f, len-2); - mpz_fdiv_q(row->p[len-1], row->p[len-1], f); - } + ConstraintSimplify(row->p, row->p, len, &f); value_set_si(f, -1); Vector_Scale(row->p+1, row->p+1, f, len-1); value_decrement(row->p[len-1], row->p[len-1]); @@ -2833,11 +2829,7 @@ static evalue* barvinok_enumerate_e_r(Polyhedron *P, value_set_si(f, -1); Vector_Scale(row->p+1, row->p+1, f, len-1); value_decrement(row->p[len-1], row->p[len-1]); - Vector_Gcd(row->p+1, len - 2, &f); - if (value_notone_p(f)) { - Vector_AntiScale(row->p+1, row->p+1, f, len-2); - mpz_fdiv_q(row->p[len-1], row->p[len-1], f); - } + ConstraintSimplify(row->p, row->p, len, &f); value_set_si(f, -1); Vector_Scale(row->p+1, row->p+1, f, len-1); value_decrement(row->p[len-1], row->p[len-1]); -- 2.11.4.GIT