Ejemplo n.º 1
0
def test_diaghom(precision='d'):
    """
    Test on the diagonal homotopy.
    """
    from phcpy.sets import witness_set_of_hypersurface
    hyp1 = 'x1*x2;'
    hyp2 = 'x1 - x2;'
    (w1sys, w1sols) = witness_set_of_hypersurface(2, hyp1, precision)
    print 'the witness sets for', hyp1
    for pol in w1sys:
        print pol
    for sol in w1sols:
        print sol
    (w2sys, w2sols) = witness_set_of_hypersurface(2, hyp2, precision)
    print 'the witness sets for', hyp2
    for pol in w2sys:
        print pol
    for sol in w2sols:
        print sol
    (sys, sols) = diagonal_solver\
        (2, 1, w1sys, w1sols, 1, w2sys, w2sols, 0, precision)
    print 'the end system :'
    for pol in sys:
        print pol
    print 'the solutions of the diagonal solver :'
    for sol in sols:
        print sol
Ejemplo n.º 2
0
def test_diaghom(precision='d'):
    """
    Test on the diagonal homotopy.
    """
    from phcpy.sets import witness_set_of_hypersurface
    hyp1 = 'x1*x2;'
    hyp2 = 'x1 - x2;'
    (w1sys, w1sols) = witness_set_of_hypersurface(2, hyp1, precision)
    print 'the witness sets for', hyp1
    for pol in w1sys:
        print pol
    for sol in w1sols:
        print sol
    (w2sys, w2sols) = witness_set_of_hypersurface(2, hyp2, precision)
    print 'the witness sets for', hyp2
    for pol in w2sys:
        print pol
    for sol in w2sols:
        print sol
    (sys, sols) = diagonal_solver\
        (2, 1, w1sys, w1sols, 1, w2sys, w2sols, 0, precision)
    print 'the end system :'
    for pol in sys:
        print pol
    print 'the solutions of the diagonal solver :'
    for sol in sols:
        print sol
Ejemplo n.º 3
0
def test_factor():
    """
    Simple test on the factor method.
    """
    from phcpy.sets import witness_set_of_hypersurface
    hyp = '(x+1)*(x^2 + y^2 + 1);'
    (wsys, wsols) = witness_set_of_hypersurface(2, hyp)
    fac = factor(1, wsys, wsols)
    print(fac)
Ejemplo n.º 4
0
def test_factor():
    """
    Simple test on the factor method.
    """
    from phcpy.sets import witness_set_of_hypersurface
    hyp = '(x+1)*(x^2 + y^2 + 1);'
    (wsys, wsols) = witness_set_of_hypersurface(2, hyp)
    fac = factor(1, wsys, wsols)
    print(fac)