Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="JuliaFormatter", version="2"))
Pkg.add(PackageSpec(name="JuliaFormatter", version="2.4.0"))
using JuliaFormatter
format(".", verbose=true)
out = String(read(Cmd(`git diff`)))
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "MathOptInterface"
uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
version = "1.51.0"
version = "1.51.1"

[deps]
CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd"
Expand Down
12 changes: 12 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ CurrentModule = MathOptInterface
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.51.1 (May 28, 2026)

### Fixed

- Fixed basic tests with [`PowerCone`](@ref) (#3003)
- Fixed various getters for [`VariableBridgingCost`](@ref) and
[`ConstraintBridgingCost`](@ref). This release adds new tests, which may cause
the tests of some dependent packages to break because of a common bug in how
layers should compute the costs of bridging variable and constraints. If you
need help fixing a package with broken tests, please open a GitHub issue.
(#3001), (#3004)

## v1.51.0 (April 27, 2026)

### Breaking
Expand Down
2 changes: 2 additions & 0 deletions docs/src/reference/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ ListOfConstraintAttributesSet
ListOfConstraintsWithAttributeSet
UserDefinedFunction
ListOfSupportedNonlinearOperators
ConstraintBridgingCost
VariableBridgingCost
```

## Optimizer interface
Expand Down
43 changes: 41 additions & 2 deletions src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3271,7 +3271,27 @@ end

attribute_value_type(::DualStatus) = ResultStatusCode

# Cost of bridging constrained variable in S
"""
VariableBridgingCost{S<:AbstractSet}()::Float64

An [`AbstractModelAttribute`](@ref) for the cost or bridging a variable in a set
of type `S`.

## Implementation

There is a default fallback which returns `0.0` if
[`supports_add_constrained_variable`](@ref) or
[`supports_add_constrained_variables`](@ref) is `true` and `Inf` if `false`.

Therefore, you should implement this method only if your optimizer does
something unusual.

Optimizers should implement the following methods:
```
MOI.get(::Optimizer, ::MOI.VariableBridgingCost{S})::Float64
```
They should not implement [`set`](@ref) or [`supports`](@ref).
"""
struct VariableBridgingCost{S<:AbstractSet} <: AbstractModelAttribute end

attribute_value_type(::VariableBridgingCost) = Float64
Expand All @@ -3290,7 +3310,26 @@ function get_fallback(
return supports_add_constrained_variables(model, S) ? 0.0 : Inf
end

# Cost of bridging F-in-S constraints
"""
ConstraintBridgingCost{F<:AbstractFunction,S<:AbstractSet}()::Float64

An [`AbstractModelAttribute`](@ref) for the cost or bridging a constraint of
type `F` in `S`.

## Implementation

There is a default fallback which returns `0.0` if [`supports_constraint`](@ref)
is `true` and `Inf` if `false`.

Therefore, you should implement this method only if your optimizer does
something unusual.

Optimizers should implement the following methods:
```
MOI.get(::Optimizer, ::MOI.ConstraintBridgingCost{F,S})::Float64
```
They should not implement [`set`](@ref) or [`supports`](@ref).
"""
struct ConstraintBridgingCost{F<:AbstractFunction,S<:AbstractSet} <:
AbstractModelAttribute end

Expand Down
Loading