2

I am using CVXPY (version 1.0). I do not understand what causes the difference between a ZERO expression and a NONNEGATIVE expression as demonstrated by the following code:

>>> import cvxpy as cv
>>> a = cv.Variable(1)
>>> b = cv.Variable(1)
>>> print((cv.square(a-b)*1/(1e-6)).__repr__()) 
Expression(CONSTANT, ZERO, (1,))
>>> print((cv.square(a-b)*float(1/1e-6)).__repr__()) 
Expression(CONVEX, NONNEGATIVE, (1,))
Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
Tony
  • 445
  • 6
  • 13

1 Answers1

2

This is due to a bug that is now fixed in 1.0. Small values were being rounded to 0.

steven
  • 671
  • 4
  • 8