visualize_helper 0.0.10.32 → 0.0.10.33
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/ext/visualize_helper/visualize_helper.c +2 -39
- data/lib/visualize_helper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1f5946747909eafa7b58d8102ea43b7cac144a
|
4
|
+
data.tar.gz: f60656e08b7c5f1439d58205651b70cba44308d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b14cb82285fa6da31c55bce011c977e1eae3bd3b06475e2758bccaef4cac16bfb936bfbe19f9c2da8a6e955b60429fcf77fb67b7ef867121052d277a5d5b72e
|
7
|
+
data.tar.gz: 491b65740274a19f7ae924efea287a3cd6a25470110a68dab1268ae24f8b63ce2fa74f06c7de5401f20246acc630f2b9b3c23b193f37556fd4682132e015d2fa
|
@@ -65,7 +65,6 @@ static char* join(VALUE strings){
|
|
65
65
|
int string_total_size = 0;
|
66
66
|
VALUE string_temp;
|
67
67
|
VALUE result;
|
68
|
-
//FILE *f = fopen("file.txt", "w");
|
69
68
|
|
70
69
|
|
71
70
|
|
@@ -89,10 +88,6 @@ static char* join(VALUE strings){
|
|
89
88
|
|
90
89
|
}
|
91
90
|
strcat(joined,"\0");
|
92
|
-
//result = rb_str_new2(joined);
|
93
|
-
//free(joined);
|
94
|
-
//fprintf(f,"%s\n",joined);
|
95
|
-
//fclose(f);
|
96
91
|
return joined;
|
97
92
|
}
|
98
93
|
|
@@ -156,26 +151,20 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
156
151
|
int max_c = FIX2INT(rb_ary_entry(array,1));
|
157
152
|
int period;
|
158
153
|
int traj_size;
|
159
|
-
//FILE *f = fopen("/tmp/aggr.txt", "a+");
|
160
154
|
|
161
155
|
|
162
156
|
if (days_c < first_interval_c) {
|
163
157
|
if (min_c > days_c) {
|
164
158
|
min_c = days_c;
|
165
|
-
//rb_ary_store(array,0,days);
|
166
159
|
}
|
167
160
|
period = 0;
|
168
|
-
//rb_ary_store(array,2,INT2FIX(0));
|
169
161
|
}else if (days_c == 0) {
|
170
162
|
period = findIndex(intervals,intervals_size,0)+1;
|
171
|
-
//rb_ary_store(array,2,INT2FIX(index+1));
|
172
163
|
|
173
164
|
}else if (days_c > last_interval_c ) {
|
174
165
|
if (max_c < days_c) {
|
175
166
|
max_c = days_c;
|
176
|
-
//rb_ary_store(array,1,days);
|
177
167
|
}
|
178
|
-
//rb_ary_store(array,2,INT2FIX(aggr_size -1));
|
179
168
|
period = aggr_size -1;
|
180
169
|
}else {
|
181
170
|
for ( int index = 0 ; index < intervals_size ; index++){
|
@@ -184,49 +173,23 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
184
173
|
if ( intervals_index_plus_1 <= 0 ){
|
185
174
|
if (( days_c >= FIX2INT(rb_ary_entry(intervals,index))) && (days_c < intervals_index_plus_1)) {
|
186
175
|
period = index +1;
|
187
|
-
//rb_ary_store(array,2,INT2FIX(i+1));
|
188
176
|
break;
|
189
177
|
}
|
190
178
|
}else if ( (days_c > FIX2INT(rb_ary_entry(intervals,index)) ) && (days_c <= intervals_index_plus_1) ) {
|
191
179
|
period = index + 2;
|
192
|
-
//rb_ary_store(array,2,INT2FIX(i+2));
|
193
180
|
break;
|
194
181
|
}
|
195
182
|
}
|
196
183
|
}
|
197
184
|
}
|
198
185
|
|
199
|
-
|
200
|
-
|
201
186
|
rb_ary_store(array,0,INT2FIX(min_c));
|
202
187
|
rb_ary_store(array,1,INT2FIX(max_c));
|
203
188
|
traj_size = RARRAY_LEN(traj);
|
204
|
-
|
205
189
|
for ( int i =0; i < traj_size; i++){
|
206
190
|
rb_ary_push(rb_ary_entry(aggr,period),rb_ary_entry(traj,i));
|
207
191
|
}
|
208
192
|
|
209
|
-
// FOR DEBUG
|
210
|
-
//for (int i = 0; i < aggr_size; i++) {
|
211
|
-
// fprintf(f, "[");
|
212
|
-
// VALUE temp = rb_ary_entry(aggr,i);
|
213
|
-
// int temp_size = RARRAY_LEN(temp);
|
214
|
-
// for (int j = 0; j < temp_size; j++){
|
215
|
-
// VALUE temp_string = rb_ary_entry(temp,j);
|
216
|
-
// fprintf(f, "%s", StringValuePtr(temp_string));
|
217
|
-
// if ( j != temp_size -1 ){
|
218
|
-
// fprintf(f, ",");
|
219
|
-
// }
|
220
|
-
// }
|
221
|
-
// fprintf(f, "]");
|
222
|
-
// if ( i != aggr_size -1 ){
|
223
|
-
// fprintf(f, ",");
|
224
|
-
// }
|
225
|
-
//}
|
226
|
-
|
227
|
-
//fprintf(f, "\n");
|
228
|
-
//fclose(f);
|
229
|
-
|
230
193
|
return ST_CONTINUE;
|
231
194
|
}
|
232
195
|
|
@@ -305,6 +268,7 @@ static VALUE generate_boxes_and_links(VALUE self, VALUE aggr, VALUE boxes, VALUE
|
|
305
268
|
if (period < aggr_size - 1) {
|
306
269
|
prox_key = rb_ary_new();
|
307
270
|
}
|
271
|
+
|
308
272
|
seq = rb_ary_entry(aggr,period);
|
309
273
|
seq_size = (int) RARRAY_LEN(seq);
|
310
274
|
|
@@ -312,14 +276,13 @@ static VALUE generate_boxes_and_links(VALUE self, VALUE aggr, VALUE boxes, VALUE
|
|
312
276
|
if (seq_size == 0) {
|
313
277
|
rb_ary_push(seq_key,rb_hash_aref(dict, rb_str_new2("M-2")));
|
314
278
|
}else{
|
315
|
-
|
316
279
|
for(int i = 0; i < seq_size; i++ ) {
|
317
280
|
rb_ary_push(seq_key,rb_hash_aref(dict,rb_ary_entry(seq,i)));
|
318
281
|
}
|
319
282
|
}
|
320
283
|
|
321
284
|
// agroup by unique or not
|
322
|
-
if ( strcmp(StringValuePtr(type_agroupment),"
|
285
|
+
if ( strcmp(StringValuePtr(type_agroupment),"n") == 0 ) {
|
323
286
|
//sort with uniq
|
324
287
|
seq_key = sort_uniq(seq_key,1);
|
325
288
|
}else{
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visualize_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.10.
|
4
|
+
version: 0.0.10.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Ottoni Santiago Machado de Faria
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|