rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
raise ValueError, "n must be greater than lbound: %s"%(lbound)
raise ValueError, "n must be at least lbound: %s"%(lbound)
def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th...
7be27a691399fe48873b13b15f955fa09aa9fb89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7be27a691399fe48873b13b15f955fa09aa9fb89/arith.py
return ZZ(n)
return n lbound = max(2, lbound) if lbound > 2: if lbound == 3 or n <= 2*lbound - 2: if lbound < 25 or n <= 6*lbound/5: if lbound < 2010760 or n <= 16598*lbound/16597: if proof: smallest_prime = ZZ(lbound-1).next_prime() else: smallest_prime = ZZ(lbound-1).next_probable_prime() if smallest_prime > n: raise ValueErro...
def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th...
7be27a691399fe48873b13b15f955fa09aa9fb89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7be27a691399fe48873b13b15f955fa09aa9fb89/arith.py
if not proof: prime_test = is_pseudoprime else: prime_test = is_prime randint = current_randstate().python_random().randint while(1): p = randint(lbound,n) if prime_test(p): return ZZ(p)
prime_test = is_pseudoprime randint = current_randstate().python_random().randint while True: p = randint(lbound, n) if prime_test(p): return ZZ(p)
def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, th...
7be27a691399fe48873b13b15f955fa09aa9fb89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7be27a691399fe48873b13b15f955fa09aa9fb89/arith.py
sage: cmp(N3, 3) -1
sage: abs( cmp(N3, 3) ) 1
def __cmp__(self, right): r""" Compare ``self`` and ``right``.
396b8ff061da0e49bb315b7342dcc37c63eb5cfa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/396b8ff061da0e49bb315b7342dcc37c63eb5cfa/toric_lattice.py
def taylor(f, v, a, n):
def taylor(f, *args):
def taylor(f, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable `v` around the point `a`, containing terms through `(x - a)^n`. INPUT: - ``v`` - variable - ``a`` - number - ``n`` - integer EXAMPLES:: sage: var('x,k,n') (x, k, n) sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6) -...
633bfa8986eb00c84d3329a7fc202dcbd0a6259c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/633bfa8986eb00c84d3329a7fc202dcbd0a6259c/functional.py
through `(x - a)^n`.
through `(x - a)^n`. Functions in more variables are also supported.
def taylor(f, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable `v` around the point `a`, containing terms through `(x - a)^n`. INPUT: - ``v`` - variable - ``a`` - number - ``n`` - integer EXAMPLES:: sage: var('x,k,n') (x, k, n) sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6) -...
633bfa8986eb00c84d3329a7fc202dcbd0a6259c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/633bfa8986eb00c84d3329a7fc202dcbd0a6259c/functional.py
- ``v`` - variable - ``a`` - number - ``n`` - integer
- ``*args`` - the following notation is supported - ``x, a, n`` - variable, point, degree - ``(x, a), (y, b), ..., n`` - variables with points, degree of polynomial
def taylor(f, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable `v` around the point `a`, containing terms through `(x - a)^n`. INPUT: - ``v`` - variable - ``a`` - number - ``n`` - integer EXAMPLES:: sage: var('x,k,n') (x, k, n) sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6) -...
633bfa8986eb00c84d3329a7fc202dcbd0a6259c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/633bfa8986eb00c84d3329a7fc202dcbd0a6259c/functional.py
return f.taylor(v=v,a=a,n=n)
return f.taylor(*args)
def taylor(f, v, a, n): """ Expands self in a truncated Taylor or Laurent series in the variable `v` around the point `a`, containing terms through `(x - a)^n`. INPUT: - ``v`` - variable - ``a`` - number - ``n`` - integer EXAMPLES:: sage: var('x,k,n') (x, k, n) sage: taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6) -...
633bfa8986eb00c84d3329a7fc202dcbd0a6259c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/633bfa8986eb00c84d3329a7fc202dcbd0a6259c/functional.py
sage: import operator
def derivative(self, ex, operator): """ EXAMPLES::
a2648bce7d829c98198521873589084f0019ebd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a2648bce7d829c98198521873589084f0019ebd3/expression_conversions.py
sage: a = function('f', x).diff(x); a
sage: f = function('f') sage: a = f(x).diff(x); a
def derivative(self, ex, operator): """ EXAMPLES::
a2648bce7d829c98198521873589084f0019ebd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a2648bce7d829c98198521873589084f0019ebd3/expression_conversions.py
sage: b = function('f', x).diff(x).diff(x)
sage: b = f(x).diff(x, x)
def derivative(self, ex, operator): """ EXAMPLES::
a2648bce7d829c98198521873589084f0019ebd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a2648bce7d829c98198521873589084f0019ebd3/expression_conversions.py
args = ex.args()
args = ex.operands()
def derivative(self, ex, operator): """ EXAMPLES::
a2648bce7d829c98198521873589084f0019ebd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a2648bce7d829c98198521873589084f0019ebd3/expression_conversions.py
sage: P, = E.gens()
sage: P = E([0,-1])
sage: def naive_height(P):
1523650f8c44ebd1c01e5ada2c22749fbcc2122c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1523650f8c44ebd1c01e5ada2c22749fbcc2122c/ell_point.py
sage: def is_4regular(G): ... D = G.degree_sequence() ... return all(d == 4 for d in D) sage: is_4regular(G)
sage: G.is_regular(4)
sage: def is_4regular(G):
1f136b794113ab4131b630d092f3ffb71a488957 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1f136b794113ab4131b630d092f3ffb71a488957/graph_generators.py
sage: [ value, edges, [ setA, setB ]] = g.max_cut(vertices=True) sage: value == 5*6
sage: [ value, edges, [ setA, setB ]] = g.max_cut(vertices=True) sage: value == 5*6
def max_cut(self, value_only=True, use_edge_labels=True, vertices=False, solver=None, verbose=0): r""" Returns a maximum edge cut of the graph. For more information, see the `Wikipedia article on cuts <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: (bsetA == setA and bsetB == setB ) or ((bsetA == setB and bsetB == setA ))
sage: (bsetA == setA and bsetB == setB ) or ((bsetA == setB and bsetB == setA ))
def max_cut(self, value_only=True, use_edge_labels=True, vertices=False, solver=None, verbose=0): r""" Returns a maximum edge cut of the graph. For more information, see the `Wikipedia article on cuts <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.max_cut()
sage: g.max_cut()
def max_cut(self, value_only=True, use_edge_labels=True, vertices=False, solver=None, verbose=0): r""" Returns a maximum edge cut of the graph. For more information, see the `Wikipedia article on cuts <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.flow(1,2)
sage: g.flow(1,2)
def flow(self, x, y, value_only=True, integer=False, use_edge_labels=True, vertex_bound=False, solver=None, verbose=0): r""" Returns a maximum flow in the graph from ``x`` to ``y`` represented by an optimal valuation of the edges. For more information, see the `Wikipedia article on maximum flow <http://en.wikipedia.org...
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: b.flow(('00',1),('00',2))
sage: b.flow(('00',1),('00',2))
def flow(self, x, y, value_only=True, integer=False, use_edge_labels=True, vertex_bound=False, solver=None, verbose=0): r""" Returns a maximum flow in the graph from ``x`` to ``y`` represented by an optimal valuation of the edges. For more information, see the `Wikipedia article on maximum flow <http://en.wikipedia.org...
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.dominating_set(value_only=True)
sage: g.dominating_set(value_only=True)
def dominating_set(self, independent=False, value_only=False, solver=None, verbose=0): r""" Returns a minimum dominating set of the graph represented by the list of its vertices. For more information, see the `Wikipedia article on dominating sets <http://en.wikipedia.org/wiki/Dominating_set>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: len(g.dominating_set())
sage: len(g.dominating_set())
def dominating_set(self, independent=False, value_only=False, solver=None, verbose=0): r""" Returns a minimum dominating set of the graph represented by the list of its vertices. For more information, see the `Wikipedia article on dominating sets <http://en.wikipedia.org/wiki/Dominating_set>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: len(g.dominating_set(independent=True))
sage: len(g.dominating_set(independent=True))
def dominating_set(self, independent=False, value_only=False, solver=None, verbose=0): r""" Returns a minimum dominating set of the graph represented by the list of its vertices. For more information, see the `Wikipedia article on dominating sets <http://en.wikipedia.org/wiki/Dominating_set>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.edge_connectivity()
sage: g.edge_connectivity()
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: [ value, edges, [ setA, setB ]] = g.edge_connectivity(vertices=True) sage: print value
sage: [ value, edges, [ setA, setB ]] = g.edge_connectivity(vertices=True) sage: print value
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: len(setA) == 1 or len(setB) == 1
sage: len(setA) == 1 or len(setB) == 1
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: cut.add_edges(edges) sage: cut.is_isomorphic(graphs.StarGraph(4))
sage: cut.add_edges(edges) sage: cut.is_isomorphic(graphs.StarGraph(4))
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: min(g.degree()) >= g.edge_connectivity()
sage: min(g.degree()) >= g.edge_connectivity()
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: minimum = min([l for u,v,l in tree.edge_iterator()]) sage: [value, [(u,v,l)]] = tree.edge_connectivity(value_only=False, use_edge_labels=True) sage: l == minimum
sage: minimum = min([l for u,v,l in tree.edge_iterator()]) sage: [value, [(u,v,l)]] = tree.edge_connectivity(value_only=False, use_edge_labels=True) sage: l == minimum
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.vertex_connectivity()
sage: g.vertex_connectivity()
def vertex_connectivity(self, value_only=True, sets=False, solver=None, verbose=0): r""" Returns the vertex connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: [value, cut, [ setA, setB ]] = g.vertex_connectivity(sets=True) sage: len(setA) == 1 or len(setB) == 1
sage: [value, cut, [ setA, setB ]] = g.vertex_connectivity(sets=True) sage: len(setA) == 1 or len(setB) == 1
def vertex_connectivity(self, value_only=True, sets=False, solver=None, verbose=0): r""" Returns the vertex connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: [val, [cut_vertex]] = tree.vertex_connectivity(value_only=False) sage: tree.degree(cut_vertex) > 1
sage: [val, [cut_vertex]] = tree.vertex_connectivity(value_only=False) sage: tree.degree(cut_vertex) > 1
def vertex_connectivity(self, value_only=True, sets=False, solver=None, verbose=0): r""" Returns the vertex connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.layout_graphviz()
sage: g.layout_graphviz()
def layout_graphviz(self, dim = 2, prog = 'dot', **options): """ Calls ``graphviz`` to compute a layout of the vertices of this graph.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.plot(layout = "graphviz")
sage: g.plot(layout = "graphviz")
def layout_graphviz(self, dim = 2, prog = 'dot', **options): """ Calls ``graphviz`` to compute a layout of the vertices of this graph.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.plot(layout = "graphviz", prog = "dot") sage: g.plot(layout = "graphviz", prog = "neato") sage: g.plot(layout = "graphviz", prog = "twopi") sage: g.plot(layout = "graphviz", prog = "fdp")
sage: g.plot(layout = "graphviz", prog = "dot") sage: g.plot(layout = "graphviz", prog = "neato") sage: g.plot(layout = "graphviz", prog = "twopi") sage: g.plot(layout = "graphviz", prog = "fdp")
def layout_graphviz(self, dim = 2, prog = 'dot', **options): """ Calls ``graphviz`` to compute a layout of the vertices of this graph.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
sage: g.plot(layout = "graphviz", prog = "circo")
sage: g.plot(layout = "graphviz", prog = "circo")
def layout_graphviz(self, dim = 2, prog = 'dot', **options): """ Calls ``graphviz`` to compute a layout of the vertices of this graph.
08b3ef8c500132f63d2dfd7371451a85a1a6987d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/08b3ef8c500132f63d2dfd7371451a85a1a6987d/generic_graph.py
Please note that for more extensive use of R's plotting capabilities (such as the lattices package), it is advisable to either use an interactive plotting device or to use the notebook. The following examples are not tested, because they differ depending on operating system.
Please note that for more extensive use of R's plotting capabilities (such as the lattices package), it is advisable to either use an interactive plotting device or to use the notebook. The following examples are not tested, because they differ depending on operating system::
def plot(self, *args, **kwds): """ The R plot function. Type r.help('plot') for much more extensive documentation about this function. See also below for a brief introduction to more plotting with R.
2a794c3e48c54273fb8f797019c7148b5b2e9257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a794c3e48c54273fb8f797019c7148b5b2e9257/r.py
In the notebook, one can use r.png() to open the device, but would need to use the following since R lattice graphics do not automatically print away from the command line.
In the notebook, one can use r.png() to open the device, but would need to use the following since R lattice graphics do not automatically print away from the command line::
def plot(self, *args, **kwds): """ The R plot function. Type r.help('plot') for much more extensive documentation about this function. See also below for a brief introduction to more plotting with R.
2a794c3e48c54273fb8f797019c7148b5b2e9257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2a794c3e48c54273fb8f797019c7148b5b2e9257/r.py
if self.ambient_vector_space() != other.ambient_vector_space(): return False if other == other.ambient_vector_space(): return True
try: if self.ambient_vector_space() != other.ambient_vector_space(): return False if other == other.ambient_vector_space(): return True except AttributeError: pass
def is_submodule(self, other): """ Return True if self is a submodule of other.
811da8d08981b12bc693926ac82e0321a72615db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/811da8d08981b12bc693926ac82e0321a72615db/free_module.py
"""
r"""
def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices.
51ff5d9a7fa20a4153bbc1b635dc35c50c555d89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/51ff5d9a7fa20a4153bbc1b635dc35c50c555d89/graph_generators.py
Let q be an integer and let m_1,m_2,...m_k be a set of positive integers. Let n=q+m_1+...+m_k. The Fuzzy Ball graph with partition m_1,m_2,...,m_k and q extra vertices is the graph constructed from the graph G=K_n by attaching, for each i=1,2,...,k, a new vertex a_i to m_i distinct vertices of G. For given positive ...
Let `q` be an integer and let `m_1,m_2,...,m_k` be a set of positive integers. Let `n=q+m_1+...+m_k`. The Fuzzy Ball graph with partition `m_1,m_2,...,m_k` and `q` extra vertices is the graph constructed from the graph `G=K_n` by attaching, for each `i=1,2,...,k`, a new vertex `a_i` to `m_i` distinct vertices of `G`....
def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices.
51ff5d9a7fa20a4153bbc1b635dc35c50c555d89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/51ff5d9a7fa20a4153bbc1b635dc35c50c555d89/graph_generators.py
Pick positive integers m and k and a nonnegative integer q. All the FuzzyBallGraphs constructed from partitions of m with k parts should be cospectral with respect to the normalized
Pick positive integers `m` and `k` and a nonnegative integer `q`. All the FuzzyBallGraphs constructed from partitions of `m` with `k` parts should be cospectral with respect to the normalized
def FuzzyBallGraph(self, partition, q): """ Construct a Fuzzy Ball graph with the integer partition ``partition`` and ``q`` extra vertices.
51ff5d9a7fa20a4153bbc1b635dc35c50c555d89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/51ff5d9a7fa20a4153bbc1b635dc35c50c555d89/graph_generators.py
"""
r"""
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
If the option extend is set to True (default), then eigenvalues in extensions of the base field are considered.
INPUT: - ``extend`` -- boolean (default: True) decides if base field extensions should be considered or not.
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
We compute the eigenvalues of an endomorphism of QQ^3::
We compute the eigenvalues of an endomorphism of `\QQ^3`::
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
Note the effect of the extend option::
Note the effect of the ``extend`` option::
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
def eigenvalues(self,extend=True): """ Returns a list with the eigenvalues of the endomorphism of vector spaces.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
- extend (True) decides if base field extensions should be considered or not.
- ``extend`` -- boolean (default: True) decides if base field extensions should be considered or not.
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
A sequence of tuples. Each tuple contains an eigenvalue, a list with a basis of the corresponding subspace of eigenvectors, and the algebraic multiplicity of the eigenvalue.
A sequence of tuples. Each tuple contains an eigenvalue, a sequence with a basis of the corresponding subspace of eigenvectors, and the algebraic multiplicity of the eigenvalue.
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (-1*I, [(1, 1*I, 0, -0.571428571428572? + 2.428571428571429?*I)], 1), (1*I, [(1, -1*I, 0, -0.571428571428572? - 2.428571428571429?*I)], 1)]
[(3, [ (0, 0, 1, -6/7) ], 1), (-1*I, [ (1, 1*I, 0, -0.571428571428572? + 2.428571428571429?*I) ], 1), (1*I, [ (1, -1*I, 0, -0.571428571428572? - 2.428571428571429?*I) ], 1)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1)]
[(3, [ (0, 0, 1, -6/7) ], 1)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (2, [(0, 1, 0, 17/7)], 2)]
[(3, [ (0, 0, 1, -6/7) ], 1), (2, [ (0, 1, 0, 17/7) ], 2)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
[(3, [(0, 0, 1, -6/7)], 1), (2, [(0, 1, 0, 17/7)], 2)]
[(3, [ (0, 0, 1, -6/7) ], 1), (2, [ (0, 1, 0, 17/7) ], 2)]
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
svectors=map(lambda j: V(j * V.basis_matrix()),i[1]) resu.append(tuple([i[0],svectors,i[2]]))
svectors=Sequence(map(lambda j: V(j * V.basis_matrix()),i[1]), cr=True) resu.append((i[0],svectors,i[2]))
def eigenvectors(self,extend=True): """ Computes the subspace of eigenvectors of a given eigenvalue.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
- ``var`` - string (default: 'x') a variable
- ``var`` - string (default: 'x') a variable name
def minpoly(self,var='x'): """ Computes the minimal polynomial.
008040e2ed037beda080180d1d6162300fff207d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/008040e2ed037beda080180d1d6162300fff207d/free_module_morphism.py
sgi = set(range(fan.nrays()))
sgi = set(range(fan.ngenerating_cones()))
def star_generator_indices(self): r""" Return indices of generating cones of the "ambient fan" containing ``self``.
7c2371cbb7e6b1f6dfe45fdeadaca434539ab071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7c2371cbb7e6b1f6dfe45fdeadaca434539ab071/fan.py
SL(n); you also some information about representations of E6
SL(n); you also lose some information about representations of E6
def WeylCharacterRing(ct, base_ring=ZZ, prefix=None, cache=False, style="lattice"): r""" A class for rings of Weyl characters. The Weyl character is a character of a semisimple (or reductive) Lie group or algebra. They form a ring, in which the addition and multiplication correspond to direct sum and tensor product of ...
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
"automorphic", "symmetric", "extended", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted.
"automorphic", "symmetric", "extended", "orthogonal_sum", "tensor", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted.
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
SYMMETRIC TYPE. Related to the automorphic type, when either the Dynkin diagram or the extended diagram has a symmetry there is a branching rule to the subalgebra (or subgroup) of invariants under the automorphism. Use rule="symmetric".
SYMMETRIC TYPE. Related to the automorphic type, when G admits an outer automorphism (usually of degree 2) we may consider the branching rule to the isotropy subgroup H. In many cases the Dynkin diagram of H can be obtained by folding the Dynkin diagram of G. For such isotropy subgroups use rule="symmetric".
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
Using rule="extended" you can get any branching rule SO(n) => SO(a) x SO(b) x SO(c) x ... where n = a+b+c+ ... Sp(2n) => Sp(2a) x Sp(2b) x Sp(2c) x ... where n = a+b+c+ ... where O(a) = ['D',r] (a=2r) or ['B',r] (a=2r+1) and Sp(2r)=['C',r].
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Will...
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
elif rule == "extended": if not s == r:
elif rule == "extended" or rule == "orthogonal_sum": if rule == "extended" and not s == r:
def rule(x) : x[len(x)-1] = -x[len(x)-1]; return x
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
if x == 0:
if x == 0 and not x in self._space:
def __call__(self, *args): """ Coerces the element into the ring.
1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1eccddf4fcbebe14ce1d16293707d2b8b0ee94b8/weyl_characters.py
K = self.base_ring()._magma_init_(magma)
K = magma(self.base_ring())
def _magma_init_(self, magma): r""" EXAMPLES: We first coerce a square matrix.
4371b59167340f70b3a65399fef9b6c7900996cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4371b59167340f70b3a65399fef9b6c7900996cd/matrix_space.py
s = 'MatrixAlgebra(%s,%s)'%(K, self.__nrows)
s = 'MatrixAlgebra(%s,%s)'%(K.name(), self.__nrows)
def _magma_init_(self, magma): r""" EXAMPLES: We first coerce a square matrix.
4371b59167340f70b3a65399fef9b6c7900996cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4371b59167340f70b3a65399fef9b6c7900996cd/matrix_space.py
s = 'RMatrixSpace(%s,%s,%s)'%(K, self.__nrows, self.__ncols)
s = 'RMatrixSpace(%s,%s,%s)'%(K.name(), self.__nrows, self.__ncols)
def _magma_init_(self, magma): r""" EXAMPLES: We first coerce a square matrix.
4371b59167340f70b3a65399fef9b6c7900996cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4371b59167340f70b3a65399fef9b6c7900996cd/matrix_space.py
A stochastic matrix is a matrix such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stochastic ( there are conditions both on the rows and on the columns ).
A stochastic matrix is a matrix with nonnegative real entries such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stochastic ( there are conditions both on the rows and on the columns ).
def bistochastic_as_sum_of_permutations(M, check = True): r""" Returns the positive sum of permutations corresponding to the bistochastic matrix. A stochastic matrix is a matrix such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stoch...
3d841b41396ffdcc7218e64fcbb4650c74bb529b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3d841b41396ffdcc7218e64fcbb4650c74bb529b/permutation.py
- ``check`` (boolean) -- set to ``True`` (default) to checl
- ``check`` (boolean) -- set to ``True`` (default) to check
def bistochastic_as_sum_of_permutations(M, check = True): r""" Returns the positive sum of permutations corresponding to the bistochastic matrix. A stochastic matrix is a matrix such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stoch...
3d841b41396ffdcc7218e64fcbb4650c74bb529b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3d841b41396ffdcc7218e64fcbb4650c74bb529b/permutation.py
An exception is raised when the matrix is not bistochastic::
An exception is raised when the matrix is not positive and bistochastic::
def bistochastic_as_sum_of_permutations(M, check = True): r""" Returns the positive sum of permutations corresponding to the bistochastic matrix. A stochastic matrix is a matrix such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stoch...
3d841b41396ffdcc7218e64fcbb4650c74bb529b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3d841b41396ffdcc7218e64fcbb4650c74bb529b/permutation.py
from sage.rings.real_mpfr import RR
from sage.rings.all import RR
def bistochastic_as_sum_of_permutations(M, check = True): r""" Returns the positive sum of permutations corresponding to the bistochastic matrix. A stochastic matrix is a matrix such that the sum of the elements of any row is equal to 1. A bistochastic matrix is a stochastic matrix whose transpose matrix is also stoch...
3d841b41396ffdcc7218e64fcbb4650c74bb529b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/3d841b41396ffdcc7218e64fcbb4650c74bb529b/permutation.py
depends = ["sage/libs/mwrank/wrap.h"],
depends = ["sage/libs/mwrank/wrap.h"] + [ SAGE_INC + "eclib/" + h for h in ["curve.h","egr.h","descent.h","points.h","isogs.h", "marith.h","htconst.h","interface.h"] ],
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
970aa08d4456e1607da4c3f1d5fd3f359c3811e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/970aa08d4456e1607da4c3f1d5fd3f359c3811e9/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","homspace.h","mat.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
970aa08d4456e1607da4c3f1d5fd3f359c3811e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/970aa08d4456e1607da4c3f1d5fd3f359c3811e9/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","homspace.h","mat.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
970aa08d4456e1607da4c3f1d5fd3f359c3811e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/970aa08d4456e1607da4c3f1d5fd3f359c3811e9/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","xsplit.h","method.h", "oldforms.h","homspace.h","cperiods.h","newforms.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
970aa08d4456e1607da4c3f1d5fd3f359c3811e9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/970aa08d4456e1607da4c3f1d5fd3f359c3811e9/module_list.py
the curve, then `|h(P) - \hat{h}(P)| \leq B`, where `h(P)` is
the curve, then `h(P) \le \hat{h}(P) + B`, where `h(P)` is
def CPS_height_bound(self): r""" Return the Cremona-Prickett-Siksek height bound. This is a floating point number B such that if P is a rational point on the curve, then `|h(P) - \hat{h}(P)| \leq B`, where `h(P)` is the naive logarithmic height of `P` and `\hat{h}(P)` is the canonical height.
d7035e0e7423888e50614f31ed14f097186811a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/d7035e0e7423888e50614f31ed14f097186811a5/ell_rational_field.py
- ``e`` - A Composition
- ``e`` - a composition
def LyndonWords(e=None, k=None): """ Returns the combinatorial class of Lyndon words. A Lyndon word `w` is a word that is lexicographically less than all of its rotations. Equivalently, whenever `w` is split into two non-empty substrings, `w` is lexicographically less than the right substring. INPUT: - no input at ...
e573cf391fa693431822cb4ca3180ddfee132119 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e573cf391fa693431822cb4ca3180ddfee132119/lyndon_word.py
A combinatorial class of Lyndon words
A combinatorial class of Lyndon words.
def LyndonWords(e=None, k=None): """ Returns the combinatorial class of Lyndon words. A Lyndon word `w` is a word that is lexicographically less than all of its rotations. Equivalently, whenever `w` is split into two non-empty substrings, `w` is lexicographically less than the right substring. INPUT: - no input at ...
e573cf391fa693431822cb4ca3180ddfee132119 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e573cf391fa693431822cb4ca3180ddfee132119/lyndon_word.py
verification that the input data represent a lyndon word.
verification that the input data represent a Lyndon word.
def __init__(self, data, check=True): r""" Construction of a Lyndon word.
e573cf391fa693431822cb4ca3180ddfee132119 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e573cf391fa693431822cb4ca3180ddfee132119/lyndon_word.py
a lyndon word
A Lyndon word.
def __init__(self, data, check=True): r""" Construction of a Lyndon word.
e573cf391fa693431822cb4ca3180ddfee132119 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/e573cf391fa693431822cb4ca3180ddfee132119/lyndon_word.py
if not principal_flag: pi = K.uniformizer(P, 'negative') pie = pi a1 /= pie pie *= pi a2 /= pie pie *= pi a3 /= pie pie *= pi a4 /= pie pie *= pi pie *= pi a6 /= pie
if pi_neg is None: if principal_flag: pi_neg = pi else: pi_neg = K.uniformizer(P, 'negative') pi_neg2 = pi_neg*pi_neg pi_neg3 = pi_neg*pi_neg2 pi_neg4 = pi_neg*pi_neg3 pi_neg6 = pi_neg4*pi_neg2 a1 /= pi_neg a2 /= pi_neg2 a3 /= pi_neg3 a4 /= pi_neg4 a6 /= pi_neg6
def _pcubicroots(b, c, d): r""" Local function returning the number of roots of `x^3 + b*x^2 + c*x + d` modulo `P`, counting multiplicities """ return sum([rr[1] for rr in PolynomialRing(F, 'x')([d, c, b, 1]).roots()],0)
1d482bddbff1aa4c482b4265496b568c4c09440b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1d482bddbff1aa4c482b4265496b568c4c09440b/ell_local_data.py
"""
TESTS:: sage: P = PolynomialRing(QQ, 0, '') sage: P(5).univariate_polynomial() 5 """ if self.parent().ngens() == 0: if R is None: return self.base_ring()(self) else: return R(self)
def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial.
806c49cf37267795d7961f587f1d55bbd12e0b3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/806c49cf37267795d7961f587f1d55bbd12e0b3e/multi_polynomial_element.py
if self == 0: raise ArithmeticError, "Prime factorization of 0 not defined." if R.ngens() == 0: base_ring = self.base_ring() if base_ring.is_field(): return Factorization([],unit=self.base_ring()(self)) else: F = base_ring(self).factor() return Factorization([(R(f),m) for f,m in F], unit=F.unit())
def factor(self, proof=True): r""" Compute the irreducible factorization of this polynomial.
806c49cf37267795d7961f587f1d55bbd12e0b3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/806c49cf37267795d7961f587f1d55bbd12e0b3e/multi_polynomial_element.py
return 0
return ZZ(0)
def _eval_(self, x): """
5eb8f726f2685c0308d3cde210e956ae04159004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5eb8f726f2685c0308d3cde210e956ae04159004/generalized.py
return 1
return ZZ(1)
def _eval_(self, x): """
5eb8f726f2685c0308d3cde210e956ae04159004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5eb8f726f2685c0308d3cde210e956ae04159004/generalized.py
return -1
return ZZ(-1)
def _eval_(self, x): """
5eb8f726f2685c0308d3cde210e956ae04159004 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/5eb8f726f2685c0308d3cde210e956ae04159004/generalized.py
We can plot with this transform. Remember that the independent variable is the radius, and the dependent variables are the
We can plot with this transform. Remember that the dependent variable is the radius, and the independent variables are the
def transform(self, **kwds): """ EXAMPLE::
0bc33ed38d1e45e2565fa50f460f2482d9632f69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0bc33ed38d1e45e2565fa50f460f2482d9632f69/plot3d.py
We can plot with this transform. Remember that the independent variable is the height, and the dependent variables are the
We can plot with this transform. Remember that the dependent variable is the height, and the independent variables are the
def transform(self, radius=None, azimuth=None, inclination=None): """ A spherical coordinates transform.
0bc33ed38d1e45e2565fa50f460f2482d9632f69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/0bc33ed38d1e45e2565fa50f460f2482d9632f69/plot3d.py
R = self.base_ring()[str(self.variables()[0])]
if self.is_constant(): R = self.base_ring()[self.parent().variable_names()[0]] else: R = self.base_ring()[str(self.variables()[0])]
def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial.
a14d745dddb1e9a5223186e1653c7d465e6c9639 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a14d745dddb1e9a5223186e1653c7d465e6c9639/multi_polynomial_element.py
This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S NOTE: This function assumes S is a list of prime ideals, it does not check this. This function will fail if S is not a list of prime ideals.
Return the part of this fractional ideal which is coprime to the prime ideals in the list ``S``. .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of prime ideals.
def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
- "self" - fractional ideal - "S" - a list of prime ideals
- `S` - a list of prime ideals
def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
- an ideal coprime to the ideals in S EXAMPLES::
A fractional ideal coprime to the primes in `S`, whose prime factorization is that of ``self`` withe the primes in `S` removed. EXAMPLES::
def prime_to_S_part(self,S): r""" This function returns the part of the fractional ideal self which is coprime to the prime ideals in the list S
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
r''' Returns True if the ideal is an unit with respect to the list of primes S. INPUT:: - `S` - a list of prime ideals (not checked if they are indeed prime). OUTPUT:: True, if the ideal is `S`-unit. False, otherwise.
r""" Return True if this fractional ideal is a unit with respect to the list of primes ``S``. INPUT: - `S` - a list of prime ideals (not checked if they are indeed prime). .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of pr...
def is_S_unit(self,S): r''' Returns True if the ideal is an unit with respect to the
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
'''
"""
def is_S_unit(self,S): r''' Returns True if the ideal is an unit with respect to the
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
r''' Returns True if the ideal is an unit with respect to the list of primes S. INPUT:: - `S` - a list of prime ideals (not checked if they are indeed prime). OUTPUT:: True, if the ideal is `S`-integral. False, otherwise.
r""" Return True if this fractional ideal is integral with respect to the list of primes ``S``. INPUT: - `S` - a list of prime ideals (not checked if they are indeed prime). .. note:: This function assumes that `S` is a list of prime ideals, but does not check this. This function will fail if `S` is not a list of ...
def is_S_integral(self,S): r''' Returns True if the ideal is an unit with respect to the
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
'''
"""
def is_S_integral(self,S): r''' Returns True if the ideal is an unit with respect to the
dd2f47f6f06398191d8dad0bb17d8c0e73073d7d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/dd2f47f6f06398191d8dad0bb17d8c0e73073d7d/number_field_ideal.py
sage: S == loads(dumps(S)) True
sage: TestSuite(S).run()
def __init__(self, s): """ TESTS::
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
element_class = Set_generic
def _element_constructor_(self, x): """ TESTS:: sage: S3 = Subsets(3); S3([1,2]) {1, 2} sage: S3([0,1,2]) Traceback (most recent call last): ... ValueError: [0, 1, 2] not in Subsets of {1, 2, 3} """ return Set(x) element_class = Set_object_enumerated
def unrank(self, r): """ Returns the subset of s that has rank k.
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
sage: S == loads(dumps(S)) True
sage: TestSuite(S).run()
def __init__(self, s, k): """ TESTS::
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
element_class = Set_generic
def _element_constructor_(self, x): """ TESTS:: sage: S32 = Subsets(3,2); S32([1,2]) {1, 2} sage: S32([0,1,2]) Traceback (most recent call last): ... ValueError: [0, 1, 2] not in Subsets of {1, 2, 3} of size 2 """ return Set(x) element_class = Set_object_enumerated
def unrank(self, r): """ Returns the subset of s that has rank k.
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
sage: S == loads(dumps(S)) True
sage: TestSuite(S).run()
def unrank(self, r): """ Returns the subset of s that has rank k.
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
sage: S == loads(dumps(S)) True
sage: TestSuite(S).run()
def __iter__(self): """ Iterates through the subsets of the multiset ``self._s``. Note that each subset is represented by a list of its elements rather than a set since we can have multiplicities (no multiset data structure yet in sage).
6b51027ab87b59ff42d9298c38dd0800c5b1d7a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/6b51027ab87b59ff42d9298c38dd0800c5b1d7a8/subset.py
raise ValueError, "%s is not a valid perfect matching: all elements of the list must be pairs"%p
raise ValueError, ("%s is not a valid perfect matching:\n" "all elements of the list must be pairs"%p)
def __classcall_private__(cls,p): r""" This function tries to recognize the input (it can be either a list or a tuple of pairs, or a fix-point free involution given as a list or as a permutation), constructs the parent (enumerated set of PerfectMatchings of the ground set) and calls the __init__ function to construct o...
506975ec24f2b785477b1f0c809db5be7b8d366e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/506975ec24f2b785477b1f0c809db5be7b8d366e/perfect_matching.py