# Changeset 2337:361b4570d4ff

Ignore:
Timestamp:
01/11/07 17:31:58 (6 years ago)
Branch:
default
Parents:
2335:f4df42f5af11 (diff), 2336:ca018d0ae6ed (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Bunches of little things to fix doctest problems.

Location:
sage
Files:
22 edited

Unmodified
Removed
• ## sage/combinat/combinat.py

 r2114 Traceback (most recent call last): ... TypeError TypeError: no implicit coercion of element to the rational numbers There was a conjecture that the sequence \$L_n\$ defined by
• ## sage/combinat/combinat.py

 r2114 Traceback (most recent call last): ... TypeError TypeError: no implicit coercion of element to the rational numbers There was a conjecture that the sequence \$L_n\$ defined by
• ## sage/libs/pari/gen.pyx

 r1816 remainder, with respect to v (to main variable if v is omitted). sage: """ t0GEN(y)
• ## sage/libs/pari/gen.pyx

 r1816 remainder, with respect to v (to main variable if v is omitted). sage: """ t0GEN(y)
• ## sage/matrix/matrix0.pyx

 r2320 EXAMPLES: sage: matrix(2,[1,2,3,4]) [1 2] [3 4] """ """ Add two matrices with the same parent. EXAMPLES: sage: """ cdef Py_ssize_t i, j sage: a = matrix(2,2, [1,2,x*y,y*x]) sage: b = matrix(2,2, [1,2,y*x,y*x]) """ return self._add_c_impl(right._left_scalar_multiply(-1)) EXAMPLES: EXAMPLE cmparing sparse and dense matrices: sage: sage: matrix(QQ,2,range(4)) == matrix(QQ,2,range(4),sparse=True) True
• ## sage/matrix/matrix0.pyx

 r2183 EXAMPLES: sage: matrix(2,[1,2,3,4]) [1 2] [3 4] """ """ Add two matrices with the same parent. EXAMPLES: sage: """ cdef Py_ssize_t i, j sage: a = matrix(2,2, [1,2,x*y,y*x]) sage: b = matrix(2,2, [1,2,y*x,y*x]) """ return self._add_c_impl(right._left_scalar_multiply(-1)) if n < 0: return (~self)**(-n) ans = self.parent()(1) if n == 1: return self ans = None apow = self while n != 0: if n%2 != 0: ans = ans * apow if ans is None: ans = apow else: ans = ans * apow n = n/2 if n == 0:  # to not waste time doing an extra multiplication/increment EXAMPLES: EXAMPLE cmparing sparse and dense matrices: sage: sage: matrix(QQ,2,range(4)) == matrix(QQ,2,range(4),sparse=True) True
• ## sage/modular/modsym/ambient.py

 r2288 sage: M = ModularSymbols(Gamma0(22), 2); M Modular Symbols space of dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field sage: for b, e in M.factorization(): sage: M.factorization(): ...    print b.dimension(), b.level(), e 1 11 2 2 26 1 2 26 1 An example with level divisible by a square: sage: M = ModularSymbols(Gamma0(2*9),2); M return self.__integral_structure class ModularSymbolsAmbient_wtk_g0(ModularSymbolsAmbient):
• ## sage/modular/modsym/ambient.py

 r2288 sage: M = ModularSymbols(Gamma0(22), 2); M Modular Symbols space of dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field sage: for b, e in M.factorization(): sage: M.factorization(): ...    print b.dimension(), b.level(), e 1 11 2 2 26 1 2 26 1 An example with level divisible by a square: sage: M = ModularSymbols(Gamma0(2*9),2); M return self.__integral_structure class ModularSymbolsAmbient_wtk_g0(ModularSymbolsAmbient):
• ## sage/modular/ssmod/ssmod.py

 r2159 sage: D = a.decomposition() sage: D[:3] [(Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  0  0  1 96 96  1  0 95  1  1  1  1 95  2 96  0  0 96 96  0  0 96  2 96 96  2  0  0  1  1 95  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 16 75 22 81  0  0 17 17 80 80  0  0 16  1 40 74 23 57 96 81  0 23 74  0  0  0 24 73  0  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 90 90  7  7  0  0  6 91  6 91  0  0  7 13  0 91  6  0 84 90  0 91  6  0  0  0 90  7  0  0], 1)] [ (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  0  0  1 96 96  1  0 95  1  1  1  1 95  2 96  0  0 96 96  0  0 96  2 96 96  2  0  0  1  1 95  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 16 75 22 81  0  0 17 17 80 80  0  0 16  1 40 74 23 57 96 81  0 23 74  0  0  0 24 73  0  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 90 90  7  7  0  0  6 91  6 91  0  0  7 13  0 91  6  0 84 90  0 91  6  0  0  0 90  7  0  0], 1) ] sage: len(D) 9
