Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dourouc05 committed Feb 13, 2020
1 parent ebf69ec commit 931340a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 66 deletions.
2 changes: 0 additions & 2 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,6 @@ include("indicator.jl")
include("complement.jl")
# SDConstraint
include("sd.jl")
# Constraint programming
include("cp.jl")

"""
Base.getindex(m::JuMP.AbstractModel, name::Symbol)
Expand Down
55 changes: 0 additions & 55 deletions src/cp.jl

This file was deleted.

12 changes: 3 additions & 9 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,9 @@ function parse_one_operator_constraint(_error::Function, vectorized::Bool, sense
return parse_code, _build_call(_error, vectorized, :(_functionize($variable)), set)
end

function parse_constraint(_error::Function, sense::Symbol, lhs, rhs)
function parse_constraint(_error::Function, sense::Symbol, args...)
(sense, vectorized) = _check_vectorized(sense)
vectorized, parse_one_operator_constraint(_error, vectorized, Val(sense), lhs, rhs)...
end

function parse_constraint(_error::Function, sense::Symbol, F)
(sense, vectorized) = _check_vectorized(sense)
vectorized, parse_one_operator_constraint(_error, vectorized, Val(sense), F)...
vectorized, parse_one_operator_constraint(_error, vectorized, Val(sense), args...)...
end

function parse_ternary_constraint(_error::Function, vectorized::Bool, lb, ::Union{Val{:(<=)}, Val{:(≤)}}, aff, rsign::Union{Val{:(<=)}, Val{:(≤)}}, ub)
Expand Down Expand Up @@ -315,8 +310,7 @@ end

# TODO: update 3-argument @constraint macro to pass through names like @variable

is_one_argument_constraint(_) = false
is_one_argument_constraint(::Val{:alldifferent}) = true
is_one_argument_constraint(::Val) = false

"""
_constraint_macro(args, macro_name::Symbol, parsefun::Function)
Expand Down

0 comments on commit 931340a

Please sign in to comment.