tarf_monte_carlo 3.61 → 3.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 157664b6dfd86644998da3438b564db2580b1f4503bb602ab321bf2b4863d63c
4
- data.tar.gz: aec6753b1e912651e2c04357d833dbacc920442a32956993d25f37c1b07de19d
3
+ metadata.gz: 774a60220745dc9096b8d91dd54d01a7053bc78a3f3b70fcc631e9c451d59ede
4
+ data.tar.gz: d2a4bbf7986e338fdec318e7a0045fb92ceb86e9a7b276ad1bdfd8ae0a38d53f
5
5
  SHA512:
6
- metadata.gz: b6f807aca25b23bef95d81eea2a6bf938f9a9a607e16ffdb5d5b2ae8179555c23ef052d67ac12edef921a12ce6657035b7347d3f1b763163af847f2851b132bd
7
- data.tar.gz: 7e30863271c763a7b57033c5d24434a1b20f908e9627e3e4ec6c2cc533c28b3f0243e67ab2511896d9beae4d83544069d494dbae815785a8fd3f0962f935ccd9
6
+ metadata.gz: 1f01816bea5fc7b19ecc9ee8c8d7ebb5179e63e1042c676a2aafcb04d68dac922f8c1bfbe6b71676d7a74aeffc4107a571340fdf442eafcb8c552cb803cefeaa
7
+ data.tar.gz: 7fdd0048cf2e8acbe0322da4f0618de813dc7de0245a2a30fc3f9b88b92138983e7239a6cc146eaafa2c03633250e461ab1abb654a28eed1321983c522f23d82
@@ -211,7 +211,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
211
211
  //
212
212
  // first create a 1-D array of pointers, and then, for each array entry, create another 1-D array.
213
213
  //
214
- double payoffmet[SCount];
215
214
  double **metrics;
216
215
  if (barrier_variations(KType)){
217
216
  metrics = ( double** ) malloc( BARRIER_DP * sizeof(double*) );
@@ -236,8 +235,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
236
235
  // run simulations loop
237
236
  for( sim_count = 0; sim_count < SCount; sim_count += 2 ) {
238
237
  // initial spot rate for each iteration would be current spot rate
239
- payoffmet[sim_count] = 0;
240
- payoffmet[sim_count + 1] = 0;
241
238
  double Spot = S, Spot_dash = S;
242
239
  double sim[NL], sim_pos[NL], sim_neg[NL], sim_dash[NL], sim_dash_pos[NL], sim_dash_neg[NL];
243
240
 
@@ -749,8 +746,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
749
746
  pvs_neg[sim_count] = sim_neg_sum;
750
747
  pvs_neg[sim_count + 1] = sim_dash_neg_sum;
751
748
 
752
- payoffmet[sim_count] = sim_pos_sum;
753
- payoffmet[sim_count + 1] = sim_dash_pos_sum;
754
749
 
755
750
  if (barrier_variations(KType)){
756
751
  if ((point_pos < DATAPOINTS) && (sim_count % INTERVAL) == 0){
@@ -826,18 +821,12 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
826
821
  }
827
822
  }
828
823
 
829
-
830
- VALUE py_final_metrics = rb_ary_new();
831
- for(metric = 0; metric < SCount; metric++) {
832
- rb_ary_push(py_final_metrics, DBL2NUM(payoffmet[metric]));
833
- }
834
824
  // rb_p(rb_str_new2("Generating output hash"));
835
825
  VALUE final_pvs = rb_hash_new();
836
826
  rb_hash_aset(final_pvs, rb_str_new2("positive_pv"), DBL2NUM( pvs_pos_sum / SCount ));
837
827
  rb_hash_aset(final_pvs, rb_str_new2("negative_pv"), DBL2NUM( pvs_neg_sum / SCount ));
838
828
  rb_hash_aset(final_pvs, rb_str_new2("total_pv"), DBL2NUM( (pvs_neg_sum + pvs_pos_sum) / SCount ));
839
829
  rb_hash_aset(final_pvs, rb_str_new2("metrics"), final_metrics);
840
- rb_hash_aset(final_pvs, rb_str_new2("payoffmetrics"), py_final_metrics);
841
830
 
842
831
  //
843
832
  // 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.61"
6
+ VERSION = "3.62"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tarf_monte_carlo
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.61'
4
+ version: '3.62'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Routh