ampl / mp

An open-source library for mathematical programming
https://mp.ampl.com
Other
227 stars 43 forks source link

Duplicated artificial variable name #221

Closed mapgccv closed 1 year ago

mapgccv commented 1 year ago

Using this model with Xpress,

param pi := 4 * atan(1);
 var x >= -4 * pi, <= -pi;
 var y >= -1, <= 1;
 s.t.Sin01: y <= sin(x);
 maximize SumXY : x + y;

and importing the model with names, we get a duplicated var names error, and indeed:

Name Value Type
[0] {s="x" n=0 } mp::pre::VCString
[1] {s="y" n=0 } mp::pre::VCString
[2] {s="Sin01" n=0 } mp::pre::VCString
[3] {s_="Sin012" n_=0 } mp::pre::VCString
[4] {s_="Sin01_2_2" n_=0 } mp::pre::VCString
[5] {s_="Sin01_2_2" n_=0 } mp::pre::VCString