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
6 changes: 4 additions & 2 deletions src/Utilities/matrix_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ function _load_constraints(
end

_add_variable(model::MatrixOfConstraints) = add_column(model.coefficients)

function _add_variables(model::MatrixOfConstraints, n)
return add_columns(model.coefficients, n)
end
Expand Down Expand Up @@ -527,14 +528,15 @@ function load_constants(
copyto!(b, offset + 1, func.constants)
return
end

function_constants(b::Vector, rows) = b[rows]

# FIXME does not work for all sets
set_from_constants(::Vector, ::Type{S}, rows) where {S} = S(length(rows))

function MOI.get(
model::MatrixOfConstraints,
attr::Union{MOI.CanonicalConstraintFunction,MOI.ConstraintFunction},
::Union{MOI.CanonicalConstraintFunction,MOI.ConstraintFunction},
ci::MOI.ConstraintIndex,
)
@assert model.final_touch
Expand All @@ -549,7 +551,7 @@ end

function MOI.get(
model::MatrixOfConstraints,
attr::MOI.ConstraintSet,
::MOI.ConstraintSet,
ci::MOI.ConstraintIndex{F,S},
) where {F,S}
@assert model.final_touch
Expand Down
Loading