summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2019-04-05 13:53:29 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2019-04-05 13:53:29 -0400
commite4ba0bb6aa38f352cf33be92c66f9c4dd4dec576 (patch)
tree0cd5fe8f37c35ee560f959367e30a50eb80fffd4
parent6d9774a855c7a5fc85908d6104c0c717b9fd819a (diff)
downloadlossdistrib-e4ba0bb6aa38f352cf33be92c66f9c4dd4dec576.tar.gz
abort early
-rw-r--r--src/lossdistrib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lossdistrib.c b/src/lossdistrib.c
index ce4b662..a9dc82c 100644
--- a/src/lossdistrib.c
+++ b/src/lossdistrib.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <omp.h>
#include "lossdistrib.h"
+#include <assert.h>
#ifdef USE_BLAS
#include <cblas.h>
@@ -493,6 +494,7 @@ void stochasticrecov(double* R, double* Rtilde, double* Z, double* w, int* nZ,
}else{
ptemp = (1 - *R) / (1 - *Rtilde) * *porig;
fitprob(Z, w, nZ, rho, &ptemp, &ptilde);
+ assert(ptilde > *pmod);
#pragma omp parallel for
for(int i = 0; i < *nZ; i++){
q[i] = fabs(1 - (1 - *Rtilde) * exp( shockprob(ptilde, *rho, Z[i], 1) -