From 91bb370e892532ae7e7d29afaab4501506b0bd65 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 10 Feb 2011 13:52:04 +0100 Subject: [PATCH] isl_tab_min: micro-optimization: postpone taking into account denominator The denominator of the affine expression shouldn't have any effect on the point where the minimum is reached. Moreover, for non-rational tableaus, it may be confusing for future optimizations to have a row that may attain rational values. It is therefore beter to multiply in the denominator after the optimum has been computed. Signed-off-by: Sven Verdoolaege --- isl_tab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/isl_tab.c b/isl_tab.c index 274cb80..06b30fb 100644 --- a/isl_tab.c +++ b/isl_tab.c @@ -2763,8 +2763,6 @@ enum isl_lp_result isl_tab_min(struct isl_tab *tab, if (r < 0) return isl_lp_error; var = &tab->con[r]; - isl_int_mul(tab->mat->row[var->index][0], - tab->mat->row[var->index][0], denom); for (;;) { int row, col; find_pivot(tab, var, var, -1, &row, &col); @@ -2777,6 +2775,8 @@ enum isl_lp_result isl_tab_min(struct isl_tab *tab, if (isl_tab_pivot(tab, row, col) < 0) return isl_lp_error; } + isl_int_mul(tab->mat->row[var->index][0], + tab->mat->row[var->index][0], denom); if (ISL_FL_ISSET(flags, ISL_TAB_SAVE_DUAL)) { int i; -- 2.7.4