dither 0.0.3 → 0.0.4

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: b9e1b376480253aa00c65aee4b4d3747968e3373
4
- data.tar.gz: 49b946da8ead53930d5258eda1208956c8c31260
3
+ metadata.gz: bd7dc97ac31f5097009170b509d7ce2e86dd451a
4
+ data.tar.gz: 37986e3680cb1e927794e307bf17eec619b22f7e
5
5
  SHA512:
6
- metadata.gz: 0060b07d6b8868e8fe49cdb8b00c6a5243eec64f8bbad4c780149aa1338f9900be7d7a5a26fc5afceb7df0c3b8b50ee0dc322e88c1d25cd11aeb284798bf4ba0
7
- data.tar.gz: 90df44c2af7881c6bd4241094086cff169f9c0bd3cf712111cce5b13540e8b4398a78000298f94582c428cbe2d496656b9f061f2cceb0605c1ffdc4906635290
6
+ metadata.gz: 3f6cfd8559eea4bba2f626c6c050a20379e61a2cfbe58907a8143acc7007abe2fe7b521bebcd639d6006e4680c7ee93400c86b8d58915e41e7da6df4e95537a5
7
+ data.tar.gz: b0d9d084bd338c6d473a7fd095c0598bae59ed0fd4fcf1e5063181e8dc503b9619666c272cfc0c9a7c3f530761ac51693deefc6f81f7459528609d997cb0883e
data/lib/dither/ipog.rb CHANGED
@@ -90,6 +90,9 @@ module Dither
90
90
  private
91
91
 
92
92
  def fill_unbound(data)
93
+ @bound_sets ||= []
94
+ return nil if @bound_sets.any? { |a| data.subset?(a) }
95
+
93
96
  arr = Array.new(params.length)
94
97
  data.each do |param|
95
98
  arr[param.i] = params[param.i][param.j]
@@ -102,6 +105,7 @@ module Dither
102
105
  data << Param.new(i, j)
103
106
  end
104
107
  end
108
+ @bound_sets << data
105
109
  return nil if violates_constraints?(data)
106
110
  arr
107
111
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Dither
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
@@ -25,6 +25,18 @@ describe Dither do
25
25
  [:c, :d, :h],
26
26
  [:c, :e, :i],
27
27
  [:c, :f, :h]])
28
+ results = Dither.all_pairs([
29
+ (0...2).to_a,
30
+ (0...2).to_a,
31
+ (0...3).to_a,
32
+ (0...3).to_a,
33
+ (0...4).to_a,
34
+ (0...6).to_a,
35
+ (0...2).to_a,
36
+ (0...7).to_a,
37
+ (0...3).to_a,
38
+ ], 2)
39
+ puts results.count
28
40
  end
29
41
 
30
42
  it 'can compute 2-way ipog' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dither
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Gowan