i is incremented, but only one time.
it = aux.end() in case aux.find(p) couldn't find the polynom p in the set<Polynom> called aux.
Im thinking this error could be related to the fact im running it on a Kubuntu virtual machine under windows.
I'm gonna give it a try under windows
EDIT: Under windows i have the same error. Infinite loop with i = 1.
However, random polynoms are generated properly (they're always different). In kubuntu they were always blank polynoms.
so.. the error could be here
1 2 3 4 5
|
it = aux.find(poli);
if (it == aux.end()) {
aux.insert(poli);
i++;
}
|
Im thinking that the error could be related to multiset, and its the default compare operator (which is <, and has been already overloaded in polynom).
EDIT 2: Btw, "i" is the count of inserted polynoms.