@@ -10,6 +10,7 @@ use rayon::prelude::*;
1010use std:: collections:: HashSet ; // for distinct method
1111use std:: collections:: VecDeque ;
1212use std:: fmt;
13+ use std:: io:: { self , Write } ;
1314
1415pub struct FlowSemigroup {
1516 //invariant: all flows have the same dimension
@@ -60,10 +61,10 @@ impl FlowSemigroup {
6061 ///non-deterministic product
6162 fn get_products ( left : & Flow , right : & Flow , maximal_finite_coordinate : u16 ) -> HashSet < Flow > {
6263 debug_assert_eq ! ( left. nb_rows, right. nb_rows) ;
63- debug ! ( "get_products\n left\n {}\n right\n {}" , left, right) ;
64+ // debug!("get_products\nleft\n{}\nright\n{}", left, right);
6465 let dim = left. nb_rows ;
6566 let omega_part = Flow :: get_omega_entries ( left, right) ;
66- debug ! ( "omega part\n {}\n " , omega_part) ;
67+ // debug!("omega part\n{}\n", omega_part);
6768 let left = & mut left. clone ( ) ;
6869 let right = & mut right. clone ( ) ;
6970
@@ -90,10 +91,10 @@ impl FlowSemigroup {
9091 flow_accumulator : & mut HashSet < Flow > ,
9192 ) {
9293 debug_assert ! ( k < dim) ;
93- debug ! (
94+ /* debug!(
9495 "k={}\nleft\n{}\nright\n{}\ncurrent_flow\n{}\n\n",
9596 k, left, right, current_flow
96- ) ;
97+ );*/
9798 let left_edges = left. edges_to ( k) ;
9899 let right_edges = right. edges_from ( k) ;
99100 debug_assert ! ( k < dim) ;
@@ -122,17 +123,19 @@ impl FlowSemigroup {
122123 //todo compute left stuff once at a time with a single into_iter
123124 let left_coefs = left_edges. iter ( ) . map ( |& ( _, c) | c) . collect :: < Vec < _ > > ( ) ;
124125 let right_coefs = right_edges. iter ( ) . map ( |& ( _, c) | c) . collect :: < Vec < _ > > ( ) ;
126+ /*
125127 debug!(
126128 "left_coefs\n\t{:?}\nright_coefs\n\t{:?}\n",
127129 left_coefs, right_coefs
128- ) ;
130+ );*/
129131 let left_indices = left_edges. into_iter ( ) . map ( |( i, _) | i) . collect :: < Vec < _ > > ( ) ;
130132 //todo compute right stuff once at a time with a single into_iter
131133 let right_indices = right_edges. into_iter ( ) . map ( |( j, _) | j) . collect :: < Vec < _ > > ( ) ;
134+ /*
132135 debug!(
133136 "left_indices\n\t{:?}\nright_indices\n\t{:?}\n",
134137 left_indices, right_indices
135- ) ;
138+ );*/
136139 let all_indices = left_indices
137140 . iter ( )
138141 . enumerate ( )
@@ -147,8 +150,8 @@ impl FlowSemigroup {
147150 let mut left = left. clone ( ) ;
148151 let mut right = right. clone ( ) ;
149152 let mut current_flow = current_flow. clone ( ) ;
150- debug ! ( "k={}\n transport\n {}\n " , k, t) ;
151- debug ! ( "current_flow before\n {}\n " , current_flow) ;
153+ // debug!("k={}\ntransport\n{}\n", k, t);
154+ // debug!("current_flow before\n{}\n", current_flow);
152155 for ( ( subi, reali) , ( subj, realj) ) in & all_indices {
153156 let cf = current_flow. get ( reali, realj) ;
154157 let tij: Coef = t. get ( & subi, & subj) ;
@@ -165,7 +168,7 @@ impl FlowSemigroup {
165168 right. set ( & k, realj, cr - tij) ;
166169 }
167170 }
168- debug ! ( "current_flow after\n {}\n " , current_flow) ;
171+ // debug!("current_flow after\n{}\n", current_flow);
169172 let k1 = k + 1 ;
170173 if k1 >= dim {
171174 flow_accumulator. insert ( current_flow) ;
@@ -194,12 +197,14 @@ impl FlowSemigroup {
194197 let mut processed = HashSet :: < Flow > :: new ( ) ;
195198 while !to_process. is_empty ( ) {
196199 let flow = to_process. pop_front ( ) . unwrap ( ) ;
200+ print ! ( "." ) ;
201+ io:: stdout ( ) . flush ( ) . unwrap ( ) ;
197202 debug ! (
198203 "\n Close_by_product_and_iteration processing flow\n {}\n " ,
199204 flow
200205 ) ;
201206 if Self :: is_covered ( & flow, & processed) {
202- debug ! ( "Skipped inqueue\n {}" , flow) ;
207+ // debug!("Skipped inqueue\n{}", flow);
203208 continue ;
204209 }
205210 processed. insert ( flow. clone ( ) ) ;
@@ -210,7 +215,7 @@ impl FlowSemigroup {
210215 self . flows . insert ( iteration. clone ( ) ) ;
211216 to_process. push_back ( iteration) ;
212217 } else {
213- debug ! ( "\n \n Skipped iteration\n {}" , iteration) ;
218+ // debug!("\n\nSkipped iteration\n{}", iteration);
214219 }
215220 {
216221 let right_products = self
0 commit comments