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 +4 -4
- data/ext/tarf_monte_carlo/tarf_monte_carlo.c +13 -9
- data/lib/tarf_monte_carlo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03bf86914a9a49bf1e131da2f8e0d7f68c74045468ac37b4d1512d02d9314dd6
|
4
|
+
data.tar.gz: eeb37d954cccbd49685804b31aae18df4e26df1b7f3b645c76693d620c37c1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
357
|
-
|
358
|
-
|
360
|
+
VALUE final_metrics = rb_ary_new();
|
361
|
+
for(metric = 0; metric < DATAPOINTS; metric++) {
|
362
|
+
VALUE leg_metrics = rb_ary_new();
|
359
363
|
|
360
|
-
|
361
|
-
|
362
|
-
|
364
|
+
for(leg = 0; leg < NL; leg++) {
|
365
|
+
rb_ary_push( leg_metrics, DBL2NUM( metrics[metric][leg] ) );
|
366
|
+
}
|
363
367
|
|
364
|
-
|
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
|
-
|
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
|
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:
|
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-
|
11
|
+
date: 2020-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|