visualize_helper 0.0.10.33 → 0.0.10.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/visualize_helper/visualize_helper.c +38 -1
- 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: 1de76bf0893430b7014404255ceb3233e3642280
|
4
|
+
data.tar.gz: 1bd1c65aeab869cf767d78b25dfbf8ea2bf07742
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9227aa99d581e2c3dc9b4295c386d3ce2231644f9ab2d638e5d7aeeda4f2ce6172c87b5d57f9bcd7ecc516d17f1eecd90c152f07e5be08b462db53227718f872
|
7
|
+
data.tar.gz: 7a2d7bdac84678b1852bcfa0c5d0494c1ec8e6d208657e2176da71f76a4b01a12c916bd6f3b81c77bff9a9a543f137fc7e2b9822f332dea9adba579d14e8eb23
|
@@ -140,7 +140,7 @@ static int encontra_min_max_period(VALUE days, VALUE traj, VALUE array){
|
|
140
140
|
// Convert every variable need to C value
|
141
141
|
VALUE intervals = rb_ary_entry(array,3);
|
142
142
|
VALUE aggr = rb_ary_entry(array,4);
|
143
|
-
int intervals_size = RARRAY_LEN(
|
143
|
+
int intervals_size = RARRAY_LEN(intervals);
|
144
144
|
int aggr_size = RARRAY_LEN(aggr);
|
145
145
|
VALUE first_interval = rb_ary_entry(intervals,0);
|
146
146
|
VALUE last_interval = rb_ary_entry(intervals,intervals_size - 1);
|
@@ -384,6 +384,40 @@ static VALUE join_teste(VALUE self, VALUE strings){
|
|
384
384
|
}
|
385
385
|
|
386
386
|
|
387
|
+
static VALUE iterate_over_trajectories(VALUE self, VALUE trajectories, VALUE min, VALUE max, VALUE hash, VALUE key_v, VALUE key_t, VALUE intervals, VALUE dict, VALUE agrupamento, VALUE boxes, VALUE links) {
|
388
|
+
|
389
|
+
VALUE trajectory;
|
390
|
+
VALUE aggr;
|
391
|
+
VALUE value;
|
392
|
+
VALUE result;
|
393
|
+
VALUE min_max_aggr;
|
394
|
+
|
395
|
+
// iterate over each trajectory
|
396
|
+
for (int i = 0; i < RARRAY_LEN(trajectories); i++ ){
|
397
|
+
|
398
|
+
trajectory = rb_ary_entry(trajectories,i);
|
399
|
+
|
400
|
+
aggr = rb_ary_new();
|
401
|
+
for (int j = 0; j < RARRAY_LEN(intervals) + 2; j++){
|
402
|
+
rb_ary_push(aggr,rb_ary_new());
|
403
|
+
}
|
404
|
+
|
405
|
+
value = rb_hash_aref(hash,key_v);
|
406
|
+
VALUE temp = rb_hash_aref(hash,key_t);
|
407
|
+
min_max_aggr = min_max_period(self,min,max,rb_hash_aref(temp,trajectory),intervals,aggr);
|
408
|
+
aggr = rb_ary_entry(min_max_aggr,4);
|
409
|
+
min = rb_ary_entry(min_max_aggr,0);
|
410
|
+
max = rb_ary_entry(min_max_aggr,1);
|
411
|
+
generate_boxes_and_links(self,aggr,boxes,links,dict,agrupamento,value);
|
412
|
+
|
413
|
+
}
|
414
|
+
|
415
|
+
result = rb_ary_new();
|
416
|
+
rb_ary_push(result,boxes);
|
417
|
+
rb_ary_push(result,links);
|
418
|
+
return result;
|
419
|
+
}
|
420
|
+
|
387
421
|
// Main function called when the gem is loaded
|
388
422
|
void Init_visualize_helper(void) {
|
389
423
|
|
@@ -399,6 +433,9 @@ void Init_visualize_helper(void) {
|
|
399
433
|
// Register the method sort
|
400
434
|
rb_define_singleton_method(mVisualizeHelper, "sort_uniq", sort_uniq, 2 );
|
401
435
|
|
436
|
+
// Register the method that iterates for each trajectory
|
437
|
+
rb_define_singleton_method(mVisualizeHelper, "iterate_over_trajectories", iterate_over_trajectories, 11);
|
438
|
+
|
402
439
|
// Register the method sort
|
403
440
|
rb_define_singleton_method(mVisualizeHelper, "join_teste", join_teste, 1 );
|
404
441
|
}
|
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.34
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|