Row and Column References

Consistent with standard C programming practices, in ILOG CPLEX an array containing k items will contain these items in locations 0 (zero) through k-1. Thus a linear program with m rows and n columns will have its rows indexed from 0 to m-1, and its columns from 0 to n-1.

Within the linear programming data structure, the rows and columns that represent constraints and variables are referenced by an index number. Each row and column may optionally have an associated name. If you add or delete rows, the index numbers usually change. However, ILOG CPLEX updates the names so that each row or column index will correspond to the correct row or column name. Double checking names against index numbers is the only sure way to determine which changes may have been made to matrix indices in such a context. The routines CPXgetrowindex() and CPXgetcolindex() translate names to indices.

If additions or deletions to the constraint matrix are few, then:

Here is an example to illustrate how rows are renumbered when rows k+1 to l-1 are deleted. That is, l-(k+1) elements are deleted in the example:

Rows before deletion 
0, . . . k, 
k+1, 
. . . , 
l-1, 
l, 
. . ., 
end 
Rows after deletion 
0, . . . k, 
k+1, 
. . . , 
[end-(l-(k+1))] 


Previous Page: Null Arguments  Return to Top Next Page: Character Strings