Displaying Variable or Constraint Names

You can display a variable name by using the display command with the options "problem names variables." If you do not enter the word "variables," ILOG CPLEX prompts you to specify whether you wish to see a constraint or variable name.

Type:

  display problem names variables

In response, ILOG CPLEX prompts you to specify a set of variable names to be displayed, like this:

  Display which variable name(s):

Specify these variables by entering the names of the variables or the numbers corresponding to the columns of those variables. A single number can be used or a range such as 1-2. All of the names can be displayed at once if you type a hyphen (the character - ). Try this by entering a hyphen at the prompt and pressing the <return> key.

  Display which variable name(s): -

In the example, there are three variables with default names. CPLEX displays these three names:

  x1  x2  x3

If you want to see only the second and third names, you could either enter the range as 2-3 or specify everything following the second variable with 2-. Try this technique:

  display problem names variables
  Display which variable name(s): 2-
  x2  x3

If you enter a number without a hyphen, you will see a single variable name:

  display problem names variables
  Display which variable name(s): 2
  x2

Summary


Previous Page: Specifying Item Ranges   Return to Top Next Page: Ordering Variables