i want to change the lower bound of a model from a zero array to take the value of the elements of another array here’s the function that i’m having
using JuMP
using Clp
function scan_maker(A)
m = JuMP.Model(solver=ClpSolver(PrimalTolerance=1e-3, DualTolerance=1e-3, InfeasibleReturn=1, PresolveType=1))
level = size(A, 2)
v = zeros(Int, level)
ub = zeros(Int, level)
lb = zeros(Int, level)
@variable(m, x[1:level])
@constraint(m, con, A*x.>=0)
function setc(c)
for i = 1:size(A, 1)
m.linconstr[i].lb = float(c[i])
end
end
end
now this function looks totally fine but when i type and run line by line for example if A=[1 2;1 1;2 2]
and c=[1,2,1]
the lower bound will always stay the same [0,0]
it’s close from something like this :
function low(c)
for i=1:size(A,1)
m.linconstr[i].lb = float(c[i])
println(lb)
end
end
low([1,2,3])
and the output is this:
1.0
1.0
1.0
which is not true in this case, it shoud be 1.0 , 2.0 , 3.0
I don’t know what to do