def store_dobldobl_laurent_system(polsys, **nbvar): r""" Stores the Laurent polynomials represented by the list of strings in *polsys* into the container for systems with coefficients in double double precision. If *nbvar* is omitted, then the system is assumed to be square. Otherwise, suppose the number of variables equals 2 and pols is the list of polynomials, then **store_dobldobl_Laurent_system(pols, nbvar=2)** stores the polynomials in pols in the dobldobl Laurent systems container. """ from phcpy.phcpy2c2 import py2c_syscon_clear_dobldobl_Laurent_system from phcpy.phcpy2c2 \ import py2c_syscon_initialize_number_of_dobldobl_Laurentials from phcpy.phcpy2c2 import py2c_syscon_store_dobldobl_Laurential py2c_syscon_clear_dobldobl_Laurent_system() dim = len(polsys) fail = 0 py2c_syscon_initialize_number_of_dobldobl_Laurentials(dim) for cnt in range(0, dim): pol = polsys[cnt] nchar = len(pol) if len(nbvar) == 0: fail = py2c_syscon_store_dobldobl_Laurential( nchar, dim, cnt + 1, pol) else: nvr = nbvar.values()[0] fail = py2c_syscon_store_dobldobl_Laurential( nchar, nvr, cnt + 1, pol) if (fail != 0): break return fail
def store_dobldobl_laurent_system(polsys, **nbvar): r""" Stores the Laurent polynomials represented by the list of strings in *polsys* into the container for systems with coefficients in double double precision. If *nbvar* is omitted, then the system is assumed to be square. Otherwise, suppose the number of variables equals 2 and pols is the list of polynomials, then **store_dobldobl_Laurent_system(pols, nbvar=2)** stores the polynomials in pols in the dobldobl Laurent systems container. """ from phcpy.phcpy2c2 import py2c_syscon_clear_dobldobl_Laurent_system from phcpy.phcpy2c2 \ import py2c_syscon_initialize_number_of_dobldobl_Laurentials from phcpy.phcpy2c2 import py2c_syscon_store_dobldobl_Laurential py2c_syscon_clear_dobldobl_Laurent_system() dim = len(polsys) fail = 0 py2c_syscon_initialize_number_of_dobldobl_Laurentials(dim) for cnt in range(0, dim): pol = polsys[cnt] nchar = len(pol) if len(nbvar) == 0: fail = py2c_syscon_store_dobldobl_Laurential(nchar, dim, cnt+1, pol) else: nvr = nbvar.values()[0] fail = py2c_syscon_store_dobldobl_Laurential(nchar, nvr, cnt+1, pol) if(fail != 0): break return fail
def dobldobl_solve(pols, silent=False, tasks=0): """ Calls the blackbox solver. On input in pols is a list of strings. By default, the solver will print to screen the computed root counts. To make the solver silent, set the flag silent to True. The number of tasks for multithreading is given by tasks. The solving happens in double double precision arithmetic. """ from phcpy.phcpy2c2 import py2c_syscon_clear_dobldobl_Laurent_system from phcpy.phcpy2c2 \ import py2c_syscon_initialize_number_of_dobldobl_Laurentials from phcpy.phcpy2c2 import py2c_syscon_store_dobldobl_Laurential from phcpy.phcpy2c2 import py2c_solcon_clear_dobldobl_solutions from phcpy.phcpy2c2 import py2c_solve_dobldobl_Laurent_system from phcpy.interface import load_dobldobl_solutions py2c_syscon_clear_dobldobl_Laurent_system() py2c_solcon_clear_dobldobl_solutions() dim = len(pols) py2c_syscon_initialize_number_of_dobldobl_Laurentials(dim) for ind in range(0, dim): pol = pols[ind] nchar = len(pol) py2c_syscon_store_dobldobl_Laurential(nchar, dim, ind+1, pol) py2c_solve_dobldobl_Laurent_system(silent, tasks) return load_dobldobl_solutions()
def store_dobldobl_laurent_system(polsys): """ Stores the Laurent polynomials represented by the list of strings in polsys into the container for systems with coefficients in double double precision. """ from phcpy.phcpy2c2 import py2c_syscon_clear_dobldobl_Laurent_system from phcpy.phcpy2c2 \ import py2c_syscon_initialize_number_of_dobldobl_Laurentials from phcpy.phcpy2c2 import py2c_syscon_store_dobldobl_Laurential py2c_syscon_clear_dobldobl_Laurent_system() dim = len(polsys) py2c_syscon_initialize_number_of_dobldobl_Laurentials(dim) for cnt in range(0, dim): pol = polsys[cnt] nchar = len(pol) fail = py2c_syscon_store_dobldobl_Laurential(nchar, dim, cnt+1, pol) if(fail != 0): break return fail