From 8f51643b678b006692fd6b1bdd2899f1832d99df Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Thu, 24 Oct 2019 16:38:07 -0400 Subject: bugfix --- pyisda/credit_index.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyisda/credit_index.pyx b/pyisda/credit_index.pyx index a3c6fe9..6526c8e 100644 --- a/pyisda/credit_index.pyx +++ b/pyisda/credit_index.pyx @@ -733,7 +733,7 @@ cdef double pv(const vector[shared_ptr[TCurve]]& curves, double epsilon, unsigned long mask) nogil: cdef: - double fl_pv, cl_pv, r = 0 + double fl_pv, cl_pv, r = 0.0 TCurve *tweaked_curve TCurve *orig_curve size_t i = 0 @@ -743,7 +743,6 @@ cdef double pv(const vector[shared_ptr[TCurve]]& curves, with parallel(): fl_pv = 0. cl_pv = 0. - for i in prange(curves.size()): tweaked_curve = curves[i].get() recovery_rate = recovery_rates[i].get() @@ -775,6 +774,7 @@ cdef double pv(const vector[shared_ptr[TCurve]]& curves, fl_pv = 0. for i in prange(curves.size()): orig_curve = curves[i].get() + tweaked_curve.fBaseDate = orig_curve.fBaseDate tweak_curve(orig_curve, tweaked_curve, epsilon, mask) recovery_rate = recovery_rates[i].get() # FIXME: do something better -- cgit v1.2.3-70-g09d2