# JuMP/cplex: setting array of variables to zero (in one shot), in heuristic callback

**URL:** https://discourse.julialang.org/t/jump-cplex-setting-array-of-variables-to-zero-in-one-shot-in-heuristic-callback/22462
**Category:** Optimization (Mathematical)
**Created:** [March 28, 2019, 3:02pm UTC](https://discourse.julialang.org/t/jump-cplex-setting-array-of-variables-to-zero-in-one-shot-in-heuristic-callback/22462 "2019-03-28T15:02:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mike\_k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike_k/32/211864_2.png) [@mike\_k](https://discourse.julialang.org/u/mike_k)
#### Post date: [March 28, 2019, 3:02pm UTC](https://discourse.julialang.org/t/jump-cplex-setting-array-of-variables-to-zero-in-one-shot-in-heuristic-callback/22462/1 "2019-03-28T15:02:21Z")

</div>

Dear community,  
I use JuMP 0.18.5 together with CPLEX 0.4.4 and want to set new solution values in a heuristic callback. I have a quite nasty array of variables

julia\>model[:x]  
x[w,i,t] ∈ {0,1} ∀ w ∈ {1,2,…,19,20}, i ∈ {1,2,…,74,75}, t ∈ {…} s.t. !(iszero(TLmax[w, i]))

where most values are zero.  
Is there a way to set all of them to zero ideally in one shot without iterating over all values?

Thank you in advance,  
best, michael.
