My model defines:
var x {i in B, j in N, v in V: A[i,j]>0.5} binary;
The result seems to be a sparse matrix (see below), most x[i,j,v] are just "dots" (undefined?).
I get "invalid subscript" if I for instance want to print all 1's:
display { i in B, j in N, v in V: x[i,j,v] = 1 };
Any help is appreciated.
I have searched the AMPL book, hoping to find something like (not succeeding):
display { i in B, j in N, v in V: defined( x[i,j,v] ) and x[i,j,v] = 1 };
(snip of x after running solve)
: M6 M60 M62 M64 M65 M66 M72 M73 M74 M76 M77 M79 M80
M11 0 . . . . . . . . . . . .
M13 . . . . . . . . . . 0 . .
M17 . . . . . . . . . . . 0 .
M18 . . . . . . 0 0 1 . . . 0
M21 . . . . . . . . . . 0 . .
M30 . . . . . . 0 0 0 . . . 1
M33 . . . . . . 0 0 0 . . . 0
M34 . . . . . . . . . . 0 . .
M37 . . . . . . . . . . 0 . .
M39 . . . . . . 0 0 0 . . . 0
M43 . . . . . . . . . . . 0 .
M46 . . . . 0 . . . . . . . .
M52 . . . . . 0 . . . . . . .
M53 . . . . . . . . . . 0 . .