I am working with cvxopt matrices in order to use them in picos library. In general I want to take a matrix, evaluate it on a certain vector, subtract something, then take the biggest absolute value of its entries
import picos as pic
import cvxopt as cvx
import numpy as np
(...)
P = pic.Problem()
theta = P.add_variable('theta', size=k, vtype='continuous', lower=-10, upper=10)
theta
P.add_constraint(max(abs(M*theta - b)) <= 5)
P.minimize(theta)
(Here b is some vector treated as cvxopt matrix.) However, the error I get is the following:
TypeError Traceback (most recent call last)
<ipython-input-11-8884e5cb14dc> in <module>
3 theta
4
----> 5 P.add_constraint(max(abs(M*theta - b.T)) < 45)
6 P.minimize(theta)
7
TypeError: 'Norm' object is not iterable
I was wondering if there is an alternative way of making these computations that would be acceptable to cvxopt?