bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _latex_(self): """ Return Latex representation of this Maxima object. This calls the tex command in Maxima, then does a little post-processing to fix bugs in the resulting Maxima output. EXAMPLES:: sage: maxima('sqrt(2) + 1/3 + asin(5)')._latex_() '\\sin^{-1}\\cdot5+\\sqrt{2}+{{1}\\over{3}}' | def _latex_(self): """ Return Latex representation of this Maxima object. This calls the tex command in Maxima, then does a little post-processing to fix bugs in the resulting Maxima output. EXAMPLES:: sage: maxima('sqrt(2) + 1/3 + asin(5)')._latex_() '\\sin^{-1}\\cdot5+\\sqrt{2}+{{1}\\over{3}}' | 462,300 |
def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | 462,301 |
def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | 462,302 |
def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | def matching_polynomial(self, complement=True, name=None): """ Computes the matching polynomial of the graph G. The algorithm used is a recursive one, based on the following observation: - If e is an edge of G, G' is the result of deleting the edge e, and G'' is the result of deleting each vertex in e, then the match... | 462,303 |
def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. A cut vertex is one whose deletion increases the number of connected components. A block is a maximal induced subgraph which itself has no cut vertices. ... | def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. A cut vertex is one whose deletion increases the number of connected components. A block is a maximal induced subgraph which itself has no cut vertices. ... | 462,304 |
def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. A cut vertex is one whose deletion increases the number of connected components. A block is a maximal induced subgraph which itself has no cut vertices. ... | def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph. A cut vertex is one whose deletion increases the number of connected components. A block is a maximal induced subgraph which itself has no cut vertices. ... | 462,305 |
def _is_a(self, x): """ Check if a sage object belongs to self. This methods is a helper for :meth:`__contains__` and the constructor :meth:`_element_constructor_`. | def _is_a(self, x): """ Check if a Sage object belongs to self. This methods is a helper for :meth:`__contains__` and the constructor :meth:`_element_constructor_`. | 462,306 |
def row_stabilizer(self): """ Return the PermutationGroup corresponding to the row stabilizer of self. EXAMPLES:: sage: rs = Tableau([[1,2,3],[4,5]]).row_stabilizer() sage: rs.order() == factorial(3)*factorial(2) True sage: PermutationGroupElement([(1,3,2),(4,5)]) in rs True sage: PermutationGroupElement([(1,4)]) in ... | def row_stabilizer(self): """ Return the PermutationGroup corresponding to the row stabilizer of self. EXAMPLES:: sage: rs = Tableau([[1,2,3],[4,5]]).row_stabilizer() sage: rs.order() == factorial(3)*factorial(2) True sage: PermutationGroupElement([(1,3,2),(4,5)]) in rs True sage: PermutationGroupElement([(1,4)]) in ... | 462,307 |
def super_categories(self): """ Returns a list of the immediate super categories of self. | def super_categories(self): """ Returns a list of the immediate super categories of self. | 462,308 |
def one(self): r""" Returns the one of the monoid, that is the unique neutral element for `*`. | def one(self): r""" Returns the one of the monoid, that is the unique neutral element for `*`. | 462,309 |
def one_element(self): r""" Backward compatibility alias for :meth:`self.one()`. | def one_element(self): r""" Backward compatibility alias for :meth:`self.one()`. | 462,310 |
def prod(self, args): r""" n-ary product | def prod(self, args): r""" n-ary product | 462,311 |
def prod(self, args): r""" n-ary product | defprod(self,args):r"""n-aryproduct | 462,312 |
def is_one(self): r""" Returns whether self is the one of the monoid | def is_one(self): r""" Returns whether self is the one of the monoid | 462,313 |
def __pow__(self, n): r""" INPUTS: - n: a non negative integer | def __pow__(self, n): r""" INPUTS: - n: a non negative integer | 462,314 |
def _pow_naive(self, n): r""" A naive implementation of __pow__ | def _pow_naive(self, n): r""" A naive implementation of __pow__ | 462,315 |
def _pow_naive(self, n): r""" A naive implementation of __pow__ | def _pow_naive(self, n): r""" A naive implementation of __pow__ | 462,316 |
def _pow_naive(self, n): r""" A naive implementation of __pow__ | def _pow_naive(self, n): r""" A naive implementation of __pow__ | 462,317 |
def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | 462,318 |
def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | 462,319 |
def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | def is_cyclic_ordered(x1,x2,x3): return ( (x1 < x2 and x2 < x3) or (x2 < x3 and x3 < x1) or (x3 < x1 and x1 < x2)) | 462,320 |
def __init__(self, x, y, r1, r2, angle, s1, s2, options): """ Initializes base class Arc. | def __init__(self, x, y, r1, r2, angle, s1, s2, options): """ Initializes base class Arc. | 462,321 |
def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | 462,322 |
def _allowed_options(self): """ Return the allowed options for the Arc class. | def _allowed_options(self): """ Return the allowed options for the Arc class. | 462,323 |
def _repr_(self): """ String representation of Arc primitive. | def _repr_(self): """ String representation of Arc primitive. | 462,324 |
def plot3d(self): r""" TESTS: | def plot3d(self): r""" TESTS: | 462,325 |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 462,326 |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 462,327 |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 462,328 |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | def if not ZZ(len(S)).is_power_of(2): raise TypeError("Lookup table length is not a power of 2.") __init__(self, if not ZZ(len(S)).is_power_of(2): raise TypeError("Lookup table length is not a power of 2.") *args, if not ZZ(len(S)).is_power_of(2): raise TypeError("Lookup table length is not a power of 2.") if not ZZ(l... | 462,329 |
def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 462,330 |
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... | 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... | 462,331 |
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... | 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... | 462,332 |
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... | 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... | 462,333 |
def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)` .. math:: (x,y) \mapsto (x',y') = (u^2xr , u^3y + su^2x' + t). EXAMPLES:: sage: E = EllipticCurve('15a') sage: F1 = E.change_weierstrass_model([1/2,0,0,0]); F1 Elliptic Curve define... | def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,t)` .. math:: (x,y) \mapsto (x',y') = (u^2xr , u^3y + su^2x' + t). EXAMPLES:: sage: E = EllipticCurve('15a') sage: F1 = E.change_weierstrass_model([1/2,0,0,0]); F1 Elliptic Curve defined... | 462,334 |
def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)` .. math:: (x,y) \mapsto (x',y') = (u^2xr , u^3y + su^2x' + t). EXAMPLES:: sage: E = EllipticCurve('15a') sage: F1 = E.change_weierstrass_model([1/2,0,0,0]); F1 Elliptic Curve define... | def change_weierstrass_model(self, *urst): r""" Return a new Weierstrass model of self under the standard transformation `(u,r,s,,t)` .. math:: (x,y) \mapsto (x',y') = (u^2x + r , u^3y + su^2x + t). EXAMPLES:: sage: E = EllipticCurve('15a') sage: F1 = E.change_weierstrass_model([1/2,0,0,0]); F1 Elliptic Curve defi... | 462,335 |
def _call_(self, x): """ Construct a module with basis from the data in ``x`` | def _call_(self, x): """ Construct a module with basis from the data in ``x`` | 462,336 |
def is_abelian(self): """ Returns whether this category is abelian | def is_abelian(self): """ Returns whether this category is abelian | 462,337 |
def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity | def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity | 462,338 |
def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity | def module_morphism(self, on_basis = None, diagonal = None, triangular = None, **keywords): r""" Constructs morphisms by linearity | 462,339 |
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | def associated_primes(self, algorithm='sy'): r""" Return a list of the associated primes of primary ideals of which the intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If `Q` is a... | 462,340 |
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | defassociated_primes(self,algorithm='sy'):r"""Returnalistofprimaryideals(andtheirassociatedprimes)suchthattheirintersectionis`I`=``self``.Anideal`Q`iscalledprimaryifitisaproperidealofthering`R`andifwhenever`ab\inQ`and`a\not\inQ`then`b^n\inQ`forsome`n\in\ZZ`.If`Q`isaprimaryidealofthering`R`,thentheradicalideal`P`of`Q`,i... | 462,341 |
def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. An ideal `Q` is called primary if it is a proper ideal of the ring `R` and if whenever `ab \in Q` and `a \not\in Q` then `b^n \in Q` for some `n \in \ZZ`. If ... | 462,342 |
def ChainPoset(self, n): """ Returns a chain (a totally ordered poset) containing ``n`` elements. | def ChainPoset(self, n): """ Returns a chain (a totally ordered poset) containing ``n`` elements. | 462,343 |
def ChainPoset(self, n): """ Returns a chain (a totally ordered poset) containing ``n`` elements. | def ChainPoset(self, n): """ Returns a chain (a totally ordered poset) containing ``n`` elements. | 462,344 |
def AntichainPoset(self, n): """ Returns an antichain (a poset with no comparable elements) containing ``n`` elements. | def AntichainPoset(self, n): """ Returns an antichain (a poset with no comparable elements) containing ``n`` elements. | 462,345 |
def AntichainPoset(self, n): """ Returns an antichain (a poset with no comparable elements) containing ``n`` elements. | def AntichainPoset(self, n): """ Returns an antichain (a poset with no comparable elements) containing ``n`` elements. | 462,346 |
def eval(self, Vobj): r""" Evaluates the left hand side `A\vec{x}+b` on the given vertex/ray/line. NOTES: * Evaluating on a vertex returns `A\vec{x}+b` * Evaluating on a ray returns `A\vec{r}`. Only the sign or whether it is zero is meaningful. * Evaluating on a line returns `A\vec{l}`. Only whether it is zero or not... | def eval(self, Vobj): r""" Evaluates the left hand side `A\vec{x}+b` on the given vertex/ray/line. NOTES: * Evaluating on a vertex returns `A\vec{x}+b` * Evaluating on a ray returns `A\vec{r}`. Only the sign or whether it is zero is meaningful. * Evaluating on a line returns `A\vec{l}`. Only whether it is zero or not... | 462,347 |
def is_inequality(self): """ Returns True since this is, by construction, an inequality. | def is_inequality(self): """ Returns True since this is, by construction, an inequality. | 462,348 |
def interior_contains(self, Vobj): """ Tests whether the interior of the halfspace (excluding its boundary) defined by the inequality contains the given vertex/ray/line. | def interior_contains(self, Vobj): If you pass a vector, it is assumed to be the coordinate vector of a point:: sage: P = Polyhedron(vertices=[[1,1],[1,-1],[-1,1],[-1,-1]]) sage: p = vector(ZZ, [1,0] ) sage: [ ieq.interior_contains(p) for ieq in P.inequality_generator() ] [True, True, True, False] """ try: if Vobj.is... | 462,349 |
def is_equation(self): """ Tests if this object is an equation. By construction, it must be. | def is_equation(self): """ Tests if this object is an equation. By construction, it must be. | 462,350 |
def is_vertex(self): """ Tests if this object is a vertex. By construction it always is. | def is_vertex(self): """ Tests if this object is a vertex. By construction it always is. | 462,351 |
def is_ray(self): """ Tests if this object is a ray. Always True by construction. | def is_ray(self): """ Tests if this object is a ray. Always True by construction. | 462,352 |
def is_line(self): """ Tests if the object is a line. By construction it must be. | def is_line(self): """ Tests if the object is a line. By construction it must be. | 462,353 |
def identity(self): """ Returns the identity projection. | def identity(self): """ Returns the identity projection. | 462,354 |
def identity(self): """ Returns the identity projection. | def identity(self): """ Returns the identity projection. | 462,355 |
def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | 462,356 |
def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | def run(self, category = None, skip = [], catch = True, raise_on_failure = False, **options): """ Run all the tests from this test suite: | 462,357 |
def instance_tester(instance, tester = None, **options): """ Returns a gadget attached to ``instance`` providing testing utilities. EXAMPLES:: sage: from sage.misc.sage_unittest import instance_tester sage: tester = instance_tester(ZZ) sage: tester.assert_(1 == 1) sage: tester.assert_(1 == 0) Traceback (most recent ... | def instance_tester(instance, tester = None, **options): """ Returns a gadget attached to ``instance`` providing testing utilities. EXAMPLES:: sage: from sage.misc.sage_unittest import instance_tester sage: tester = instance_tester(ZZ) sage: tester.assert_(1 == 1) sage: tester.assert_(1 == 0) Traceback (most recent ... | 462,358 |
def __init__(self, instance, elements = None, verbose = False, prefix = "", **options): """ A gadget attached to an instance providing it with testing utilities. | def __init__(self, instance, elements = None, verbose = False, prefix = "", **options): """ A gadget attached to an instance providing it with testing utilities. | 462,359 |
def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ym... | def region_plot(f, xrange, yrange, plot_points, incol, outcol, bordercol, borderstyle, borderwidth): r""" ``region_plot`` takes a boolean function of two variables, `f(x,y)` and plots the region where f is True over the specified ``xrange`` and ``yrange`` as demonstrated below. ``region_plot(f, (xmin, xmax), (ymin, ym... | 462,360 |
def equify(f): """ Returns the equation rewritten as a symbolic function to give negative values when True, positive when False. EXAMPLES:: sage: from sage.plot.contour_plot import equify sage: var('x, y') (x, y) sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) -x^2 + 2 sage: equify(x*y > 1) -x*y + 1 sage: equify(... | def equify(f): """ Returns the equation rewritten as a symbolic function to give negative values when True, positive when False. EXAMPLES:: sage: from sage.plot.contour_plot import equify sage: var('x, y') (x, y) sage: equify(x^2 < 2) x^2 - 2 sage: equify(x^2 > 2) -x^2 + 2 sage: equify(x*y > 1) -x*y + 1 sage: equify(... | 462,361 |
def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... | def order(self, *args, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... | 462,362 |
def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... | deforder(self,*gens,**kwds):r"""Returntheorderwithgivenringgeneratorsinthemaximalorderofthisnumberfield.INPUT:-``gens``-listofelementsofself;ifnogeneratorsaregiven,justreturnsthecardinalityofthisnumberfield(oo)forconsistency.-``check_is_integral``-bool(default:True),whethertocheckthateachgeneratorisintegral.-``check_ra... | 462,363 |
def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. INPUT: - ``gens`` - list of elements of self; if no generators are given, just returns the cardinality of this number field (oo) for consistency. - ``check_is_integral`` - bool (default: Tru... | def order(self, *gens, **kwds): r sage: K.<a> = NumberField(x^3 - 2) sage: ZZ[a] Order in Number Field in a0 with defining polynomial x^3 - 2 TESTS: We verify that trac sage: K.<a> = NumberField(x^4 + 4*x^2 + 2) sage: B = K.integral_basis() sage: K.order(*B) Order in Number Field in a with defining polynomial x^4 + ... | 462,364 |
def iterated_right_palindromic_closure(self, f=None, algorithm='recursive'): r""" Returns the iterated (`f`-)palindromic closure of self. INPUT: | def iterated_right_palindromic_closure(self, f=None, algorithm='recursive'): r""" Returns the iterated (`f`-)palindromic closure of self. INPUT: | 462,365 |
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: | 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: | 462,366 |
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: | 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: | 462,367 |
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: | 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: | 462,368 |
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: | 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: | 462,369 |
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: | 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: | 462,370 |
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: | 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: | 462,371 |
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: | 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: | 462,372 |
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: | 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: | 462,373 |
def __init__(self): r""" The inverse of the hyperbolic secant function. | def __init__(self): r""" The inverse of the hyperbolic secant function. | 462,374 |
def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | 462,375 |
def modular_symbol(self, sign=1, use_eclib = False, normalize = "L_ratio"): r""" Return the modular symbol associated to this elliptic curve, with given sign and base ring. This is the map that sends `r/s` to a fixed multiple of the integral of `2 \pi i f(z) dz` from `\infty` to `r/s`, normalized so that all values of... | def modular_symbol(self, sign=1, use_eclib = False, normalize = "L_ratio"): r""" Return the modular symbol associated to this elliptic curve, with given sign and base ring. This is the map that sends `r/s` to a fixed multiple of the integral of `2 \pi i f(z) dz` from `\infty` to `r/s`, normalized so that all values of... | 462,376 |
def modular_symbol(self, sign=1, use_eclib = False, normalize = "L_ratio"): r""" Return the modular symbol associated to this elliptic curve, with given sign and base ring. This is the map that sends `r/s` to a fixed multiple of the integral of `2 \pi i f(z) dz` from `\infty` to `r/s`, normalized so that all values of... | def modular_symbol(self, sign=1, use_eclib = False, normalize = "L_ratio"): r""" Return the modular symbol associated to this elliptic curve, with given sign and base ring. This is the map that sends `r/s` to a fixed multiple of the integral of `2 \pi i f(z) dz` from `\infty` to `r/s`, normalized so that all values of... | 462,377 |
def __classcall_private__(cls, fam, facade=True, keepkey=False): # was *args, **options): """ Normalization of arguments; see :cls:`UniqueRepresentation`. | def __classcall_private__(cls, fam, facade=True, keepkey=False): # was *args, **options): """ Normalization of arguments; see :cls:`UniqueRepresentation`. | 462,378 |
def derivative(self, ex, operator): """ EXAMPLES:: | def derivative(self, ex, operator): """ EXAMPLES:: | 462,379 |
def derivative(self, ex, operator): """ EXAMPLES:: | def derivative(self, ex, operator): """ EXAMPLES:: | 462,380 |
def derivative(self, ex, operator): """ EXAMPLES:: | def derivative(self, ex, operator): """ EXAMPLES:: | 462,381 |
def derivative(self, ex, operator): """ EXAMPLES:: | def derivative(self, ex, operator): """ EXAMPLES:: | 462,382 |
def strip_answer(self, s): """ Returns the string s with Matlab's answer prompt removed. EXAMPLES:: sage: s = '\nans =\n\n 2\n' sage: matlab.strip_answer(s) ' 2' """ i = s.find('=') return s[i+1:].strip('\n') | def strip_answer(self, s): r""" Returns the string s with Matlab's answer prompt removed. EXAMPLES:: sage: s = '\nans =\n\n 2\n' sage: matlab.strip_answer(s) ' 2' r""" i = s.find('=') return s[i+1:].strip('\n') | 462,383 |
def pn(self, n): """ Return the number of the `n`-th partial convergent, computed using the recurrence. EXAMPLES:: sage: c = continued_fraction(pi); c [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3] sage: c.pn(0), c.qn(0) (3, 1) sage: len(c) 14 sage: c.pn(13), c.qn(13) (245850922, 78256779) """ if n < -2: raise ValueE... | def pn(self, n): """ Return the numerator of the `n`-th partial convergent, computed using the recurrence. EXAMPLES:: sage: c = continued_fraction(pi); c [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3] sage: c.pn(0), c.qn(0) (3, 1) sage: len(c) 14 sage: c.pn(13), c.qn(13) (245850922, 78256779) """ if n < -2: raise Val... | 462,384 |
def ContinuedFractionField(): """ Return the (unique) field of all contiued fractions. EXAMPLES:: sage: ContinuedFractionField() Field of all continued fractions """ return CFF | def ContinuedFractionField(): """ Return the (unique) field of all continued fractions. EXAMPLES:: sage: ContinuedFractionField() Field of all continued fractions """ return CFF | 462,385 |
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): r""" Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | 462,386 |
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | 462,387 |
def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | def cospectral_graphs(self, vertices, matrix_function=lambda g: g.adjacency_matrix(), graphs=None): """ Find all sets of graphs on ``vertices`` vertices (with possible restrictions) which are cospectral with respect to a constructed matrix. | 462,388 |
def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 462,389 |
def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 462,390 |
def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | def inject_coefficients(self, scope=None, verbose=True): r""" Inject generators of the base field of ``self`` into ``scope``. | 462,391 |
def _repr_defn(self): """ This function is used internally for printing. | def _repr_defn(self): """ This function is used internally for printing. | 462,392 |
def __init__(self, parent, polys, check=True): SchemeMorphism_on_points.__init__(self, parent, polys, check) if check: # morphisms from projective space are always given by # homogeneous polynomials of the same degree deg = self.defining_polynomials()[0].degree() for poly in self.defining_polynomials(): if (poly.degree... | def __init__(self, parent, polys, check=True): SchemeMorphism_on_points.__init__(self, parent, polys, check) if check: # morphisms from projective space are always given by # homogeneous polynomials of the same degree polys = self.defining_polynomials() try: d = polys[0].degree() except AttributeError: polys = [f.lift(... | 462,393 |
def identity_matrix(ring, n=0, sparse=False): r""" Return the `n \times n` identity matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = identity_matrix(QQ, 2); M [1 0] [0 1] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = identity_matrix(2); M [... | def identity_matrix(ring, n=0, sparse=False): r""" Return the `n \times n` identity matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = identity_matrix(QQ, 2); M [1 0] [0 1] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = identity_matrix(2); M [... | 462,394 |
def zero_matrix(ring, nrows, ncols=None, sparse=False): r""" Return the `nrows \times ncols` zero matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = zero_matrix(QQ, 2); M [0 0] [0 0] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = zero_matrix(2... | def zero_matrix(ring, nrows, ncols=None, sparse=False): r""" Return the `nrows \times ncols` zero matrix over the given ring. The default ring is the integers. EXAMPLES:: sage: M = zero_matrix(QQ, 2); M [0 0] [0 0] sage: M.parent() Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: M = zero_matrix(2... | 462,395 |
def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``. | def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``. | 462,396 |
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True """ l = self.length() if l < 2: return True suff = self for i in xrange(0,... | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True """ l = self.length() if l < 2: return True suff = self for i in xrange(0,... | 462,397 |
def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. | 462,398 |
def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. | 462,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.