Commit 7a6637a
committed
Lighter construction of finite field elements from lists
When doing intensive polynomial arithmetic with the NTL implementation
the constructor with lists is called a large number of times
and may spend a lot of time constructing the vector_space and
FreeModuleElement objects.
The very common call to vector_space(map=False) is optimized to be as cheap as
possible using the already cached object.
The common case of lists of length 0 and 1 is replaced by cheaper
shortcuts.1 parent 82e02a1 commit 7a6637a
File tree
2 files changed
+21
-3
lines changed- src/sage/rings/finite_rings
2 files changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
| 284 | + | |
| 285 | + | |
280 | 286 | | |
281 | 287 | | |
282 | 288 | | |
| |||
496 | 502 | | |
497 | 503 | | |
498 | 504 | | |
499 | | - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
500 | 512 | | |
501 | 513 | | |
502 | 514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
| 1232 | + | |
1232 | 1233 | | |
1233 | | - | |
1234 | | - | |
1235 | 1234 | | |
1236 | 1235 | | |
1237 | 1236 | | |
| |||
1241 | 1240 | | |
1242 | 1241 | | |
1243 | 1242 | | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1244 | 1250 | | |
1245 | 1251 | | |
1246 | 1252 | | |
| |||
0 commit comments