activecube 0.1.43 → 0.1.44
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/Gemfile.lock +1 -1
- data/lib/activecube/processor/optimizer.rb +7 -0
- data/lib/activecube/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4657cc9edb63bf6760180e758e985d47bbd452b479d17a9dea044a5030ca83a
|
4
|
+
data.tar.gz: ce8fe2944bccabb655d76924a677f1a7a0324d5b7a6d88e2ed33d10813923d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1edc0deb21fac6290515851e11c678e2a4f1c65db5c760163b3f37566680f6318c8e91e0d6e72d672a21dca59aac4c6f16fe722d59302cde3e65804d9ccf7a86
|
7
|
+
data.tar.gz: 17198fbc0d5b0d0879d194e62e32b3906eadc3bd86ff8684fccc8c2ed220bcf066c79277b67ec181e9a61e52ed1a9b274f9d4edd1e6ed9f741120cae010a45d9
|
data/Gemfile.lock
CHANGED
@@ -93,6 +93,7 @@ module Activecube::Processor
|
|
93
93
|
# reduce size of cost_matrix deleting duplicates
|
94
94
|
uniq_rows = []
|
95
95
|
rows_indices = {}
|
96
|
+
possible_tables = {}
|
96
97
|
cost_matrix.each_with_index do |row, i|
|
97
98
|
flag = false
|
98
99
|
|
@@ -105,6 +106,7 @@ module Activecube::Processor
|
|
105
106
|
|
106
107
|
unless flag
|
107
108
|
rows_indices[i] = uniq_rows.length
|
109
|
+
possible_tables[i] = Hash[row.map.with_index { |c, index| [index, true] if c }.compact]
|
108
110
|
uniq_rows.push(row)
|
109
111
|
end
|
110
112
|
end
|
@@ -112,6 +114,11 @@ module Activecube::Processor
|
|
112
114
|
# generating variants for reduced matrix
|
113
115
|
vars = gen_permutations(tables_count, uniq_rows.length)
|
114
116
|
|
117
|
+
# filter possible variants
|
118
|
+
vars = vars.filter do |v|
|
119
|
+
v.map.with_index.all? {|t_n, i| possible_tables[i][t_n]}
|
120
|
+
end
|
121
|
+
|
115
122
|
# restore variants for full matrix
|
116
123
|
vars.map do |variant|
|
117
124
|
full_v = Array.new(metrics_count)
|
data/lib/activecube/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activecube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksey Studnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|