diff options
| -rw-r--r-- | pyisda/curve.pyx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index a575a96..d761867 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -525,7 +525,7 @@ cdef class SpreadCurve(Curve): cdef double* tenors_c = NULL cdef TCurve* curve = NULL cdef TCurve* new_curve = NULL - cdef double* rates = NULL + cdef vector[double] rates cdef unsigned int includes = 0 cdef size_t i cdef bint freeup = False @@ -587,12 +587,10 @@ cdef class SpreadCurve(Curve): <long>'M', b'NONE') else: - rates = <double*>malloc(n_dates * sizeof(double)) - for i in range(n_dates): - rates[i] = 1000 + rates = vector[double](n_dates, 1000) curve = JpmcdsMakeTCurve(today_c, end_dates_c, - rates, + rates.data(), n_dates, 5000., ACT_360) |
