# HG changeset patch
# User Robert L. Miller <rlm@rlmiller.org>
# Date 1218044187 25200
# Node ID b1de815b82dd2e5fc79e9ef0cf70700d2cb5957c
# Parent a5e2fd3928b58fe2de1878ca0dba06b7bf1c9a75
A few missing details in tree_traversal.pyx
diff -r a5e2fd3928b5 -r b1de815b82dd sage/groups/perm_gps/partn_ref/tree_traversal.pyx
|
a
|
b
|
|
| 281 | 281 | cdef int cell, i, num_cells = len(L), cur_start = 0, cur_len, n = 0 |
| 282 | 282 | for cell from 0 <= cell < num_cells: |
| 283 | 283 | n += len(L[cell]) |
| 284 | | cdef PartitionStack *PS = PS_new(n, False) |
| | 284 | cdef PartitionStack *PS = PS_new(n, 0) |
| 285 | 285 | cell = 0 |
| 286 | 286 | if PS is NULL: |
| 287 | 287 | return PS |
| … |
… |
|
| 312 | 312 | cdef int i |
| 313 | 313 | for i from 0 <= i < PS.depth + 1: |
| 314 | 314 | PS_print_partition(PS, i) |
| | 315 | print |
| 315 | 316 | |
| 316 | 317 | cdef inline int PS_print_partition(PartitionStack *PS, int k): |
| 317 | 318 | """ |
| … |
… |
|
| 509 | 510 | cdef int i, n = sum([len(cell) for cell in partition]), *gamma |
| 510 | 511 | cdef bitset_t b |
| 511 | 512 | print "Allocating PartitionStack..." |
| 512 | | cdef PartitionStack *PS = PS_new(n, True), *PS2 |
| | 513 | cdef PartitionStack *PS = PS_new(n, 1), *PS2 |
| 513 | 514 | if PS is NULL: |
| 514 | 515 | print "Allocation failed!" |
| 515 | 516 | return |
| … |
… |
|
| 759 | 760 | output.num_gens = 0 |
| 760 | 761 | if base: |
| 761 | 762 | output.base = <int *> sage_malloc( n * sizeof(int) ) |
| | 763 | output.base_size = 0 |
| 762 | 764 | |
| 763 | 765 | current_indicators = <int *> sage_malloc( n * sizeof(int) ) |
| 764 | 766 | first_indicators = <int *> sage_malloc( n * sizeof(int) ) |
| … |
… |
|
| 776 | 778 | cells_to_refine_by = <int *> sage_malloc( n * sizeof(int) ) |
| 777 | 779 | vertices_determining_current_stack = <int *> sage_malloc( n * sizeof(int) ) |
| 778 | 780 | |
| 779 | | current_ps = PS_new(n, False) |
| | 781 | current_ps = PS_new(n, 0) |
| 780 | 782 | orbits_of_subgroup = OP_new(n) |
| 781 | 783 | |
| 782 | 784 | # Check for allocation failures: |
| … |
… |
|
| 951 | 953 | label_indicators[i] = current_indicators[i] |
| 952 | 954 | if base: |
| 953 | 955 | output.base[i] = vertices_determining_current_stack[i] |
| | 956 | output.base_size += 1 |
| 954 | 957 | |
| 955 | 958 | first_meets_current = current_ps.depth |
| 956 | 959 | first_kids_are_same = current_ps.depth |
| … |
… |
|
| 971 | 974 | label_meets_current = current_ps.depth |
| 972 | 975 | |
| 973 | 976 | # I. Search for a new vertex to split, and update subgroup information |
| 974 | | |
| 975 | 977 | new_vertex = 0 |
| 976 | 978 | if current_ps.depth > first_meets_current: |
| 977 | 979 | # If we are not at a node of the first stack, reduce size of |
| … |
… |
|
| 1111 | 1113 | elif i < 0: |
| 1112 | 1114 | backtrack = 1 |
| 1113 | 1115 | else: |
| | 1116 | PS_get_perm_from(current_ps, label_ps, permutation) |
| 1114 | 1117 | automorphism = 1 |
| 1115 | 1118 | if update_label: |
| 1116 | 1119 | PS_copy_from_to(current_ps, label_ps) |
| … |
… |
|
| 1219 | 1222 | if canonical_label: |
| 1220 | 1223 | sage_free(output.relabeling) |
| 1221 | 1224 | sage_free(output) |
| | 1225 | output = NULL |
| | 1226 | raise MemoryError |
| 1222 | 1227 | |
| 1223 | 1228 | |
| 1224 | 1229 | |
| … |
… |
|
| 1233 | 1238 | |
| 1234 | 1239 | |
| 1235 | 1240 | |
| 1236 | | |