void evalNode(BigNumber &n, int i, DdValues<BigNumber, ARITY> const &values) { assert(size_t(i) <= pools.size()); if (BDD) { int w = tmp1.store(0); for (int b = 0; b < ARITY; ++b) { tmp2.store(values.get(b)); tmp2.shiftLeft(i - values.getLevel(b) - 1); w = tmp1.add(tmp2); } n.setArray(pools[i].template allocate<uint64_t>(w)); n.store(tmp1); } else { int w; if (ARITY <= 0) { w = tmp1.store(0); } else { w = tmp1.store(values.get(0)); for (int b = 1; b < ARITY; ++b) { w = tmp1.add(values.get(b)); } } n.setArray(pools[i].template allocate<uint64_t>(w)); n.store(tmp1); } }
void evalNode(BigNumber& n, int i, DdValues<BigNumber,ARITY> const& values) { assert(0 <= i && size_t(i) <= pools.size()); if (BDD) { size_t w = tmp1.store(0); for (int b = 0; b < ARITY; ++b) { tmp2.store(values.get(b)); int k = i - values.getLevel(b) - 1; if (ARITY == 2) { tmp2.shiftLeft(k); } else { while (--k >= 0) { tmp3.store(tmp2); for (int b = 1; b < ARITY; ++b) { tmp2.add(tmp3); } } } w = tmp1.add(tmp2); } n.setArray(pools[i].allocate<uint64_t>(w)); n.store(tmp1); } else { size_t w; if (ARITY <= 0) { w = tmp1.store(0); } else { w = tmp1.store(values.get(0)); for (int b = 1; b < ARITY; ++b) { w = tmp1.add(values.get(b)); } } n.setArray(pools[i].allocate<uint64_t>(w)); n.store(tmp1); } }