tarf_monte_carlo 2.3.5 → 2.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 +6 -5
- data/lib/tarf_monte_carlo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa559f1331081293c450d366e52847a785f5d1625184f88dbd5777c37ed12ff
|
4
|
+
data.tar.gz: 63f65cb9067dcde1ef52e1bce61dc381fbabab56212a5362f37cb3c47d20aa73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0103ea38bf72f8f7da7b5bcf0a269ee060d37ae7ddd4198bfaa62a66b86f7ec3688c4d101e61eb070f7a67324ee81a6185044adf6048be1f4ef1d86fe5c6ab98
|
7
|
+
data.tar.gz: 6c32222f236d0e69d7934ddb471714d43a8eb42dfcda740940c51b837bde746b4d184c8fb94b94799aab0c84e47332a852737af338cc6fb2c1f2474d62da1d4e
|
@@ -29,6 +29,7 @@
|
|
29
29
|
#define POINTS 2 // knockout by points
|
30
30
|
#define LEGS 3 // knockout by legs
|
31
31
|
#define DATAPOINTS 200 // data for plotting
|
32
|
+
#define INTERVAL 50
|
32
33
|
|
33
34
|
// Defining a space for information and references
|
34
35
|
// about the module to be stored internally
|
@@ -178,7 +179,8 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
178
179
|
//
|
179
180
|
// Store spot and spot dash
|
180
181
|
//
|
181
|
-
if( (sim_count + 1) %
|
182
|
+
if( (sim_count + 1) % INTERVAL == 0 ) {
|
183
|
+
rb_p(rb_str_new2("True condition"));
|
182
184
|
metrics[ point_pos ][ leg ] = Spot;
|
183
185
|
metrics[ point_pos + 2 ][ leg ] = Spot_dash;
|
184
186
|
}
|
@@ -188,8 +190,6 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
188
190
|
if ( MCType == UNCHAINED ) {
|
189
191
|
Spot = S;
|
190
192
|
Spot_dash = S;
|
191
|
-
// VALUE sk = DBL2NUM( Spot );
|
192
|
-
// rb_p(sk)
|
193
193
|
}
|
194
194
|
}
|
195
195
|
// legs loop end
|
@@ -300,7 +300,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
300
300
|
//
|
301
301
|
// store and send whichever payoff you want
|
302
302
|
//
|
303
|
-
if( (sim_count + 1) %
|
303
|
+
if( (sim_count + 1) % INTERVAL == 0 ) {
|
304
304
|
metrics[ point_pos + 1 ][ leg ] = sim_pos[leg];
|
305
305
|
metrics[ point_pos + 3 ][ leg ] = sim_dash_pos[leg];
|
306
306
|
}
|
@@ -320,10 +320,11 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
320
320
|
//
|
321
321
|
// increment metric storing point by 4
|
322
322
|
//
|
323
|
-
if( (sim_count + 1) %
|
323
|
+
if( (sim_count + 1) % INTERVAL == 0 ) {
|
324
324
|
point_pos += 4;
|
325
325
|
}
|
326
326
|
}
|
327
|
+
// run simulations loop
|
327
328
|
|
328
329
|
//
|
329
330
|
// sum all final +ve and -ve payoffs
|