summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyisda/flat_hazard.pyx5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyisda/flat_hazard.pyx b/pyisda/flat_hazard.pyx
index daeac41..7bf548a 100644
--- a/pyisda/flat_hazard.pyx
+++ b/pyisda/flat_hazard.pyx
@@ -179,11 +179,12 @@ def pv_vec(double[:] spreads, YieldCurve yc, trade_date, value_date,
1e-10, # xacc */
1e-10, # facc */
&h) != 0:
- printf("failed to find the root")
+ printf("Failed to find hazard rate for %f:\n", spreads[i])
+ break
sc.fArray[0].fRate = h
if JpmcdsFeeLegPV(fee_leg, trade_date_c, step_in_date_c, value_date_c,
yc._thisptr, sc, True, &coupon_leg_pv) != 0:
- printf("Something went wrong")
+ printf("Something went wrong\n")
pv[i] = coupon_leg_pv * (spreads[i] - fixed_rate)
free(params)
JpmcdsFeeLegFree(fee_leg)