Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jul 21, 2021
1 parent 1f76df0 commit ec6fece
Show file tree
Hide file tree
Showing 2 changed files with 296 additions and 488 deletions.
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

0 comments on commit ec6fece

Please sign in to comment.