File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -619,13 +619,15 @@ namespace lp {
619
619
620
620
bool lar_solver::solve_for (unsigned j, lar_term& t, mpq& coeff) {
621
621
t.clear ();
622
+ IF_VERBOSE (10 , verbose_stream () << column_is_fixed (j) << " " << is_base (j) << " \n " );
622
623
if (column_is_fixed (j)) {
623
624
coeff = get_value (j);
624
625
return true ;
625
626
}
626
627
if (!is_base (j)) {
627
628
for (const auto & c : A_r ().m_columns [j]) {
628
629
lpvar basic_in_row = r_basis ()[c.var ()];
630
+ IF_VERBOSE (10 , verbose_stream () << " c.var() = " << c.var () << " basic_in_row = " << basic_in_row << " \n " );
629
631
pivot (j, basic_in_row);
630
632
break ;
631
633
}
Original file line number Diff line number Diff line change @@ -3638,9 +3638,21 @@ class theory_lra::imp {
3638
3638
rational coeff;
3639
3639
if (!lp ().solve_for (vi, t, coeff))
3640
3640
return false ;
3641
+ rational lc (1 );
3642
+ if (is_int (v)) {
3643
+ lc = denominator (coeff);
3644
+ for (auto const & cv : t)
3645
+ lc = lcm (denominator (cv.coeff ()), lc);
3646
+ if (lc != 1 ) {
3647
+ coeff *= lc;
3648
+ t *= lc;
3649
+ }
3650
+ }
3641
3651
term = mk_term (t, is_int (v));
3642
3652
if (coeff != 0 )
3643
3653
term = a.mk_add (a.mk_numeral (coeff, is_int (v)), term);
3654
+ if (lc != 1 )
3655
+ term = a.mk_idiv (term, a.mk_numeral (lc, true ));
3644
3656
return true ;
3645
3657
}
3646
3658
You can’t perform that action at this time.
0 commit comments