• ## sage/modular/ssmod/ssmod.py

 r2159 sage: D = a.decomposition() sage: D[:3] [(Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  0  0  1 96 96  1  0 95  1  1  1  1 95  2 96  0  0 96 96  0  0 96  2 96 96  2  0  0  1  1 95  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 16 75 22 81  0  0 17 17 80 80  0  0 16  1 40 74 23 57 96 81  0 23 74  0  0  0 24 73  0  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 90 90  7  7  0  0  6 91  6 91  0  0  7 13  0 91  6  0 84 90  0 91  6  0  0  0 90  7  0  0], 1)] [ (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  0  0  1 96 96  1  0 95  1  1  1  1 95  2 96  0  0 96 96  0  0 96  2 96 96  2  0  0  1  1 95  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 16 75 22 81  0  0 17 17 80 80  0  0 16  1 40 74 23 57 96 81  0 23 74  0  0  0 24 73  0  0], 1), (Vector space of degree 33 and dimension 1 over Finite Field of size 97 Basis matrix: [ 0  1 96 90 90  7  7  0  0  6 91  6 91  0  0  7 13  0 91  6  0 84 90  0 91  6  0  0  0 90  7  0  0], 1) ] sage: len(D) 9
• ## sage/modules/complex_double_vector.pyx

 r2321 Traceback (most recent call last): ... IndexError: index 5 out of range IndexError: index out of range """ cdef gsl_complex z_temp
• ## sage/modules/complex_double_vector.pyx

 r2274 from sage.rings.complex_double cimport ComplexDoubleElement from sage.rings.complex_double import CDF from sage.rings.complex_double import CDF, new_ComplexDoubleElement include '../ext/stdsage.pxi' def __getitem__(self,size_t i): """ Return the ith entry of self. EXAMPLES: sage: v = vector(CDF, [1,CDF(3,2), -1]); v (1.0, 3.0 + 2.0*I, -1.0) sage: v[1] 3.0 + 2.0*I sage: v[5] Traceback (most recent call last): ... IndexError: index out of range """ cdef gsl_complex z_temp cdef ComplexDoubleElement x if i < 0 or i >= self.v.size: raise IndexError else: z_temp = gsl_vector_complex_get(self.v,i) return CDF(GSL_REAL(z_temp),GSL_IMAG (z_temp)) raise IndexError, 'index out of range' else: x = new_ComplexDoubleElement() x._complex = gsl_vector_complex_get(self.v,i) return x cdef ModuleElement _add_c_impl(self, ModuleElement right):
• ## sage/plot/tachyon.py

 r2334 sage: t.plane((0,-20,0), (0,1,0), 'white') sage: t.plane((-20,0,0), (1,0,0), 'white') sage: sage: k=0 sage: for i in srange(-1,1,0.05): def get_colors(self, list): return texture_recolor(self._tachyon, self._texture, list) return self._tachyon.texture_recolor(self._texture, list)
• ## sage/plot/tachyon.py

 r2334 sage: t.plane((0,-20,0), (0,1,0), 'white') sage: t.plane((-20,0,0), (1,0,0), 'white') sage: sage: k=0 sage: for i in srange(-1,1,0.05): def get_colors(self, list): return texture_recolor(self._tachyon, self._texture, list) return self._tachyon.texture_recolor(self._texture, list)
• ## sage/rings/quotient_ring.py

 r2014 sage: pi(5) 2 sage: sage: l = pi.lift()
• ## sage/rings/quotient_ring.py

 r2014 sage: pi(5) 2 sage: sage: l = pi.lift()
• ## sage/server/notebook/cell.py

 r2330 output = output[:i] if len(output) > MAX_OUTPUT: if not self.computing(): file = "%s/full_output.txt"%self.directory() open(file,"w").write(output) html+="
full_output.txt"%file if output.lstrip()[:len(TRACEBACK)] != TRACEBACK: output = 'WARNING: Output truncated!\n' + output[:MAX_OUTPUT] + '\n(truncated)' output = 'WARNING: Output truncated!\n' + output[:MAX_OUTPUT/2] + '...\n\n...' + output[-MAX_OUTPUT/2:] else: output = output[:MAX_OUTPUT] + '\n(truncated)' output = output[:MAX_OUTPUT/2] + '...\n\n...' + output[-MAX_OUTPUT/2:] self.__out = output self.__out_html = html images.append(''%(dir,F)) else: files.append('%s'%(dir, F, F)) files.append('%s'%(dir, F, F)) if len(images) == 0: images = ''
• ## sage/server/notebook/cell.py

 r2336 self.__text = text self.__worksheet = worksheet def set_worksheet(self, worksheet, id=None): self.__worksheet = worksheet self.__dir = '%s/cells/%s'%(worksheet.directory(), self.relative_id()) if not id is None: self.__id = id def relative_id(self): return self.__id - self.__worksheet.id()*notebook.MAX_WORKSHEETS def html(self, ncols, do_print=False, do_math_parse=True): self.set_id(id) self.__out_html = self.files_html() def id(self): return self.__id def relative_id(self): return self.__id - self.__worksheet.id()*notebook.MAX_WORKSHEETS def set_id(self, id): self.__id = int(id) def worksheet(self): return self.__worksheet def notebook(self): return self.__worksheet.notebook() def directory(self): if not os.path.exists(self.__dir): os.makedirs(self.__dir) return self.__dir def __cmp__(self, right): def computing(self): return self in self.__worksheet.queue() def directory(self): if not os.path.exists(self.__dir): os.makedirs(self.__dir) return self.__dir def id(self): return self.__id def relative_id(self): return self.__id - self.__worksheet.id()*notebook.MAX_WORKSHEETS def set_id(self, id): self.__id = int(id) def worksheet(self): return self.__worksheet def notebook(self): return self.__worksheet.notebook() def set_input_text(self, input):
• ## sage/server/notebook/worksheet.py

 r2335 # Finished a computation. self.__comp_is_running = False del self.__queue[0] out = self._process_output(out) if C.introspect(): self.notebook().add_to_history(history) del self.__queue[0] return 'd', C
• ## sage/server/notebook/worksheet.py

 r2336 input = input.split('\n') # The following is all so the last line (or single lines) # will implicitly print as they should, unless they are # an assignment.   "display hook"  It's very complicated, # but it has to be... i = len(input)-1 if i >= 0:
• ## sage/structure/element.pyx

 r2321 def _is_atomic(self): """ Return True if and only if parenthesis are not required when *printing* out any of x - self, x + self, x^self and x/self. EXAMPLES: sage: n = 5; n._is_atomic() True sage: n = x+1; n._is_atomic() False """ if self._parent.is_atomic_repr(): return True
• ## sage/structure/element.pyx

 r2078 def _is_atomic(self): """ Return True if and only if parenthesis are not required when *printing* out any of x - self, x + self, x^self and x/self. EXAMPLES: sage: n = 5; n._is_atomic() True sage: n = x+1; n._is_atomic() False """ if self._parent.is_atomic_repr(): return True # self * right,  where right need not be a ring element in the base ring # This does type checking and canonical coercion then calls _lmul_c_impl. if PY_TYPE_CHECK(right, Element) and (right)._parent is self._parent._base: # No coercion needed return self._lmul_c(right) else: # Otherwise we do an explicit canonical coercion. try: return self._lmul_c( self._parent._base._coerce_c(right) ) except TypeError: # that failed -- try to base extend right then do the multiply: self = self.base_extend((right)._parent) return (self)._lmul_c(right) if PY_TYPE_CHECK(right, Element): if (right)._parent is self._parent._base: # No coercion needed return self._lmul_c(right) else: # Otherwise we do an explicit canonical coercion. try: return self._lmul_c( self._parent._base._coerce_c(right) ) except TypeError: # that failed -- try to base extend right then do the multiply: self = self.base_extend((right)._parent) return (self)._lmul_c(right) else: # right is not an element at all return (self)._lmul_c(self._parent._base._coerce_c(right)) cdef ModuleElement _rmultiply_by_scalar(self, left): # left * self, where left need not be a ring element in the base ring # This does type checking and canonical coercion then calls _rmul_c_impl. if PY_TYPE_CHECK(left, Element) and (self)._parent is self._parent._base: # No coercion needed return self._rmul_c(right) else: # Otherwise we do an explicit canonical coercion. try: return self._rmul_c(self._parent._base._coerce_c(left)) except TypeError: # that failed -- try to base extend self then do the multiply: self = self.base_extend((left)._parent) return (self)._rmul_c(left) if PY_TYPE_CHECK(left, Element): if (self)._parent is self._parent._base: # No coercion needed return self._rmul_c(right) else: # Otherwise we do an explicit canonical coercion. try: return self._rmul_c(self._parent._base._coerce_c(left)) except TypeError: # that failed -- try to base extend self then do the multiply: self = self.base_extend((left)._parent) return (self)._rmul_c(left) else: # now left is not an element at all. return (self)._rmul_c(self._parent._base._coerce_c(left)) cdef ModuleElement _lmul_nonscalar_c(left, right): a = self power = self.parent()(1) power = None if n < 0: n = -n a = ~self elif n == 0: return power return self.parent()(1) power = (self)._parent(1) apow = a while True: if n&1 > 0: power = power*apow if n&1 > 0: if power is None: power = apow else: power = power*apow n = n >> 1 if n != 0:
Note: See TracChangeset for help on using the changeset viewer.