From 56e328f1d6c438d86fbcace2fac2e0b1b0e64fd7 Mon Sep 17 00:00:00 2001 From: Miguel Marco Date: Mon, 20 Mar 2017 13:47:37 +0100 Subject: [PATCH] Minor corrections in README.md --- README.md | 4 ++-- sage-sirocco_interface.pyx | 21 +++++++-------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 917af93..cd5674a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## General description. This is a library for computing homotopy continuation of a given root of one -dimensional sections of bivariate complex polynomials (of degree greater than 2). +dimensional sections of bivariate complex polynomials. The output is a piecewise linear aproximation of the path followed by the root, with the property that there is a tubular neighborhood, with square transversal section, that contains the actual path, and there is a three times thicker tubular @@ -25,7 +25,7 @@ the [MPFR](http://www.mpfr.org/) and [GMP](https://gmplib.org/) libraries. ## Usage: After installing the library, you can call it from any .cpp program by calling -the homotopyPath or homotopyPath_mp functions. In the file tests/sirocco_test.cpp +the `homotopyPath` or `homotopyPath_mp` functions. In the file tests/sirocco_test.cpp you can see a simple example ### Double precission: diff --git a/sage-sirocco_interface.pyx b/sage-sirocco_interface.pyx index 3d4dc80..6f76c97 100644 --- a/sage-sirocco_interface.pyx +++ b/sage-sirocco_interface.pyx @@ -20,13 +20,6 @@ cdef extern from "sirocco.h": -def devuelve(RealNumber a): - cdef mpfr_prec_t ap = mpfr_get_prec(a.value) - cdef RealNumber my_number = RealField(ap)() - mpfr_set(my_number.value, a.value, MPFR_RNDN) - return my_number - - def contpath_mp(deg, values, RealNumber y0r, RealNumber y0i, int prec): cdef int cdeg = deg cdef mpfr_t* cvalues = sage_malloc(sizeof(mpfr_t)*len(values)) @@ -39,7 +32,7 @@ def contpath_mp(deg, values, RealNumber y0r, RealNumber y0i, int prec): mpfr_set(cvalues[j], (values[j]).value, MPFR_RNDN) sig_off() cdef mpfr_t y0R - cdef mpfr_t y0I + cdef mpfr_t y0I sig_on() mpfr_init2(y0R, prec) mpfr_set(y0R, (y0r).value, MPFR_RNDN) @@ -56,11 +49,11 @@ def contpath_mp(deg, values, RealNumber y0r, RealNumber y0i, int prec): if rop == NULL: raise ValueError("libsirocco could not guarantee one step") cdef int n = mpfr_get_si(rop[0], MPFR_RNDN) - + #cdef RealNumber res = RealField(53)() cdef double res l = [] - + for i in range(1, 3*n+1): RN = RealField(prec)() sig_on() @@ -70,7 +63,7 @@ def contpath_mp(deg, values, RealNumber y0r, RealNumber y0i, int prec): l.append(RN) free(rop) return [(l[3*i], l[3*i+1], l[3*i+2]) for i in range(len(l)/3)] - + @@ -80,9 +73,9 @@ def contpath(deg,values,y0r,y0i): cdef int clen = len(values) for i,v in enumerate(values): c_values[i] = values[i] - - - + + + cdef double y0R = y0r cdef double y0I = y0i sig_on()