189 : nVars(nVars) {
190 if(
p.nObjsMaxLog <
p.nObjsAllocLog)
191 fatal_error("nObjsMax must not be smaller than nObjsAlloc");
192 if(nVars >= lww())
193 nSize = 1ull << (nVars - lww());
194 else
195 nSize = 1;
196 if(!nSize)
197 fatal_error("Memout (nVars) in init");
198 if(!(nSize <<
p.nObjsMaxLog))
199 fatal_error("Memout (nObjsMax) in init");
200 lit nObjsMaxLit = (
lit)1 <<
p.nObjsMaxLog;
201 if(!nObjsMaxLit)
202 fatal_error("Memout (nObjsMax) in init");
203 if(nObjsMaxLit > (
lit)BvarMax())
204 nObjsMax = BvarMax();
205 else
206 nObjsMax = (
bvar)nObjsMaxLit;
207 lit nObjsAllocLit = (
lit)1 <<
p.nObjsAllocLog;
208 if(!nObjsAllocLit)
209 fatal_error("Memout (nObjsAlloc) in init");
210 if(nObjsAllocLit > (
lit)BvarMax())
211 nObjsAlloc = BvarMax();
212 else
213 nObjsAlloc = (
bvar)nObjsAllocLit;
214 if(nObjsAlloc <= (
bvar)nVars)
215 fatal_error("nObjsAlloc must be larger than nVars");
216 nTotalSize = nSize <<
p.nObjsAllocLog;
217 vVals.resize(nTotalSize);
218 if(
p.fCountOnes && nVars > 63)
219 fatal_error("nVars must be less than 64 to count ones");
220 nObjs = 1;
221 for(int i = 0; i < 6 && i < nVars; i++) {
222 for(
size j = 0; j < nSize; j++)
223 vVals[nSize * nObjs + j] = vars(i);
224 nObjs++;
225 }
226 for(int i = 0; i < nVars - 6; i++) {
227 for(
size j = 0; j < nSize; j += (2ull << i))
228 for(
size k = 0; k < (1ull << i); k++)
229 vVals[nSize * nObjs + j + k] = one();
230 nObjs++;
231 }
232 nVerbose =
p.nVerbose;
234 if(nGbc ||
p.nReo != BvarMax())
235 vRefs.resize(nObjsAlloc);
236 }