visualize_helper 0.0.10.33 → 0.0.10.34

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c1f5946747909eafa7b58d8102ea43b7cac144a
4
- data.tar.gz: f60656e08b7c5f1439d58205651b70cba44308d0
3
+ metadata.gz: 1de76bf0893430b7014404255ceb3233e3642280
4
+ data.tar.gz: 1bd1c65aeab869cf767d78b25dfbf8ea2bf07742
5
5
  SHA512:
6
- metadata.gz: 7b14cb82285fa6da31c55bce011c977e1eae3bd3b06475e2758bccaef4cac16bfb936bfbe19f9c2da8a6e955b60429fcf77fb67b7ef867121052d277a5d5b72e
7
- data.tar.gz: 491b65740274a19f7ae924efea287a3cd6a25470110a68dab1268ae24f8b63ce2fa74f06c7de5401f20246acc630f2b9b3c23b193f37556fd4682132e015d2fa
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(array);
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
  }
@@ -1,3 +1,3 @@
1
1
  module VisualizeHelper
2
- VERSION = "0.0.10.33"
2
+ VERSION = "0.0.10.34"
3
3
  end
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.33
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-08 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler