rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
OUTPUT: - ``int`` - smallest cond - ``int`` - largest conductor plus one | OUTPUT: tuple of ints (N1,N2+1) where N1 is the smallest and N2 the largest conductor for which the database is complete. | def conductor_range(self): """ Return the range of conductors that are covered by the database. OUTPUT: - ``int`` - smallest cond - ``int`` - largest conductor plus one EXAMPLES:: sage: from sage.databases.cremona import LargeCremonaDatabase # optional - database_cremona_ellcurve sage: c = LargeCremonaDatabas... | c505e04eee8babcf64b9ccd5039fa569f6981a5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c505e04eee8babcf64b9ccd5039fa569f6981a5b/cremona.py |
TESTS:: | TESTS: | def _init_allgens(self, ftpdata, largest_conductor=0): """ Initialize the allgens table by reading the corresponding ftpdata files and importing them into the database. """ if self.read_only: raise RuntimeError, "The database must not be read_only." files = os.listdir(ftpdata) files.sort() name = "allgens" c = _map[nam... | c505e04eee8babcf64b9ccd5039fa569f6981a5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c505e04eee8babcf64b9ccd5039fa569f6981a5b/cremona.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. EXAMPLES:: sage: M = FreeModule(ZZ,3) sage: V = M.ambient_vector_space() sage: X = V.span([[1/2,1/2,0],[1/2,0,1/2]], ZZ) sage: Y = V.span([[1,1,1]], ZZ) sage: N = X + Y sage: M.is_submodule(X) False sage: M.is_submodule(Y) False sage: Y.i... | e118ad7551e056d7b03d98e3a28c161948f843a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e118ad7551e056d7b03d98e3a28c161948f843a5/free_module.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. EXAMPLES:: sage: M = FreeModule(ZZ,3) sage: V = M.ambient_vector_space() sage: X = V.span([[1/2,1/2,0],[1/2,0,1/2]], ZZ) sage: Y = V.span([[1,1,1]], ZZ) sage: N = X + Y sage: M.is_submodule(X) False sage: M.is_submodule(Y) False sage: Y.i... | e31b2a27c07bc2dcfc4911cdb27e1dfd41834942 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e31b2a27c07bc2dcfc4911cdb27e1dfd41834942/free_module.py |
_vars = str(self.gen()) | _vars = '(%s)'%self.gen() | def _singular_init_(self, singular=singular_default): """ Return a newly created Singular ring matching this ring. """ if not can_convert_to_singular(self): raise TypeError, "no conversion of this ring to a Singular ring defined" if self.ngens()==1: _vars = str(self.gen()) if "*" in _vars: # 1.000...000*x _vars = _var... | 55a1f2e05214dc8200d4a6bf53dc11a232ac194f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/55a1f2e05214dc8200d4a6bf53dc11a232ac194f/polynomial_singular_interface.py |
p.add_constraint(v[x] + b[x][y] - v[y], min=0, max=0) | p.add_constraint(v[x] + b[x][y] - v[y], min=0) | def edge_cut(self, s, t, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns a minimum edge cut between vertices `s` and `t` represented by a list of edges. | d35af2d2d16530cc3fbebdc555a16f8eb2b48914 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/d35af2d2d16530cc3fbebdc555a16f8eb2b48914/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. | dccbc038c856be868249683d9d7d2eefd155f36d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/dccbc038c856be868249683d9d7d2eefd155f36d/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. | dccbc038c856be868249683d9d7d2eefd155f36d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/dccbc038c856be868249683d9d7d2eefd155f36d/r.py |
sage: @interacts.decorator.library_interact | sage: @interacts.library.library_interact | def library_interact(f): """ This is a decorator for using interacts in the Sage library. EXAMPLES:: sage: @interacts.decorator.library_interact ... def f(n=5): print n ... sage: f() # an interact appears <html>...</html> """ @sage_wraps(f) def library_wrapper(): # Maybe program around bug (?) in the notebook: html(... | a4e39e8ca11198782765e43ec44546ec7c1c3daf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a4e39e8ca11198782765e43ec44546ec7c1c3daf/library.py |
sage: interacts.decorator.demo() | sage: interacts.library.demo() | def demo(n=tuple(range(10)), m=tuple(range(10))): """ This is a demo interact that sums two numbers. INPUT: - `n` -- integer slider - `m` -- integer slider EXAMPLES:: sage: interacts.decorator.demo() <html>...</html> """ print n+m | a4e39e8ca11198782765e43ec44546ec7c1c3daf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a4e39e8ca11198782765e43ec44546ec7c1c3daf/library.py |
be overfull if : - `n` is odd - It satisfies `2m > (n-1)\Delta(G)`, where `\Delta(G)` denotes the maximal degree of a vertex in `G` | be overfull if: - `n` is odd - It satisfies `2m > (n-1)\Delta(G)`, where `\Delta(G)` denotes the maximum degree among all vertices in `G`. | def is_overfull(self): r""" Tests whether the current graph is overfull. | a9b829f661d7bc42123ff69ff5975a9a0a8b87de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a9b829f661d7bc42123ff69ff5975a9a0a8b87de/generic_graph.py |
EXAMPLE: A complete graph is overfull if and only if its number of vertices is odd:: | EXAMPLES: A complete graph of order `n > 1` is overfull if and only if `n` is odd:: | def is_overfull(self): r""" Tests whether the current graph is overfull. | a9b829f661d7bc42123ff69ff5975a9a0a8b87de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a9b829f661d7bc42123ff69ff5975a9a0a8b87de/generic_graph.py |
return (self.order() % 2 == 1) and \ (2*self.size() > max(self.degree())*(self.order()-1)) | return (self.order() % 2 == 1) and ( 2 * self.size() > max(self.degree()) * (self.order() - 1)) | def is_overfull(self): r""" Tests whether the current graph is overfull. | a9b829f661d7bc42123ff69ff5975a9a0a8b87de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a9b829f661d7bc42123ff69ff5975a9a0a8b87de/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... | bd1e8329022b55a21211c0a26e9960bbc1e6b5c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/bd1e8329022b55a21211c0a26e9960bbc1e6b5c1/package.py |
(\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of strings like | (\\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (\`$ or \$`), because of strings like | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... | 76507bb3690dbe2a9fc5054ca0a1bf290fe345a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/76507bb3690dbe2a9fc5054ca0a1bf290fe345a2/sagedoc.py |
Replace \$ with $, and don't do anything when backticks are involved:: | Replace \\$ with $, and don't do anything when backticks are involved:: | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... | 76507bb3690dbe2a9fc5054ca0a1bf290fe345a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/76507bb3690dbe2a9fc5054ca0a1bf290fe345a2/sagedoc.py |
This is not perfect: | This is not perfect:: | def process_dollars(s): r"""nodetex Replace dollar signs with backticks. More precisely, do a regular expression search. Replace a plain dollar sign ($) by a backtick (`). Replace an escaped dollar sign (\$) by a dollar sign ($). Don't change a dollar sign preceded or followed by a backtick (`$ or $`), because of s... | 76507bb3690dbe2a9fc5054ca0a1bf290fe345a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/76507bb3690dbe2a9fc5054ca0a1bf290fe345a2/sagedoc.py |
Replace \mathtt{BLAH} with either \verb|BLAH| (in the notebook) or | Replace \\mathtt{BLAH} with either \\verb|BLAH| (in the notebook) or | def process_mathtt(s, embedded=False): r"""nodetex Replace \mathtt{BLAH} with either \verb|BLAH| (in the notebook) or BLAH (from the command line). INPUT: - ``s`` - string, in practice a docstring - ``embedded`` - boolean (optional, default False) This function is called by :func:`format`, and if in the notebook, it... | 76507bb3690dbe2a9fc5054ca0a1bf290fe345a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/76507bb3690dbe2a9fc5054ca0a1bf290fe345a2/sagedoc.py |
I | i | def _sympy_(self): """ Converts pi to sympy pi. EXAMPLES:: sage: import sympy sage: sympy.pi == pi # indirect doctest True """ import sympy return sympy.pi | 4f14eb2f11e8df41b3a35456ab6dea9007ddc4d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4f14eb2f11e8df41b3a35456ab6dea9007ddc4d4/constants.py |
A map from '(' to open_symbol and ')' to close_symbol and otherwise an error is raised. | A map from ``'('`` to ``open_symbol`` and ``')'`` to ``close_symbol`` and otherwise an error is raised. The values of the constants ``open_symbol`` and ``close_symbol`` are subject to change. This is the inverse map of :func:`replace_symbols`. INPUT: - ``x`` -- either an opening or closing parenthesis. OUTPUT: - If... | def replace_parens(x): r""" A map from '(' to open_symbol and ')' to close_symbol and otherwise an error is raised. EXAMPLES:: sage: from sage.combinat.dyck_word import replace_parens sage: replace_parens('(') 1 sage: replace_parens(')') 0 sage: replace_parens(1) Traceback (most recent call last): ... ValueError """ ... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
A map from open_symbol to '(' and close_symbol to ')' and otherwise an error is raised. | A map from ``open_symbol`` to ``'('`` and ``close_symbol`` to ``')'`` and otherwise an error is raised. The values of the constants ``open_symbol`` and ``close_symbol`` are subject to change. This is the inverse map of :func:`replace_parens`. INPUT: - ``x`` -- either ``open_symbol`` or ``close_symbol``. OUTPUT: - I... | def replace_symbols(x): r""" A map from open_symbol to '(' and close_symbol to ')' and otherwise an error is raised. EXAMPLES:: sage: from sage.combinat.dyck_word import replace_symbols sage: replace_symbols(1) '(' sage: replace_symbols(0) ')' sage: replace_symbols(3) Traceback (most recent call last): ... ValueError... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Returns a Dyck word object or a head of a Dyck word object if the Dyck word is not complete | Returns a Dyck word object or a head of a Dyck word object if the Dyck word is not complete. | def DyckWord(dw=None, noncrossing_partition=None): r""" Returns a Dyck word object or a head of a Dyck word object if the Dyck word is not complete EXAMPLES:: sage: dw = DyckWord([1, 0, 1, 0]); dw [1, 0, 1, 0] sage: print dw ()() sage: print dw.height() 1 sage: dw.to_noncrossing_partition() [[1], [2]] :: sage: Dyck... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
TODO: In functions where a Dyck word is necessary, an error should be raised (e.g. a_statistic, b_statistic)? | TODO: In functions where a Dyck word is necessary, an error should be raised (e.g. ``a_statistic``, ``b_statistic``)? | def DyckWord(dw=None, noncrossing_partition=None): r""" Returns a Dyck word object or a head of a Dyck word object if the Dyck word is not complete EXAMPLES:: sage: dw = DyckWord([1, 0, 1, 0]); dw [1, 0, 1, 0] sage: print dw ()() sage: print dw.height() 1 sage: dw.to_noncrossing_partition() [[1], [2]] :: sage: Dyck... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
report the position for the parenthesis that matches the one at position ``pos`` | Report the position for the parenthesis that matches the one at position ``pos``. | def associated_parenthesis(self, pos): r""" report the position for the parenthesis that matches the one at position ``pos`` | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
- ``pos`` - the index of the parenthesis in the list | - ``pos`` - the index of the parenthesis in the list. | def associated_parenthesis(self, pos): r""" report the position for the parenthesis that matches the one at position ``pos`` | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
integer representing the index of the matching parenthesis. If no parenthesis matches nothing is returned | Integer representing the index of the matching parenthesis. If no parenthesis matches, return ``None``. | def associated_parenthesis(self, pos): r""" report the position for the parenthesis that matches the one at position ``pos`` | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Bijection of Biane from Dyck words to non crossing partitions | Bijection of Biane from Dyck words to non-crossing partitions. | def to_noncrossing_partition(self): r""" Bijection of Biane from Dyck words to non crossing partitions Thanks to Mathieu Dutour for describing the bijection. EXAMPLES:: sage: DyckWord([]).to_noncrossing_partition() [] sage: DyckWord([1, 0]).to_noncrossing_partition() [[1]] sage: DyckWord([1, 1, 0, 0]).to_noncrossing_... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | Returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list. The standard tableau will be rectangular iff ``self`` is a complete Dyck word. | def to_tableau(self): r""" returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
TODO: better name? to_standard_tableau? and should *actually* return a Tableau object? | TODO: better name? ``to_standard_tableau``? and should *actually* return a Tableau object? | def to_tableau(self): r""" returns a standard tableau of length less than or equal to 2 with the size the same as the length of the list the standard tableau will be rectangular iff ``self`` is a complete Dyck word | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. | Returns the a-statistic for the Dyck word corresponding to the area of the Dyck path. | def a_statistic(self): """ Returns the a-statistic for the Dyck word correspond to the area of the Dyck path. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(1,0)` and '0's represent steps in the direction `(0,1)`. The... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. | Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. | def b_statistic(self): r""" Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(0,1)` and '0's represent steps in the direct... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
The bouncing ball will strike the diagonal at places $(0, 0), (j_1, j_1), (j_2, j_2), ... , (j_r-1, j_r-1), (j_r, j_r) = (n, n).$ | The bouncing ball will strike the diagonal at places .. MATH:: (0, 0), (j_1, j_1), (j_2, j_2), \dots , (j_r-1, j_r-1), (j_r, j_r) = (n, n). | def b_statistic(self): r""" Returns the b-statistic for the Dyck word corresponding to the bounce statistic of the Dyck word. One can view a balanced Dyck word as a lattice path from `(0,0)` to `(n,n)` in the first quadrant by letting '1's represent steps in the direction `(0,1)` and '0's represent steps in the direct... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Returns a list of all the Dyck words with ``k1`` opening and ``k2`` closing parentheses. | Returns a list of all the Dyck words with ``k1`` opening and ``k2`` closing parentheses. | def list(self): """ Returns a list of all the Dyck words with ``k1`` opening and ``k2`` closing parentheses. EXAMPLES:: sage: DyckWords(0).list() [[]] sage: DyckWords(1).list() [[1, 0]] sage: DyckWords(2).list() [[1, 0, 1, 0], [1, 1, 0, 0]] """ return list(self) | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. | Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. | def __iter__(self): r""" Returns an iterator for Dyck words with ``k1`` opening and ``k2`` closing parentheses. EXAMPLES:: sage: [ w for w in DyckWords(0) ] [[]] sage: [ w for w in DyckWords(1) ] [[1, 0]] sage: [ w for w in DyckWords(2) ] [[1, 0, 1, 0], [1, 1, 0, 0]] sage: len([ 'x' for _ in DyckWords(5) ]) 42 """ if... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
converts a non-crossing partition to a Dyck word | Converts a non-crossing partition to a Dyck word. | def from_noncrossing_partition(ncp): r""" converts a non-crossing partition to a Dyck word TESTS:: sage: DyckWord(noncrossing_partition=[[1,2]]) # indirect doctest [1, 1, 0, 0] sage: DyckWord(noncrossing_partition=[[1],[2]]) [1, 0, 1, 0] :: sage: dws = DyckWords(5).list() sage: ncps = map( lambda x: x.to_noncrossin... | 8d61da4d6fedb82316ed36a28c821e2413b239d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8d61da4d6fedb82316ed36a28c821e2413b239d3/dyck_word.py |
sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U | sage: VV = VectorSpace(QQ,5,sparse=True) sage: UU = VV.submodule([ VV.gen(i) - VV.gen(0) for i in range(1,5) ]) sage: print UU | def _repr_(self): """ The printing representation of self. EXAMPLES:: sage: V = VectorSpace(QQ,5) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U # indirect doctest Vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0 0 1 ... | 2fa09a8465bf7f362ac70477b8b158b9afea0833 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2fa09a8465bf7f362ac70477b8b158b9afea0833/free_module.py |
sage: V = VectorSpace(QQ,5,sparse=True) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U | sage: VV = VectorSpace(QQ,5,sparse=True) sage: UU = VV.submodule([ VV.gen(i) - VV.gen(0) for i in range(1,5) ]) sage: print UU | def _repr_(self): """ The default printing representation of self. EXAMPLES:: sage: V = VectorSpace(QQ,5) sage: U = V.submodule([ V.gen(i) - V.gen(0) for i in range(1,5) ]) sage: print U # indirect doctest Vector space of degree 5 and dimension 4 over Rational Field Basis matrix: [ 1 0 0 0 -1] [ 0 1 0 0 -1] [ 0... | 2fa09a8465bf7f362ac70477b8b158b9afea0833 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/2fa09a8465bf7f362ac70477b8b158b9afea0833/free_module.py |
cones = tuple(tuple(new_fan_rays.index(cone_polytope.vertex(v)) for v in range(cone_polytope.nvertices() - 1)) | cones = tuple(tuple(sorted(new_fan_rays.index(cone_polytope.vertex(v)) for v in range(cone_polytope.nvertices() - 1))) | def _subdivide_palp(self, new_rays, verbose): r""" Subdivide ``self`` adding ``new_rays`` one by one. | 84e0dedc20318847adefc0619fe755ea5fe8e485 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84e0dedc20318847adefc0619fe755ea5fe8e485/fan.py |
for cone, polytope in zip(fan.generating_cones(), cone_polytopes): cone._lattice_polytope = polytope | def _subdivide_palp(self, new_rays, verbose): r""" Subdivide ``self`` adding ``new_rays`` one by one. | 84e0dedc20318847adefc0619fe755ea5fe8e485 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84e0dedc20318847adefc0619fe755ea5fe8e485/fan.py | |
p.add_constraint(v[x] + b[x][y] - v[y], min=0, max=0) | p.add_constraint(v[x] + b[x][y] - v[y], min=0) | def edge_cut(self, s, t, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns a minimum edge cut between vertices `s` and `t` represented by a list of edges. | c689b5410fb1054bf00912c776e7aa93a3ae72ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c689b5410fb1054bf00912c776e7aa93a3ae72ec/generic_graph.py |
sage: P1 in G | sage: P1 in G | def _call_(self, x): r""" TEST:: | 9f46c6e0430a3fe65f65390b0f8a31bedac5eeb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9f46c6e0430a3fe65f65390b0f8a31bedac5eeb9/additive_abelian_wrapper.py |
return u[0] | return u[0].vector() | def _discrete_log(self,x): # EVEN DUMBER IMPLEMENTATION! u = [y for y in self.list() if y.element() == x] if len(u) == 0: raise TypeError, "Not in group" if len(u) > 1: raise NotImplementedError return u[0] | 9f46c6e0430a3fe65f65390b0f8a31bedac5eeb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9f46c6e0430a3fe65f65390b0f8a31bedac5eeb9/additive_abelian_wrapper.py |
""" return Vobj.evaluated_on(self) | If you pass a vector, it is assumed to be the coordinate vector of a point:: sage: ineq.eval( vector(ZZ, [3,2]) ) -4 """ try: return Vobj.evaluated_on(self) except AttributeError: return self.A() * Vobj + self.b() | 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... | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py |
is_inequality.__doc__ = Hrepresentation.is_inequality.__doc__ | def is_inequality(self): """ Returns True since this is, by construction, an inequality. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
""" | 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_vector(): return self.polyhedron()... | 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. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py |
is_equation.__doc__ = Hrepresentation.is_equation.__doc__ | def is_equation(self): """ Tests if this object is an equation. By construction, it must be. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
is_vertex.__doc__ = Vrepresentation.is_vertex.__doc__ | def is_vertex(self): """ Tests if this object is a vertex. By construction it always is. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
is_ray.__doc__ = Vrepresentation.is_ray.__doc__ | def is_ray(self): """ Tests if this object is a ray. Always True by construction. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
is_line.__doc__ = Vrepresentation.is_line.__doc__ | def is_line(self): """ Tests if the object is a line. By construction it must be. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
Returns the identity projection. | Returns the identity projection of the polyhedron. | def identity(self): """ Returns the identity projection. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py |
identity.__doc__ = projection_func_identity.__doc__ | def identity(self): """ Returns the identity projection. | 5a86189340052675eba0272587e8250bbba1bc18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5a86189340052675eba0272587e8250bbba1bc18/polyhedra.py | |
return sage_eval(x, self.gens_dict()) | return self(sage_eval(x, self.gens_dict())) | def __call__(self, x, check=True): """ Convert ``x`` to an element of this multivariate polynomial ring, possibly non-canonically. EXAMPLES: | f3adb32d5ac0fd8b2688b3f0ec2944852f8ee9cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f3adb32d5ac0fd8b2688b3f0ec2944852f8ee9cb/multi_polynomial_ring.py |
This is called "massaging" in [CB07]_. | This is called "massaging" in [CBJ07]_. | def eliminate_linear_variables(self, maxlength=3, skip=lambda lm,tail: False): """ Return a new system where "linear variables" are eliminated. | b0a4c8e6677e121e116a49b51045c0b586f70dd5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b0a4c8e6677e121e116a49b51045c0b586f70dd5/mpolynomialsystem.py |
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)) | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py | |
Primitive class for the Arc graphics type. See arc? for information | Primitive class for the Arc graphics type. See ``arc?`` for information | 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)) | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
Note that the construction should be done using arc:: | Note that the construction should be done using ``arc``:: | 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)) | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
Initializes base class Arc. | Initializes base class ``Arc``. | def __init__(self, x, y, r1, r2, angle, s1, s2, options): """ Initializes base class Arc. | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
The same example with a rotation of angle pi/2:: | The same example with a rotation of angle `\pi/2`:: | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
Return the allowed options for the Arc class. | Return the allowed options for the ``Arc`` class. | def _allowed_options(self): """ Return the allowed options for the Arc class. | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
String representation of Arc primitive. | String representation of ``Arc`` primitive. | def _repr_(self): """ String representation of Arc primitive. | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
TESTS: | TESTS:: | def plot3d(self): r""" TESTS: | 3153e8a6f77fbbdaab12733027eebc09b8e0b429 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3153e8a6f77fbbdaab12733027eebc09b8e0b429/arc.py |
For infinite periodic words (resp. for finite words of type `u^i u[0:j]`), the reduced Rauzy graph of order `n` (resp. for `n` smaller or equal to `(i-1)|u|+j`) is the directed graph whose unique vertex is the prefix `p` of length `n` of self and which has an only edge which is a loop on `p` labelled by `w[n+1:|w|] p` ... | For infinite periodic words (resp. for finite words of type `u^i u[0:j]`), the reduced Rauzy graph of order `n` (resp. for `n` smaller or equal to `(i-1)|u|+j`) is the directed graph whose unique vertex is the prefix `p` of length `n` of self and which has an only edge which is a loop on `p` labelled by `w[n+1:|w|] p` ... | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
:: For the Fibonacci word: :: | For the Fibonacci word:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
:: For periodic words: :: | For periodic words:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
:: For ultimataly periodic words: :: | For ultimately periodic words:: | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
return words," Advances in Applied Mathematics 42, no. 1 60-74 | return words," Advances in Applied Mathematics 42 (2009) 60-74. | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
155,(3-4) : 251-263, 2008. | 155 (2008) 251-263. | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
if g.num_verts() !=0 and len(l)==g.num_verts(): | if g.num_verts() !=0 and len(l)==g.num_verts(): | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
g.add_edge(i,o,g.edge_label(i,v)[0]+g.edge_label(v,o)[0]) | g.add_edge(i,o,g.edge_label(i,v)[0]*g.edge_label(v,o)[0]) | def reduced_rauzy_graph(self, n): r""" Returns the reduced Rauzy graph of order `n` of self. | ad384197990a1f7a894a75fbf3b0c0f4163c34fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad384197990a1f7a894a75fbf3b0c0f4163c34fc/word.py |
""" | Multi-edged and looped graphs are partially supported:: sage: G = Graph({0:[1,1]}, multiedges=True) sage: G.is_planar() True sage: G.is_planar(on_embedding={}) Traceback (most recent call last): ... NotImplementedError: Cannot compute with embeddings of multiple-edged or looped graphs. sage: G.is_planar(set_pos=True)... | def is_planar(self, on_embedding=None, kuratowski=False, set_embedding=False, set_pos=False): """ Returns True if the graph is planar, and False otherwise. This wraps the reference implementation provided by John Boyer of the linear time planarity algorithm by edge addition due to Boyer Myrvold. (See reference code in ... | a6b29541f5b288dce1de199fa1a32d91401fc768 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a6b29541f5b288dce1de199fa1a32d91401fc768/generic_graph.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 ... | ad4689fa903072bfc0e90226dd583848b9059a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad4689fa903072bfc0e90226dd583848b9059a46/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 ... | ad4689fa903072bfc0e90226dd583848b9059a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad4689fa903072bfc0e90226dd583848b9059a46/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. | ad4689fa903072bfc0e90226dd583848b9059a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad4689fa903072bfc0e90226dd583848b9059a46/lyndon_word.py |
a lyndon word | A Lyndon word. | def __init__(self, data, check=True): r""" Construction of a Lyndon word. | ad4689fa903072bfc0e90226dd583848b9059a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ad4689fa903072bfc0e90226dd583848b9059a46/lyndon_word.py |
self.n = ZZ(max(S)+1).exact_log(2) | self.n = ZZ(max(S)).nbits() | def __init__(self, *args, **kwargs): """ Construct a substitution box (S-box) for a given lookup table `S`. | 545f21e5a9f36a186853ab139bb1daf40b02474e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/545f21e5a9f36a186853ab139bb1daf40b02474e/sbox.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... | 7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05/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... | 7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05/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... | 7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05/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... | 7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/7b3dd94f59108e2b7c8b4c08ae1e59b8a1d24b05/permutation.py |
more planar areas get fewer triangles, and areas with higher curvature get more triangles | more planar areas get fewer triangles, and areas with higher curvature get more triangles. | def get_colors(self, list): """ Parameters: list: an iterable collection of values which can be cast into colors -- typically an RGB triple, or an RGBA 4-tuple Returns: a list of single parameters which can be passed into the set_color method of the Triangle or SmoothTriangle objects generated by this factory. TESTS:... | cd7effbbdba0d7068b238c9eca1f885aa2fae2ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cd7effbbdba0d7068b238c9eca1f885aa2fae2ea/tri_plot.py |
if self._style == "coroots" and all(xv in ZZ for xv in x): | if self._style == "coroots" and isinstance(x, tuple) and all(xv in ZZ for xv in x): | def __call__(self, *args): """ Coerces the element into the ring. You may pass a vector in the ambient space, an element of the base_ring, or an argument list of integers (or half-integers for the spin types) which are the components of a vector in the ambient space. INPUT: - ``x`` - a ring element to be coerced; o... | 3d0e5b3bdb1b89666238168668debc31346ebfea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3d0e5b3bdb1b89666238168668debc31346ebfea/weyl_characters.py |
gens = [ "()" ] | k = max(self.entries()) gens = [range(1,k+1)] | 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 ... | b744452c7f6bfbeb397c74b7e46d79bc9098d8be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b744452c7f6bfbeb397c74b7e46d79bc9098d8be/tableau.py |
""" Theta_Precision = bound | sage: Q = QuadraticForm(ZZ, 4, [1,1,1,1, 1,0,0, 1,0, 1]) sage: map(len, Q.vectors_by_length(2)) [1, 12, 12] """ eps = RDF(1e-6) bound = ZZ(floor(bound)) Theta_Precision = bound + eps | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
empty_vec_list = [[] for i in range(Theta_Precision + 1)] theta_vec = [[] for i in range(Theta_Precision + 1)] | theta_vec = [[] for i in range(bound + 1)] | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) | Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
Z = sqrt(T[i] / Q[i][i]) L[i] = ZZ(floor(Z - U[i])) x[i] = ZZ(ceil(-Z - U[i]) - 0) | Z = (T[i] / Q[i][i]).sqrt(extend=False) L[i] = ( Z - U[i]).floor() x[i] = (-Z - U[i]).ceil() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
Q_val = ZZ(floor(round(Q_val_double))) | Q_val = Q_val_double.round() | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
if (Q_val <= Theta_Precision): | if (Q_val <= bound): | def vectors_by_length(self, bound): """ Returns a list of short vectors together with their values. This is a naive algorithm which uses the Cholesky decomposition, but does not use the LLL-reduction algorithm. INPUT: bound -- an integer >= 0 OUTPUT: A list L of length (bound + 1) whose entry L[i] is a list of all v... | 0464758030cf3fbc3a19f1c59504815d743fdfec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0464758030cf3fbc3a19f1c59504815d743fdfec/quadratic_form__split_local_covering.py |
def _limit_latex_(*args): | def _limit_latex_(self, f, x, a): | def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (20... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) | sage: f = function('f',x) sage: _limit_latex_(0, f, x, a) | def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (20... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
f = args[0] x = args[1] a = args[2] | def _limit_latex_(*args): r""" Return latex expression for limit of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _limit_latex_ sage: var('x,a') (x, a) sage: f(x) = function('f',x) sage: _limit_latex_(f(x), x, a) '\\lim_{x \\to a}\\, f\\left(x\\right)' AUTHORS: - Golam Mortuza Hossain (20... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py | |
def _integrate_latex_(*args): | def _integrate_latex_(self, f, x, *args): | def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) | sage: f = function('f',x) sage: _integrate_latex_(0,f,x) | def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
sage: _integrate_latex_(f(x),x,a,b) | sage: _integrate_latex_(0,f,x,a,b) | def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
f = args[0] x = args[1] | def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py | |
if len(args) == 4: a = args[2] b = args[3] | if len(args) == 2: a, b = args | def _integrate_latex_(*args): r""" Return LaTeX expression for integration of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _integrate_latex_ sage: var('x,a,b') (x, a, b) sage: f(x) = function('f',x) sage: _integrate_latex_(f(x),x) '\\int f\\left(x\\right)\\,{d x}' sage: _integrate_latex_(f... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
def _laplace_latex_(*args): | def _laplace_latex_(self, *args): | def _laplace_latex_(*args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' AUTHORS:... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s) | sage: f = function('f',t) sage: _laplace_latex_(0,f,t,s) | def _laplace_latex_(*args): r""" Return LaTeX expression for Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _laplace_latex_ sage: var('s,t') (s, t) sage: f(t) = function('f',t) sage: _laplace_latex_(f(t),t,s) '\\mathcal{L}\\left(f\\left(t\\right), t, s\\right)' AUTHORS:... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
def _inverse_laplace_latex_(*args): | def _inverse_laplace_latex_(self, *args): | def _inverse_laplace_latex_(*args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t) '\\mathcal{L}^{-1}\\left(F\\le... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t) | sage: F = function('F',s) sage: _inverse_laplace_latex_(0,F,s,t) | def _inverse_laplace_latex_(*args): r""" Return LaTeX expression for inverse Laplace transform of a symbolic function. EXAMPLES:: sage: from sage.calculus.calculus import _inverse_laplace_latex_ sage: var('s,t') (s, t) sage: F(s) = function('F',s) sage: _inverse_laplace_latex_(F(s),s,t) '\\mathcal{L}^{-1}\\left(F\\le... | 4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4d7d88dc0e2e88a2fc4473ccb94bb557e357cf3b/calculus.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.