1 | 3,5c3,5 |
---|
2 | < # Date 1305544525 -7200 |
---|
3 | < # Node ID 97c20526215a35957e2f8dc775b10e6c5d2b1b2a |
---|
4 | < # Parent b5e5e417fa7829eb3149f0ae431721aac5610ecd |
---|
5 | --- |
---|
6 | > # Date 1305716078 -7200 |
---|
7 | > # Node ID 93f1d2b12b726d98a28e3eb8f18e47df9bfaa3c8 |
---|
8 | > # Parent 14b58788c951a16ed2b6ef0cc748758faed602e8 |
---|
9 | 13c13 |
---|
10 | < @@ -989,9 +989,9 @@ |
---|
11 | --- |
---|
12 | > @@ -971,9 +971,9 @@ |
---|
13 | 315c315 |
---|
14 | < @@ -119,16 +124,39 @@ |
---|
15 | --- |
---|
16 | > @@ -119,16 +124,42 @@ |
---|
17 | 320c320,323 |
---|
18 | < + The following tests against a bug that was fixed in trac ticket #9944:: |
---|
19 | --- |
---|
20 | > + The following tests against a bug that was fixed in trac |
---|
21 | > + ticket #9944. The method ``zero()`` calls this hom space with |
---|
22 | > + a function, not with a matrix, and that case had previously |
---|
23 | > + not been taken care of:: |
---|
24 | 323c326 |
---|
25 | < + sage: V.Hom(V).zero() |
---|
26 | --- |
---|
27 | > + sage: V.Hom(V).zero() # indirect doctest |
---|
28 | 360c363 |
---|
29 | < @@ -137,7 +165,8 @@ |
---|
30 | --- |
---|
31 | > @@ -137,7 +168,8 @@ |
---|
32 | 370c373 |
---|
33 | < @@ -158,7 +187,8 @@ |
---|
34 | --- |
---|
35 | > @@ -158,7 +190,8 @@ |
---|
36 | 1090a1094,1102 |
---|
37 | > @@ -5317,7 +5339,7 @@ |
---|
38 | > |
---|
39 | > EXAMPLES:: |
---|
40 | > |
---|
41 | > - sage: R.<x> = ZZ[]; S.<y> = R[] |
---|
42 | > + sage: R.<x> = ZZ[]; S.<y> = PolynomialRing(R, sparse=True) |
---|
43 | > sage: f = y^3 + x*y -3*x; f |
---|
44 | > y^3 + x*y - 3*x |
---|
45 | > sage: f.truncate(2) |
---|
46 | 1494c1506 |
---|
47 | < @@ -6101,34 +6172,43 @@ |
---|
48 | --- |
---|
49 | > @@ -6101,34 +6172,12 @@ |
---|
50 | 1503,1512c1515,1516 |
---|
51 | < + self._new_constant_poly_ = self._an_element._new_constant_poly |
---|
52 | < + return |
---|
53 | < + # this is likely to be overridden below: |
---|
54 | < + try: |
---|
55 | < + self._new_constant_poly_ = self._an_element._new_constant_poly |
---|
56 | < + except AttributeError: |
---|
57 | < + self._new_constant_poly_ = codomain.__call__ |
---|
58 | < + return |
---|
59 | < if domain is codomain: # some rings are base rings of themselves! |
---|
60 | < return |
---|
61 | --- |
---|
62 | > - if domain is codomain: # some rings are base rings of themselves! |
---|
63 | > - return |
---|
64 | 1517,1518c1521 |
---|
65 | < + if not is_PolynomialRing(domain): |
---|
66 | < try: |
---|
67 | --- |
---|
68 | > - try: |
---|
69 | 1520,1530c1523,1524 |
---|
70 | < + one = codomain._element_constructor_(domain.one_element()) |
---|
71 | < except (AttributeError, NotImplementedError, TypeError): |
---|
72 | < + # perhaps it uses the old model? |
---|
73 | < + try: |
---|
74 | < + one = codomain._coerce_c(domain.one_element()) |
---|
75 | < + except (AttributeError, NotImplementedError, TypeError): |
---|
76 | < + return |
---|
77 | < + try: |
---|
78 | < + one_rmul_ = one._rmul_ |
---|
79 | < + except AttributeError: |
---|
80 | < return |
---|
81 | --- |
---|
82 | > - except (AttributeError, NotImplementedError, TypeError): |
---|
83 | > - return |
---|
84 | 1545,1553c1539 |
---|
85 | < + # For the p-adic fields, _lmul_ and _rmul_ return None!!! |
---|
86 | < + # To work around, we need to test its sanity before we try |
---|
87 | < + # to use it. |
---|
88 | < + try: |
---|
89 | < + if one_rmul_(domain.one_element()) is None: |
---|
90 | < + return |
---|
91 | < + self._new_constant_poly_ = one_rmul_ |
---|
92 | < + except TypeError: |
---|
93 | < + pass |
---|
94 | --- |
---|
95 | > + self._new_constant_poly_ = self._an_element._new_constant_poly |
---|
96 | 1558c1544 |
---|
97 | < @@ -6142,9 +6222,7 @@ |
---|
98 | --- |
---|
99 | > @@ -6142,9 +6191,7 @@ |
---|
100 | 1569c1555 |
---|
101 | < @@ -6154,7 +6232,12 @@ |
---|
102 | --- |
---|
103 | > @@ -6154,7 +6201,12 @@ |
---|
104 | 1729c1715 |
---|
105 | < + mpfr_set_si(self._coeffs[i], PyInt_AS_LONG(int(0)), rnd) |
---|
106 | --- |
---|
107 | > + mpfr_set_si(self._coeffs[0], PyInt_AS_LONG(int(0)), rnd) |
---|
108 | 1913c1899 |
---|
109 | < + Caveat: There is no coercion from a sparse into a dense |
---|
110 | --- |
---|
111 | > + Caveat: There is no coercion from a dense into a sparse |
---|
112 | 3318c3304 |
---|
113 | < @@ -761,7 +761,7 @@ |
---|
114 | --- |
---|
115 | > @@ -760,7 +760,7 @@ |
---|
116 | 3327c3313 |
---|
117 | < @@ -1483,7 +1483,7 @@ |
---|
118 | --- |
---|
119 | > @@ -1272,7 +1272,7 @@ |
---|
120 | 3350c3336 |
---|
121 | < @@ -104,10 +107,10 @@ |
---|
122 | --- |
---|
123 | > @@ -102,10 +105,10 @@ |
---|