Matrix representation
As a first step in the transformation of the mathematical problem into the form required by the LP problem input function of Xpress Optimizer we write the problem in the form of a table where the columns represent the decision variables and the rows are the constraints. All non-zero coefficients are then entered into this table, resulting in the problem matrix, completed by the operators and the constant terms (the latter are usually refered to as the right hand side, RHS, values).
frac1 | frac2 | frac3 | frac4 | frac5 | frac6 | frac7 | frac8 | frac9 | frac10 | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Oper. | RHS | ||
Risk | 0 | 12 | 15 | 18 | 115 | 117 | ≤ | 1/3 | |||||
MinNA | 1 | 10 | 13 | 16 | 19 | ≥ | 0.5 | ||||||
Allfrac | 2 | 11 | 14 | 17 | 110 | 111 | 112 | 113 | 114 | 116 | 118 | = | 1 |
↑ | ↑ | ||||||||||||
rowidx | matval | ||||||||||||
colbeg | 0 | 2 | 5 | 8 | 11 | 12 | 13 | 14 | 15 | 17 | 19 | ||
nelem | 2 | 3 | 3 | 3 | 1 | 1 | 1 | 1 | 2 | 2 |
The matrix specified to Xpress Optimizer does not consist of the full number_of_ rows x number_of_columns table; instead, only the list of non-zero coefficients is given and an indication where they are located. The superscripts in the table above indicate the order of the matrix entries in this list. The coefficient values will be stored in the array matval, the corresponding row numbers in the array rowidx, the values of the first few entries of these arrays are printed in italics to highlight them (see the code example in the following section for the full definition of these arrays). To complete this information, the array colbeg contains the index of the first entry per column and the array nelem the number of entries per column.