ruby-cbc 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2de5ed8e62dc379bc8da7ae805eb03b316e615df
4
- data.tar.gz: df00a0e1f03c468ad3d93b768fec26267c034e9b
3
+ metadata.gz: 3d05d2dddacdfb1243b0ccbe0db95ef785002175
4
+ data.tar.gz: b9ea06e2a20a3b60a8a28c7a7ccfac5f7af73e3f
5
5
  SHA512:
6
- metadata.gz: e5896e52aace5c6ee29c49feb554b69532ffe9b88f67d01ccac1901aed594759180e860658db31f50a9a840b51c8b34e3ae3ccf80f3576d0e0cba0c46e6c6de8
7
- data.tar.gz: 8261b051167142baf52e6debe96058b783bb6e32e6784984509bc2cf0a81bc5276e28b96a1c588abe289cf35afc5ce66f82b2dc12c7f66ee6bad50e98c409ca1
6
+ metadata.gz: 4d876f561b81578e8d1b69108e5c4e024eb2c52b66b34eeaade45b4f941d357145a2889e3ad71919bd0a979d7ee3f7a28d92223c263e67777a9a2cce842a8561
7
+ data.tar.gz: eb4aed1071260b46aacd4ec4c228a56a1dfb24e8e691c3d4e7ad941348e3521200d747413a75de80fca2bbef3e2a0456f81c66bc23637a9b84dcbe8ca82811e8
@@ -10,12 +10,12 @@ module Cbc
10
10
  def find_conflict
11
11
  continuous = is_continuous_conflict?
12
12
  conflict_set = []
13
- all_constraints = @model.constraints.to_a
13
+ all_constraints = @model.constraints
14
14
  nb_constraints = all_constraints.count
15
15
  loop do
16
16
  m = Model.new
17
17
  m.vars = @model.vars
18
- m.enforce(conflict_set)
18
+ m.constraints = conflict_set
19
19
  return conflict_set if infeasible?(m, continuous: continuous)
20
20
 
21
21
  constraint_idx = first_failing(conflict_set, all_constraints, nb_constraints, continuous: continuous)
@@ -43,10 +43,9 @@ module Cbc
43
43
  loop do
44
44
  m = Model.new
45
45
  m.vars = @model.vars
46
- m.enforce(conflict_set)
47
46
 
48
47
  half_constraints = (max_nb_constraints + min_nb_constraints) / 2
49
- m.enforce(constraints.take(half_constraints))
48
+ m.constraints = conflict_set + constraints.take(half_constraints)
50
49
  if infeasible?(m, continuous: continuous)
51
50
  max_nb_constraints = half_constraints
52
51
  else
@@ -25,7 +25,7 @@ module Cbc
25
25
 
26
26
  def initialize(name: "ILP Problem")
27
27
  @vars = Set.new
28
- @constraints = Set.new
28
+ @constraints = []
29
29
  @objective = nil
30
30
  @name = name
31
31
  end
@@ -1,3 +1,3 @@
1
1
  module Cbc
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-cbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Verger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler