tarf_monte_carlo 3.5 → 3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/tarf_monte_carlo/tarf_monte_carlo.c +2 -3
- data/lib/tarf_monte_carlo/version.rb +1 -1
- data/lib/tarf_monte_carlo.rb +5 -5
- 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: bb1130c50f083ee54950ca2a4d8325d462762da404fd52c8cd0a67534f1ea410
|
4
|
+
data.tar.gz: 5cfb4c9642286a14869655c2ba082add5226d076be8998c78c5df2eccbbd702f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1bc8757d3a7945059c5784f6180e596576a828a8283bc03ffa85243425f2300136d10cf5a69e4480c79ede4be88010c2f73171f8750182bbf6da7d2b0b3716b
|
7
|
+
data.tar.gz: d7805cc57138165266e6e63b1ec062fad176ec598610c5317d21e9d756e097c060fe8b9101403df5ca91240619b316f46db2f47f433cb1aa80e4658985e0d8c7
|
@@ -205,7 +205,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
205
205
|
double temp_payoff_ko_ccy = temp_payoff * pow( *( Xs_array + leg ), Ko_compare_mult );
|
206
206
|
|
207
207
|
if( temp_payoff_ko_ccy > ko_so_far ) {
|
208
|
-
sim_pos[leg] = ko_so_far * pow( *( Xs_array + leg ), Ko_compare_mult );
|
208
|
+
sim_pos[leg] = ko_so_far * pow( *( Xs_array + leg ), (-1 * Ko_compare_mult) );
|
209
209
|
ko_so_far = 0.0;
|
210
210
|
} else if( temp_payoff_ko_ccy <= ko_so_far ) {
|
211
211
|
sim_pos[leg] = temp_payoff; // take the payoff in +ve's
|
@@ -224,7 +224,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
224
224
|
double temp_payoff_ko_ccy = temp_payoff_dash * pow( *( Xs_array + leg ), Ko_compare_mult );
|
225
225
|
|
226
226
|
if( temp_payoff_ko_ccy > ko_so_far_dash ) {
|
227
|
-
sim_dash_pos[leg] = ko_so_far_dash * pow( *( Xs_array + leg ), Ko_compare_mult );
|
227
|
+
sim_dash_pos[leg] = ko_so_far_dash * pow( *( Xs_array + leg ), (-1 * Ko_compare_mult) );
|
228
228
|
ko_so_far_dash = 0.0;
|
229
229
|
} else if( temp_payoff_ko_ccy <= ko_so_far_dash ) {
|
230
230
|
sim_dash_pos[leg] = temp_payoff_dash; // take the payoff in +ve's
|
@@ -402,4 +402,3 @@ void Init_tarf_monte_carlo() {
|
|
402
402
|
rb_define_singleton_method(cTarfMonteCarlo, "box_muller", method_box_muller, 0);
|
403
403
|
rb_define_singleton_method(cTarfMonteCarlo, "run_monte_carlo", method_run_monte_carlo, -2);
|
404
404
|
}
|
405
|
-
|
data/lib/tarf_monte_carlo.rb
CHANGED
@@ -4,11 +4,11 @@ require "tarf_monte_carlo/version"
|
|
4
4
|
# my_malloc/my_malloc will be the shared object built when the gem is
|
5
5
|
# installed then copied into lib/my_malloc/.
|
6
6
|
|
7
|
-
begin
|
8
|
-
|
9
|
-
rescue LoadError
|
10
|
-
|
11
|
-
end
|
7
|
+
# begin
|
8
|
+
# require "tarf_monte_carlo/#{RUBY_VERSION[/\d+.\d+/]}/tarf_monte_carlo"
|
9
|
+
# rescue LoadError
|
10
|
+
# require "tarf_monte_carlo/tarf_monte_carlo"
|
11
|
+
# end
|
12
12
|
|
13
13
|
module TarfMonteCarlo
|
14
14
|
# Your code goes here...
|
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.
|
4
|
+
version: '3.6'
|
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-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|