Beispiel #1
0
def test():
    """
    Fixes the seed for the random number generators
    and then runs a test on the diagonal homotopy.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(234798272)
    test_diaghom('dd')
Beispiel #2
0
def test():
    """
    Fixes the seed for the random number generators
    and then runs a test on the diagonal homotopy.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(234798272)
    test_diaghom('dd')
Beispiel #3
0
def test():
    """
    Fixes a seed for the random number generators
    before running the test on the cascade homotopies.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(234798272)
    # test_cascade()
    test_run_cascade()
Beispiel #4
0
def test():
    """
    Fixes a seed for the random number generators
    before running the test on the cascade homotopies.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(234798272)
    # test_cascade()
    test_run_cascade()
Beispiel #5
0
def test():
    """
    Solves the systems and tests on their number of solutions.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(834798272)
    import solver
    print '\nsolving a random binomial system...'
    pols = binomials()
    sols = solver.solve(pols)
    assert len(sols) == 20
    print 'test on binomial system passed'
    print '\nsolving the cyclic 7-roots problem...'
    pols = cyclic7()
    sols = solver.solve(pols)
    assert len(sols) == 924
    print 'test on cyclic 7-roots passed'
    print '\nsolving the benchmark problem D1...'
    pols = sysd1()
    sols = solver.solve(pols)
    assert len(sols) == 48
    print 'test on benchmark problem D1 passed'
    print '\nsolving a generic 5-point 4-bar design problem...'
    pols = fbrfive4()
    sols = solver.solve(pols)
    assert len(sols) == 36
    print 'test on 4-bar system passed'
    print '\ncomputing all Nash equilibria...'
    pols = game4two()
    sols = solver.solve(pols)
    assert len(sols) == 9
    print 'test on Nash equilibria for 4 players passed'
    print '\nsolving a problem in magnetism...'
    pols = katsura6()
    sols = solver.solve(pols)
    assert len(sols) == 64
    print 'test on a problem in magnetism passed'
    print '\nsolving a neural network model...'
    pols = noon3()
    sols = solver.solve(pols)
    assert len(sols) == 21
    print 'test on a neural network model passed'
    print '\nsolving a mechanical design problem...'
    pols = rps10()
    sols = solver.solve(pols)
    assert len(sols) == 1024
    print 'test on RPS serial chains problem passed'
    print '\nsolving a fully real Stewart-Gough platform...'
    pols = stewgou40()
    sols = solver.solve(pols)
    assert len(sols) == 40
    print 'test on real Stewart-Gough platform passed'
    print '\ncomputing all tangent lines to 4 spheres...'
    pols = tangents()
    sols = solver.solve(pols)
    assert len(sols) == 6
    print 'test on multiple tangent lines to spheres passed'
Beispiel #6
0
def test():
    """
    Sets the seed for the random number generators
    to a fixed number and then runs a test.
    """
    from phcpy.phcpy2c2 import py2c_set_seed
    py2c_set_seed(234798272)
    # test_monodromy()
    # test_decompose()
    test_solve()