def load_standard_tableau(verbose=False): """ Returns the tableau form of the system stored in the container for double precision coefficients. """ from phcpy.phcpy2c2 import py2c_tabform_load_standard_tableau as load neq, nvr, nbterms, coefficients, exponents = load(int(verbose)) nbt = eval(nbterms) cff = eval(coefficients) xps = eval(exponents) xpsidx = 0 cffidx = 0 tableau = [] for i in range(neq): pol = [] for j in range(nbt[i]): trm = [] for k in range(nvr): trm.append(xps[xpsidx]) xpsidx = xpsidx + 1 cfftrm = complex(cff[cffidx], cff[cffidx + 1]) cffidx = cffidx + 2 pol.append((cfftrm, tuple(trm))) tableau.append(pol) return (neq, nvr, tableau)
def retrieve_quaddobl_tropism(dim, idx): """ Returns the winding number, coordinates of the direction, and its error, stored in double precision, of dimension dim, and index idx. The index must be in the range 1..quaddobl_size(). Observe that the index counter starts at one and not at zero. """ from ast import literal_eval from phcpy.phcpy2c2 import py2c_numbtrop_quaddobl_retrieve_tropism as load (fail, wnd, strdata) = load(dim, idx) data = literal_eval(strdata) dir = [data[k] for k in range(4 * dim)] err = [data[4 * dim], data[4 * dim + 1], data[4 * dim + 2], data[4 * dim + 3]] return (wnd, dir, err)
def retrieve_dobldobl_tropism(dim, idx): r""" Returns the winding number, coordinates of the direction, and its error, stored in double precision, of dimension *dim*, and index *idx*. The index *idx* must be in the range 1..dobldobl_size(). Observe that the index counter starts at one and not at zero. """ from ast import literal_eval from phcpy.phcpy2c2 \ import py2c_numbtrop_dobldobl_retrieve_tropism as load (fail, wnd, strdata) = load(dim, idx) data = literal_eval(strdata) dir = [data[k] for k in range(2 * dim)] err = [data[2 * dim], data[2 * dim + 1]] return (wnd, dir, err)
def retrieve_standard_tropism(dim, idx): r""" Returns the winding number, coordinates of the direction, and its error, stored in double precision, of dimension *dim*, and index *idx*. The index *idx* must be in the range 1..standard_size(). Observe that the index counter starts at one and not at zero. """ from ast import literal_eval from phcpy.phcpy2c2 \ import py2c_numbtrop_standard_retrieve_tropism as load (fail, wnd, strdata) = load(dim, idx) data = literal_eval(strdata) dir = [data[k] for k in range(dim)] err = data[dim] return (wnd, dir, err)
def quaddobl_retrieve(nbt, dim): r""" Given on input the number of tropisms in *nbt* and the dimension in *dim*, returns a tuple of three lists: the winding numbers, coordinates of the direction vectors, and the errrors; in quad double precision. """ from ast import literal_eval from phcpy.phcpy2c2 import py2c_numbtrop_quaddobl_retrieve as load (fail, strdata) = load(nbt, dim) data = literal_eval(strdata) wnd = [int(data[k]) for k in range(nbt)] dirs = [] for i in range(nbt): dirs.append([data[nbt + i * 4 * dim + j] for j in range(4 * dim)]) err = [data[nbt * (4 * dim + 1) + k] for k in range(4 * nbt)] return (wnd, dirs, err)
def quaddobl_retrieve(nbt, dim): r""" Given on input the number of tropisms in *nbt* and the dimension in *dim*, returns a tuple of three lists: the winding numbers, coordinates of the direction vectors, and the errrors; in quad double precision. """ from ast import literal_eval from phcpy.phcpy2c2 import py2c_numbtrop_quaddobl_retrieve as load (fail, strdata) = load(nbt, dim) data = literal_eval(strdata) wnd = [int(data[k]) for k in range(nbt)] dirs = [] for i in range(nbt): dirs.append([data[nbt+i*4*dim+j] for j in range(4*dim)]) err = [data[nbt*(4*dim+1)+k] for k in range(4*nbt)] return (wnd, dirs, err)