jump-dev / HiGHS.jl

A Julia interface to the HiGHS solver
https://highs.dev
MIT License
96 stars 13 forks source link

Non-convex QPs #210

Closed odow closed 2 months ago

odow commented 2 months ago

x-ref https://discourse.julialang.org/t/highs-jl-gives-strange-results/112995

julia> using HiGHS

julia> model = Highs_create()
Ptr{Nothing} @0x00007fab448a6c00

julia> Highs_addCol(model, 0.0, -Inf, Inf, 0, C_NULL, C_NULL)
Running HiGHS 1.7.0 (git hash: 50670fd4c): Copyright (c) 2024 HiGHS under MIT licence terms
0

julia> Highs_addCol(model, 0.0, -Inf, Inf, 0, C_NULL, C_NULL)
0

julia> Highs_changeObjectiveSense(model, kHighsObjSenseMaximize)
0

julia> Highs_passHessian(
           model,
           2,
           1,
           kHighsHessianFormatTriangular,
           Cint[0, 1, 1],
           Cint[1],
           [1.0],
       )
0

julia> Highs_run(model)
Coefficient ranges:
  Cost   [0e+00, 0e+00]
  Bound  [0e+00, 0e+00]
Iteration, Runtime, ObjVal, NullspaceDim
0, 0.000229, 0.000000, 2
2, 0.000256, 0.000000, 2
Model   status      : Optimal
Objective value     :  0.0000000000e+00
HiGHS run time      :          0.00
0

julia> Highs_getModelStatus(model)
7

This should error.

odow commented 2 months ago

Closing in favor of upstream, since this doesn't seem like a HiGHS.jl bug. I initially wasn't sure.