Commit 91c4bed8 authored by Matthias Rungger's avatar Matthias Rungger
Browse files

Maximal number of variables corrected in CuddMintermIterator.hh

parent c5eb124b
...@@ -59,7 +59,7 @@ class CuddMintermIterator { ...@@ -59,7 +59,7 @@ class CuddMintermIterator {
done_=false; done_=false;
counter_=0; counter_=0;
if(nvars_>(sizeof(size_t))) { if(nvars_>sizeof(size_t)*8) {
std::ostringstream os; std::ostringstream os;
os << "Error: CuddMintermIterator: number of variables we iterate over is limited to highest number in size_t."; os << "Error: CuddMintermIterator: number of variables we iterate over is limited to highest number in size_t.";
throw std::invalid_argument(os.str().c_str()); throw std::invalid_argument(os.str().c_str());
...@@ -133,7 +133,7 @@ class CuddMintermIterator { ...@@ -133,7 +133,7 @@ class CuddMintermIterator {
std::cout<<std::endl; std::cout<<std::endl;
/* number of variables we iterate over is limited to highest number in size_t */ /* number of variables we iterate over is limited to highest number in size_t */
if(nvars_>(sizeof(size_t))) { if(nvars_>sizeof(size_t)*8) {
std::ostringstream os; std::ostringstream os;
os << "Error: CuddMintermIterator: number of variables we iterate over is limited to highest number in size_t."; os << "Error: CuddMintermIterator: number of variables we iterate over is limited to highest number in size_t.";
throw std::invalid_argument(os.str().c_str()); throw std::invalid_argument(os.str().c_str());
...@@ -182,14 +182,13 @@ class CuddMintermIterator { ...@@ -182,14 +182,13 @@ class CuddMintermIterator {
} }
inline void operator++(void) { inline void operator++(void) {
const size_t MVAR = sizeof(size_t);
iterator++; iterator++;
progress++; progress++;
/* get new cube or expand cube further */ /* get new cube or expand cube further */
if (iterator<nexpand) { if (iterator<nexpand) {
/* still not don with this cube */ /* still not don with this cube */
/* generate binary value for iterator to fill cube */ /* generate binary value for iterator to fill cube */
std::bitset<MVAR> iterator2binary(iterator); std::bitset<sizeof(size_t)*8> iterator2binary(iterator);
for(size_t i=0; i<ndontcares; i++) for(size_t i=0; i<ndontcares; i++)
cube[idontcares[i]]=iterator2binary[i]; cube[idontcares[i]]=iterator2binary[i];
} else { } else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment