Can JuMP.fix be use to fix Array{Float64,1} to Array{VariableRef,1}

Hi,
I find if I write

model=Model();
ep=ones(20);
@variable(model,ep1[1:20]);
JuMP.fix(ep1,ep);

I find it cannot be deal with, and do the JuMP.fix need to fix one by one?
and How can I do it?
Thanks a lot.

Use the broadcast notation:

JuMP.fix.(ep1, ep);
1 Like

Also, you do not need those semicolons and the default style is to omit them.

1 Like

Thanks a lot!