Skip to content

Commit

Permalink
Update for CBLS.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Aug 9, 2023
1 parent f10ec74 commit 407e2de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Constraints = "0.5"
Dictionaries = "0.3"
JSON = "0.21"
Lazy = "0.15"
OrderedCollections = "1"
julia = "1.8"
OrderedCollections = "1.6"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 1 addition & 1 deletion test/internal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end

values = [1, 2, 3]
inds = [1, 2]
err = (x; X) -> error_f(usual_constraints[:all_different])(x)
err = (x; X) -> error_f(USUAL_CONSTRAINTS[:all_different])(x)
c1 = constraint(err, inds)
c2 = constraint(err, inds)
cons = Dictionary(1:2, [c1, c2])
Expand Down
12 changes: 6 additions & 6 deletions test/raw_solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function mincut(graph; source, sink, interdiction =0)
foreach(_ -> variable!(m, d), 0:n)

# Extract error function from usual_constraint
e1 = (x; X) -> error_f(usual_constraints[:ordered])(x)
e2 = (x; X) -> error_f(usual_constraints[:all_different])(x)
e1 = (x; X) -> error_f(USUAL_CONSTRAINTS[:ordered])(x)
e2 = (x; X) -> error_f(USUAL_CONSTRAINTS[:all_different])(x)

# Add constraint
constraint!(m, e1, [source, separator, sink])
Expand All @@ -31,9 +31,9 @@ function golomb(n, L = n^2)
foreach(_ -> variable!(m, d), 1:n)

# Extract error function from usual_constraint
e1 = (x; X) -> error_f(usual_constraints[:all_different])(x)
e2 = (x; X) -> error_f(usual_constraints[:all_equal])(x; val=0)
e3 = (x; X) -> error_f(usual_constraints[:dist_different])(x)
e1 = (x; X) -> error_f(USUAL_CONSTRAINTS[:all_different])(x)
e2 = (x; X) -> error_f(USUAL_CONSTRAINTS[:all_equal])(x; val=0)
e3 = (x; X) -> error_f(USUAL_CONSTRAINTS[:dist_different])(x)

# # Add constraints
constraint!(m, e1, 1:n)
Expand Down Expand Up @@ -63,7 +63,7 @@ function sudoku(n; start=nothing)
end


e = (x; X) -> error_f(usual_constraints[:all_different])(x)
e = (x; X) -> error_f(USUAL_CONSTRAINTS[:all_different])(x)

# Add constraints: line, columns; blocks
foreach(i -> constraint!(m, e, (i * N + 1):((i + 1) * N)), 0:(N - 1))
Expand Down

0 comments on commit 407e2de

Please sign in to comment.