diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2017-06-06 15:24:26 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2017-06-06 15:24:26 -0400 |
| commit | ca6bc4d9aa7df2c3fd4f102a5a999558b73a938e (patch) | |
| tree | d2d078437481a95d4c54f1241e83e2254bb71bd9 | |
| parent | a7a9a91b7e218999636a64b53161a34514e9a55c (diff) | |
| download | pyisda-ca6bc4d9aa7df2c3fd4f102a5a999558b73a938e.tar.gz | |
farm is the new city
| -rw-r--r-- | pyisda/curve.pxd | 4 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 6 | ||||
| -rw-r--r-- | setup.py | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index 632d2e1..2419d1d 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -38,8 +38,8 @@ cdef extern from "isda/bastypes.h": TDate fDate double fRate -cdef extern from "city.h" nogil: - uint64_t c_CityHash64 "CityHash64" (char *buff, size_t len) +cdef extern from "farmhash.h" namespace 'util' nogil: + uint64_t Hash64(const char *buff, size_t len) cdef inline size_t TCurve_size(int num_items) nogil: return sizeof(int) + sizeof(TDate) + sizeof(double) + \ diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 082d5e0..60858b8 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -63,7 +63,7 @@ cdef class Curve(object): size_t curve_size = TCurve_size(curve.fNumItems) unsigned char* buf = <unsigned char*>malloc(curve_size * sizeof(unsigned char)) serialize(curve, buf) - cdef uint64_t r = c_CityHash64(<char*>buf, curve_size) + cdef uint64_t r = Hash64(<char*>buf, curve_size) free(buf) return r @@ -328,7 +328,7 @@ cdef class YieldCurve(Curve): memcpy(cursor, &size, sizeof(size_t)) cursor += sizeof(size_t) memcpy(cursor, self.dates.data(), sizeof(TDate) * size) - cdef uint64_t r = c_CityHash64(<char*>buf, buf_size) + cdef uint64_t r = Hash64(<char*>buf, buf_size) free(buf) return r @@ -545,7 +545,7 @@ cdef class SpreadCurve(Curve): memcpy(cursor, &size, sizeof(size_t)) cursor += sizeof(size_t) self.ticker.copy(<char*>cursor, size, 0) - cdef uint64_t r = c_CityHash64(<char*>buf, buf_size) + cdef uint64_t r = Hash64(<char*>buf, buf_size) free(buf) return r @@ -5,7 +5,7 @@ import numpy all_extensions = Extension("*", ["pyisda/*.pyx"], include_dirs = ['c_layer', numpy.get_include()], - libraries = ["cds", "cityhash"], + libraries = ["cds", "farmhash"], language = 'c++') c_extension = Extension("pyisda.flat_hazard", |
