Esempio n. 1
0
def solve(nvr, dim, pols, islaurent=False, \
    precision='d', tasks=0, nbloops=20, \
    tol=1.0e-8, rcotol=1.0e-6, evatol=1.0e-6, memtol=1.0e-6, verbose=True):
    r"""
    Computes a numerical irreducible decomposition for the polynomials
    in the list *pols*, where *nvr* is the number of variables in *pols*.
    The top dimension (the highest dimension of the solution set) is
    given in *dim* and could be by default set to *nvr*-1.
    If *islaurent*, then *pols* is considered a Laurent polynomial system
    and negative exponents may occur.
    The default precision is double 'd'.  Other valid values for precision
    are 'dd' for double double, or 'qd' for quad double.
    On return is a dictionary.  The keys in the dictionary are dimensions.
    For each dimension, a tuple represents a witness set.
    For dimension zero, the solution list contains the isolated solutions.
    For each nonzero dimension, the generic points in the witness set are
    partitioned according to the irreducible factors of the solution set
    at that dimension.
    """
    from phcpy.cascades import run_cascade
    deco = run_cascade(nvr, dim, pols, islaurent, \
               tol=1.0e-8, rcotol=rcotol, evatol=evatol, memtol=memtol, \
               tasks=tasks, prc=precision, verbose=verbose)
    fadc = decompose(deco, islaurent=int(islaurent), verbose=verbose, \
               nbloops=nbloops, precision=precision)
    if verbose:
        write_decomposition(fadc)
    return fadc
Esempio n. 2
0
def solve(nvr, dim, pols, islaurent=False, \
    precision='d', tasks=0, nbloops=20, \
    tol=1.0e-8, rcotol=1.0e-6, evatol=1.0e-6, memtol=1.0e-6, verbose=True):
    r"""
    Computes a numerical irreducible decomposition for the polynomials
    in the list *pols*, where *nvr* is the number of variables in *pols*.
    The top dimension (the highest dimension of the solution set) is
    given in *dim* and could be by default set to *nvr*-1.
    If *islaurent*, then *pols* is considered a Laurent polynomial system
    and negative exponents may occur.
    The default precision is double 'd'.  Other valid values for precision
    are 'dd' for double double, or 'qd' for quad double.
    On return is a dictionary.  The keys in the dictionary are dimensions.
    For each dimension, a tuple represents a witness set.
    For dimension zero, the solution list contains the isolated solutions.
    For each nonzero dimension, the generic points in the witness set are
    partitioned according to the irreducible factors of the solution set
    at that dimension.
    """
    from phcpy.cascades import run_cascade
    deco = run_cascade(nvr, dim, pols, islaurent, \
               tol=1.0e-8, rcotol=rcotol, evatol=evatol, memtol=memtol, \
               tasks=tasks, prc=precision, verbose=verbose)
    fadc = decompose(deco, islaurent=int(islaurent), verbose=verbose, \
               nbloops=nbloops, precision=precision)
    if verbose:
        write_decomposition(fadc)
    return fadc
Esempio n. 3
0
def test_decompose():
    """
    Runs a test on the decompose() function.
    """
    from cascades import run_cascade
    pols = ['(x1-1)*(x1-2)*(x1-3)*(x1-4);', \
            '(x1-1)*(x2-1)*(x2-2)*(x2-3);', \
            '(x1-1)*(x1-2)*(x3-1)*(x3-2);', \
            '(x1-1)*(x2-1)*(x3-1)*(x4-1);']
    deco = run_cascade(4, 3, pols)
    fadc = decompose(deco)
    write_decomposition(fadc)
Esempio n. 4
0
def test_decompose():
    """
    Runs a test on the decompose() function.
    """
    from cascades import run_cascade
    pols = ['(x1-1)*(x1-2)*(x1-3)*(x1-4);', \
            '(x1-1)*(x2-1)*(x2-2)*(x2-3);', \
            '(x1-1)*(x1-2)*(x3-1)*(x3-2);', \
            '(x1-1)*(x2-1)*(x3-1)*(x4-1);']
    deco = run_cascade(4, 3, pols)
    fadc = decompose(deco)
    write_decomposition(fadc)