コード例 #1
0
ファイル: interface.py プロジェクト: lailaiflow/PHCpack
def load_standard_laurent_system():
    """
    Returns the Laurent polynomials stored in the system container
    for standard double precision arithmetic.
    """
    from phcpy.phcpy2c2 import py2c_syscon_number_of_standard_Laurentials
    from phcpy.phcpy2c2 import py2c_syscon_load_standard_Laurential
    dim = py2c_syscon_number_of_standard_Laurentials()
    result = []
    for ind in range(1, dim + 1):
        result.append(py2c_syscon_load_standard_Laurential(ind))
    return result
コード例 #2
0
ファイル: interface.py プロジェクト: janverschelde/PHCpack
def load_standard_laurent_system():
    """
    Returns the Laurent polynomials stored in the system container
    for standard double precision arithmetic.
    """
    from phcpy.phcpy2c2 import py2c_syscon_number_of_standard_Laurentials
    from phcpy.phcpy2c2 import py2c_syscon_load_standard_Laurential
    dim = py2c_syscon_number_of_standard_Laurentials()
    result = []
    for ind in range(1, dim+1):
        result.append(py2c_syscon_load_standard_Laurential(ind))
    return result
コード例 #3
0
def is_binomial_system(silent=True):
    r"""
    Returns True if the system stored in the Laurent systems
    container is a binomial system, returns False otherwise.
    if not *silent*, then the number of terms in each Laurent
    polynomial is written to screen.
    """
    from phcpy.phcpy2c2 import py2c_syscon_number_of_standard_Laurentials
    from phcpy.phcpy2c2 import py2c_syscon_number_of_Laurent_terms
    nbequ = py2c_syscon_number_of_standard_Laurentials()
    if not silent:
        print 'checking if binomial system ...'
        print '  number of Laurent polynomials :', nbequ
    for i in range(1, nbequ + 1):
        nbterms = py2c_syscon_number_of_Laurent_terms(i)
        if not silent:
            print '  -> number of terms in polynomial', i, ':', nbterms
        if (nbterms != 2):
            if not silent:
                print '  the system is not a binomial system'
            return False
    if not silent:
        print '  the system is a binomial system'
    return True
コード例 #4
0
ファイル: maps.py プロジェクト: callmetaste/PHCpack
def is_binomial_system(silent=True):
    """
    Returns True if the system stored in the Laurent systems
    container is a binomial system, returns False otherwise.
    if not silent, then the number of terms in each Laurent
    polynomial is written to screen.
    """
    from phcpy.phcpy2c2 import py2c_syscon_number_of_standard_Laurentials
    from phcpy.phcpy2c2 import py2c_syscon_number_of_Laurent_terms
    nbequ = py2c_syscon_number_of_standard_Laurentials()
    if not silent:
        print 'checking if binomial system ...'
        print '  number of Laurent polynomials :', nbequ
    for i in range(1, nbequ+1):
        nbterms = py2c_syscon_number_of_Laurent_terms(i)
        if not silent:
            print '  -> number of terms in polynomial', i, ':', nbterms
        if(nbterms != 2):
            if not silent:
                print '  the system is not a binomial system'
            return False
    if not silent:
        print '  the system is a binomial system'
    return True