# 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/sage/groups/perm_gps/partn_ref/tree_traversal.pyx	Tue Jul 29 13:41:56 2008 -0700
+++ b/sage/groups/perm_gps/partn_ref/tree_traversal.pyx	Wed Aug 06 10:36:27 2008 -0700
@@ -281,7 +281,7 @@ cdef inline PartitionStack *PS_from_list
     cdef int cell, i, num_cells = len(L), cur_start = 0, cur_len, n = 0
     for cell from 0 <= cell < num_cells:
         n += len(L[cell])
-    cdef PartitionStack *PS = PS_new(n, False)
+    cdef PartitionStack *PS = PS_new(n, 0)
     cell = 0
     if PS is NULL:
         return PS
@@ -312,6 +312,7 @@ cdef inline int PS_print(PartitionStack 
     cdef int i
     for i from 0 <= i < PS.depth + 1:
         PS_print_partition(PS, i)
+    print
 
 cdef inline int PS_print_partition(PartitionStack *PS, int k):
     """
@@ -509,7 +510,7 @@ def PS_represent(partition=[[6],[3,4,8,7
     cdef int i, n = sum([len(cell) for cell in partition]), *gamma
     cdef bitset_t b
     print "Allocating PartitionStack..."
-    cdef PartitionStack *PS = PS_new(n, True), *PS2
+    cdef PartitionStack *PS = PS_new(n, 1), *PS2
     if PS is NULL:
         print "Allocation failed!"
         return
@@ -759,6 +760,7 @@ cdef traverse_return *traverse_tree(obje
     output.num_gens = 0
     if base:
         output.base = <int *> sage_malloc( n * sizeof(int) )
+        output.base_size = 0
     
     current_indicators = <int *> sage_malloc( n * sizeof(int) )
     first_indicators = <int *> sage_malloc( n * sizeof(int) )
@@ -776,7 +778,7 @@ cdef traverse_return *traverse_tree(obje
     cells_to_refine_by = <int *> sage_malloc( n * sizeof(int) )
     vertices_determining_current_stack = <int *> sage_malloc( n * sizeof(int) )
     
-    current_ps = PS_new(n, False)
+    current_ps = PS_new(n, 0)
     orbits_of_subgroup = OP_new(n)
     
     # Check for allocation failures:
@@ -951,6 +953,7 @@ cdef traverse_return *traverse_tree(obje
             label_indicators[i] = current_indicators[i]
         if base:
             output.base[i] = vertices_determining_current_stack[i]
+            output.base_size += 1
 
     first_meets_current = current_ps.depth
     first_kids_are_same = current_ps.depth
@@ -971,7 +974,6 @@ cdef traverse_return *traverse_tree(obje
             label_meets_current = current_ps.depth
 
         # I. Search for a new vertex to split, and update subgroup information
-
         new_vertex = 0
         if current_ps.depth > first_meets_current:
             # If we are not at a node of the first stack, reduce size of
@@ -1111,6 +1113,7 @@ cdef traverse_return *traverse_tree(obje
                     elif i < 0:
                         backtrack = 1
                     else:
+                        PS_get_perm_from(current_ps, label_ps, permutation)
                         automorphism = 1
                 if update_label:
                     PS_copy_from_to(current_ps, label_ps)
@@ -1219,6 +1222,8 @@ cdef traverse_return *traverse_tree(obje
         if canonical_label:
             sage_free(output.relabeling)
         sage_free(output)
+        output = NULL
+        raise MemoryError
 
 
 
@@ -1233,4 +1238,3 @@ cdef traverse_return *traverse_tree(obje
 
 
 
-
