Oscar Dowson

Results 1409 comments of Oscar Dowson

And here it is using ccalls: ```Julia julia> using NLopt julia> NLopt.NLOPT_VERSION v"2.8.0" julia> function my_scalar_callback_fn(n, p_x, p_grad, ::Ptr{Cvoid})::Cdouble x = unsafe_wrap(Array, p_x, (n,)) if p_grad !== C_NULL grad =...

I have a C reproducer in https://github.com/stevengj/nlopt/issues/215#issuecomment-2303303204

Closing in favor of https://github.com/stevengj/nlopt/issues/215

What is the original output of `test.lp`? Our LP file format does not support indicator constraints, so it'll be getting reformulated somehow.

```julia shell> cat test.lp minimize obj: subject to c1: 1 x + 1 x3 = 0 Bounds x free x3 free Binary y SOS c1_1: S1:: x3:0.4 y:0.6 End ```

So this reformulates your indicator constraint as an SOS1 constraint. when you do the negation, it tries to instead reformulate as a big-M MIP, which it can't do because `x`...

It looks like CPLEX and Gurobi support indicators https://www.ibm.com/docs/en/icos/22.1.0?topic=representation-mip-features-in-lp-file-format#d360454e288 `[constraintname:] binaryvariable = value -> linear constraint` https://www.gurobi.com/documentation/11.0/refman/lp_format.html `c0: b1 = 1 -> 2.5 x + 2.3 y + 5.3 z

I get that we can reformulate the indicator constraint a different way. But the current bridge supports only `ACTIVATE_ON_ONE`: https://github.com/jump-dev/MathOptInterface.jl/blob/77d6b6fffc7cbc59dfa1696f1905a88162e34dc6/src/Bridges/Constraint/bridges/indicator_sos.jl#L7-L24 But this is unrelated to the file format issue. >...

You can `print` to file: ```julia open("model.txt") do io print(io, model) end ``` But oh, reverse engineering a model from the LP file does not sound like fun.

Base MOI doesn't delete rows. And the internal workings of a bridge are private. We don't make any claims about efficiency etc. just that the transformation is correct. I don't...