typedef deque<mpz_class> dqz;
typedef unordered_set<string> HS;
HS S;
FILE* f;
/* now construct the coefficients of a massive polynomial
* based on the words of the file we just read. */
dqz coeff[2]; // we'll alternate which is input / output...
coeff[currentIn].push_back(1);
mpz_class hashv; // store hash as an integer.
HS::iterator it;
for (it=S.begin(); it!= S.end(); it++) {
SHA1((constunsignedchar*)it->c_str(), it->length(), output);
/* now convert to mpz_t, and multiply into the accumulator. */
mpz_from_bytes(hashv, output, 20);
coeff[1-currentIn].resize( coeff[currentIn].size()+1, 0 ); //coeff[currentIn].size() ? //coeff[1-currentIn]?
for (size_t i = 0; i < coeff[currentIn].size(); i++) {
MULMOD(coeff[1-currentIn][i],coeff[currentIn][i],hashv,algPRF::p);
}
// shift the coeff's and add to the output register:
coeff[currentIn].push_front(0);
for (size_t i = 0; i < coeff[currentIn].size(); i++) {
coeff[1-currentIn][i] += coeff[currentIn][i];
MOD(coeff[1-currentIn][i],coeff[1-currentIn][i],algPRF::p);
}
currentIn = 1 - currentIn; // swap input and output.
}
Just focus on parts:
1 2 3 4
dqz coeff[2]; // we'll alternate which is input / output...
int currentIn=0;
coeff[currentIn].push_back(1);
coeff[1-currentIn].resize( coeff[currentIn].size()+1, 0 );
What do they mean?
deque named coeff of size 2?
Then, coeff[currentIn].push_back(1); ?? Is this a multidimensional deque?