# Hypatia -- JuMP

**URL:** <https://discourse.julialang.org/t/hypatia-jump/70717>\
**Category:** Optimization (Mathematical)\
**Created:** [November 1, 2021, 7:12am UTC](https://discourse.julialang.org/t/hypatia-jump/70717 "2021-11-01T07:12:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![geo](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@geo](https://discourse.julialang.org/u/geo)\
**Post date:** [November 1, 2021, 7:12am UTC](https://discourse.julialang.org/t/hypatia-jump/70717/1 "2021-11-01T07:12:43Z")

</div>

I know that JuMP does not support BigFloat; however Hypatia does. Is it possible to define a problem in JuMP, in Float64, but cause Hypatia to carry out the optimization in BigFloat? I am working on a problem, where the problem definition is adequately represented in Float64, but sometimes Hypatia has difficulty converging. I would like to try to increase the number of digits used by Hypatia to obtain a solution.

---

<div class="post-metadata">

**Author:** ![blob](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@blob](https://discourse.julialang.org/u/blob)\
**Post date:** [November 1, 2021, 8:01am UTC](https://discourse.julialang.org/t/hypatia-jump/70717/2 "2021-11-01T08:01:31Z")

</div>

I don’t think it’s there: [Generic numeric type in JuMP · Issue #2025 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2025)

---

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [November 1, 2021, 3:17pm UTC](https://discourse.julialang.org/t/hypatia-jump/70717/3 "2021-11-01T15:17:34Z")

</div>

If the problem data is accurately represented in `Float64`, then you don’t need [Generic numeric type in JuMP · Issue #2025 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2025). Hypatia could expose an option to compute in a different precision than the input data. I’d suggest requesting this feature.

---

<div class="post-metadata">

**Author:** ![chriscoey](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@chriscoey](https://discourse.julialang.org/u/chriscoey)\
**Post date:** [November 2, 2021, 12:50am UTC](https://discourse.julialang.org/t/hypatia-jump/70717/4 "2021-11-02T00:50:41Z")

</div>

One option if you want to use JuMP to build the model is to extract the Hypatia model data before optimizing, then convert c, A, b, G, h and the cones to the numeric type you want, then use Hypatia’s native interface to optimize that model. You can get the Hypatia MOI optimizer (the object in src/mathoptinterface.jl) using [Models · JuMP](https://jump.dev/JuMP.jl/stable/reference/models/#JuMP.unsafe_backend) and then get the model field. You can make a new Hypatia Model object with the converted types and then solve as in [Solving · Hypatia](https://chriscoey.github.io/Hypatia.jl/dev/solving/#Native-interface). The issue is you won’t be able to use JuMP to query the solutions of course.

I would suggest looking at [https://github.com/JuliaMath/DoubleFloats.jl](https://github.com/JuliaMath/DoubleFloats.jl) for some performance tips on selecting a higher precision type.

Talking to MOI/JuMP devs now - it’s seems to me to be a JuMP feature that needs to be supported rather than a Hypatia feature - [Generic numeric type in JuMP · Issue #2025 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2025). Because Hypatia allows any MOI model in any real floating point type already (see our MOI tests at [https://github.com/chriscoey/Hypatia.jl/blob/e3672d2f1ad1fc1418a4a81e5fe12df26e4ff1e2/test/runmoitests.jl#L35](https://github.com/chriscoey/Hypatia.jl/blob/e3672d2f1ad1fc1418a4a81e5fe12df26e4ff1e2/test/runmoitests.jl#L35)).

---

<div class="post-metadata">

**Author:** ![geo](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@geo](https://discourse.julialang.org/u/geo)\
**Post date:** [November 2, 2021, 6:12am UTC](https://discourse.julialang.org/t/hypatia-jump/70717/5 "2021-11-02T06:12:07Z")

</div>

Thank you for all the answers, especially from Chris. I will try this work around.
