diff options
| author | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-11-15 09:54:46 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@serenitascapital.com> | 2016-11-15 09:54:46 -0500 |
| commit | a5025ce33baad083ead22f3cff92fc88d0e2687a (patch) | |
| tree | 3ed471f05100a5745828cb8d7a8688ab220d1439 /c_layer/cdsbootstrap.c | |
| parent | 76064859c2d24ea1c44aa9839e09bfdada284000 (diff) | |
| download | pyisda-gsl.tar.gz | |
Use gsl brent solvergsl
slower than the jpm's one
Diffstat (limited to 'c_layer/cdsbootstrap.c')
| -rw-r--r-- | c_layer/cdsbootstrap.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/c_layer/cdsbootstrap.c b/c_layer/cdsbootstrap.c index f3ae975..6b0a4cd 100644 --- a/c_layer/cdsbootstrap.c +++ b/c_layer/cdsbootstrap.c @@ -1,12 +1,6 @@ #include "cdsbootstrap.h" -int cdsBootstrapPointFunction -(double hazardRate, - void *data, - double *pv) -{ - int status = FAILURE; - +double cdsBootstrapPointFunction(double hazardRate, void *data) { cds_bootstrap_ctx *context = (cds_bootstrap_ctx*)data; TCurve *discountCurve = context->discountCurve; @@ -27,7 +21,6 @@ int cdsBootstrapPointFunction cdsCurve, context->recoveryRate, &pvC) != SUCCESS) - goto done; if (JpmcdsFeeLegPV(context->fl, cdsBaseDate, @@ -37,10 +30,8 @@ int cdsBootstrapPointFunction cdsCurve, 1, &pvF) != SUCCESS) - goto done; /* Note: price is discounted to cdsBaseDate */ - *pv = pvC - context->spread * pvF; - status = SUCCESS; + return pvC - context->spread * pvF; done: |
