Skip to content

Conversation

odow
Copy link
Member

@odow odow commented Sep 20, 2023

Part of #2268

Now down to ═════ 70 possible errors found ═════

https://github.com/jump-dev/MathOptInterface.jl/actions/runs/6242312138

MOI.VectorQuadraticFunction{T},
MOI.VectorNonlinearFunction,
},
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This breaks JuMP:
https://github.com/jump-dev/JuMP.jl/blob/1ee5faee4335386435e3211b8758fba13799234e/test/test_objective.jl#L168-L180

I'm not sure whether we intended this:

julia> model = GenericModel{Float32}();

julia> @variable(model, x)
x

julia> @objective(model, Min, 2 * x + 1)
2 x + 1

julia> f = objective_function(model, GenericAffExpr{Float64,VariableRef})
2 x + 1

julia> typeof(f)
GenericAffExpr{Float64, GenericVariableRef{Float32}}

julia> g = objective_function(model)
2 x + 1

julia> typeof(g)
GenericAffExpr{Float32, GenericVariableRef{Float32}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think we meant to use T instead of Float64 in the test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I guess we just leave this as-is for now though.

return x
end

function MOI.add_variables(model::AbstractModel, n::Integer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did that one go ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same as the default fallback

Copy link
Member

@blegat blegat Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, it's in Utilities/model.jl. We indeed used to not have that default fallback

@odow odow merged commit 516b230 into master Sep 20, 2023
@odow odow deleted the od/jet4 branch September 20, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants