I want to solve the optimization of maximizing the objective which is the sum of the absolute value of a matrix. However, I cannot find the accurate way to get that:
for example:
import mosek.fusion as mf
from mosek.fusion import Model, Domain, Expr, ObjectiveSense
with Model('lol') as M:
x = M.variable('x', [5,1], Domain.inRange(-1,1))
M.objective('obj', ObjectiveSense.Maximize, abs(x))
M.solve()
does not work
Type Error: bad operand type for abs(): 'RangedVariable'
How can I get the absolute value of x
?