diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2019-10-24 16:38:07 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2019-10-24 16:38:07 -0400 |
| commit | 8f51643b678b006692fd6b1bdd2899f1832d99df (patch) | |
| tree | 6416d1546dfa9188a4cafac742bbc6f509fc5ab8 | |
| parent | 0ee8969150cc0a68d920cd22499219916da60416 (diff) | |
| download | pyisda-8f51643b678b006692fd6b1bdd2899f1832d99df.tar.gz | |
bugfix
| -rw-r--r-- | pyisda/credit_index.pyx | 4 |
1 files 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 |
