Go to the first, previous, next, last section, table of contents.
i = ~A
i = (A == B)
i = (A >> B)
i = col_lcm(j);
i = col_gcd(j);
normalize();
normalize(TRUE)
the constant term of each inequality is adjusted
to make the bounds tight without changing the integer solution.
del_zeros();
del_unused_var();
del_repetition();
del_loose();
min_constant();
max_rank();
A = B.filter(a, i, j);
A = B.filter_thru(a, i);
A = B.filter_away(a, i);
filter
determines
the filter operation. If j is 1 the operation is
filter_thru
and when j is -1 the operation is
filter_away
.
Let's look at an example loop nest.
for i1 = 0 to N do for i2 = 0 to MIN(i1, N) do for i3 = 1 to MIN(i2, N-1) do for i4 = 0 to 100 do ...The set of inequalities representing this loop nest is:
// N i1 i2 i3 i4 [ 0 0 1 0 0 0 ] [ 0 1 -1 0 0 0 ] [ 0 0 0 1 0 0 ] A = [ 0 0 1 -1 0 0 ] [ 0 1 0 -1 0 0 ] [ -1 0 0 0 1 0 ] [ 0 0 0 1 -1 0 ] [ 1 1 0 0 -1 0 ] [ 0 0 0 0 0 1 ] [ 100 0 0 0 0 -1 ]Let's see how to extract the lower and upper bounds of the loop i2 from the system of inequalities A.
constraint c(6); // First remove all the inequalities representing // the bounds of inner loops (i3 and i4). This step // will remove the 7th inequality where i2 is in // the bounds of i3. c = 0; c[4] = 1 c[5] = 1 // c =[ 0 0 0 0 1 1 ] B = A.filter_away(c, 0); // [ 0 0 1 0 0 0 ] // [ 0 1 -1 0 0 0 ] // B = [ 0 0 0 1 0 0 ] // [ 0 0 1 -1 0 0 ] // [ 0 1 0 -1 0 0 ] // Now get the inequalities that represent the bounds // of i2. After the previous step, all the inequalities // with a non-zero coefficient for i2 represents a // bound for the i2 loop. c = 0; c[3] = 1 // c = [ 0 0 0 1 0 0 ] LB = B.filter_thru(c, 1); // The lower bound of the loop i2 is: // LB = [ 0 0 0 1 0 0 ] UB = B.filter_thru(c, -1); // The upper bound of the loop i2 is: // UB = [ 0 0 1 -1 0 0 ] // [ 0 1 0 -1 0 0 ]
Go to the first, previous, next, last section, table of contents.