Hello everyone!
I’m having some trouble with some basic concepts about vectorized syntax.
My data were structured this way (just to show that everything is in matrix form):
U = [ ATumor zeros(tr, tr) zeros(tr, gr) zeros(tr, rr);
-ATumor -I zeros(tr, gr) zeros(tr, rr);
ACritical zeros(gr, tr) -I zeros(gr, rr);
ARegular zeros(rr, tr) zeros(rr, gr) -I ]
u = [TUB; -TLB; CUB; RUB]
lb = [zeros(tc); zeros(tr); -CUB; zeros(rr)]
ub = [Inf * ones(tc); TLB; Inf * ones(gr); Inf * ones(rr)]
c = [zeros(tc,1); omega * ones(tr); ones(gr); ones(rr)]
And the commands that I tried with JuMP were:
model = Model(CPLEX.Optimizer)
@variable(model, x[1:size_p], lower_bound = lb, upper_bound = ub)
@constraint(model, U * x .<= u)
@objective(model, Min, c' * x)
But I got the following error message "Cannot `convert` an object of type Array{Float64,1} to an object of type Float64"
at the line with “@variable”
As far as I know, this is happening because JuMP is not seeing my variable as a vector. What is the appropriate syntax for that?
Thanks in advance!