dither 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1a1dd2b611fde7eca72c6f9a9b859e8b38d15eb
4
- data.tar.gz: f6c9f9b7783fc64ad0603bdcf0cadd1d56729e50
3
+ metadata.gz: b9e1b376480253aa00c65aee4b4d3747968e3373
4
+ data.tar.gz: 49b946da8ead53930d5258eda1208956c8c31260
5
5
  SHA512:
6
- metadata.gz: b8fb409da9c6ba2699ce18c64ab4d18ec4ab6a31644323f66af0f38466dfe8810cf689f34f1ff001dec747d6475658439f466adea0adaa3c57c222d5eb09b8dd
7
- data.tar.gz: 341b6f7240542c9697e3f18876fe1619ad39f2c53f4155e1149cfe77f5fa05804eb59b61c06d14bc0139331416f25033e1f08c2021088e329fb5a2283a95ee18
6
+ metadata.gz: 0060b07d6b8868e8fe49cdb8b00c6a5243eec64f8bbad4c780149aa1338f9900be7d7a5a26fc5afceb7df0c3b8b50ee0dc322e88c1d25cd11aeb284798bf4ba0
7
+ data.tar.gz: 90df44c2af7881c6bd4241094086cff169f9c0bd3cf712111cce5b13540e8b4398a78000298f94582c428cbe2d496656b9f061f2cceb0605c1ffdc4906635290
data/lib/dither/ipog.rb CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  module Dither
3
3
  class IPOG
4
- attr_reader :params, :t, :prng, :constraints
5
- private :params, :t, :prng, :constraints
4
+ attr_reader :params, :t, :constraints
5
+ private :params, :t, :constraints
6
6
 
7
7
  def initialize(params, t, opts = {})
8
8
  @params = params
@@ -13,7 +13,6 @@ module Dither
13
13
  .map { |a| a.map { |b| Param.new(*b) } }
14
14
  .map(&:to_set)
15
15
  end
16
- @prng = Random.new
17
16
  raise 't must be >= 2' if t < 2
18
17
  raise 't must be <= params.length' if t > params.length
19
18
  params.each do |param|
@@ -51,6 +50,8 @@ module Dither
51
50
 
52
51
  ts.map { |a| fill_unbound(a) }
53
52
  .delete_if(&:nil?)
53
+ .to_set
54
+ .to_a
54
55
  end
55
56
 
56
57
  def violates_constraints?(params)
@@ -96,9 +97,9 @@ module Dither
96
97
 
97
98
  arr.each_with_index do |e, i|
98
99
  if e.nil?
99
- j = prng.rand(0...params[i].length)
100
+ j = 0
100
101
  arr[i] = params[i][j]
101
- data << Param.new(i,j)
102
+ data << Param.new(i, j)
102
103
  end
103
104
  end
104
105
  return nil if violates_constraints?(data)
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Dither
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
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.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Gowan