visualize_helper 0.0.10.34 → 0.0.10.35
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 +12 -10
- data/lib/visualize_helper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d63db7c253c734accbfaf226fd0252019044f0
|
4
|
+
data.tar.gz: 9369123d379d8e1a8a7182cf9d3ebffcd272616c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4ba09283d42e8617f6fcf96451e281693be6bb05fd4dc6972b7dc5469a5bdfd53b453a0da669054ae262dabfcf4ec81e7c3e78a10068d3f84d017d3822de7d0
|
7
|
+
data.tar.gz: 8020baa5505faba8503a6519327a4617ff62add832a8c5ad451f274750d0503b6fe36030096f162b9cac80dcc3dc430ec4d394d619d212deacb49e3be972dbd1
|
@@ -149,8 +149,7 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
149
149
|
int days_c = atoi(StringValuePtr(days));
|
150
150
|
int min_c = FIX2INT(rb_ary_entry(array,0));
|
151
151
|
int max_c = FIX2INT(rb_ary_entry(array,1));
|
152
|
-
int period;
|
153
|
-
int traj_size;
|
152
|
+
int period, traj_size, index, i;
|
154
153
|
|
155
154
|
|
156
155
|
if (days_c < first_interval_c) {
|
@@ -167,7 +166,7 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
167
166
|
}
|
168
167
|
period = aggr_size -1;
|
169
168
|
}else {
|
170
|
-
for (
|
169
|
+
for ( index = 0 ; index < intervals_size ; index++){
|
171
170
|
if( index < (intervals_size - 1) ){
|
172
171
|
int intervals_index_plus_1 = FIX2INT(rb_ary_entry(intervals,index+1));
|
173
172
|
if ( intervals_index_plus_1 <= 0 ){
|
@@ -186,7 +185,7 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
186
185
|
rb_ary_store(array,0,INT2FIX(min_c));
|
187
186
|
rb_ary_store(array,1,INT2FIX(max_c));
|
188
187
|
traj_size = RARRAY_LEN(traj);
|
189
|
-
for (
|
188
|
+
for ( i =0; i < traj_size; i++){
|
190
189
|
rb_ary_push(rb_ary_entry(aggr,period),rb_ary_entry(traj,i));
|
191
190
|
}
|
192
191
|
|
@@ -225,8 +224,9 @@ static VALUE remove_entry_from_array (VALUE strings, char* element){
|
|
225
224
|
VALUE result = rb_ary_new();
|
226
225
|
char* current_value;
|
227
226
|
VALUE current_value_temp;
|
227
|
+
int i;
|
228
228
|
|
229
|
-
for(
|
229
|
+
for( i = 0; i < RARRAY_LEN(strings); i++){
|
230
230
|
current_value_temp = rb_ary_entry(strings,i);
|
231
231
|
current_value = StringValuePtr(current_value_temp);
|
232
232
|
if (strcmp(current_value, element) != 0) {
|
@@ -260,9 +260,10 @@ static VALUE generate_boxes_and_links(VALUE self, VALUE aggr, VALUE boxes, VALUE
|
|
260
260
|
char* link_key = (char*) malloc(1000);
|
261
261
|
char* period_s;
|
262
262
|
char* prox_s;
|
263
|
+
int period,i;
|
263
264
|
//FILE *f = fopen("/tmp/file.txt", "a");
|
264
265
|
|
265
|
-
for(
|
266
|
+
for(period = 0; period < aggr_size; period++ ){
|
266
267
|
seq_key = rb_ary_new();
|
267
268
|
|
268
269
|
if (period < aggr_size - 1) {
|
@@ -276,7 +277,7 @@ static VALUE generate_boxes_and_links(VALUE self, VALUE aggr, VALUE boxes, VALUE
|
|
276
277
|
if (seq_size == 0) {
|
277
278
|
rb_ary_push(seq_key,rb_hash_aref(dict, rb_str_new2("M-2")));
|
278
279
|
}else{
|
279
|
-
for(
|
280
|
+
for(i = 0; i < seq_size; i++ ) {
|
280
281
|
rb_ary_push(seq_key,rb_hash_aref(dict,rb_ary_entry(seq,i)));
|
281
282
|
}
|
282
283
|
}
|
@@ -315,7 +316,7 @@ static VALUE generate_boxes_and_links(VALUE self, VALUE aggr, VALUE boxes, VALUE
|
|
315
316
|
if ( aggr_prox_size == 0) {
|
316
317
|
rb_ary_push(prox_key,rb_hash_aref(dict, rb_str_new2("M-2")));
|
317
318
|
}else{
|
318
|
-
for(
|
319
|
+
for( i = 0; i < aggr_prox_size ; i++ ) {
|
319
320
|
rb_ary_push(prox_key,rb_hash_aref(dict,rb_ary_entry(aggr_prox,i)));
|
320
321
|
}
|
321
322
|
}
|
@@ -391,14 +392,15 @@ static VALUE iterate_over_trajectories(VALUE self, VALUE trajectories, VALUE min
|
|
391
392
|
VALUE value;
|
392
393
|
VALUE result;
|
393
394
|
VALUE min_max_aggr;
|
395
|
+
int i,j;
|
394
396
|
|
395
397
|
// iterate over each trajectory
|
396
|
-
for (
|
398
|
+
for (i = 0; i < RARRAY_LEN(trajectories); i++ ){
|
397
399
|
|
398
400
|
trajectory = rb_ary_entry(trajectories,i);
|
399
401
|
|
400
402
|
aggr = rb_ary_new();
|
401
|
-
for (
|
403
|
+
for (j = 0; j < RARRAY_LEN(intervals) + 2; j++){
|
402
404
|
rb_ary_push(aggr,rb_ary_new());
|
403
405
|
}
|
404
406
|
|