rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for f in self.all_deps(filename):
for f in self.all_deps(filename, ext_module):
def newest_dep(self, filename): """ Returns the most recently modified file that filename depends on, along with its timestamp. """ nfile = filename ntime = self.timestamp(filename) for f in self.all_deps(filename): if self.timestamp(f) > ntime: nfile = f ntime = self.timestamp(f) return nfile, ntime
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
dep_file, dep_time = deps.newest_dep(f)
dep_file, dep_time = deps.newest_dep(f,m)
def compile_command_list(ext_modules, deps): """ Computes a list of commands needed to compile and link the extension modules given in 'ext_modules' """ queue_compile_high = [] queue_compile_med = [] queue_compile_low = [] for m in ext_modules: new_sources = [] for f in m.sources: if f.endswith('.pyx'): dep_file, dep_...
578b3dc4ae6572d8955745050879ff3bb3e0334a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/578b3dc4ae6572d8955745050879ff3bb3e0334a/setup.py
self._error_re = re.compile('(Principal Value|debugmode|Incorrect syntax|Maxima encountered a Lisp error)')
self._error_re = re.compile('(Principal Value|debugmode|incorrect syntax|Maxima encountered a Lisp error)')
def __init__(self, script_subdirectory=None, logfile=None, server=None, init_code = None): """ Create an instance of the Maxima interpreter.
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
sage: maxima.eval('sage0: x == x;')
sage: maxima._eval_line('sage0: x == x;')
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
TypeError: error evaluating "sage0: x == x;":...
TypeError: Error executing code in Maxima...
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
self._expect_expr(self._display_prompt) pre_out = self._before() self._expect_expr() out = self._before()
assert line_echo.strip() == line.strip() self._expect_expr(self._display_prompt) out = self._before()
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
self._error_check(line, pre_out)
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
self._expect_expr() assert len(self._before())==0, 'Maxima expect interface is confused!'
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
i = o.rfind('(%o') return o[:i]
def _eval_line(self, line, allow_use_file=False, wait_for_prompt=True, reformat=True, error_check=True): """ EXAMPLES: We check that errors are correctly checked:: sage: maxima._eval_line('1+1;') '2' sage: maxima.eval('sage0: x == x;') Traceback (most recent call last): ... TypeError: error evaluating "sage0: x == x;...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
def _command_runner(self, command, s, redirect=True): """ Run ``command`` in a new Maxima session and return its output as an ``AsciiArtString``. If redirect is set to False, then the output of the command is not returned as a string. Instead, it behaves like os.system. This is used for interactive things like Maxima'...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
for _ in range(3):
for _ in range(5):
def _command_runner(self, command, s, redirect=True): """ Run ``command`` in a new Maxima session and return its output as an ``AsciiArtString``. If redirect is set to False, then the output of the command is not returned as a string. Instead, it behaves like os.system. This is used for interactive things like Maxima'...
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
'5.20.1'
'5.22.1'
def version(self): """ Return the version of Maxima that Sage includes. EXAMPLES:: sage: maxima.version() '5.20.1' """ return maxima_version()
1c5683ac123dd26a0497c4d29290cfe1a7e6273a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1c5683ac123dd26a0497c4d29290cfe1a7e6273a/maxima.py
sage: browse_sage_doc(identity_matrix, 'rst')[-60:-5] 'MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
sage: browse_sage_doc(identity_matrix, 'rst')[-107:-47] 'Full MatrixSpace of 3 by 3 sparse matrices over Integer Ring'
'def identity_matrix'
a8248b1998a8c3fce72d7270142255f709a4109d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/a8248b1998a8c3fce72d7270142255f709a4109d/sagedoc.py
Some cases that check on the negative twists::
Some harder cases fail::
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
-2
1
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
Dlist = [5,8,12,13,17,21,24,28,29]
Dlist = [5,8,12,13,17,21,24,28,29, 33, 37, 40, 41, 44, 53, 56, 57, 60, 61, 65, 69, 73, 76, 77, 85, 88, 89, 92, 93, 97]
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
while j < 9 and at0 == 0 :
while j < 30 and at0 == 0 :
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
chtw = True for ell in prime_divisors(D): chtw = chtw and ( valuation(E.conductor(),ell)<= valuation(D,ell) ) if chtw :
if all( valuation(E.conductor(),ell)<= valuation(D,ell) for ell in prime_divisors(D) ) :
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
if j == 9 and at0 == 0: sc = 1 if not self._use_eclib : msn = ModularSymbolSage(self._E,sign = -1,normalize = "L_ratio") sc = msn._scaling if sc == 0 or self._use_eclib : self.__scale_by_periods_only__() else : self._scaling = sc
if j == 30 and at0 == 0: self.__scale_by_periods_only__()
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
verbose('scale modular symbols by %s'%(l1/at0))
verbose('scale modular symbols by %s found at D=%s '%(l1/at0,D), level=2)
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
Dlist = [-3,-4,-7,-8,-11,-15,-19,-20,-23,-24]
Dlist = [-3,-4,-7,-8,-11,-15,-19,-20,-23,-24, -31, -35, -39, -40, -43, -47, -51, -52, -55, -56, -59, -67, -68, -71, -79, -83, -84, -87, -88, -91]
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
while j < 9 and at0 == 0 :
while j < 30 and at0 == 0 :
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
chtw = True for ell in prime_divisors(D): chtw = chtw and ( valuation(E.conductor(),ell)<= valuation(D,ell) ) if chtw :
if all( valuation(E.conductor(),ell)<= valuation(D,ell) for ell in prime_divisors(D) ) :
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
if j == 9 and at0 == 0:
if j == 30 and at0 == 0:
def _find_scaling_L_ratio(self): r""" This function is use to set ``_scaling``, the factor used to adjust the scalar multiple of the modular symbol. If `[0]`, the modular symbol evaluated at 0, is non-zero, we can just scale it with respect to the approximation of the L-value. It is known that the quotient is a rationa...
e61ada745f0d2355b8ce0e9e880d62354692e106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e61ada745f0d2355b8ce0e9e880d62354692e106/ell_modular_symbols.py
sage: W = Words('123') sage: W('1212').is_square() True sage: W('1213').is_square() False sage: W('12123').is_square() False sage: W().is_square()
sage: Word('1212').is_square() True sage: Word('1213').is_square() False sage: Word('12123').is_square() False sage: Word().is_square()
def is_square(self): r""" Returns True if self is a square, and False otherwise. EXAMPLES:: sage: Word([1,0,0,1]).is_square() False sage: W = Words('123') sage: W('1212').is_square() True sage: W('1213').is_square() False sage: W('12123').is_square() False sage: W().is_square() True """ if self.length() % 2 != 0: ret...
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True TESTS:: sage: W = Words('123') sage: W('11').is_square_free() False sage: W('211').is_square_free() False sage: W('3211').is_square_free() False """ l = self.length() if l < 2:
sage: Word('12312').is_square_free() True sage: Word('31212').is_square_free() False sage: Word().is_square_free() True TESTS: We make sure that sage: Word('11').is_square_free() False sage: Word('211').is_square_free() False sage: Word('3211').is_square_free() False """ L = self.length() if L < 2:
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
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
suff = self for i in xrange(0, l-1): for ll in xrange(2, l-i+1, 2): if suff[:ll].is_square():
for start in xrange(0, L-1): for end in xrange(start+2, L+1, 2): if self[start:end].is_square():
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
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
suff = suff[1:]
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
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
sage: W = Words('012') sage: W('012012012').is_cube() True sage: W('01010101').is_cube() False sage: W().is_cube() True sage: W('012012').is_cube()
sage: Word('012012012').is_cube() True sage: Word('01010101').is_cube() False sage: Word().is_cube() True sage: Word('012012').is_cube()
def is_cube(self): r""" Returns True if self is a cube, and False otherwise. EXAMPLES:: sage: W = Words('012') sage: W('012012012').is_cube() True sage: W('01010101').is_cube() False sage: W().is_cube() True sage: W('012012').is_cube() False """ if self.length() % 3 != 0: return False l = self.length() / 3 return sel...
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3:
sage: Word('12312').is_cube_free() True sage: Word('32221').is_cube_free() False sage: Word().is_cube_free() True TESTS: We make sure that sage: Word('111').is_cube_free() False sage: Word('2111').is_cube_free() False sage: Word('32111').is_cube_free() False """ L = self.length() if L < 3:
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f...
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
suff = self for i in xrange(0, l - 3): for ll in xrange(3, l-i+1, 3): if suff[:ll].is_cube():
for start in xrange(0, L - 2): for end in xrange(start+3, L+1, 3): if self[start:end].is_cube():
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f...
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
suff = suff[1:]
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f...
608ca0250585b254464e69042498a89fb0e15156 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/608ca0250585b254464e69042498a89fb0e15156/finite_word.py
sage: browse_sage_doc(identity_matrix, 'rst')[:9] '**File:**' sage: browse_sage_doc(identity_matrix, 'rst')[-60:] 'MatrixSpace of 3 by 3 sparse matrices over Integer Ring\n ' sage: browse_sage_doc(identity_matrix, 'html', False)[:59] '<div class="docstring">\n \n <p><strong>File:</strong> /v'
sage: browse_sage_doc(identity_matrix, 'rst') "...**File:**...**Type:**...**Definition:** identity_matrix..." sage: identity_matrix.__doc__.replace('\\','\\\\') in browse_sage_doc(identity_matrix, 'rst') True sage: browse_sage_doc(identity_matrix, 'html', False) '...div...File:...Type:...Definition:...identity_matrix.....
def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``.
174f63c0b28c1a0bf36a3fe3338398b77321ceb7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/174f63c0b28c1a0bf36a3fe3338398b77321ceb7/sagedoc.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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/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...
0c1f24a85f1dccaf5341fcaca9e87554c8bacafa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1f24a85f1dccaf5341fcaca9e87554c8bacafa/rational_point.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``.
f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df/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``.
f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df/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``.
f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df/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``.
f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df/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``.
f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f0ec6e0ce17a906bf1c86ce6872fa3d8abb839df/generic_graph.py
sage: for lset in polytopes.cross_polytope(2).face_lattice().level_sets(): print lset[0] (None, (0, 1, 2, 3)) ((1,), (2, 3)) ((1, 2), (3,)) ((0, 1, 2, 3), None)
sage: level_sets = polytopes.cross_polytope(2).face_lattice().level_sets() sage: print level_sets[0], level_sets[-1] [(None, (0, 1, 2, 3))] [((0, 1, 2, 3), None)]
def face_lattice(self): """ Computes the face-lattice poset. Elements are tuples of (vertices, facets) - i.e. this keeps track of both the vertices in each face, and all the facets containing them.
59b3d8aaf6dc3b4c8e02614ae4b037c186cd7041 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/59b3d8aaf6dc3b4c8e02614ae4b037c186cd7041/polyhedra.py
sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1)
sage: region_plot([x^2+y^2<1, x<y], (x,-2,2), (y,-2,2), plot_points=400).show(aspect_ratio=1)
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...
753edff7feefaa3a751a4038db4165cb12358168 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/753edff7feefaa3a751a4038db4165cb12358168/contour_plot.py
return (self._sublattice_polytope.facet_constant(i) - self.facet_normal(i) * self._shift_vector)
return (self._sublattice_polytope.facet_constant(i) * self._dual_embedding_scale - self.facet_normal(i) * self._shift_vector )
def facet_constant(self, i): r""" Return the constant in the ``i``-th facet inequality of this polytope. The i-th facet inequality is given by self.facet_normal(i) * X + self.facet_constant(i) >= 0. INPUT: - ``i`` - integer, the index of the facet OUTPUT: - integer -- the constant in the ``i``-th facet inequality....
cb382479abb49cb54d316e5faf82ae76e94689dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb382479abb49cb54d316e5faf82ae76e94689dc/lattice_polytope.py
return (self._embedding_matrix * self._sublattice_polytope.facet_normal(i))
return ( self._sublattice_polytope.facet_normal(i) * self._dual_embedding_matrix )
def facet_normal(self, i): r""" Return the inner normal to the ``i``-th facet of this polytope. If this polytope is not full-dimensional, facet normals will be parallel to the affine subspace spanned by this polytope. INPUT: - ``i`` -- integer, the index of the facet OUTPUT: - vectors -- the inner normal of the ``...
cb382479abb49cb54d316e5faf82ae76e94689dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/cb382479abb49cb54d316e5faf82ae76e94689dc/lattice_polytope.py
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2
def dimension(self): r""" Returns the dimension of this code. EXAMPLES:: sage: G = matrix(GF(2),[[1,0,0],[1,1,0]]) sage: C = LinearCode(G) sage: C.dimension() 2 """ return self.__dim
e7978e4a8a9e7a0b967dd74b71761058529fdc6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e7978e4a8a9e7a0b967dd74b71761058529fdc6c/linear_code.py
Returns the Duursama data `v` and `m` of this formally s.d. code `C`
Returns the Duursma data `v` and `m` of this formally s.d. code `C`
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
e7978e4a8a9e7a0b967dd74b71761058529fdc6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e7978e4a8a9e7a0b967dd74b71761058529fdc6c/linear_code.py
- Pair ``(v, m)`` as in Duursama [D]_
- Pair ``(v, m)`` as in Duursma [D]_
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
e7978e4a8a9e7a0b967dd74b71761058529fdc6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e7978e4a8a9e7a0b967dd74b71761058529fdc6c/linear_code.py
- [D] - I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
.. [D] I. Duursma, "Extremal weight enumerators and ultraspherical polynomials"
def sd_duursma_data(C, i): r""" Returns the Duursama data `v` and `m` of this formally s.d. code `C` and the type number `i` in (1,2,3,4). Does *not* check if this code is actually sd. INPUT: - ``i`` - Type number OUTPUT: - Pair ``(v, m)`` as in Duursama [D]_ REFERENCES: - [D] - I. Duursma, "Extremal weight enum...
e7978e4a8a9e7a0b967dd74b71761058529fdc6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e7978e4a8a9e7a0b967dd74b71761058529fdc6c/linear_code.py
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursma [D]_
def sd_duursma_q(C,i,d0): r""" INPUT: - ``C`` - sd code; does *not* check if `C` is actually an sd code - ``i`` - Type number, one of 1,2,3,4 - ``d0`` - Divisor, the smallest integer such that each `A_i > 0` iff `i` is divisible by `d0` OUTPUT: - Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_ REFEREN...
e7978e4a8a9e7a0b967dd74b71761058529fdc6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/e7978e4a8a9e7a0b967dd74b71761058529fdc6c/linear_code.py
def has_good_reduction(self, P=None): r""" Returns True iff this point has good reduction modulo a prime.
4af8c2c715dfcf38fe582d3cf4bd633db20887f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4af8c2c715dfcf38fe582d3cf4bd633db20887f1/ell_point.py
if F.derivative(v)(xyz).valuation(P) == 0:
c = (F.derivative(v))(xyz) try: val = c.valuation(P) except AttributeError: val = c.constant_coefficient().valuation(P) if val == 0:
def has_good_reduction(self, P=None): r""" Returns True iff this point has good reduction modulo a prime.
4af8c2c715dfcf38fe582d3cf4bd633db20887f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/4af8c2c715dfcf38fe582d3cf4bd633db20887f1/ell_point.py
depends = ["sage/libs/mwrank/wrap.h"],
depends = ["sage/libs/mwrank/wrap.h"] + [ SAGE_INC + "eclib/" + h for h in ["curve.h","egr.h","descent.h","points.h","isogs.h", "marith.h","htconst.h","interface.h"] ],
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
f8079648562e9c376da4855658b14e9dcdaba916 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8079648562e9c376da4855658b14e9dcdaba916/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","homspace.h","mat.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
f8079648562e9c376da4855658b14e9dcdaba916 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8079648562e9c376da4855658b14e9dcdaba916/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","homspace.h","mat.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
f8079648562e9c376da4855658b14e9dcdaba916 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8079648562e9c376da4855658b14e9dcdaba916/module_list.py
define_macros = [("NTL_ALL",None)]),
define_macros = [("NTL_ALL",None)], depends = [ SAGE_INC + "eclib/" + h for h in ["interface.h","bigrat.h","rat.h","curve.h", "moddata.h","symb.h","cusp.h","xsplit.h","method.h", "oldforms.h","homspace.h","cperiods.h","newforms.h"] ]),
def uname_specific(name, value, alternative): if name in os.uname()[0]: return value else: return alternative
f8079648562e9c376da4855658b14e9dcdaba916 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8079648562e9c376da4855658b14e9dcdaba916/module_list.py
solution is not SymbolisEquation (as happens for example for
solution is not SymbolicEquation (as happens for example for
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): """ Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
- ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation.
- ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation.
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): """ Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
"""
r"""
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = [...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = ["s","x","y"], where s is the independent variable and x,y the dependent variables) ics -- a list of numbers representing initial condit...
- ``de`` - a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") - ``vars`` - a list of strings representing the variables (eg, vars = ["s","x","y"], where s is the independent variable and x,y the dependent variables) - ``ics`` - a list of numbers representing in...
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = [...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES:
The given ics sets the initial values of the dependent vars in maxima, so subsequent ODEs involving these variables will have these initial conditions automatically imposed. EXAMPLES::
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = [...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
Now type show(P1), show(P2) to view these.
Now type show(P1), show(P2) to view these.
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = [...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
AUTHORS: David Joyner (3-2006, 8-2007)
AUTHORS: - David Joyner (3-2006, 8-2007)
def desolve_system_strings(des,vars,ics=None): """ Solves any size system of 1st order ODE's. Initials conditions are optional. INPUT: de -- a list of strings representing the ODEs in maxima notation (eg, de = "diff(f(x),x,2)=diff(f(x),x)+sin(x)") vars -- a list of strings representing the variables (eg, vars = [...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
"""
r"""
def eulers_method(f,x0,y0,h,x1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order ODE ``y' = f(x,y)``, ``y(a)=c``. The "x" column of the table increments from ``x0`` to ``x1`` by ``h`` (so ``(x1-x0)/h`` must be an integer). In the "y" column, the new y-value equals...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
"""
r"""
def eulers_method_2x2(f,g, t0, x0, y0, h, t1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order system of two ODEs ``x' = f(t, x, y), x(t0)=x0.`` ``y' = g(t, x, y), y(t0)=y0.`` The "t" column of the table increments from `t_0` to `t_1` by `h` (so `\\frac{t_1-t_0...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
"""
r""" Plots solution of ODE
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
`\\theta''+\\sin(\\theta)=0`, `\\theta(0)=\\frac 34`, `\\theta'(0) =
`\theta''+\sin(\theta)=0`, `\theta(0)=\frac 34`, `\theta'(0) =
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
``(P[0]+P[1]).show()`` to plot `(t,\\theta(t))` and `(t,\\theta'(t))`:: sage: from sage.calculus.desolvers import eulers_method_2x2_plot
``(P[0]+P[1]).show()`` to plot `(t,\theta(t))` and `(t,\theta'(t))`::
def eulers_method_2x2_plot(f,g, t0, x0, y0, h, t1): """ This plots the soln in the rectangle ``(xrange[0],xrange[1]) x (yrange[0],yrange[1])`` and plots using Euler's method the numerical solution of the 1st order ODEs `x' = f(t,x,y)`, `x(a)=x_0`, `y' = g(t,x,y)`, `y(a) = y_0`. *For pedagogical purposes only.* EXAMPL...
9902f1225cf51ac05097f8e749c306b7e620fc70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9902f1225cf51ac05097f8e749c306b7e620fc70/desolvers.py
A decorator which renames keyword arguments and optionally deprecates the new keyword.
A decorator which renames keyword arguments and optionally deprecates the new keyword.
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword. INPUT: - ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyw...
0c1919a3916abf41ae3e625aa391cda0c7db51fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1919a3916abf41ae3e625aa391cda0c7db51fc/misc.py
- ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyword arguments in the form ``renamed_option='existing_option'``. This will have the effect of renaming ``renamed_option`` so that the function only s...
- ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyword arguments in the form ``renamed_option='existing_option'``. This will have the effect of renaming ``renamed_option`` so that the function only...
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword. INPUT: - ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyw...
0c1919a3916abf41ae3e625aa391cda0c7db51fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1919a3916abf41ae3e625aa391cda0c7db51fc/misc.py
def __init__(self, deprecated=None, **renames): """ A decorator which renames keyword arguments and optionally deprecates the new keyword. INPUT: - ``deprecated`` - If the option being renamed is deprecated, this is the Sage version where the deprecation initially occurs. - the rest of the arguments is a list of keyw...
0c1919a3916abf41ae3e625aa391cda0c7db51fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0c1919a3916abf41ae3e625aa391cda0c7db51fc/misc.py
""" qE = self._q
sage: T = EllipticCurve('14').tate_curve(7) sage: T.E2(30) 2 + 4*7 + 7^2 + 3*7^3 + 6*7^4 + 5*7^5 + 2*7^6 + 7^7 + 5*7^8 + 6*7^9 + 5*7^10 + 2*7^11 + 6*7^12 + 4*7^13 + 3*7^15 + 5*7^16 + 4*7^17 + 4*7^18 + 2*7^20 + 7^21 + 5*7^22 + 4*7^23 + 4*7^24 + 3*7^25 + 6*7^26 + 3*7^27 + 6*7^28 + O(7^30) """
def E2(self,prec=20): r""" Returns the value of the `p`-adic Eisenstein series of weight 2 evaluated on the elliptic curve having split multiplicative reduction.
3f6a66d93a81116b602fa428aafbd1665444d19f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/3f6a66d93a81116b602fa428aafbd1665444d19f/ell_tate_curve.py
if len(xi) != n:
if len(yi) != n:
def cnf(self, xi=None, yi=None, format=None): """ Return a representation of this S-Box in conjunctive normal form.
8b8863c7f600a0d590124d6ea490991c07ebcad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8b8863c7f600a0d590124d6ea490991c07ebcad8/sbox.py
x = self.to_bits(e)
x = self.to_bits(e, m)
def cnf(self, xi=None, yi=None, format=None): """ Return a representation of this S-Box in conjunctive normal form.
8b8863c7f600a0d590124d6ea490991c07ebcad8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/8b8863c7f600a0d590124d6ea490991c07ebcad8/sbox.py
""" qE = self._q
sage: T = EllipticCurve('14').tate_curve(7) sage: T.E2(30) 2 + 4*7 + 7^2 + 3*7^3 + 6*7^4 + 5*7^5 + 2*7^6 + 7^7 + 5*7^8 + 6*7^9 + 5*7^10 + 2*7^11 + 6*7^12 + 4*7^13 + 3*7^15 + 5*7^16 + 4*7^17 + 4*7^18 + 2*7^20 + 7^21 + 5*7^22 + 4*7^23 + 4*7^24 + 3*7^25 + 6*7^26 + 3*7^27 + 6*7^28 + O(7^30) """
def E2(self,prec=20): r""" Returns the value of the `p`-adic Eisenstein series of weight 2 evaluated on the elliptic curve having split multiplicative reduction.
255dc7d2b69b78763a51775965ef27eb47e87d36 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/255dc7d2b69b78763a51775965ef27eb47e87d36/ell_tate_curve.py
``obj``, return a list of those names. If
``obj``, return a sorted list of those names. If
def sage_getvariablename(obj, omit_underscore_names=True): """ Attempt to get the name of a Sage object. INPUT: - ``obj`` - an object - ``omit_underscore_names`` (optional, default True) If the user has assigned an object ``obj`` to a variable name, then return that variable name. If several variables point to ``ob...
9c29d381b0b6b0fd6b56d40504b997f23e53ff44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9c29d381b0b6b0fd6b56d40504b997f23e53ff44/sageinspect.py
return result
return sorted(result)
def sage_getvariablename(obj, omit_underscore_names=True): """ Attempt to get the name of a Sage object. INPUT: - ``obj`` - an object - ``omit_underscore_names`` (optional, default True) If the user has assigned an object ``obj`` to a variable name, then return that variable name. If several variables point to ``ob...
9c29d381b0b6b0fd6b56d40504b997f23e53ff44 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/9c29d381b0b6b0fd6b56d40504b997f23e53ff44/sageinspect.py