0

I am using picos as a LP modeling language. However, I got the following inconsistency:

import picos as pic
prob_tmp = pic.Problem()
a_tmp = prob_tmp.add_variable("a",1)
eta_tmp = pic.new_param("eta",0.0341)
print (1-eta_tmp) * a_tmp
print a_tmp - eta_tmp * a_tmp

The (1-eta_tmp) * a_tmp and a_tmp - eta_tmp * a_tmp should mean the same thing. But the printed output is not corrected:

# (1 x 1)-affine expression: -eta + 1.0*a # <- this one is wrong!
# (1 x 1)-affine expression: a -eta*a #

Both of them should output # (1 x 1)-affine expression: a -eta*a #. Is it a bug? If so, how do I report that?

Paul Fournel
  • 10,807
  • 9
  • 40
  • 68
user40780
  • 1,828
  • 7
  • 29
  • 50
  • Not an answer to your problem per say, but have you tested [CVXPy](http://www.cvxpy.org/) I've used it for some LPs before with ease. – Yngve Moe Apr 16 '18 at 11:33

1 Answers1

0

I can confirm that this is a bug, but only for the string representation of the expression. Internally, both expressions are stored correctly. To evidence this, let us give a value to the expression a_tmp. Then, printing the expressions show that they are both evaluated correctly:

> a_tmp.value = 42.
> print ((1-eta_tmp) * a_tmp)
40.5678
> print (a_tmp-eta_tmp*a_tmp)
40.5678

I will open an issue on gitlab to fix the string representation of (1-eta_tmp) * a_tmp

guigux
  • 113
  • 2