rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
Either `QQ` or `RDF`. Raises `TypeError` if `other` is not a
Either `\QQ` or `RDF`. Raises ``TypeError`` if ``other`` is not a
def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`.
6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0/polyhedra.py
NOTE: "Real" numbers in sage are not necessarily elements of `RDF`. For example, the literal `1.0` is not.
.. NOTE:: "Real" numbers in sage are not necessarily elements of `RDF`. For example, the literal `1.0` is not.
def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`.
6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0/polyhedra.py
raise TypeError
raise TypeError("cannot determine field from %s!" % other)
def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`.
6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0/polyhedra.py
- is isomorphic to self, - is invariant in the isomorphism class.
- is isomorphic to self, - is invariant in the isomorphism class.
def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c`` a...
9064872aab5b5a6cb8caf09bda6bd7693f964168 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9064872aab5b5a6cb8caf09bda6bd7693f964168/generic_graph.py
- ``G_c == H_c`` - ``G_c.adjacency_matrix() == H_c.adjacency_matrix()`` - ``G_c.graph6_string() == H_c.graph6_string()``
- ``G_c == H_c`` - ``G_c.adjacency_matrix() == H_c.adjacency_matrix()`` - ``G_c.graph6_string() == H_c.graph6_string()``
def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c`` a...
9064872aab5b5a6cb8caf09bda6bd7693f964168 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9064872aab5b5a6cb8caf09bda6bd7693f964168/generic_graph.py
""" Enumerates projective, rational points on scheme X of height up to bound B.
r""" Enumerates projective, rational points on scheme ``X`` of height up to bound ``B``.
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound
- ``X`` - a scheme or set of abstract rational points of a scheme; - ``B`` - a positive integer bound.
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- a list containing the projective points of X of height up to B, sorted.
- a list containing the projective points of ``X`` of height up to ``B``, sorted.
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
[(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 :...
[(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 :...
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
of projective space to see if they lie on X.
of projective space to see if they lie on ``X``.
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
John Cremona and Charlie Turner (06-2010)
- John Cremona and Charlie Turner (06-2010)
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
n = X.codomain().ambient_space().ngens()-1 zero=tuple([0 for _ in range(n+1)]) pts =[] for c in cartesian_product_iterator([srange(-B,B+1) for _ in range(n+1)]): if gcd(c)==1 and c>zero:
n = X.codomain().ambient_space().ngens() zero = (0,) * n pts = [] for c in cartesian_product_iterator([srange(-B,B+1) for _ in range(n)]): if gcd(c) == 1 and c > zero:
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
except:
except TypeError:
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. E...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B.
Enumerates affine rational points on scheme ``X`` (defined over `\QQ`) up to bound ``B``.
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound
- ``X`` - a scheme or set of abstract rational points of a scheme; - ``B`` - a positive integer bound.
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- a list containing the affine points of X of height up to B, sorted.
- a list containing the affine points of ``X`` of height up to ``B``, sorted.
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
sage: A.<x,y,z> = AffineSpace(3,QQ)
sage: A.<x,y,z> = AffineSpace(3,QQ)
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
AUTHOR: David R. Kohel <kohel@maths.usyd.edu.au> (small adjustments by Charlie Turner 06-2010)
AUTHORS: - David R. Kohel <kohel@maths.usyd.edu.au>: original version. - Charlie Turner (06-2010): small adjustments.
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
Q = [ k+1 for k in range(B) ] R = [ 0 ] + [ s*k for k in range(1,B+1) for s in [1,-1] ]
Q = range(1, B + 1) R = [ 0 ] + [ s*k for k in range(1, B+1) for s in [1, -1] ]
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
P = [ 0 for _ in range(n) ]
P = [0] * n
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
except:
except TypeError:
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
[ iters[j].next() for j in range(n) ]
for it in iters: it.next()
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
m = m.gcd(a) P[i] = a for b in Q: if m.gcd(b) == 1: try: pts.append(X([ num/b for num in P ])) except: pass i = 0 m = ZZ(0)
def enum_affine_rational_field(X,B): """ Enumerates affine rational points on scheme X (defined over `\QQ`) up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme - ``B`` - a positive integer bound OUTPUT: - a list containing the affine points of X of height up to B, sorted. EXAM...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
Enumerates projective points on scheme X defined over a finite field
Enumerates projective points on scheme ``X`` defined over a finite field.
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme
- ``X`` - a scheme defined over a finite field or a set of abstract rational points of such a scheme.
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
- a list containing the projective points of X over the finite field, sorted
- a list containing the projective points of ``X`` over the finite field, sorted.
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
[(0 : 0 : 1), (0 : 1 : 1), (0 : 2 : 1), (1 : 1 : 0), (a + 1 : 2*a : 1),
[(0 : 0 : 1), (0 : 1 : 1), (0 : 2 : 1), (1 : 1 : 0), (a + 1 : 2*a : 1),
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
NOTE: Warning:if X given as input is defined over an infinite field then this code will not finish! AUTHORS: John Cremona and Charlie Turner (06-2010)
.. WARNING:: If ``X`` is defined over an infinite field, this code will not finish! AUTHORS: - John Cremona and Charlie Turner (06-2010).
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
except:
except TypeError:
def enum_projective_finite_field(X): """ Enumerates projective points on scheme X defined over a finite field INPUT: - ``X`` - a scheme defined over a finite field or set of abstract rational points of such a scheme OUTPUT: - a list containing the projective points of X over the finite field, sorted EXAMPLES:: s...
8548f34244013d468d2344ef95101a9ce0e899a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8548f34244013d468d2344ef95101a9ce0e899a4/rational_point.py
EXAMPLES:
EXAMPLES::
def __call__(self, im_gens, check=True): """ Return the homomorphism defined by images of generators.
95c60479dc98df88e992df019324d61382703db4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/95c60479dc98df88e992df019324d61382703db4/homset.py
return QuotientRingElement(self.parent(), self.__rep + right.__rep)
return self.parent()(self.__rep + right.__rep)
def _add_(self, right): """ Add quotient ring element ``self`` to another quotient ring element, ``right``. If the quotient is `R/I`, the addition is carried out in `R` and then reduced to `R/I`.
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(), self.__rep - right.__rep)
return self.parent()(self.__rep - right.__rep)
def _sub_(self, right): """ Subtract quotient ring element ``right`` from quotient ring element ``self``. If the quotient is `R/I`, the subtraction is carried out in `R` and then reduced to `R/I`.
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(), self.__rep * right.__rep)
return self.parent()(self.__rep * right.__rep)
def _mul_(self, right): """ Multiply quotient ring element ``self`` by another quotient ring element, ``right``. If the quotient is `R/I`, the multiplication is carried out in `R` and then reduced to `R/I`.
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(), -self.__rep)
return self.parent()(-self.__rep)
def __neg__(self): """ EXAMPLES:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: -a # indirect doctest -a sage: -(a+b) -a - b """ return QuotientRingElement(self.parent(), -self.__rep)
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(), inv)
return self.parent()(inv)
def __invert__(self): """ EXAMPLES:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: ~S(2/3) 3/2
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(),self.__rep.lt())
return self.parent()(self.__rep.lt())
def lt(self): """ Return the leading term of this quotient ring element. EXAMPLE:: sage: R.<x,y,z>=PolynomialRing(GF(7),3,order='lex') sage: I = sage.rings.ideal.FieldIdeal(R) sage: Q = R.quo( I ) sage: f = Q( z*y + 2*x ) sage: f.lt() 2*xbar
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return QuotientRingElement(self.parent(),self.__rep.lm())
return self.parent()(self.__rep.lm())
def lm(self): """ Return the leading monomial of this quotient ring element. EXAMPLE:: sage: R.<x,y,z>=PolynomialRing(GF(7),3,order='lex') sage: I = sage.rings.ideal.FieldIdeal(R) sage: Q = R.quo( I ) sage: f = Q( z*y + 2*x ) sage: f.lm() xbar TESTS:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class...
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return tuple([QuotientRingElement(self.parent(),v) for v in self.__rep.variables()])
return tuple([self.parent()(v) for v in self.__rep.variables()])
def variables(self): """ EXAMPLES:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: a.variables() (a,) sage: b.variables() (b,) sage: s = a^2 + b^2 + 1; s 1 sage: s.variables() () sage: (a+b).variables() (a, b) """ return tuple([QuotientRin...
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
return [QuotientRingElement(self.parent(),m) for m in self.__rep.monomials()]
return [self.parent()(m) for m in self.__rep.monomials()]
def monomials(self): """ EXAMPLES:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: a.monomials() [a] sage: (a+a*b).monomials() [a*b, a] """ return [QuotientRingElement(self.parent(),m) for m in self.__rep.monomials()]
5150cfd7bff51425dd7dea453e4b7c0b0f851e0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5150cfd7bff51425dd7dea453e4b7c0b0f851e0a/quotient_ring_element.py
X = list(X)
return Set_object_enumerated(list(X))
def Set(X): r""" Create the underlying set of $X$. If $X$ is a list, tuple, Python set, or ``X.is_finite()`` is true, this returns a wrapper around Python's enumerated immutable frozenset type with extra functionality. Otherwise it returns a more formal wrapper. If you need the functionality of mutable sets, use Pyt...
364fb40eec340f49072670ff78af331e0b523b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/364fb40eec340f49072670ff78af331e0b523b16/set.py
A.append(chr(ascii_integer(b[8*i : 8*(i+1)])))
A.append(chr(ascii_integer(b[8*i: 8*(i+1)])))
def bin_to_ascii(B): r""" Return the ASCII representation of the binary string ``B``. INPUT: - ``B`` -- a non-empty binary string or a non-empty list of bits. The number of bits in ``B`` must be a multiple of 8. OUTPUT: - The ASCII string corresponding to ``B``. ALGORITHM: Consider a block of bits `B = b_0 b_1 \c...
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
bug reported in trac
Bug reported in trac
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
import sage.rings.integer n = sage.rings.integer.Integer(n)
n = Integer(n)
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
e = L[0][1]
e = L[0][1]
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
if e < 3: e = e-1 else: e = e-2 t.append(1<<e)
if e < 3: e = e - 1 else: e = e - 2 t.append(1 << e)
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
t += [ p**(k-1)*(p-1) for p,k in L ]
t += [p**(k - 1) * (p - 1) for p, k in L]
sage: def my_carmichael(n):
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
return map(lambda x: int(x), list(n.binary()[-k:]))
return map(int, list(n.binary()[-k:]))
def least_significant_bits(n, k): r""" Return the ``k`` least significant bits of ``n``. INPUT: - ``n`` -- an integer. - ``k`` -- a positive integer. OUTPUT: - The ``k`` least significant bits of the integer ``n``. If ``k=1``, then return the parity bit of the integer ``n``. Let `b` be the binary representation of...
e2afc15236de548daed970d2a6027441122878c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e2afc15236de548daed970d2a6027441122878c5/util.py
def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i...
def is_integral_domain(self, proof=True): r""" With ``proof`` equal to ``True`` (the default), this function may raise a ``NotImplementedError``. When ``proof`` is ``False``, if ``True`` is returned, then self is definitely an integral domain. If the function returns ``False``, then either self is not an integral do...
def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i...
3a0b55fb00691c840d0a3ab2771849c160e71b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3a0b55fb00691c840d0a3ab2771849c160e71b93/quotient_ring.py
sage: R.<a,b,c> = ZZ['a','b','c'] sage: I = R.ideal(a,b) sage: Q = R.quotient_ring(I)
sage: R.quo(x^2 - y^2).is_integral_domain(proof=False) False sage: R.<a,b,c> = ZZ[] sage: Q = R.quotient_ring([a, b])
def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i...
3a0b55fb00691c840d0a3ab2771849c160e71b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3a0b55fb00691c840d0a3ab2771849c160e71b93/quotient_ring.py
return self.defining_ideal.is_prime() except AttributeError: return False
return self.defining_ideal().is_prime()
def is_integral_domain(self, proof = True): r""" If this function returns ``True`` then self is definitely an integral domain. If it returns ``False``, then either self is definitely not an integral domain or this function was unable to determine whether or not self is an integral domain. Use ``self.defining_ideal().i...
3a0b55fb00691c840d0a3ab2771849c160e71b93 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3a0b55fb00691c840d0a3ab2771849c160e71b93/quotient_ring.py
- ``s`` (vertex) -- forces the source of the path. Set to ``None`` by default. - ``t`` (vertex) -- forces the destination of the path. Set to ``None`` by default. - ``weighted`` (boolean) -- whether the labels on the edges are to be considered as weights (a label set to ``None`` or ``{}`` being considered as a weight...
- ``s`` (vertex) -- forces the source of the path (the method then returns the longest path starting at ``s``). The argument is set to ``None`` by default, which means that no constraint is set upon the first vertex in the path. - ``t`` (vertex) -- forces the destination of the path (the method then returns the longes...
def longest_path(self, s=None, t=None, weighted=False, algorithm="MILP", solver=None, verbose=0): r""" Returns a longest path of ``self``.
2844860c71e96d19faf73b53215f4ac4a13b1f2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2844860c71e96d19faf73b53215f4ac4a13b1f2b/generic_graph.py
The length of a path is assumed to be the number of its edges, or the sum of their labels.
The length of a path is assumed to be the number of its edges, or the sum of their labels.
def longest_path(self, s=None, t=None, weighted=False, algorithm="MILP", solver=None, verbose=0): r""" Returns a longest path of ``self``.
2844860c71e96d19faf73b53215f4ac4a13b1f2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2844860c71e96d19faf73b53215f4ac4a13b1f2b/generic_graph.py
A subgraph of ``self`` corresponding to a (directed if ``self`` is directed) longest path. If ``weighted == True``, a pair ``weight, path`` is returned.
A subgraph of ``self`` corresponding to a (directed if ``self`` is directed) longest path. If ``weighted == True``, a pair ``weight, path`` is returned.
def longest_path(self, s=None, t=None, weighted=False, algorithm="MILP", solver=None, verbose=0): r""" Returns a longest path of ``self``.
2844860c71e96d19faf73b53215f4ac4a13b1f2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2844860c71e96d19faf73b53215f4ac4a13b1f2b/generic_graph.py
Mixed Integer Linear Programming. (This problem is known to be NP-Hard).
Mixed Integer Linear Programming. (This problem is known to be NP-Hard).
def longest_path(self, s=None, t=None, weighted=False, algorithm="MILP", solver=None, verbose=0): r""" Returns a longest path of ``self``.
2844860c71e96d19faf73b53215f4ac4a13b1f2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2844860c71e96d19faf73b53215f4ac4a13b1f2b/generic_graph.py
Let us compute longest paths on random graphs with random weights. Each time, we ensure the resulting graph is indeed a path::
Let us compute longest paths on random graphs with random weights. Each time, we ensure the resulting graph is indeed a path::
def longest_path(self, s=None, t=None, weighted=False, algorithm="MILP", solver=None, verbose=0): r""" Returns a longest path of ``self``.
2844860c71e96d19faf73b53215f4ac4a13b1f2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2844860c71e96d19faf73b53215f4ac4a13b1f2b/generic_graph.py
return []
return
def upgrade(): """ Download and build the latest version of Sage. You must have an internet connection. Also, you will have to restart Sage for the changes to take affect. This upgrades to the latest version of core packages (optional packages are not automatically upgraded). This will not work on systems that don't...
5340cd0a74f20685c91def5a2c7ec7252c8a4624 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5340cd0a74f20685c91def5a2c7ec7252c8a4624/package.py
""" from sage.rings.all import ZZ
Check if sage: c.get_fake_div(1/pi/x) FakeExpression([1, FakeExpression([pi, x], <built-in function mul>)], <built-in function div>) """
def get_fake_div(self, ex): """ EXAMPLES::
f17756401409e5055b6f654842517d3249c49b4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f17756401409e5055b6f654842517d3249c49b4d/expression_conversions.py
if len(n) == 1:
if len(n) == 0: return FakeExpression([SR.one_element(), d], _operator.div) elif len(n) == 1:
def get_fake_div(self, ex): """ EXAMPLES::
f17756401409e5055b6f654842517d3249c49b4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f17756401409e5055b6f654842517d3249c49b4d/expression_conversions.py
from sage.rings.all import Rational
def arithmetic(self, ex, operator): r""" EXAMPLES::
f17756401409e5055b6f654842517d3249c49b4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f17756401409e5055b6f654842517d3249c49b4d/expression_conversions.py
Shafarevich-Tate group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
Tate-Shafarevich group for the Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational Field
def update(self): """ Updates some properties from ``curve``.
56ba0d7a834d25fb4d2cfe8a7925ba51a1476a6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/56ba0d7a834d25fb4d2cfe8a7925ba51a1476a6e/BSD.py
A curve for which 3 divides the order of the Shafarevich-Tate group::
A curve for which 3 divides the order of the Tate-Shafarevich group::
sage: def foo(use_database):
56ba0d7a834d25fb4d2cfe8a7925ba51a1476a6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/56ba0d7a834d25fb4d2cfe8a7925ba51a1476a6e/BSD.py
- ``algorithm`` - string (default: 'recursive') specifying which algorithm to be used when computing the iterated palindromic closure. It must be one of the two following values: - ``'definition'`` means that the iterated right palindromic closure is computed using the definition. - ``'recursive'`` is based on an eff...
- ``algorithm`` - string (default: ``'recursive'``) specifying which algorithm to be used when computing the iterated palindromic closure. It must be one of the two following values: - ``'definition'`` - computed using the definition - ``'recursive'`` - computation based on an efficient formula that recursively compu...
def iterated_right_palindromic_closure(self, f=None, algorithm='recursive'): r""" Returns the iterated (`f`-)palindromic closure of self. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
l = len(sub)
L = len(sub)
def find(self, sub, start=0, end=None): r""" Returns the index of the first occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
i = len(self) - l
i = len(self) - L
def find(self, sub, start=0, end=None): r""" Returns the index of the first occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
i = start - l
i = start - L
def find(self, sub, start=0, end=None): r""" Returns the index of the first occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
if self[i:i+l] == sub: return i
if self[i:i+L] == sub: return i
def find(self, sub, start=0, end=None): r""" Returns the index of the first occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
l = len(sub)
L = len(sub)
def rfind(self, sub, start=0, end=None): r""" Returns the index of the last occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
i = len(self) - l
i = len(self) - L
def rfind(self, sub, start=0, end=None): r""" Returns the index of the last occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
i = end - l
i = end - L
def rfind(self, sub, start=0, end=None): r""" Returns the index of the last occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
if self[i:i+l] == sub: return i
if self[i:i+L] == sub: return i
def rfind(self, sub, start=0, end=None): r""" Returns the index of the last occurrence of sub in self, such that sub is contained within self[start:end]. Returns -1 on failure. INPUT:
8314ed5b4ce69ce94781be7db152ca2a9dc9a334 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8314ed5b4ce69ce94781be7db152ca2a9dc9a334/word.py
self._option["pdflatex"] = False
self._option["engine"] = "latex" self._option["engine_name"] = "LaTeX"
def __init__(self, bb=False, delimiters=["(", ")"]): """ Define an object that holds LaTeX global preferences. """ self._option = {} self._option["blackboard_bold"] = bb self._option["matrix_delimiters"] = list(delimiters) self._option["vector_delimiters"] = list(delimiters) self._option["macros"] = "" self._option["pr...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False):
def _run_latex_(filename, debug=False, density=150, engine=None, png=False, do_in_background=False):
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
"filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't convert the dvi file to png (because of postscript specials or other issues), then dvips is called, and the PS file is converted to a png file.
"filename.dvi" (or "filename.pdf"` if engine is either ``pdflatex`` or ``xelatex'') and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't convert the dvi file to png (because of postscript specials or other issues), then dvips is called, and the PS file is converted to a png file.
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
- ``pdflatex`` - bool (optional, default False): whether to use pdflatex.
- ``engine`` - string: latex engine to use.
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
``pdflatex`` is False, then a dvi file is created, but if there
engine is latex or None, then a dvi file is created, but if there
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
returned.) If ``pdflatex`` is True and there are no errors, then
returned.) If engine is pdflatex or xelatex and there are no errors, then
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
pdflatex, you must have 'convert' installed.
pdflatex or xelatex, you must have 'convert' installed.
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if pdflatex is None: pdflatex = _Latex_prefs._option["pdflatex"] if not pdflatex and not have_latex():
if engine is None: engine = _Latex_prefs._option["engine"] if not engine and not have_latex():
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if pdflatex and not have_pdflatex(): print "Error: PDFLaTeX does not seem to be installed. Download it from"
if engine and not have_pdflatex() and not have_xelatex(): print "Error: %s does not seem to be installed. Download it from" % _Latex_prefs._option["engine_name"]
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if not pdflatex and not (have_dvipng() or have_convert()):
if (not engine or engine == "latex") and not (have_dvipng() or have_convert()):
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
print "appear to be installed. Displaying LaTeX or PDFLaTeX output"
print "appear to be installed. Displaying LaTeX, PDFLaTeX output"
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
elif pdflatex and not have_convert():
elif engine == "pdflatex" and not have_convert():
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if pdflatex:
if not engine or engine == "latex": command = "latex" suffix = "ps" return_suffix = "dvi" elif engine == "pdflatex":
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
command = "latex" suffix = "ps" return_suffix = "dvi"
raise ValueError, "Unsupported LaTeX engine."
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if pdflatex:
if engine == "pdflatex" or engine == "xelatex":
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
e = os.system(cmd + ' ' + redirect + background) else:
e = os.system(cmd + ' ' + redirect + background) else:
def _run_latex_(filename, debug=False, density=150, pdflatex=None, png=False, do_in_background=False): """ This runs LaTeX on the TeX file "filename.tex". It produces files "filename.dvi" (or "filename.pdf"` if ``pdflatex`` is ``True``) and if ``png`` is True, "filename.png". If ``png`` is True and dvipng can't conve...
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
def __init__(self, debug=False, slide=False, density=150, pdflatex=None):
def __init__(self, debug=False, slide=False, density=150, pdflatex=None, engine=None):
def __init__(self, debug=False, slide=False, density=150, pdflatex=None): self.__debug = debug self.__slide = slide self.__pdflatex = pdflatex self.__density = density
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
def _relation_symbols(self): """ Returns a dictionary whose keys are attributes of the :mod:`operator` module and whose values are the corresponding LaTeX expressions. EXAMPLES::
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
density=None, pdflatex=None, locals={}):
density=None, pdflatex=None, engine=None, locals={}):
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
- ``pdflatex`` - whether to use pdflatex.
- ``pdflatex`` - whether to use pdflatex. This is deprecated. Use ``engine`` option instead. - ``engine`` - latex engine to use. Currently latex, pdflatex, and xelatex are supported.
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
or this command won't work. When using pdflatex, you must
or this command won't work. When using pdflatex or xelatex, you must
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
if pdflatex is None: if self.__pdflatex is None: pdflatex = _Latex_prefs._option["pdflatex"]
if engine is None: if self.__engine is None: engine = _Latex_prefs._option["engine"]
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
pdflatex = bool(self.__pdflatex)
engine = self.__engine
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
density=density, pdflatex=pdflatex, png=True)
density=density, engine=engine, png=True)
def eval(self, x, globals, strip=False, filename=None, debug=None, density=None, pdflatex=None, locals={}): """ INPUT:
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
def pdflatex(self, t = None): """
def pdflatex(self, t = None): """ This is deprecated. Use engine("pdflatex") instead.
def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. INPUT: - ``t`` -- boolean or None
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
sage: latex.pdflatex()
sage: latex.pdflatex() doctest:...: DeprecationWarning: Use engine() instead.
def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. INPUT: - ``t`` -- boolean or None
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
sage: latex.pdflatex(False)
sage: latex.pdflatex(False) doctest:...: DeprecationWarning: Use engine("latex") instead.
def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. INPUT: - ``t`` -- boolean or None
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py
return _Latex_prefs._option["pdflatex"] _Latex_prefs._option["pdflatex"] = bool(t)
from sage.misc.misc import deprecation deprecation('Use engine() instead.') return _Latex_prefs._option["engine"] == "pdflatex" elif t: from sage.misc.misc import deprecation deprecation('Use engine("pdflatex") instead.') self.engine("pdflatex") else: from sage.misc.misc import deprecation deprecation('Use engine("late...
def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. INPUT: - ``t`` -- boolean or None
cb479d7b1046f03bed1e0b94d39ef8da9d356f4e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb479d7b1046f03bed1e0b94d39ef8da9d356f4e/latex.py