Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/methods/nnf/NodeManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ class NodeManager {
@param[in] nbVar, the number of variables in the problem.
*/
static NodeManager<T> *makeNodeManager(unsigned nbVar) {
if (nbVar < (1 << 8)) return new NodeManagerTyped<T, uint8_t>();
if (nbVar < (1 << 16)) return new NodeManagerTyped<T, uint16_t>();
// One bit is reserved for the sign of the variable.
// Hence, with 8 bits we can store variables from -(2⁷-1) up to 2⁷-1. Same holds for 16 and 32 bits.
if (nbVar < (1 << 7)) return new NodeManagerTyped<T, uint8_t>();
if (nbVar < (1 << 15)) return new NodeManagerTyped<T, uint16_t>();
return new NodeManagerTyped<T, uint32_t>();
} // makeNodeManager

Expand Down