= Printing Primal and Dual Values (and other suffix data) =

Pyomo solvers return a variety of information about the optimization
process, including the final solution values.  However, there is often
additional information related to the variables and constraints that a
solver generates.  Following the convention developed by AMPL, we call
this `suffix` data.

For performance reasons, the default behavior of Pyomo is to not collect
suffix data.  The following examples illustrate how to instrument Pyomo
to collect this data.

== Example 1 ==

The `pyomo` command includes the option `--solver-suffix`, which can be
used multiple times to specify the suffixes that a user wishes to collect:
{{{
  pyomo --solver=glpk --solver-suffix=dual knapsack.py knapsack.dat
}}}
You can specify the suffix name as a regular expression, so the following
requests all suffix values:
{{{
  pyomo --solver=glpk --solver-suffix='.*' knapsack.py knapsack.dat
}}}

Suffix data is not uniformly generated by solvers.  The following
suffixes may be available:
 * dual - Dual values
 * rc - Reduced costs
 * slack - Slack values
Additionally, the results generated by the `pyomo` command only prints
variable and constraint data with non-zero values.


== Example 2 ==

The following script executes a workflow that is similar to that executed by the `pyomo` command:[[BR]]
[[Include(source:pyomo.data.samples/trunk/pyomo/data/samples/scripts/s2/script.py)]]
This script includes a simple loop to print out variable data, including
suffix data.

This script generates the following output:
[[Include(source:pyomo.data.samples/trunk/pyomo/data/samples/scripts/s2/script.out, text/x-text)]]


== Downloads ==

 * [source:pyomo.data.samples/trunk/pyomo/data/samples/scripts/s2/knapsack.py knapsack.py]
 * [source:pyomo.data.samples/trunk/pyomo/data/samples/scripts/s2/knapsack.dat knapsack.dat]
 * [source:pyomo.data.samples/trunk/pyomo/data/samples/scripts/s2/script.py script.py]

