Example #1
0
def write_monomial_maps(nbvar):
    """
    Writes the maps stored in the container.
    """
    from phcpy.phcpy2c2 import py2c_mapcon_top_dimension
    from phcpy.phcpy2c2 import py2c_mapcon_number_of_maps
    from phcpy.phcpy2c2 import py2c_mapcon_degree_of_map
    topdim = py2c_mapcon_top_dimension()
    print 'the top dimension :', topdim
    for dim in range(topdim, -1, -1):
        nbmaps = py2c_mapcon_number_of_maps(dim)
        print 'number of maps of dimension', dim, ':', nbmaps
        for ind in range(1, nbmaps + 1):
            print 'monomial map', ind, 'of dimension', dim, ':'
            write_monomial_map(dim, ind, nbvar)
            degmap = py2c_mapcon_degree_of_map(dim, ind)
            print 'degree of map', ind, ':', degmap
Example #2
0
def write_monomial_maps(nbvar):
    """
    Writes the maps stored in the container.
    """
    from phcpy.phcpy2c2 import py2c_mapcon_top_dimension
    from phcpy.phcpy2c2 import py2c_mapcon_number_of_maps
    from phcpy.phcpy2c2 import py2c_mapcon_degree_of_map
    topdim = py2c_mapcon_top_dimension()
    print 'the top dimension :', topdim
    for dim in range(topdim, -1, -1):
        nbmaps = py2c_mapcon_number_of_maps(dim)
        print 'number of maps of dimension', dim, ':', nbmaps
        for ind in range(1, nbmaps+1):
            print 'monomial map', ind, 'of dimension', dim, ':'
            write_monomial_map(dim, ind, nbvar)
            degmap = py2c_mapcon_degree_of_map(dim, ind)
            print 'degree of map', ind, ':', degmap
Example #3
0
def monomial_map_solutions(nbvar, with_degree=True):
    r"""
    Returns the list of lists of strings,
    each list of strings representing a monomial map
    stored in the container.
    The number of variables equals *nbvar*.
    """
    from phcpy.phcpy2c2 import py2c_mapcon_top_dimension
    from phcpy.phcpy2c2 import py2c_mapcon_number_of_maps
    from phcpy.phcpy2c2 import py2c_mapcon_degree_of_map
    result = []
    topdim = py2c_mapcon_top_dimension()
    for dim in range(topdim, -1, -1):
        nbmaps = py2c_mapcon_number_of_maps(dim)
        for ind in range(1, nbmaps + 1):
            str_map = monomial_map_strings(dim, ind, nbvar)
            str_map.append('dimension = %d' % dim)
            if with_degree:
                degmap = py2c_mapcon_degree_of_map(dim, ind)
                str_map.append('degree = %d' % degmap)
            result.append(str_map)
    return result
Example #4
0
def monomial_map_solutions(nbvar, with_degree=True):
    """
    Returns the list of lists of strings,
    each list of strings representing a monomial map
    stored in the container.
    The number of variables equals nbvar.
    """
    from phcpy.phcpy2c2 import py2c_mapcon_top_dimension
    from phcpy.phcpy2c2 import py2c_mapcon_number_of_maps
    from phcpy.phcpy2c2 import py2c_mapcon_degree_of_map
    result = []
    topdim = py2c_mapcon_top_dimension()
    for dim in range(topdim, -1, -1):
        nbmaps = py2c_mapcon_number_of_maps(dim)
        for ind in range(1, nbmaps+1):
            str_map = monomial_map_strings(dim, ind, nbvar)
            str_map.append('dimension = %d' % dim)
            if with_degree:
                degmap = py2c_mapcon_degree_of_map(dim, ind)
                str_map.append('degree = %d' % degmap)
            result.append(str_map)
    return result