# Call back with matrix

**URL:** <https://discourse.julialang.org/t/call-back-with-matrix/87584>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [September 21, 2022, 4:12pm UTC](https://discourse.julialang.org/t/call-back-with-matrix/87584 "2022-09-21T16:12:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [September 21, 2022, 5:05pm UTC](https://discourse.julialang.org/t/call-back-with-matrix/87584/2 "2022-09-21T17:05:33Z")

</div>

I think you should use `vcat()` for that. For instance, something like

```julia
vars = vcat( [model[:u][i,j] for i in 1:gmax for j in 1:hmax] )
vals = vcat( u_vals[i,j] for i in 1:gmax for j in 1:hmax] )
status = MOI.submit( model, MOI.HeuristicSolution(cb_data), vars, vals )
println("$status")

```

but I am not sure. Probably also reshaping helps (see [here](https://discourse.julialang.org/t/setting-heuristic-solution-involving-symmetric-matrix-in-jump-callback/69621/3) ). Regarding the objective function value: I always computed it manually with the current variable values.

---

_[View the full topic](https://discourse.julialang.org/t/call-back-with-matrix/87584)._
