Changeset 2209


Ignore:
Timestamp:
Jan 30, 2010 7:01:12 PM (10 years ago)
Author:
jwatson
Message:

Fix to new LP writer to output variable label, instead of name. The name has embedded quotes, which hoses all kinds of things. The label doesn't.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/io/cpxlp.py

    r2170 r2209  
    100100            for id in keys:
    101101                coef = x[1][id]
    102                 name = convert_name(model._var[id.keys()[0]].name)
     102                name = convert_name(model._var[id.keys()[0]].label)
    103103                print >>OUTPUT, ('- %f' % math.fabs(coef) if coef < 0.0 else '+ %f' % coef), name,
    104104                terms_output += 1
     
    117117                print >>OUTPUT, ('- %f' % math.fabs(coef) if coef < 0.0 else '+ %f' % coef),
    118118                for var in id:
    119                     name = convert_name(model._var[var].name)
     119                    name = convert_name(model._var[var].label)
    120120                    if id[var] > 1:
    121121                        print "%s^%d" % (name,id[var]),
Note: See TracChangeset for help on using the changeset viewer.