Skip to content

Instantly share code, notes, and snippets.

@vcwu
Created June 26, 2012 07:39
Show Gist options
  • Select an option

  • Save vcwu/2994156 to your computer and use it in GitHub Desktop.

Select an option

Save vcwu/2994156 to your computer and use it in GitHub Desktop.
Modified Simplify Tester for powers of two
for(int x = 1000; x <= 8000; x += x)
{
Poly* pol1 = new Poly();
Poly* pol2 = new Poly();
for(int i = 0; i < x; i++)
{
//This ensures that all terms are alike.
term t1(i+1, 2,2);
term t2(i+2, 2,2);
pol1->addTerm(t1);
pol2->addTerm(t2);
}
file2 << "Pol 1 terms: " << pol1->getTerms()->size() <<endl;
file2 << "Pol 2 terms: " << pol2->getTerms()->size() <<endl;
file2 << "Num of Operations: "
<< pol1->simplifyTester() << endl << endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment