# Attempting to Warm start causes errors

**URL:** <https://discourse.julialang.org/t/attempting-to-warm-start-causes-errors/118450>\
**Category:** Optimization (Mathematical)\
**Created:** [August 21, 2024, 12:07pm UTC](https://discourse.julialang.org/t/attempting-to-warm-start-causes-errors/118450 "2024-08-21T12:07:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fimiller](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fimiller/32/51226_2.png) [@fimiller](https://discourse.julialang.org/u/fimiller)\
**Post date:** [August 21, 2024, 12:07pm UTC](https://discourse.julialang.org/t/attempting-to-warm-start-causes-errors/118450/1 "2024-08-21T12:07:34Z")

</div>

I am trying to warm start my problem using a sparse matrix. The following code produces an error:

```julia
model = Model(Mosek.Optimizer)
@variable(model, Z[1:size(cost)[1],1:size(cost)[2]], PSD)
 set_start_value(Z, warm_start_value)

```

ERROR: MethodError: no method matching set\_start\_value(::Symmetric{VariableRef, Matrix{VariableRef}}, ::SparseMatrixCSC{Float64, Int64})

Attempting to broadcast results in (so adding a `.` between `set_start_value and the `(` ).

ERROR: MethodError: no method matching set\_primal\_start(::Mosek.Task, ::MosekTools.MatrixIndex, ::Float64)

attempting

`set_start_values(model, variable_primal_start = warm_start_value)`

results in

ERROR: TypeError: in keyword argument variable\_primal\_start, expected Union{Nothing, Function}, got a value of type SparseMatrixCSC{Float64, Int64}

So I think the last one is what I would like to do. What function would I write?

---

<div class="post-metadata">

**Author:** ![fimiller](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fimiller/32/51226_2.png) [@fimiller](https://discourse.julialang.org/u/fimiller)\
**Post date:** [August 21, 2024, 12:35pm UTC](https://discourse.julialang.org/t/attempting-to-warm-start-causes-errors/118450/2 "2024-08-21T12:35:17Z")

</div>

I have done some more digging, and I have found this piece of documentation that suggests I cannot do this at all.

> Currently, the interior-point optimizer in **MOSEK** cannot take advantage of a previous optimal solution, however, the simplex optimizer can exploit any basic solution.

source: [9.1 Advanced hot-start — MOSEK Optimization Toolbox for MATLAB 10.2.3](https://docs.mosek.com/latest/toolbox/advanced-hotstart.html)

I’m keeping this up to see if someone has a workaround or if this is correct (how unfortunate).

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [August 22, 2024, 1:45am UTC](https://discourse.julialang.org/t/attempting-to-warm-start-causes-errors/118450/3 "2024-08-22T01:45:52Z")

</div>

Yes, the intended syntax for this is `set_start_value.(Z, warm_start_value)`, but Mosek doesn’t support setting the start value of a PSD matrix variable.

For `set_start_values(model, variable_primal_start = warm_start_value)`, `variable_primal_start` needs to be a function that takes the scalar variable and returns a `Float64` start value. But it still won’t work, because Mosek doesn’t support setting the start value of a PSD matrix variable.
