@@ -130,7 +130,9 @@ int main (int argc, char **argv) {
130130 assert (a .backp == NULL );
131131 #endif
132132
133+ int iter = 0 ;
133134 while (true) {
135+ if (verbose ) printf ("## Iteration %d\n" , iter ); iter ++ ;
134136 #ifdef K2MAT
135137 // compute subtree info and write to file
136138 vu64_t z ; // resizable array to contain the subtree sizes
@@ -149,6 +151,7 @@ int main (int argc, char **argv) {
149151 if (node_limit < min_node_limit ) node_limit = min_node_limit ; // minimum node limit (ensure at least 2 levels)
150152 if (verbose ) printf ("Computing sizes for subtrees larger than %zu nodes\n" , node_limit );
151153 p = k2dfs_sizes_limit (a .fullsize ,& a ,& pos ,& z ,(size_t )node_limit ); // visit tree, compute and save subtree sizes in z
154+ node_limit = 0 ; // reset for next iterqation
152155 }
153156 a .subtinfo_size = z .n ;
154157 a .subtinfoarray = a .subtinfo = z .v ; // save subtree info in a
@@ -162,13 +165,13 @@ int main (int argc, char **argv) {
162165 if (verbose ) printf ("Multiplying (A+I)A\n" );
163166 mmult (& b ,& a ,& aIa ); // aIa = (a+I)a
164167 if (verbose ) printf ("Checking if fixed point\n" );
165- int eq = mequals (a .fullsize , & a ,& aIa );
166- if (eq < 0 ) break ;
168+ if (mequals (& a ,& aIa )== true) break ;
167169 k2mat_t temp = a ; a = aIa ; aIa = temp ; // swap a and aIa for the next iteration
168170 matrix_free (& aIa );
169171 }
170172 if (verbose ) printf ("Fixed point reached, stopping\n" );
171173 if (verbose ) mshow_stats (& aIa ,"Transitive closure matrix" ,stdout );
174+ msave_to_file (& aIa , oname );
172175 // done
173176 matrix_free (& aIa );
174177 matrix_free (& a );
0 commit comments