@@ -212,11 +212,11 @@ void Common::get_incidence()
212212 assert (inc.size () == orig_num_vars*2 );
213213 for (uint32_t i = 0 ; i < orig_num_vars; i++) {
214214 Lit l = Lit (i, true );
215- if (conf.incidence_sort == 10 ) {
215+ if (conf.incidence_count == 1 ) {
216216 incidence[l.var ()] = inc[l.toInt ()] + inc[(~l).toInt ()];
217- } else if (conf.incidence_sort == 11 ) {
217+ } else if (conf.incidence_count == 2 ) {
218218 incidence[l.var ()] = std::max (inc[l.toInt ()], inc[(~l).toInt ()]);
219- } else {
219+ } else if (conf. incidence_count == 3 ) {
220220 incidence[l.var ()] = std::min (inc[l.toInt ()],inc[(~l).toInt ()]);
221221 }
222222 }
@@ -290,14 +290,7 @@ bool Common::preproc_and_duplicate()
290290 seen.resize (solver->nVars (), 0 );
291291
292292 get_incidence ();
293- if (conf.incidence_sort == 4 || conf.incidence_sort == 5 ) {
294- #ifdef LOUVAIN_COMMS
295- calc_community_parts ();
296- #else
297- cout << " ERROR: you must compile with louvain community libraries for this to work. Install https://github.com/meelgroup/louvain-community first." << endl;
298- exit (-1 );
299- #endif
300- }
293+ calc_community_parts ();
301294 if (conf.simp && !simplify ()) return false ;
302295 get_incidence ();
303296 duplicate_problem ();
@@ -315,13 +308,18 @@ bool Common::preproc_and_duplicate()
315308 return true ;
316309}
317310
318- #ifdef LOUVAIN_COMMS
319311void Common::calc_community_parts ()
320312{
321- double myTime = cpuTime ();
322- if (conf.verb ) {
323- cout << " c [arjun] Calculating Louvain Communities..." << endl;
313+ if (!(conf.unknown_sort == 4 || conf.unknown_sort == 5 )) {
314+ return ;
324315 }
316+ #ifndef LOUVAIN_COMMS
317+ cout << " ERROR: you must compile with louvain community libraries for this to work."
318+ << " Install https://github.com/meelgroup/louvain-community first." << endl;
319+ exit (-1 );
320+ #else
321+ double myTime = cpuTime ();
322+ verb_print (1 , " [arjun] Calculating Louvain Communities..." );
325323
326324 vector<vector<Lit>> cnf;
327325 solver->start_getting_small_clauses (
@@ -415,11 +413,8 @@ void Common::calc_community_parts()
415413 }
416414 solver->end_getting_small_clauses ();
417415
418- if (conf.verb ) {
419- cout << " c [mis-comm] Number of communities: " << commpart_incs.size ()
420- << " T: " << (cpuTime () - myTime)
421- << endl;
422- }
416+ verb_print (1 , " [mis-comm] Number of communities: " << commpart_incs.size () \
417+ << " T: " << (cpuTime () - myTime));
418+ #endif
423419}
424420
425- #endif
0 commit comments