bash-3.00$ cat e14.in # Philippe's simple example #-------------------------- # 1 <= i <= N # 1 <= j <= N # 1 <= k <= N # i+j+k-2 = M #-------------------------- 7 7 # i j k N M 1 1 1 0 0 0 0 -1 1 -1 0 0 1 0 0 1 0 1 0 0 0 -1 1 0 -1 0 1 0 0 1 0 0 1 0 0 -1 1 0 0 -1 1 0 0 0 -1 -1 -1 0 1 2 #-------------------------- 0 4 N M Philippe's simple example #-------------------------- # I have done the work by hand, and here is the right # answer : # # If 1 <= M <= N then EP(N,M) = 1/2 M^2 + 1/2 M # If N <= M <= 2N-1 then EP(N,M) = -3/2 N^2 - M^2 + 3NM - M # If 2N-1 <= M <= 3N-2 then EP(N,M) = 9/2 N^2 + 1/2 M^2 - 3NM - 3/2 N + 1/2 M bash-3.00$ ~/obj/barvinok/barvinok_enumerate < e14.in POLYHEDRON Dimension:5 Constraints:8 Equations:1 Rays:9 Lines:0 Constraints 8 7 Equality: [ 1 1 1 0 -1 -2 ] Inequality: [ 0 -1 -1 0 1 1 ] Inequality: [ 0 1 1 1 -1 -2 ] Inequality: [ 0 1 0 0 0 -1 ] Inequality: [ 0 -1 0 1 0 0 ] Inequality: [ 0 0 1 0 0 -1 ] Inequality: [ 0 0 -1 1 0 0 ] Inequality: [ 0 0 0 0 0 1 ] Rays 9 7 Ray: [ 1 0 1 1 2 ] Vertex: [ 1 1 1 1 1 ]/1 Ray: [ 0 1 0 1 1 ] Ray: [ 0 0 0 1 0 ] Ray: [ 1 0 0 1 1 ] Ray: [ 1 1 0 1 2 ] Ray: [ 1 1 1 1 3 ] Ray: [ 0 1 1 1 2 ] Ray: [ 0 0 1 1 1 ] POLYHEDRON Dimension:2 Constraints:1 Equations:0 Rays:3 Lines:2 Constraints 1 4 Inequality: [ 0 0 1 ] Rays 3 4 Line: [ 1 0 ] Line: [ 0 1 ] Vertex: [ 0 0 ]/1 M -1 >= 0 N - M -1 >= 0 1 >= 0 ( 1/2 * M^2 + 1/2 * M + 0 ) 3N - M -2 >= 0 -2N + M >= 0 1 >= 0 ( 9/2 * N^2 + ( -3 * M + -3/2 ) * N + ( 1/2 * M^2 + 1/2 * M + 0 ) ) 2N - M -1 >= 0 - N + M >= 0 1 >= 0 ( -3/2 * N^2 + ( 3 * M + 3/2 ) * N + ( -1 * M^2 + -1 * M + 0 ) )