blob: ce44f280a1d81abf8ac8db51b5dc4640310e1a96 [file] [edit]
#include "internal.hpp"
namespace CaDiCaL {
/*------------------------------------------------------------------------*/
// Occurrence lists.
void Internal::init_occs () {
// breaks with factor.
// assert (otab.empty ());
if (otab.size () < 2 * vsize)
otab.resize (2 * vsize, Occs ());
LOG ("initialized occurrence lists");
}
void Internal::reset_occs () {
// breaks when memory allocation fails during sweep
// assert (occurring ());
erase_vector (otab);
LOG ("reset occurrence lists");
}
void Internal::clear_occs () {
assert (occurring ());
for (auto &occ : otab)
occ.clear ();
LOG ("clear occurrence lists");
}
/*------------------------------------------------------------------------*/
// One-sided occurrence counter (each literal has its own counter).
void Internal::init_noccs () {
// breaks with factor.
// assert (ntab.empty ());
if (ntab.size () < 2 * vsize)
ntab.resize (2 * vsize, 0);
LOG ("initialized two-sided occurrence counters");
}
void Internal::clear_noccs () {
assert (!ntab.empty ());
for (auto &nt : ntab)
nt = 0;
LOG ("clear two-sided occurrence counters");
}
void Internal::reset_noccs () {
// breaks when memory allocation fails during sweep
// assert (!max_var || !ntab.empty ());
erase_vector (ntab);
LOG ("reset two-sided occurrence counters");
}
} // namespace CaDiCaL