tarf_monte_carlo 3.2 → 3.2.1

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
  SHA256:
3
- metadata.gz: 19779d73318aeb56d320baa85cf0336c417c5267a9ce080272f2d18c47b06be5
4
- data.tar.gz: 78a64e49d31588e6fdb589803850f650d6350ebc0e5daf21e30e2d949f01da4e
3
+ metadata.gz: 03bf86914a9a49bf1e131da2f8e0d7f68c74045468ac37b4d1512d02d9314dd6
4
+ data.tar.gz: eeb37d954cccbd49685804b31aae18df4e26df1b7f3b645c76693d620c37c1f7
5
5
  SHA512:
6
- metadata.gz: dd7966fcf228352b5ca765f5a5e0b1aae4dfa9ca471855d23096b1751ff6a5e782382357ff2f546fb5ef7d813b50b69c8054b5ecf0aa4e4cd0d49dc4698724f8
7
- data.tar.gz: 82fd773ed3614fe2634572e57718f67fd1f1808bac78d4bcd6a82da5dde94a6283fbc9ce318d82090279ebc036129b5d4aad9f356f2406397542facd5ac65401
6
+ metadata.gz: 21f5c9487dd9534ef219b00636993d2df6c2282e5249589fafe282990a81fe74a3dc77dfa0f3861cfd75dde25df3929479b1a5331ded3099791bf43b8c466002
7
+ data.tar.gz: 1c5d90afdd841e6a2238eac32c9b930ada776c4c17ad8d8a16ffd1d4f4e972cfd51a735a7d07cca35fc86e2f76c9a90912154d75501ad8f6aabbbdedd422ece3
@@ -180,6 +180,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
180
180
  // Store spot and spot dash
181
181
  //
182
182
  if( (sim_count + 2) % INTERVAL == 0 ) {
183
+ rb_p(rb_str_new2("Leg:Spots"));
183
184
  metrics[ point_pos ][ leg ] = Spot;
184
185
  metrics[ point_pos + 2 ][ leg ] = Spot_dash;
185
186
  }
@@ -300,6 +301,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
300
301
  // store and send whichever payoff you want
301
302
  //
302
303
  if( (sim_count + 2) % INTERVAL == 0 ) {
304
+ rb_p(rb_str_new2("Leg:Payoffs"));
303
305
  metrics[ point_pos + 1 ][ leg ] = sim_pos[leg];
304
306
  metrics[ point_pos + 3 ][ leg ] = sim_dash_pos[leg];
305
307
  }
@@ -320,6 +322,8 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
320
322
  // increment metric storing point by 4
321
323
  //
322
324
  if( (sim_count + 2) % INTERVAL == 0 ) {
325
+ rb_p(rb_str_new2("T:"));
326
+ rb_p(INT2NUM(point_pos));
323
327
  point_pos += 4;
324
328
  }
325
329
  }
@@ -353,23 +357,23 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
353
357
  // return both payoffs
354
358
  //
355
359
  rb_p(rb_str_new2("Converting metrics"));
356
- // VALUE final_metrics = rb_ary_new();
357
- // for(metric = 0; metric < DATAPOINTS; metric++) {
358
- // VALUE leg_metrics = rb_ary_new();
360
+ VALUE final_metrics = rb_ary_new();
361
+ for(metric = 0; metric < DATAPOINTS; metric++) {
362
+ VALUE leg_metrics = rb_ary_new();
359
363
 
360
- // for(leg = 0; leg < NL; leg++) {
361
- // rb_ary_push( leg_metrics, DBL2NUM( metrics[metric][leg] ) );
362
- // }
364
+ for(leg = 0; leg < NL; leg++) {
365
+ rb_ary_push( leg_metrics, DBL2NUM( metrics[metric][leg] ) );
366
+ }
363
367
 
364
- // rb_ary_push(final_metrics, leg_metrics);
365
- // }
368
+ rb_ary_push(final_metrics, leg_metrics);
369
+ }
366
370
 
367
371
  rb_p(rb_str_new2("Generating output hash"));
368
372
  VALUE final_pvs = rb_hash_new();
369
373
  rb_hash_aset(final_pvs, rb_str_new2("positive_pv"), DBL2NUM( pvs_pos_sum / SCount ));
370
374
  rb_hash_aset(final_pvs, rb_str_new2("negative_pv"), DBL2NUM( pvs_neg_sum / SCount ));
371
375
  rb_hash_aset(final_pvs, rb_str_new2("total_pv"), DBL2NUM( (pvs_neg_sum + pvs_pos_sum) / SCount ));
372
- // rb_hash_aset(final_pvs, rb_str_new2("metrics"), final_metrics);
376
+ rb_hash_aset(final_pvs, rb_str_new2("metrics"), final_metrics);
373
377
 
374
378
  //
375
379
  // free your arrays from memory once you're done using them
@@ -3,5 +3,5 @@
3
3
  # gem yank tarf_monte_carlo -v 2.3
4
4
 
5
5
  module TarfMonteCarlo
6
- VERSION = "3.2"
6
+ VERSION = "3.2.1"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarf_monte_carlo
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.2'
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Routh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2020-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler