Public Member Functions | |
LazyWalksat (LWInfo *lwInfo, int memLimit) | |
~LazyWalksat () | |
bool | sample (const MaxWalksatParams *const &mwsParams, const SampleSatParams &sampleSatParams, const bool &initial) |
void | infer (const MaxWalksatParams *const ¶ms, const int &numSolutions, const bool &includeUnsatSolutions, Array< Array< bool > * > &solutions, Array< int > &numBad, const bool &initial) |
int | getNumInitClauses () |
int | getNumInitAtoms () |
int | getNumClauses () |
void | resetSampleSat () |
Sets all active atoms not in the base set to inactive and false and removes all activated clauses from memory. | |
void | randomizeActiveAtoms () |
Definition at line 29 of file lazywalksat.h.
void LazyWalksat::resetSampleSat | ( | ) |
Sets all active atoms not in the base set to inactive and false and removes all activated clauses from memory.
This method should be called between steps of SampleSat.
Definition at line 413 of file lazywalksat.cpp.
References Array< Type >::removeLastItem(), LWInfo::setInactive(), LWInfo::setVarVal(), Array< Type >::shrinkToSize(), and Array< Type >::size().
Referenced by infer().
00414 { 00415 // Set all subsequently activated atoms to inactive and false 00416 for(int atom = basenumatom + 1; atom <= numatom; atom++) 00417 { 00418 lwInfo->setVarVal(atom, false); 00419 lwInfo->setInactive(atom); 00420 } 00421 00422 // Remove all activated clauses 00423 for(int i = allClauses.size() - 1; i >= 0; i++) 00424 { 00425 delete allClauses[i]; 00426 allClauses.removeLastItem(); 00427 allClauseWeights.removeLastItem(); 00428 } 00429 allClauses.shrinkToSize(initClauseCount); 00430 numclause = 0; 00431 }