dither 0.2.0.rc5-java → 0.2.1-java
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 +4 -4
- data/dither.gemspec +1 -1
- data/ext/dither/combinations.h +69 -0
- data/ext/dither/ipog.cc +3 -5
- data/lib/dither/version.rb +1 -1
- data/lib/{dither-0.1.4.jar → dither-0.1.5.jar} +0 -0
- data/lib/dither.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a987783363aa9b53be68e9b15beb1fae453985e
|
4
|
+
data.tar.gz: e207f2588859e02213785fea494d02bc8d75af72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04cdb9b5a5d9fa432daeb000a4efc4297d990581d351da6f3b5cc774c864d0043a7daea53abe436b36d50e051189927a2c5cad9bbd072b138a920cd979c5528c
|
7
|
+
data.tar.gz: 00f0c16140b9726118fe75c9caf333bde02e43e00fce6ee369acbcfa3f3baa5291431541193169b017ea8bb2c24457ced00f1bf45b723b66ec567906654b38d8
|
data/dither.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
if RUBY_PLATFORM =~ /java/
|
25
25
|
s.platform = "java"
|
26
26
|
# compile dither-java on jdk 8
|
27
|
-
files << "lib/dither-0.1.
|
27
|
+
files << "lib/dither-0.1.5.jar"
|
28
28
|
files << "lib/choco-solver-3.3.1-with-dependencies.jar"
|
29
29
|
else
|
30
30
|
s.add_dependency "ffi", "~> 1.0"
|
data/ext/dither/combinations.h
CHANGED
@@ -122,6 +122,75 @@ inline void product(
|
|
122
122
|
rvi.pop_back(); // clean ME off for next round
|
123
123
|
}
|
124
124
|
}
|
125
|
+
|
126
|
+
inline void product3(
|
127
|
+
std::forward_list<dtest_case>& results,
|
128
|
+
std::vector<dtest_case>::const_iterator begin,
|
129
|
+
std::vector<dtest_case>::const_iterator end) {
|
130
|
+
dtest_case ranges;
|
131
|
+
for(auto it = begin; it != end; ++it) {
|
132
|
+
const dval tmp = (*it).size() - 1;
|
133
|
+
ranges.push_back(tmp);
|
134
|
+
}
|
135
|
+
|
136
|
+
dtest_case scratch(ranges.size(), 0);
|
137
|
+
|
138
|
+
const std::size_t max = ranges.size() - 1;
|
139
|
+
for(std::size_t i = max;;) {
|
140
|
+
|
141
|
+
if(i == max) {
|
142
|
+
for(dval val = 0; val <= ranges[i]; val++) {
|
143
|
+
results.push_front(scratch);
|
144
|
+
scratch[i]++;
|
145
|
+
}
|
146
|
+
scratch[i] = 0;
|
147
|
+
i--;
|
148
|
+
} else if(i == 0 && scratch[i] >= ranges[i]) {
|
149
|
+
return;
|
150
|
+
} else if(scratch[i] < ranges[i]) {
|
151
|
+
scratch[i]++;
|
152
|
+
i++;
|
153
|
+
} else {
|
154
|
+
scratch[i] = -1;
|
155
|
+
i--;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
inline void product4(
|
161
|
+
std::forward_list<std::vector<param>>& results,
|
162
|
+
std::vector<std::vector<param>>& param_matrix) {
|
163
|
+
std::vector<int> ranges;
|
164
|
+
std::vector<param> scratch;
|
165
|
+
for(auto params : param_matrix) {
|
166
|
+
ranges.push_back(params.size() - 1);
|
167
|
+
scratch.push_back(params[0]);
|
168
|
+
}
|
169
|
+
std::vector<int> indexes(scratch.size(), 0);
|
170
|
+
|
171
|
+
const std::size_t max = ranges.size() - 1;
|
172
|
+
for(std::size_t i = max;;) {
|
173
|
+
|
174
|
+
if(i == max) {
|
175
|
+
for(std::size_t val = 0; val <= ranges[i]; val++) {
|
176
|
+
scratch[i] = param_matrix[i][indexes[i]];
|
177
|
+
results.push_front(scratch);
|
178
|
+
indexes[i]++;
|
179
|
+
}
|
180
|
+
indexes[i] = 0;
|
181
|
+
i--;
|
182
|
+
} else if(i == 0 && indexes[i] >= ranges[i]) {
|
183
|
+
return;
|
184
|
+
} else if(indexes[i] < ranges[i]) {
|
185
|
+
indexes[i]++;
|
186
|
+
scratch[i] = param_matrix[i][indexes[i]];
|
187
|
+
i++;
|
188
|
+
} else {
|
189
|
+
indexes[i] = -1;
|
190
|
+
i--;
|
191
|
+
}
|
192
|
+
}
|
193
|
+
}
|
125
194
|
}
|
126
195
|
|
127
196
|
#endif
|
data/ext/dither/ipog.cc
CHANGED
@@ -31,10 +31,10 @@ Ipog::Ipog(const unsigned int t) {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
void Ipog::init_bound() {
|
34
|
-
using dither::
|
34
|
+
using dither::product3;
|
35
35
|
dtest_case tmp;
|
36
36
|
|
37
|
-
|
37
|
+
product3(bound_, input_params_.begin(), input_params_.begin() + t_);
|
38
38
|
auto size = param_cache_.size();
|
39
39
|
for (auto it = bound_.begin(); it != bound_.end(); ++it) {
|
40
40
|
(*it).resize(size, -1);
|
@@ -77,9 +77,7 @@ std::forward_list<std::vector<param>> Ipog::cover(const int k) {
|
|
77
77
|
|
78
78
|
std::forward_list<std::vector<param>> coverage;
|
79
79
|
for (auto it = product_input.begin(); it != product_input.end(); ++it) {
|
80
|
-
|
81
|
-
std::vector<std::vector<param>> x = *it;
|
82
|
-
product2(coverage, tmp, (*it).cbegin(), (*it).cend());
|
80
|
+
product4(coverage, *it);
|
83
81
|
}
|
84
82
|
coverage.remove_if([this](std::vector<param>& a) { return has_previously_tested(a); });
|
85
83
|
return coverage;
|
data/lib/dither/version.rb
CHANGED
Binary file
|
data/lib/dither.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dither
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Jason Gowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,7 +94,7 @@ files:
|
|
94
94
|
- ext/dither/simple_constraint_handler.cc
|
95
95
|
- ext/dither/simple_constraint_handler.h
|
96
96
|
- lib/choco-solver-3.3.1-with-dependencies.jar
|
97
|
-
- lib/dither-0.1.
|
97
|
+
- lib/dither-0.1.5.jar
|
98
98
|
- lib/dither.rb
|
99
99
|
- lib/dither/aetg.rb
|
100
100
|
- lib/dither/aetg_pairwise.rb
|
@@ -122,9 +122,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
122
122
|
version: '0'
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
124
|
requirements:
|
125
|
-
- - "
|
125
|
+
- - ">="
|
126
126
|
- !ruby/object:Gem::Version
|
127
|
-
version:
|
127
|
+
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project: dither
|
130
130
|
rubygems_version: 2.4.8
|