Skip to content
Merged
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
3 changes: 2 additions & 1 deletion docs/src/submodules/Utilities/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ Utilities.rows
```@docs
Utilities.ProductOfSets
Utilities.MixOfScalarSets
Utilities.@mix_of_scalar_sets
Utilities.OrderedProductOfSets
Utilities.OrderedProductOfScalarSets
Utilities.@product_of_sets
```

## Fallbacks
Expand Down
7 changes: 7 additions & 0 deletions src/Utilities/matrix_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ The `.sets::ST` type must implement:
* [`MOI.Utilities.set_index`](@ref)
* [`MOI.Utilities.add_set`](@ref)
* [`MOI.Utilities.rows`](@ref)
* [`MOI.Utilities.final_touch`](@ref)
"""
mutable struct MatrixOfConstraints{T,AT,BT,ST} <: MOI.ModelLike
coefficients::AT
Expand Down Expand Up @@ -135,6 +136,11 @@ function load_terms end
final_touch(coefficients)::Nothing

Informs the `coefficients` that all functions have been added with `load_terms`.
No more modification is allowed unless `MOI.empty!` is called.

final_touch(sets)::Nothing

Informs the `sets` that all functions have been added with `add_set`.
No more modification is allowed unless `MOI.empty!` is called.
"""
function final_touch end
Expand Down Expand Up @@ -392,6 +398,7 @@ function pass_nonvariable_constraints(
end

function final_touch(model::MatrixOfConstraints, index_map)
final_touch(model.sets)
num_rows = MOI.dimension(model.sets)
resize!(model.constants, num_rows)
set_number_of_rows(model.coefficients, num_rows)
Expand Down
Loading