tarf_monte_carlo 3.31 → 3.32

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: 1ffba748a882648f94602365c6fe89ba13ad4012e4daa54ce87e836c757c2df7
4
- data.tar.gz: 56cf966863ed9d42802d78634b411aef7039eab87a74420d33a3dc429e5c1fa5
3
+ metadata.gz: 2fd5c07e07e1a0fa016c6f8137c1e2b964f031b7210dca898e4d1006c0781ff4
4
+ data.tar.gz: 95210edd7247efc5785fec37c5c13cbe64f86a7509570382f19234174a021e4c
5
5
  SHA512:
6
- metadata.gz: e15a1be8f1f8fcc330201ccbfd814866da27b0010428de8e8f4b449ca74b4879d62947309aedabecb86432657f5a1729f52b737518b2de147e967932beedbd96
7
- data.tar.gz: 6d3a80d0819af9cacb1f4a15beb51a3e6edf3a65f38fdb50a0b6c03d0992d73f7046b126c7cf9e6a7febb1e1430fc4fbafba04590b629c02d21e51debcd0d7d7
6
+ metadata.gz: b9da6d59b8810e6ff75ca95a02c66f59081dfc368bca41de0b809a6c14468b5c1935e07bcb3ba8108766b423177b43d454788fd62c44566747c2f2122a412626
7
+ data.tar.gz: a954cdf5255f86459bae5c6c171b9232dfce4ec4fa13e1f1ef8d5ebfe18beac0defbcbb3ba6d33fbe05af28c889b28031139b60d5e2cac1fd4a468099c387d77
@@ -193,7 +193,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
193
193
  // first create a 1-D array of pointers, and then, for each array entry, create another 1-D array.
194
194
  //
195
195
  double **metrics;
196
- double data[4][NL];
197
196
  metrics = ( double** ) malloc( DATAPOINTS * sizeof(double*) );
198
197
  for( metric = 0; metric < DATAPOINTS; metric++ ) {
199
198
  metrics[metric] = ( double* ) malloc( NL * sizeof(double) );
@@ -217,10 +216,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
217
216
  sim_dash[leg] = 0.0;
218
217
  sim_dash_pos[leg] = 0.0;
219
218
  sim_dash_neg[leg] = 0.0;
220
- data[0][leg] = 0.0;
221
- data[1][leg] = 0.0;
222
- data[2][leg] = 0.0;
223
- data[3][leg] = 0.0;
224
219
  }
225
220
 
226
221
  int knockedLeg = -1;
@@ -374,8 +369,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
374
369
  sim[leg] = profit_loss;
375
370
  sim_dash[leg] = profit_loss_dash;
376
371
 
377
- data[0][leg] = sim[leg];
378
- data[1][leg] = sim_dash[leg];
379
372
  //
380
373
  // Store spot and spot dash
381
374
  //
@@ -392,7 +385,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
392
385
  Spot_dash = S;
393
386
  }
394
387
  }
395
-
396
388
  // legs loop end
397
389
  // start from the Knock value
398
390
  double ko_so_far = K, ko_so_far_dash = K;
@@ -411,9 +403,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
411
403
  else{
412
404
  sim_dash_pos[NL-1] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + 0 ) ), sim_dash[NL-1]);
413
405
  }
414
-
415
- data[2][NL-1] = sim_pos[NL-1];
416
- data[3][NL-1] = sim_dash_pos[NL-1];
417
406
  } else if(KType == FX_AMERICAN_BARRIER_KNOCKOUT_DISCRETE){
418
407
  if(knockedLeg >= 0){
419
408
  sim_pos[knockedLeg] = get_equivalent_rebate(rebate_conversion_sign, ( *( Rebate_array + knockedLeg ) ), sim[knockedLeg]);
@@ -595,11 +584,11 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
595
584
  //
596
585
  // rb_p(rb_str_new2("Converting metrics"));
597
586
  VALUE final_metrics = rb_ary_new();
598
- for(metric = 0; metric < 5; metric++) {
587
+ for(metric = 0; metric < DATAPOINTS; metric++) {
599
588
  VALUE leg_metrics = rb_ary_new();
600
589
 
601
590
  for(leg = 0; leg < NL; leg++) {
602
- rb_ary_push( leg_metrics, DBL2NUM( data[metric][leg] ) );
591
+ rb_ary_push( leg_metrics, DBL2NUM( metrics[metric][leg] ) );
603
592
  }
604
593
 
605
594
  rb_ary_push(final_metrics, leg_metrics);
@@ -3,5 +3,5 @@
3
3
  # gem yank tarf_monte_carlo -v 2.3
4
4
 
5
5
  module TarfMonteCarlo
6
- VERSION = "3.31"
6
+ VERSION = "3.32"
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.31'
4
+ version: '3.32'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vivek Routh