diff options
| -rw-r--r-- | pyisda/curve.pyx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 0864019..a62e103 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -58,6 +58,20 @@ cdef class Curve(object): 'day_count_convention': dcc_tostring(self._thisptr.fDayCountConv), 'data': fArray_to_list(self._thisptr.fArray, self._thisptr.fNumItems)} + + def __deepcopy__(self, memo): + cdef Curve sc = type(self).__new__(type(self)) + cdef TCurve* newcurve = <TCurve*>malloc(sizeof(TCurve)) + newcurve.fNumItems = self._thisptr.fNumItems + newcurve.fBaseDate = self._thisptr.fBaseDate + newcurve.fDayCountConv = self._thisptr.fDayCountConv + newcurve.fArray = <TRatePt*>malloc(sizeof(TRatePt) * newcurve.fNumItems) + newcurve.fBasis = self._thisptr.fBasis + memcpy(newcurve.fArray, <char*>self._thisptr.fArray, + sizeof(TRatePt) * newcurve.fNumItems) + sc._thisptr = newcurve + return sc + @property def forward_hazard_rates(self): cdef double t1, h1, t2, h2 @@ -343,7 +357,7 @@ cdef class SpreadCurve(Curve): Flat hazard rate. basis : int, optional Default to :data:`CONTINUOUS` - day_count_cont : str, optional + day_count_conv : str, optional Default to 'Actual/365F' """ |
