dither 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- 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.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b23198b7faddebcd97e1656ffa56e8f7dbb067f7
|
4
|
+
data.tar.gz: bb83f1fafe1e7366f090b750af571d1bd61aeb95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d199030a4862dfdf5d18744da482bbcef95d29b8a43d85f3285f1e8c90d2c655b34d958ed3c7eae087fc42b9a30ce83bc98d0cd6e9629faab25f5d01c049f643
|
7
|
+
data.tar.gz: 5e5510739b5ac632cf92e8da6cd7ba7e4ae60362a39047c9ea5f2c29f6db4dde73449de47cfc28708c0d366e4af1a2dffadb9ba879d891fe4d68c52e41f1a273
|
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
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: ruby
|
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
|
name: rspec
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project: dither
|
143
|
-
rubygems_version: 2.
|
143
|
+
rubygems_version: 2.4.5.1
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Collection of test generation strategies
|