COPASI API  4.16.103
Public Member Functions | Static Protected Attributes | Private Member Functions | List of all members
test_biomodels217_expression Class Reference

#include <test_biomodels217_expression.h>

Inheritance diagram for test_biomodels217_expression:
Inheritance graph
[legend]
Collaboration diagram for test_biomodels217_expression:
Collaboration graph
[legend]

Public Member Functions

void setUp ()
 
void tearDown ()
 
void test_term_den1 ()
 
void test_term_den12 ()
 
void test_term_den123 ()
 
void test_term_den1234 ()
 
void test_term_den12345 ()
 
void test_term_den123456 ()
 
void test_term_den1234567 ()
 
void test_term_den2 ()
 
void test_term_den3 ()
 
void test_term_den3456 ()
 
void test_term_den346 ()
 
void test_term_den356 ()
 
void test_term_den36 ()
 
void test_term_den4 ()
 
void test_term_den456 ()
 
void test_term_den5 ()
 
void test_term_den56 ()
 
void test_term_den6 ()
 
void test_term_den67 ()
 
void test_term_den7 ()
 
void test_term_num1 ()
 
void test_term_num2 ()
 
void test_term_num3 ()
 
void test_term_num4 ()
 
void test_term_num5 ()
 
void test_term_num6 ()
 
void test_term_num7 ()
 

Static Protected Attributes

static const char * factor_den = "K+A"
 
static const char * factor_num = "P*A"
 
static const char * term_den1 = "1+B/J"
 
static const char * term_den2 = "3*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))"
 
static const char * term_den3 = "3*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*l1)"
 
static const char * term_den4 = "C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))"
 
static const char * term_den5 = "C^3*B*N/(E*G*I*J*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*n1)"
 
static const char * term_den6 = "3*C^4*O*N/(D*E*G*I*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*m1)"
 
static const char * term_den7 = "3*C^4*B*O*N/(D*E*G*I*J*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*o1)"
 
static const char * term_num1 = "f1*B/J"
 
static const char * term_num2 = "3*e1*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))"
 
static const char * term_num3 = "3*h1*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))"
 
static const char * term_num4 = "g1*C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))"
 
static const char * term_num5 = "j1*C^3*B*N/(E*G*I*J*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))"
 
static const char * term_num6 = "3*i1*C^4*O*N/(D*E*G*I*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))"
 
static const char * term_num7 = "3*k1*C^4*B*O*N/(D*E*G*I*J*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))"
 

Private Member Functions

 CPPUNIT_TEST (test_term_num1)
 
 CPPUNIT_TEST (test_term_num2)
 
 CPPUNIT_TEST (test_term_num3)
 
 CPPUNIT_TEST (test_term_num4)
 
 CPPUNIT_TEST (test_term_num5)
 
 CPPUNIT_TEST (test_term_num6)
 
 CPPUNIT_TEST (test_term_num7)
 
 CPPUNIT_TEST (test_term_den1)
 
 CPPUNIT_TEST (test_term_den2)
 
 CPPUNIT_TEST (test_term_den3)
 
 CPPUNIT_TEST (test_term_den4)
 
 CPPUNIT_TEST (test_term_den5)
 
 CPPUNIT_TEST (test_term_den6)
 
 CPPUNIT_TEST (test_term_den7)
 
 CPPUNIT_TEST (test_term_den12)
 
 CPPUNIT_TEST (test_term_den123)
 
 CPPUNIT_TEST (test_term_den1234)
 
 CPPUNIT_TEST (test_term_den12345)
 
 CPPUNIT_TEST (test_term_den123456)
 
 CPPUNIT_TEST (test_term_den1234567)
 
 CPPUNIT_TEST (test_term_den67)
 
 CPPUNIT_TEST (test_term_den56)
 
 CPPUNIT_TEST (test_term_den456)
 
 CPPUNIT_TEST (test_term_den3456)
 
 CPPUNIT_TEST (test_term_den356)
 
 CPPUNIT_TEST (test_term_den346)
 
 CPPUNIT_TEST (test_term_den36)
 
 CPPUNIT_TEST_SUITE (test_biomodels217_expression)
 
 CPPUNIT_TEST_SUITE_END ()
 

Detailed Description

Definition at line 23 of file test_biomodels217_expression.h.

Member Function Documentation

test_biomodels217_expression::CPPUNIT_TEST ( test_term_num1  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num2  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num3  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num4  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num5  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num6  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_num7  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den1  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den2  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den3  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den4  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den5  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den6  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den7  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den12  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den123  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den1234  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den12345  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den123456  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den1234567  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den67  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den56  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den456  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den3456  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den356  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den346  )
private
test_biomodels217_expression::CPPUNIT_TEST ( test_term_den36  )
private
test_biomodels217_expression::CPPUNIT_TEST_SUITE ( test_biomodels217_expression  )
private
test_biomodels217_expression::CPPUNIT_TEST_SUITE_END ( )
private
void test_biomodels217_expression::setUp ( )

Definition at line 55 of file test_biomodels217_expression.cpp.

References CCopasiRootContainer::init().

56 {
57  CCopasiRootContainer::init(false, 0, NULL);
58 }
static void init(int argc, char *argv[], const bool &withGui=false)
void test_biomodels217_expression::tearDown ( )
void test_biomodels217_expression::test_term_den1 ( )

Definition at line 3958 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den1, and CNormalItem::VARIABLE.

3959 {
3960  // 1+B/J -> (B+J)/J
3961  CEvaluationTree* pTree = new CEvaluationTree();
3962  pTree->setInfix(term_den1);
3963  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
3965  delete pTree;
3966  CPPUNIT_ASSERT(pFraction != NULL);
3967 
3968  // numerator
3969  // B+J
3970  const CNormalSum* pNumerator = &pFraction->getNumerator();
3971  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
3972  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
3973  CPPUNIT_ASSERT(pProducts->size() == 2);
3974  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
3975  const CNormalProduct* pProduct = *(it);
3976  CPPUNIT_ASSERT(pProduct != NULL);
3977  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3978  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3979  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
3980  // B
3981  const CNormalItemPower* pItemPower = *(it2);
3982  CPPUNIT_ASSERT(pItemPower != NULL);
3983  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3984  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3985  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3986  CPPUNIT_ASSERT(pItem != NULL);
3987  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3988  CPPUNIT_ASSERT(pItem->getName() == "B");
3989 
3990  ++it;
3991  pProduct = *(it);
3992  CPPUNIT_ASSERT(pProduct != NULL);
3993  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3994  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3995  it2 = pProduct->getItemPowers().begin();
3996  // J
3997  pItemPower = *(it2);
3998  CPPUNIT_ASSERT(pItemPower != NULL);
3999  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4000  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4001  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4002  CPPUNIT_ASSERT(pItem != NULL);
4003  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4004  CPPUNIT_ASSERT(pItem->getName() == "J");
4005 
4006  // denominator
4007  // J
4008  const CNormalSum* pDenominator = &pFraction->getDenominator();
4009  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
4010  pProducts = &pDenominator->getProducts();
4011  CPPUNIT_ASSERT(pProducts->size() == 1);
4012  it = pProducts->begin();
4013  pProduct = *(it);
4014  CPPUNIT_ASSERT(pProduct != NULL);
4015  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4016  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4017  it2 = pProduct->getItemPowers().begin();
4018  pItemPower = *(it2);
4019  CPPUNIT_ASSERT(pItemPower != NULL);
4020  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4021  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4022  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4023  CPPUNIT_ASSERT(pItem != NULL);
4024  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4025  CPPUNIT_ASSERT(pItem->getName() == "J");
4026 
4027  delete pFraction;
4028 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den12 ( )

Definition at line 8219 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, and term_num2.

8220 {
8221  std::cout << "testing numerator terms 1 to 2" << std::endl;
8222  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2);
8223 
8224  CEvaluationTree* pTree = new CEvaluationTree();
8225  pTree->setInfix(infix);
8226  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8228  delete pTree;
8229  CPPUNIT_ASSERT(pFraction != NULL);
8230 
8231  const CNormalSum* pNumerator = &pFraction->getNumerator();
8232  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8233  const CNormalSum* pDenominator = &pFraction->getDenominator();
8234  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8235 
8236  delete pFraction;
8237 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den123 ( )

Definition at line 8240 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, term_num2, and term_num3.

8241 {
8242  std::cout << "testing numerator terms 1 to 3" << std::endl;
8243  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2) + std::string(" + ") + std::string(term_num3);
8244 
8245  CEvaluationTree* pTree = new CEvaluationTree();
8246  pTree->setInfix(infix);
8247  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8249  delete pTree;
8250  CPPUNIT_ASSERT(pFraction != NULL);
8251 
8252  const CNormalSum* pNumerator = &pFraction->getNumerator();
8253  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8254  const CNormalSum* pDenominator = &pFraction->getDenominator();
8255  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8256 
8257  delete pFraction;
8258 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den1234 ( )

Definition at line 8260 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, term_num2, term_num3, and term_num4.

8261 {
8262  std::cout << "testing numerator terms 1 to 4" << std::endl;
8263  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2) + std::string(" + ") + std::string(term_num3) + std::string(" + ") + std::string(term_num4);
8264 
8265  CEvaluationTree* pTree = new CEvaluationTree();
8266  pTree->setInfix(infix);
8267  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8269  delete pTree;
8270  CPPUNIT_ASSERT(pFraction != NULL);
8271 
8272  const CNormalSum* pNumerator = &pFraction->getNumerator();
8273  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8274  const CNormalSum* pDenominator = &pFraction->getDenominator();
8275  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8276 
8277  delete pFraction;
8278 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den12345 ( )

Definition at line 8281 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, term_num2, term_num3, term_num4, and term_num5.

8282 {
8283  std::cout << "testing numerator terms 1 to 5" << std::endl;
8284  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2) + std::string(" + ") + std::string(term_num3) + std::string(" + ") + std::string(term_num4) + std::string(" + ") + std::string(term_num5);
8285 
8286  CEvaluationTree* pTree = new CEvaluationTree();
8287  pTree->setInfix(infix);
8288  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8290  delete pTree;
8291  CPPUNIT_ASSERT(pFraction != NULL);
8292 
8293  const CNormalSum* pNumerator = &pFraction->getNumerator();
8294  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8295  const CNormalSum* pDenominator = &pFraction->getDenominator();
8296  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8297 
8298  delete pFraction;
8299 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den123456 ( )

Definition at line 8302 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, term_num2, term_num3, term_num4, term_num5, and term_num6.

8303 {
8304  std::cout << "testing numerator terms 1 to 6" << std::endl;
8305  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2) + std::string(" + ") + std::string(term_num3) + std::string(" + ") + std::string(term_num4) + std::string(" + ") + std::string(term_num5) + std::string(" + ") + std::string(term_num6);
8306 
8307  CEvaluationTree* pTree = new CEvaluationTree();
8308  pTree->setInfix(infix);
8309  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8311  delete pTree;
8312  CPPUNIT_ASSERT(pFraction != NULL);
8313 
8314  const CNormalSum* pNumerator = &pFraction->getNumerator();
8315  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8316  const CNormalSum* pDenominator = &pFraction->getDenominator();
8317  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8318 
8319  delete pFraction;
8320 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den1234567 ( )

Definition at line 8323 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num1, term_num2, term_num3, term_num4, term_num5, term_num6, and term_num7.

8324 {
8325  std::cout << "testing numerator terms 1 to 7" << std::endl;
8326  std::string infix = std::string(term_num1) + std::string(" + ") + std::string(term_num2) + std::string(" + ") + std::string(term_num3) + std::string(" + ") + std::string(term_num4) + std::string(" + ") + std::string(term_num5) + std::string(" + ") + std::string(term_num6) + std::string(" + ") + std::string(term_num7);
8327 
8328  CEvaluationTree* pTree = new CEvaluationTree();
8329  pTree->setInfix(infix);
8330  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8332  delete pTree;
8333  CPPUNIT_ASSERT(pFraction != NULL);
8334 
8335  const CNormalSum* pNumerator = &pFraction->getNumerator();
8336  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8337  const CNormalSum* pDenominator = &pFraction->getDenominator();
8338  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8339 
8340  delete pFraction;
8341 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den2 ( )

Definition at line 4031 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den2, and CNormalItem::VARIABLE.

4032 {
4033  // 3*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))
4034  // -> (3*C*F*H*O)/(C^3*L + D*F*H*L + 3*C^2*H*L + 3*C*F*H*L)
4035  CEvaluationTree* pTree = new CEvaluationTree();
4036  pTree->setInfix(term_den2);
4037  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
4039  delete pTree;
4040  CPPUNIT_ASSERT(pFraction != NULL);
4041 
4042  // numerator
4043  // (3*C*F*H*O)
4044  const CNormalSum* pNumerator = &pFraction->getNumerator();
4045  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
4046  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
4047  CPPUNIT_ASSERT(pProducts->size() == 1);
4048  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
4049  const CNormalProduct* pProduct = *(it);
4050  CPPUNIT_ASSERT(pProduct != NULL);
4051  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4052  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4053  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
4054  // C
4055  const CNormalItemPower* pItemPower = *(it2);
4056  CPPUNIT_ASSERT(pItemPower != NULL);
4057  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4058  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4059  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4060  CPPUNIT_ASSERT(pItem != NULL);
4061  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4062  CPPUNIT_ASSERT(pItem->getName() == "C");
4063 
4064  ++it2;
4065  // F
4066  pItemPower = *(it2);
4067  CPPUNIT_ASSERT(pItemPower != NULL);
4068  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4069  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4070  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4071  CPPUNIT_ASSERT(pItem != NULL);
4072  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4073  CPPUNIT_ASSERT(pItem->getName() == "F");
4074 
4075  ++it2;
4076  // H
4077  pItemPower = *(it2);
4078  CPPUNIT_ASSERT(pItemPower != NULL);
4079  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4080  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4081  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4082  CPPUNIT_ASSERT(pItem != NULL);
4083  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4084  CPPUNIT_ASSERT(pItem->getName() == "H");
4085 
4086  ++it2;
4087  // O
4088  pItemPower = *(it2);
4089  CPPUNIT_ASSERT(pItemPower != NULL);
4090  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4091  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4092  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4093  CPPUNIT_ASSERT(pItem != NULL);
4094  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4095  CPPUNIT_ASSERT(pItem->getName() == "O");
4096 
4097 
4098  // denominator
4099  // (C^3*L + D*F*H*L + 3*C^2*H*L + 3*C*F*H*L)
4100  const CNormalSum* pDenominator = &pFraction->getDenominator();
4101  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
4102  pProducts = &pDenominator->getProducts();
4103  CPPUNIT_ASSERT(pProducts->size() == 4);
4104 
4105  // C^3*L
4106  it = pProducts->begin();
4107  pProduct = *(it);
4108  CPPUNIT_ASSERT(pProduct != NULL);
4109  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4110  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
4111 
4112  // C^3
4113  it2 = pProduct->getItemPowers().begin();
4114  pItemPower = *(it2);
4115  CPPUNIT_ASSERT(pItemPower != NULL);
4116  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4117  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4118  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4119  CPPUNIT_ASSERT(pItem != NULL);
4120  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4121  CPPUNIT_ASSERT(pItem->getName() == "C");
4122 
4123  // L
4124  ++it2;
4125  pItemPower = *(it2);
4126  CPPUNIT_ASSERT(pItemPower != NULL);
4127  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4128  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4129  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4130  CPPUNIT_ASSERT(pItem != NULL);
4131  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4132  CPPUNIT_ASSERT(pItem->getName() == "L");
4133 
4134  // D*F*H*L
4135  ++it;
4136  pProduct = *(it);
4137  CPPUNIT_ASSERT(pProduct != NULL);
4138  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4139  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4140 
4141  // D
4142  it2 = pProduct->getItemPowers().begin();
4143  pItemPower = *(it2);
4144  CPPUNIT_ASSERT(pItemPower != NULL);
4145  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4146  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4147  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4148  CPPUNIT_ASSERT(pItem != NULL);
4149  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4150  CPPUNIT_ASSERT(pItem->getName() == "D");
4151 
4152  // F
4153  ++it2;
4154  pItemPower = *(it2);
4155  CPPUNIT_ASSERT(pItemPower != NULL);
4156  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4157  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4158  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4159  CPPUNIT_ASSERT(pItem != NULL);
4160  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4161  CPPUNIT_ASSERT(pItem->getName() == "F");
4162 
4163  // H
4164  ++it2;
4165  pItemPower = *(it2);
4166  CPPUNIT_ASSERT(pItemPower != NULL);
4167  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4168  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4169  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4170  CPPUNIT_ASSERT(pItem != NULL);
4171  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4172  CPPUNIT_ASSERT(pItem->getName() == "H");
4173 
4174  // L
4175  ++it2;
4176  pItemPower = *(it2);
4177  CPPUNIT_ASSERT(pItemPower != NULL);
4178  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4179  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4180  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4181  CPPUNIT_ASSERT(pItem != NULL);
4182  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4183  CPPUNIT_ASSERT(pItem->getName() == "L");
4184 
4185  // 3*C^2*H*L
4186  ++it;
4187  pProduct = *(it);
4188  CPPUNIT_ASSERT(pProduct != NULL);
4189  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4190  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
4191 
4192  // C^2
4193  it2 = pProduct->getItemPowers().begin();
4194  pItemPower = *(it2);
4195  CPPUNIT_ASSERT(pItemPower != NULL);
4196  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
4197  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4198  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4199  CPPUNIT_ASSERT(pItem != NULL);
4200  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4201  CPPUNIT_ASSERT(pItem->getName() == "C");
4202 
4203  // H
4204  ++it2;
4205  pItemPower = *(it2);
4206  CPPUNIT_ASSERT(pItemPower != NULL);
4207  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4208  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4209  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4210  CPPUNIT_ASSERT(pItem != NULL);
4211  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4212  CPPUNIT_ASSERT(pItem->getName() == "H");
4213 
4214  // L
4215  ++it2;
4216  pItemPower = *(it2);
4217  CPPUNIT_ASSERT(pItemPower != NULL);
4218  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4219  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4220  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4221  CPPUNIT_ASSERT(pItem != NULL);
4222  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4223  CPPUNIT_ASSERT(pItem->getName() == "L");
4224 
4225  // 3*C*F*H*L
4226  ++it;
4227  pProduct = *(it);
4228  CPPUNIT_ASSERT(pProduct != NULL);
4229  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4230  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4231 
4232  // C
4233  it2 = pProduct->getItemPowers().begin();
4234  pItemPower = *(it2);
4235  CPPUNIT_ASSERT(pItemPower != NULL);
4236  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4237  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4238  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4239  CPPUNIT_ASSERT(pItem != NULL);
4240  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4241  CPPUNIT_ASSERT(pItem->getName() == "C");
4242 
4243  // F
4244  ++it2;
4245  pItemPower = *(it2);
4246  CPPUNIT_ASSERT(pItemPower != NULL);
4247  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4248  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4249  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4250  CPPUNIT_ASSERT(pItem != NULL);
4251  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4252  CPPUNIT_ASSERT(pItem->getName() == "F");
4253 
4254  // H
4255  ++it2;
4256  pItemPower = *(it2);
4257  CPPUNIT_ASSERT(pItemPower != NULL);
4258  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4259  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4260  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4261  CPPUNIT_ASSERT(pItem != NULL);
4262  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4263  CPPUNIT_ASSERT(pItem->getName() == "H");
4264 
4265  // L
4266  ++it2;
4267  pItemPower = *(it2);
4268  CPPUNIT_ASSERT(pItemPower != NULL);
4269  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4270  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4271  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4272  CPPUNIT_ASSERT(pItem != NULL);
4273  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4274  CPPUNIT_ASSERT(pItem->getName() == "L");
4275 
4276  delete pFraction;
4277 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den3 ( )

Definition at line 4280 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den3, and CNormalItem::VARIABLE.

4281 {
4282  // 3*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*l1)
4283  // -> (3*B*C*F*H*O)/(C^3*J*L*l1 + D*F*H*J*L*l1 + 3*C^2*H*J*L*l1 + 3*C*F*H*J*L*l1)
4284  CEvaluationTree* pTree = new CEvaluationTree();
4285  pTree->setInfix(term_den3);
4286  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
4288  delete pTree;
4289  CPPUNIT_ASSERT(pFraction != NULL);
4290 
4291  // numerator
4292  // (3*B*C*F*H*O)
4293  const CNormalSum* pNumerator = &pFraction->getNumerator();
4294  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
4295  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
4296  CPPUNIT_ASSERT(pProducts->size() == 1);
4297  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
4298  const CNormalProduct* pProduct = *(it);
4299  CPPUNIT_ASSERT(pProduct != NULL);
4300  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4301  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
4302  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
4303  // B
4304  const CNormalItemPower* pItemPower = *(it2);
4305  CPPUNIT_ASSERT(pItemPower != NULL);
4306  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4307  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4308  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4309  CPPUNIT_ASSERT(pItem != NULL);
4310  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4311  CPPUNIT_ASSERT(pItem->getName() == "B");
4312 
4313  ++it2;
4314  // C
4315  pItemPower = *(it2);
4316  CPPUNIT_ASSERT(pItemPower != NULL);
4317  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4318  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4319  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4320  CPPUNIT_ASSERT(pItem != NULL);
4321  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4322  CPPUNIT_ASSERT(pItem->getName() == "C");
4323 
4324  ++it2;
4325  // F
4326  pItemPower = *(it2);
4327  CPPUNIT_ASSERT(pItemPower != NULL);
4328  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4329  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4330  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4331  CPPUNIT_ASSERT(pItem != NULL);
4332  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4333  CPPUNIT_ASSERT(pItem->getName() == "F");
4334 
4335  ++it2;
4336  // H
4337  pItemPower = *(it2);
4338  CPPUNIT_ASSERT(pItemPower != NULL);
4339  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4340  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4341  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4342  CPPUNIT_ASSERT(pItem != NULL);
4343  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4344  CPPUNIT_ASSERT(pItem->getName() == "H");
4345 
4346  ++it2;
4347  // O
4348  pItemPower = *(it2);
4349  CPPUNIT_ASSERT(pItemPower != NULL);
4350  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4351  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4352  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4353  CPPUNIT_ASSERT(pItem != NULL);
4354  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4355  CPPUNIT_ASSERT(pItem->getName() == "O");
4356 
4357 
4358  // denominator
4359  // (C^3*J*L*l1 + D*F*H*J*L*l1 + 3*C^2*H*J*L*l1 + 3*C*F*H*J*L*l1)
4360  const CNormalSum* pDenominator = &pFraction->getDenominator();
4361  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
4362  pProducts = &pDenominator->getProducts();
4363  CPPUNIT_ASSERT(pProducts->size() == 4);
4364 
4365  // C^3*J*L*l1
4366  it = pProducts->begin();
4367  pProduct = *(it);
4368  CPPUNIT_ASSERT(pProduct != NULL);
4369  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4370  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4371 
4372  // C^3
4373  it2 = pProduct->getItemPowers().begin();
4374  pItemPower = *(it2);
4375  CPPUNIT_ASSERT(pItemPower != NULL);
4376  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4377  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4378  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4379  CPPUNIT_ASSERT(pItem != NULL);
4380  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4381  CPPUNIT_ASSERT(pItem->getName() == "C");
4382 
4383  // J
4384  ++it2;
4385  pItemPower = *(it2);
4386  CPPUNIT_ASSERT(pItemPower != NULL);
4387  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4388  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4389  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4390  CPPUNIT_ASSERT(pItem != NULL);
4391  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4392  CPPUNIT_ASSERT(pItem->getName() == "J");
4393 
4394  // L
4395  ++it2;
4396  pItemPower = *(it2);
4397  CPPUNIT_ASSERT(pItemPower != NULL);
4398  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4399  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4400  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4401  CPPUNIT_ASSERT(pItem != NULL);
4402  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4403  CPPUNIT_ASSERT(pItem->getName() == "L");
4404 
4405  // l1
4406  ++it2;
4407  pItemPower = *(it2);
4408  CPPUNIT_ASSERT(pItemPower != NULL);
4409  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4410  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4411  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4412  CPPUNIT_ASSERT(pItem != NULL);
4413  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4414  CPPUNIT_ASSERT(pItem->getName() == "l1");
4415 
4416  // D*F*H*J*L*l1
4417  ++it;
4418  pProduct = *(it);
4419  CPPUNIT_ASSERT(pProduct != NULL);
4420  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4421  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
4422 
4423  // D
4424  it2 = pProduct->getItemPowers().begin();
4425  pItemPower = *(it2);
4426  CPPUNIT_ASSERT(pItemPower != NULL);
4427  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4428  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4429  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4430  CPPUNIT_ASSERT(pItem != NULL);
4431  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4432  CPPUNIT_ASSERT(pItem->getName() == "D");
4433 
4434  // F
4435  ++it2;
4436  pItemPower = *(it2);
4437  CPPUNIT_ASSERT(pItemPower != NULL);
4438  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4439  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4440  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4441  CPPUNIT_ASSERT(pItem != NULL);
4442  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4443  CPPUNIT_ASSERT(pItem->getName() == "F");
4444 
4445  // H
4446  ++it2;
4447  pItemPower = *(it2);
4448  CPPUNIT_ASSERT(pItemPower != NULL);
4449  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4450  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4451  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4452  CPPUNIT_ASSERT(pItem != NULL);
4453  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4454  CPPUNIT_ASSERT(pItem->getName() == "H");
4455 
4456  // J
4457  ++it2;
4458  pItemPower = *(it2);
4459  CPPUNIT_ASSERT(pItemPower != NULL);
4460  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4461  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4462  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4463  CPPUNIT_ASSERT(pItem != NULL);
4464  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4465  CPPUNIT_ASSERT(pItem->getName() == "J");
4466 
4467  // L
4468  ++it2;
4469  pItemPower = *(it2);
4470  CPPUNIT_ASSERT(pItemPower != NULL);
4471  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4472  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4473  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4474  CPPUNIT_ASSERT(pItem != NULL);
4475  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4476  CPPUNIT_ASSERT(pItem->getName() == "L");
4477 
4478  // l1
4479  ++it2;
4480  pItemPower = *(it2);
4481  CPPUNIT_ASSERT(pItemPower != NULL);
4482  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4483  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4484  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4485  CPPUNIT_ASSERT(pItem != NULL);
4486  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4487  CPPUNIT_ASSERT(pItem->getName() == "l1");
4488 
4489  // 3*C^2*H*J*L*l1
4490  ++it;
4491  pProduct = *(it);
4492  CPPUNIT_ASSERT(pProduct != NULL);
4493  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4494  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
4495 
4496  // C^2
4497  it2 = pProduct->getItemPowers().begin();
4498  pItemPower = *(it2);
4499  CPPUNIT_ASSERT(pItemPower != NULL);
4500  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
4501  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4502  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4503  CPPUNIT_ASSERT(pItem != NULL);
4504  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4505  CPPUNIT_ASSERT(pItem->getName() == "C");
4506 
4507  // H
4508  ++it2;
4509  pItemPower = *(it2);
4510  CPPUNIT_ASSERT(pItemPower != NULL);
4511  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4512  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4513  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4514  CPPUNIT_ASSERT(pItem != NULL);
4515  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4516  CPPUNIT_ASSERT(pItem->getName() == "H");
4517 
4518  // J
4519  ++it2;
4520  pItemPower = *(it2);
4521  CPPUNIT_ASSERT(pItemPower != NULL);
4522  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4523  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4524  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4525  CPPUNIT_ASSERT(pItem != NULL);
4526  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4527  CPPUNIT_ASSERT(pItem->getName() == "J");
4528 
4529  // L
4530  ++it2;
4531  pItemPower = *(it2);
4532  CPPUNIT_ASSERT(pItemPower != NULL);
4533  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4534  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4535  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4536  CPPUNIT_ASSERT(pItem != NULL);
4537  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4538  CPPUNIT_ASSERT(pItem->getName() == "L");
4539 
4540  // l1
4541  ++it2;
4542  pItemPower = *(it2);
4543  CPPUNIT_ASSERT(pItemPower != NULL);
4544  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4545  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4546  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4547  CPPUNIT_ASSERT(pItem != NULL);
4548  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4549  CPPUNIT_ASSERT(pItem->getName() == "l1");
4550 
4551  // 3*C*F*H*J*L*l1
4552  ++it;
4553  pProduct = *(it);
4554  CPPUNIT_ASSERT(pProduct != NULL);
4555  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4556  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
4557 
4558 
4559  // C
4560  it2 = pProduct->getItemPowers().begin();
4561  pItemPower = *(it2);
4562  CPPUNIT_ASSERT(pItemPower != NULL);
4563  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4564  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4565  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4566  CPPUNIT_ASSERT(pItem != NULL);
4567  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4568  CPPUNIT_ASSERT(pItem->getName() == "C");
4569 
4570  // F
4571  ++it2;
4572  pItemPower = *(it2);
4573  CPPUNIT_ASSERT(pItemPower != NULL);
4574  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4575  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4576  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4577  CPPUNIT_ASSERT(pItem != NULL);
4578  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4579  CPPUNIT_ASSERT(pItem->getName() == "F");
4580 
4581  // H
4582  ++it2;
4583  pItemPower = *(it2);
4584  CPPUNIT_ASSERT(pItemPower != NULL);
4585  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4586  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4587  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4588  CPPUNIT_ASSERT(pItem != NULL);
4589  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4590  CPPUNIT_ASSERT(pItem->getName() == "H");
4591 
4592  // J
4593  ++it2;
4594  pItemPower = *(it2);
4595  CPPUNIT_ASSERT(pItemPower != NULL);
4596  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4597  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4598  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4599  CPPUNIT_ASSERT(pItem != NULL);
4600  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4601  CPPUNIT_ASSERT(pItem->getName() == "J");
4602 
4603  // L
4604  ++it2;
4605  pItemPower = *(it2);
4606  CPPUNIT_ASSERT(pItemPower != NULL);
4607  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4608  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4609  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4610  CPPUNIT_ASSERT(pItem != NULL);
4611  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4612  CPPUNIT_ASSERT(pItem->getName() == "L");
4613 
4614  // l1
4615  ++it2;
4616  pItemPower = *(it2);
4617  CPPUNIT_ASSERT(pItemPower != NULL);
4618  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4619  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4620  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4621  CPPUNIT_ASSERT(pItem != NULL);
4622  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4623  CPPUNIT_ASSERT(pItem->getName() == "l1");
4624 
4625  delete pFraction;
4626 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den3456 ( )

Definition at line 8403 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num3, term_num4, term_num5, and term_num6.

8404 {
8405  std::cout << "testing numerator terms 3 to 6" << std::endl;
8406  std::string infix = std::string(term_num3) + std::string(" + ") + std::string(term_num4) + std::string(" + ") + std::string(term_num5) + std::string(" + ") + std::string(term_num6);
8407 
8408  CEvaluationTree* pTree = new CEvaluationTree();
8409  pTree->setInfix(infix);
8410  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8412  delete pTree;
8413  CPPUNIT_ASSERT(pFraction != NULL);
8414 
8415  const CNormalSum* pNumerator = &pFraction->getNumerator();
8416  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8417  const CNormalSum* pDenominator = &pFraction->getDenominator();
8418  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8419 
8420  delete pFraction;
8421 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den346 ( )

Definition at line 8444 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num3, term_num4, and term_num6.

8445 {
8446  std::cout << "testing numerator terms 3,4 and 6" << std::endl;
8447  std::string infix = std::string(term_num3) + std::string(" + ") + std::string(term_num4) + std::string(" + ") + std::string(term_num6);
8448 
8449  CEvaluationTree* pTree = new CEvaluationTree();
8450  pTree->setInfix(infix);
8451  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8453  delete pTree;
8454  CPPUNIT_ASSERT(pFraction != NULL);
8455 
8456  const CNormalSum* pNumerator = &pFraction->getNumerator();
8457  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8458  const CNormalSum* pDenominator = &pFraction->getDenominator();
8459  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8460 
8461  delete pFraction;
8462 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den356 ( )

Definition at line 8423 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num3, term_num5, and term_num6.

8424 {
8425  std::cout << "testing numerator terms 3,5 and 6" << std::endl;
8426  std::string infix = std::string(term_num3) + std::string(" + ") + std::string(term_num5) + std::string(" + ") + std::string(term_num6);
8427 
8428  CEvaluationTree* pTree = new CEvaluationTree();
8429  pTree->setInfix(infix);
8430  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8432  delete pTree;
8433  CPPUNIT_ASSERT(pFraction != NULL);
8434 
8435  const CNormalSum* pNumerator = &pFraction->getNumerator();
8436  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8437  const CNormalSum* pDenominator = &pFraction->getDenominator();
8438  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8439 
8440  delete pFraction;
8441 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den36 ( )

Definition at line 8464 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num3, and term_num6.

8465 {
8466  std::cout << "testing numerator terms 3 and 6" << std::endl;
8467  std::string infix = std::string(term_num3) + std::string(" + ") + std::string(term_num6);
8468 
8469  CEvaluationTree* pTree = new CEvaluationTree();
8470  pTree->setInfix(infix);
8471  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8473  delete pTree;
8474  CPPUNIT_ASSERT(pFraction != NULL);
8475 
8476  const CNormalSum* pNumerator = &pFraction->getNumerator();
8477  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8478  const CNormalSum* pDenominator = &pFraction->getDenominator();
8479  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8480 
8481  delete pFraction;
8482 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den4 ( )

Definition at line 4629 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den4, and CNormalItem::VARIABLE.

4630 {
4631  // C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))
4632  // -> (C^3*N)/(C^3*M + E*G*I*M + 3*C^2*I*M + 3*C*G*I*M)
4633  CEvaluationTree* pTree = new CEvaluationTree();
4634  pTree->setInfix(term_den4);
4635  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
4637  delete pTree;
4638  CPPUNIT_ASSERT(pFraction != NULL);
4639 
4640  // numerator
4641  // (C^3*N)
4642  const CNormalSum* pNumerator = &pFraction->getNumerator();
4643  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
4644  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
4645  CPPUNIT_ASSERT(pProducts->size() == 1);
4646  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
4647  const CNormalProduct* pProduct = *(it);
4648  CPPUNIT_ASSERT(pProduct != NULL);
4649  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4650  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
4651  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
4652  // C^3
4653  const CNormalItemPower* pItemPower = *(it2);
4654  CPPUNIT_ASSERT(pItemPower != NULL);
4655  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4656  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4657  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4658  CPPUNIT_ASSERT(pItem != NULL);
4659  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4660  CPPUNIT_ASSERT(pItem->getName() == "C");
4661 
4662  ++it2;
4663  // N
4664  pItemPower = *(it2);
4665  CPPUNIT_ASSERT(pItemPower != NULL);
4666  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4667  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4668  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4669  CPPUNIT_ASSERT(pItem != NULL);
4670  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4671  CPPUNIT_ASSERT(pItem->getName() == "N");
4672 
4673  // denominator
4674  // (C^3*M + E*G*I*M + 3*C^2*I*M + 3*C*G*I*M)
4675  const CNormalSum* pDenominator = &pFraction->getDenominator();
4676  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
4677  pProducts = &pDenominator->getProducts();
4678  CPPUNIT_ASSERT(pProducts->size() == 4);
4679 
4680  // C^3*M
4681  it = pProducts->begin();
4682  pProduct = *(it);
4683  CPPUNIT_ASSERT(pProduct != NULL);
4684  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4685  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
4686 
4687  // C^3
4688  it2 = pProduct->getItemPowers().begin();
4689  pItemPower = *(it2);
4690  CPPUNIT_ASSERT(pItemPower != NULL);
4691  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4692  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4693  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4694  CPPUNIT_ASSERT(pItem != NULL);
4695  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4696  CPPUNIT_ASSERT(pItem->getName() == "C");
4697 
4698  // M
4699  ++it2;
4700  pItemPower = *(it2);
4701  CPPUNIT_ASSERT(pItemPower != NULL);
4702  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4703  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4704  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4705  CPPUNIT_ASSERT(pItem != NULL);
4706  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4707  CPPUNIT_ASSERT(pItem->getName() == "M");
4708 
4709  // E*G*I*M
4710  ++it;
4711  pProduct = *(it);
4712  CPPUNIT_ASSERT(pProduct != NULL);
4713  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4714  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4715 
4716  // E
4717  it2 = pProduct->getItemPowers().begin();
4718  pItemPower = *(it2);
4719  CPPUNIT_ASSERT(pItemPower != NULL);
4720  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4721  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4722  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4723  CPPUNIT_ASSERT(pItem != NULL);
4724  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4725  CPPUNIT_ASSERT(pItem->getName() == "E");
4726 
4727  // G
4728  ++it2;
4729  pItemPower = *(it2);
4730  CPPUNIT_ASSERT(pItemPower != NULL);
4731  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4732  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4733  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4734  CPPUNIT_ASSERT(pItem != NULL);
4735  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4736  CPPUNIT_ASSERT(pItem->getName() == "G");
4737 
4738  // I
4739  ++it2;
4740  pItemPower = *(it2);
4741  CPPUNIT_ASSERT(pItemPower != NULL);
4742  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4743  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4744  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4745  CPPUNIT_ASSERT(pItem != NULL);
4746  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4747  CPPUNIT_ASSERT(pItem->getName() == "I");
4748 
4749  // M
4750  ++it2;
4751  pItemPower = *(it2);
4752  CPPUNIT_ASSERT(pItemPower != NULL);
4753  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4754  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4755  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4756  CPPUNIT_ASSERT(pItem != NULL);
4757  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4758  CPPUNIT_ASSERT(pItem->getName() == "M");
4759 
4760  // 3*C^2*I*M
4761  ++it;
4762  pProduct = *(it);
4763  CPPUNIT_ASSERT(pProduct != NULL);
4764  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4765  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
4766 
4767  // C^2
4768  it2 = pProduct->getItemPowers().begin();
4769  pItemPower = *(it2);
4770  CPPUNIT_ASSERT(pItemPower != NULL);
4771  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
4772  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4773  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4774  CPPUNIT_ASSERT(pItem != NULL);
4775  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4776  CPPUNIT_ASSERT(pItem->getName() == "C");
4777 
4778  // I
4779  ++it2;
4780  pItemPower = *(it2);
4781  CPPUNIT_ASSERT(pItemPower != NULL);
4782  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4783  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4784  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4785  CPPUNIT_ASSERT(pItem != NULL);
4786  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4787  CPPUNIT_ASSERT(pItem->getName() == "I");
4788 
4789  // M
4790  ++it2;
4791  pItemPower = *(it2);
4792  CPPUNIT_ASSERT(pItemPower != NULL);
4793  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4794  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4795  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4796  CPPUNIT_ASSERT(pItem != NULL);
4797  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4798  CPPUNIT_ASSERT(pItem->getName() == "M");
4799 
4800  // 3*C*G*I*M
4801  ++it;
4802  pProduct = *(it);
4803  CPPUNIT_ASSERT(pProduct != NULL);
4804  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
4805  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4806 
4807  // C
4808  it2 = pProduct->getItemPowers().begin();
4809  pItemPower = *(it2);
4810  CPPUNIT_ASSERT(pItemPower != NULL);
4811  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4812  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4813  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4814  CPPUNIT_ASSERT(pItem != NULL);
4815  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4816  CPPUNIT_ASSERT(pItem->getName() == "C");
4817 
4818  // G
4819  ++it2;
4820  pItemPower = *(it2);
4821  CPPUNIT_ASSERT(pItemPower != NULL);
4822  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4823  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4824  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4825  CPPUNIT_ASSERT(pItem != NULL);
4826  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4827  CPPUNIT_ASSERT(pItem->getName() == "G");
4828 
4829  // I
4830  ++it2;
4831  pItemPower = *(it2);
4832  CPPUNIT_ASSERT(pItemPower != NULL);
4833  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4834  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4835  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4836  CPPUNIT_ASSERT(pItem != NULL);
4837  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4838  CPPUNIT_ASSERT(pItem->getName() == "I");
4839 
4840  // M
4841  ++it2;
4842  pItemPower = *(it2);
4843  CPPUNIT_ASSERT(pItemPower != NULL);
4844  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4845  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4846  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4847  CPPUNIT_ASSERT(pItem != NULL);
4848  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4849  CPPUNIT_ASSERT(pItem->getName() == "M");
4850 
4851  delete pFraction;
4852 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den456 ( )

Definition at line 8383 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num4, term_num5, and term_num6.

8384 {
8385  std::cout << "testing numerator terms 4 to 6" << std::endl;
8386  std::string infix = std::string(term_num4) + std::string(" + ") + std::string(term_num5) + std::string(" + ") + std::string(term_num6);
8387 
8388  CEvaluationTree* pTree = new CEvaluationTree();
8389  pTree->setInfix(infix);
8390  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8392  delete pTree;
8393  CPPUNIT_ASSERT(pFraction != NULL);
8394 
8395  const CNormalSum* pNumerator = &pFraction->getNumerator();
8396  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8397  const CNormalSum* pDenominator = &pFraction->getDenominator();
8398  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8399 
8400  delete pFraction;
8401 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den5 ( )

Definition at line 4855 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den5, and CNormalItem::VARIABLE.

4856 {
4857  // C^3*B*N/(E*G*I*J*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*n1)
4858  // -> (B*C^3*N)/(C^3*J*M*n1 + E*G*I*J*M*n1 + 3*C^2*I*J*M*n1 + 3*C*G*I*J*M*n1)
4859  CEvaluationTree* pTree = new CEvaluationTree();
4860  pTree->setInfix(term_den5);
4861  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
4863  delete pTree;
4864  CPPUNIT_ASSERT(pFraction != NULL);
4865 
4866  // numerator
4867  // (B*C^3*N)
4868  const CNormalSum* pNumerator = &pFraction->getNumerator();
4869  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
4870  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
4871  CPPUNIT_ASSERT(pProducts->size() == 1);
4872  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
4873  const CNormalProduct* pProduct = *(it);
4874  CPPUNIT_ASSERT(pProduct != NULL);
4875  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4876  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
4877  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
4878  // B
4879  const CNormalItemPower* pItemPower = *(it2);
4880  CPPUNIT_ASSERT(pItemPower != NULL);
4881  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4882  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4883  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4884  CPPUNIT_ASSERT(pItem != NULL);
4885  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4886  CPPUNIT_ASSERT(pItem->getName() == "B");
4887 
4888  ++it2;
4889  // C^3
4890  pItemPower = *(it2);
4891  CPPUNIT_ASSERT(pItemPower != NULL);
4892  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4893  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4894  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4895  CPPUNIT_ASSERT(pItem != NULL);
4896  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4897  CPPUNIT_ASSERT(pItem->getName() == "C");
4898 
4899  ++it2;
4900  // N
4901  pItemPower = *(it2);
4902  CPPUNIT_ASSERT(pItemPower != NULL);
4903  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4904  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4905  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4906  CPPUNIT_ASSERT(pItem != NULL);
4907  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4908  CPPUNIT_ASSERT(pItem->getName() == "N");
4909 
4910 
4911  // denominator
4912  // (C^3*J*M*n1 + E*G*I*J*M*n1 + 3*C^2*I*J*M*n1 + 3*C*G*I*J*M*n1)
4913  const CNormalSum* pDenominator = &pFraction->getDenominator();
4914  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
4915  pProducts = &pDenominator->getProducts();
4916  CPPUNIT_ASSERT(pProducts->size() == 4);
4917 
4918  // C^3*J*M*n1
4919  it = pProducts->begin();
4920  pProduct = *(it);
4921  CPPUNIT_ASSERT(pProduct != NULL);
4922  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4923  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
4924 
4925  // C^3
4926  it2 = pProduct->getItemPowers().begin();
4927  pItemPower = *(it2);
4928  CPPUNIT_ASSERT(pItemPower != NULL);
4929  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
4930  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4931  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4932  CPPUNIT_ASSERT(pItem != NULL);
4933  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4934  CPPUNIT_ASSERT(pItem->getName() == "C");
4935 
4936  // J
4937  ++it2;
4938  pItemPower = *(it2);
4939  CPPUNIT_ASSERT(pItemPower != NULL);
4940  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4941  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4942  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4943  CPPUNIT_ASSERT(pItem != NULL);
4944  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4945  CPPUNIT_ASSERT(pItem->getName() == "J");
4946 
4947  // M
4948  ++it2;
4949  pItemPower = *(it2);
4950  CPPUNIT_ASSERT(pItemPower != NULL);
4951  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4952  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4953  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4954  CPPUNIT_ASSERT(pItem != NULL);
4955  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4956  CPPUNIT_ASSERT(pItem->getName() == "M");
4957 
4958  // n1
4959  ++it2;
4960  pItemPower = *(it2);
4961  CPPUNIT_ASSERT(pItemPower != NULL);
4962  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4963  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4964  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4965  CPPUNIT_ASSERT(pItem != NULL);
4966  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4967  CPPUNIT_ASSERT(pItem->getName() == "n1");
4968 
4969  // E*G*I*J*M*n1
4970  ++it;
4971  pProduct = *(it);
4972  CPPUNIT_ASSERT(pProduct != NULL);
4973  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4974  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
4975 
4976  // E
4977  it2 = pProduct->getItemPowers().begin();
4978  pItemPower = *(it2);
4979  CPPUNIT_ASSERT(pItemPower != NULL);
4980  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4981  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4982  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4983  CPPUNIT_ASSERT(pItem != NULL);
4984  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4985  CPPUNIT_ASSERT(pItem->getName() == "E");
4986 
4987  // G
4988  ++it2;
4989  pItemPower = *(it2);
4990  CPPUNIT_ASSERT(pItemPower != NULL);
4991  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4992  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
4993  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
4994  CPPUNIT_ASSERT(pItem != NULL);
4995  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
4996  CPPUNIT_ASSERT(pItem->getName() == "G");
4997 
4998  // I
4999  ++it2;
5000  pItemPower = *(it2);
5001  CPPUNIT_ASSERT(pItemPower != NULL);
5002  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5003  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5004  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5005  CPPUNIT_ASSERT(pItem != NULL);
5006  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5007  CPPUNIT_ASSERT(pItem->getName() == "I");
5008 
5009  // J
5010  ++it2;
5011  pItemPower = *(it2);
5012  CPPUNIT_ASSERT(pItemPower != NULL);
5013  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5014  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5015  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5016  CPPUNIT_ASSERT(pItem != NULL);
5017  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5018  CPPUNIT_ASSERT(pItem->getName() == "J");
5019 
5020  // M
5021  ++it2;
5022  pItemPower = *(it2);
5023  CPPUNIT_ASSERT(pItemPower != NULL);
5024  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5025  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5026  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5027  CPPUNIT_ASSERT(pItem != NULL);
5028  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5029  CPPUNIT_ASSERT(pItem->getName() == "M");
5030 
5031  // n1
5032  ++it2;
5033  pItemPower = *(it2);
5034  CPPUNIT_ASSERT(pItemPower != NULL);
5035  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5036  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5037  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5038  CPPUNIT_ASSERT(pItem != NULL);
5039  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5040  CPPUNIT_ASSERT(pItem->getName() == "n1");
5041 
5042  // 3*C^2*I*J*M*n1
5043  ++it;
5044  pProduct = *(it);
5045  CPPUNIT_ASSERT(pProduct != NULL);
5046  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5047  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
5048 
5049  // C^2
5050  it2 = pProduct->getItemPowers().begin();
5051  pItemPower = *(it2);
5052  CPPUNIT_ASSERT(pItemPower != NULL);
5053  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
5054  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5055  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5056  CPPUNIT_ASSERT(pItem != NULL);
5057  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5058  CPPUNIT_ASSERT(pItem->getName() == "C");
5059 
5060  // I
5061  ++it2;
5062  pItemPower = *(it2);
5063  CPPUNIT_ASSERT(pItemPower != NULL);
5064  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5065  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5066  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5067  CPPUNIT_ASSERT(pItem != NULL);
5068  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5069  CPPUNIT_ASSERT(pItem->getName() == "I");
5070 
5071  // J
5072  ++it2;
5073  pItemPower = *(it2);
5074  CPPUNIT_ASSERT(pItemPower != NULL);
5075  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5076  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5077  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5078  CPPUNIT_ASSERT(pItem != NULL);
5079  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5080  CPPUNIT_ASSERT(pItem->getName() == "J");
5081 
5082  // M
5083  ++it2;
5084  pItemPower = *(it2);
5085  CPPUNIT_ASSERT(pItemPower != NULL);
5086  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5087  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5088  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5089  CPPUNIT_ASSERT(pItem != NULL);
5090  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5091  CPPUNIT_ASSERT(pItem->getName() == "M");
5092 
5093  // n1
5094  ++it2;
5095  pItemPower = *(it2);
5096  CPPUNIT_ASSERT(pItemPower != NULL);
5097  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5098  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5099  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5100  CPPUNIT_ASSERT(pItem != NULL);
5101  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5102  CPPUNIT_ASSERT(pItem->getName() == "n1");
5103 
5104  // 3*C*G*I*J*M*n1
5105  ++it;
5106  pProduct = *(it);
5107  CPPUNIT_ASSERT(pProduct != NULL);
5108  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5109  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
5110 
5111  // C
5112  it2 = pProduct->getItemPowers().begin();
5113  pItemPower = *(it2);
5114  CPPUNIT_ASSERT(pItemPower != NULL);
5115  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5116  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5117  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5118  CPPUNIT_ASSERT(pItem != NULL);
5119  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5120  CPPUNIT_ASSERT(pItem->getName() == "C");
5121 
5122  // G
5123  ++it2;
5124  pItemPower = *(it2);
5125  CPPUNIT_ASSERT(pItemPower != NULL);
5126  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5127  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5128  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5129  CPPUNIT_ASSERT(pItem != NULL);
5130  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5131  CPPUNIT_ASSERT(pItem->getName() == "G");
5132 
5133  // I
5134  ++it2;
5135  pItemPower = *(it2);
5136  CPPUNIT_ASSERT(pItemPower != NULL);
5137  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5138  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5139  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5140  CPPUNIT_ASSERT(pItem != NULL);
5141  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5142  CPPUNIT_ASSERT(pItem->getName() == "I");
5143 
5144  // J
5145  ++it2;
5146  pItemPower = *(it2);
5147  CPPUNIT_ASSERT(pItemPower != NULL);
5148  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5149  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5150  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5151  CPPUNIT_ASSERT(pItem != NULL);
5152  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5153  CPPUNIT_ASSERT(pItem->getName() == "J");
5154 
5155  // M
5156  ++it2;
5157  pItemPower = *(it2);
5158  CPPUNIT_ASSERT(pItemPower != NULL);
5159  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5160  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5161  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5162  CPPUNIT_ASSERT(pItem != NULL);
5163  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5164  CPPUNIT_ASSERT(pItem->getName() == "M");
5165 
5166  // n1
5167  ++it2;
5168  pItemPower = *(it2);
5169  CPPUNIT_ASSERT(pItemPower != NULL);
5170  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5171  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5172  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5173  CPPUNIT_ASSERT(pItem != NULL);
5174  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5175  CPPUNIT_ASSERT(pItem->getName() == "n1");
5176 
5177  delete pFraction;
5178 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den56 ( )

Definition at line 8363 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num5, and term_num6.

8364 {
8365  std::cout << "testing numerator terms 5 to 6" << std::endl;
8366  std::string infix = std::string(term_num5) + std::string(" + ") + std::string(term_num6);
8367 
8368  CEvaluationTree* pTree = new CEvaluationTree();
8369  pTree->setInfix(infix);
8370  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8372  delete pTree;
8373  CPPUNIT_ASSERT(pFraction != NULL);
8374 
8375  const CNormalSum* pNumerator = &pFraction->getNumerator();
8376  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8377  const CNormalSum* pDenominator = &pFraction->getDenominator();
8378  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8379 
8380  delete pFraction;
8381 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den6 ( )

Definition at line 5181 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den6, and CNormalItem::VARIABLE.

5182 {
5183  // 3*C^4*O*N/(D*E*G*I*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*m1)
5184  // -> (3*C^4*F*H*N*O)/(C^6*L*M*m1 + C^3*D*F*H*L*M*m1 + C^3*E*G*I*L*M*m1 + D*E*F*G*H*I*L*M*m1 + 3*C^5*H*L*M*m1 + 3*C^5*I*L*M*m1 + 3*C^4*F*H*L*M*m1 + 3*C^4*G*I*L*M*m1 + 3*C^2*D*F*H*I*L*M*m1 + 3*C^2*E*G*H*I*L*M*m1 + 3*C*D*F*G*H*I*L*M*m1 + 3*C*E*F*G*H*I*L*M*m1 + 9*C^4*H*I*L*M*m1 + 9*C^3*F*H*I*L*M*m1 + 9*C^3*G*H*I*L*M*m1 + 9*C^2*F*G*H*I*L*M*m1)
5185  CEvaluationTree* pTree = new CEvaluationTree();
5186  pTree->setInfix(term_den6);
5187  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
5189  delete pTree;
5190  CPPUNIT_ASSERT(pFraction != NULL);
5191 
5192  // numerator
5193  // (3*C^4*F*H*N*O)
5194  const CNormalSum* pNumerator = &pFraction->getNumerator();
5195  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
5196  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
5197  CPPUNIT_ASSERT(pProducts->size() == 1);
5198  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
5199  const CNormalProduct* pProduct = *(it);
5200  CPPUNIT_ASSERT(pProduct != NULL);
5201  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5202  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
5203  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
5204  // C^4
5205  const CNormalItemPower* pItemPower = *(it2);
5206  CPPUNIT_ASSERT(pItemPower != NULL);
5207  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
5208  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5209  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5210  CPPUNIT_ASSERT(pItem != NULL);
5211  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5212  CPPUNIT_ASSERT(pItem->getName() == "C");
5213 
5214  ++it2;
5215  // F
5216  pItemPower = *(it2);
5217  CPPUNIT_ASSERT(pItemPower != NULL);
5218  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5219  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5220  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5221  CPPUNIT_ASSERT(pItem != NULL);
5222  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5223  CPPUNIT_ASSERT(pItem->getName() == "F");
5224 
5225  ++it2;
5226  // H
5227  pItemPower = *(it2);
5228  CPPUNIT_ASSERT(pItemPower != NULL);
5229  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5230  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5231  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5232  CPPUNIT_ASSERT(pItem != NULL);
5233  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5234  CPPUNIT_ASSERT(pItem->getName() == "H");
5235 
5236  ++it2;
5237  // N
5238  pItemPower = *(it2);
5239  CPPUNIT_ASSERT(pItemPower != NULL);
5240  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5241  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5242  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5243  CPPUNIT_ASSERT(pItem != NULL);
5244  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5245  CPPUNIT_ASSERT(pItem->getName() == "N");
5246 
5247  ++it2;
5248  // O
5249  pItemPower = *(it2);
5250  CPPUNIT_ASSERT(pItemPower != NULL);
5251  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5252  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5253  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5254  CPPUNIT_ASSERT(pItem != NULL);
5255  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5256  CPPUNIT_ASSERT(pItem->getName() == "O");
5257 
5258 
5259  // denominator
5260  // (C^6*L*M*m1 + C^3*D*F*H*L*M*m1 + C^3*E*G*I*L*M*m1 + D*E*F*G*H*I*L*M*m1 + 3*C^5*H*L*M*m1 + 3*C^5*I*L*M*m1 + 3*C^4*F*H*L*M*m1 + 3*C^4*G*I*L*M*m1 + 3*C^2*D*F*H*I*L*M*m1 + 3*C^2*E*G*H*I*L*M*m1 + 3*C*D*F*G*H*I*L*M*m1 + 3*C*E*F*G*H*I*L*M*m1 + 9*C^4*H*I*L*M*m1 + 9*C^3*F*H*I*L*M*m1 + 9*C^3*G*H*I*L*M*m1 + 9*C^2*F*G*H*I*L*M*m1)
5261  const CNormalSum* pDenominator = &pFraction->getDenominator();
5262  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
5263  pProducts = &pDenominator->getProducts();
5264  CPPUNIT_ASSERT(pProducts->size() == 16);
5265 
5266  // C^6*L*M*m1
5267  it = pProducts->begin();
5268  pProduct = *(it);
5269  CPPUNIT_ASSERT(pProduct != NULL);
5270  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
5271  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
5272 
5273  // C^6
5274  it2 = pProduct->getItemPowers().begin();
5275  pItemPower = *(it2);
5276  CPPUNIT_ASSERT(pItemPower != NULL);
5277  CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
5278  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5279  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5280  CPPUNIT_ASSERT(pItem != NULL);
5281  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5282  CPPUNIT_ASSERT(pItem->getName() == "C");
5283 
5284  // L
5285  ++it2;
5286  pItemPower = *(it2);
5287  CPPUNIT_ASSERT(pItemPower != NULL);
5288  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5289  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5290  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5291  CPPUNIT_ASSERT(pItem != NULL);
5292  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5293  CPPUNIT_ASSERT(pItem->getName() == "L");
5294 
5295  // M
5296  ++it2;
5297  pItemPower = *(it2);
5298  CPPUNIT_ASSERT(pItemPower != NULL);
5299  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5300  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5301  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5302  CPPUNIT_ASSERT(pItem != NULL);
5303  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5304  CPPUNIT_ASSERT(pItem->getName() == "M");
5305 
5306  // m1
5307  ++it2;
5308  pItemPower = *(it2);
5309  CPPUNIT_ASSERT(pItemPower != NULL);
5310  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5311  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5312  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5313  CPPUNIT_ASSERT(pItem != NULL);
5314  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5315  CPPUNIT_ASSERT(pItem->getName() == "m1");
5316 
5317  // C^3*D*F*H*L*M*m1
5318  ++it;
5319  pProduct = *(it);
5320  CPPUNIT_ASSERT(pProduct != NULL);
5321  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
5322  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
5323 
5324  // C^3
5325  it2 = pProduct->getItemPowers().begin();
5326  pItemPower = *(it2);
5327  CPPUNIT_ASSERT(pItemPower != NULL);
5328  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
5329  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5330  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5331  CPPUNIT_ASSERT(pItem != NULL);
5332  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5333  CPPUNIT_ASSERT(pItem->getName() == "C");
5334 
5335  // D
5336  ++it2;
5337  pItemPower = *(it2);
5338  CPPUNIT_ASSERT(pItemPower != NULL);
5339  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5340  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5341  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5342  CPPUNIT_ASSERT(pItem != NULL);
5343  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5344  CPPUNIT_ASSERT(pItem->getName() == "D");
5345 
5346  // F
5347  ++it2;
5348  pItemPower = *(it2);
5349  CPPUNIT_ASSERT(pItemPower != NULL);
5350  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5351  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5352  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5353  CPPUNIT_ASSERT(pItem != NULL);
5354  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5355  CPPUNIT_ASSERT(pItem->getName() == "F");
5356 
5357  // H
5358  ++it2;
5359  pItemPower = *(it2);
5360  CPPUNIT_ASSERT(pItemPower != NULL);
5361  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5362  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5363  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5364  CPPUNIT_ASSERT(pItem != NULL);
5365  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5366  CPPUNIT_ASSERT(pItem->getName() == "H");
5367 
5368  // L
5369  ++it2;
5370  pItemPower = *(it2);
5371  CPPUNIT_ASSERT(pItemPower != NULL);
5372  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5373  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5374  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5375  CPPUNIT_ASSERT(pItem != NULL);
5376  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5377  CPPUNIT_ASSERT(pItem->getName() == "L");
5378 
5379  // M
5380  ++it2;
5381  pItemPower = *(it2);
5382  CPPUNIT_ASSERT(pItemPower != NULL);
5383  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5384  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5385  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5386  CPPUNIT_ASSERT(pItem != NULL);
5387  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5388  CPPUNIT_ASSERT(pItem->getName() == "M");
5389 
5390  // m1
5391  ++it2;
5392  pItemPower = *(it2);
5393  CPPUNIT_ASSERT(pItemPower != NULL);
5394  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5395  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5396  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5397  CPPUNIT_ASSERT(pItem != NULL);
5398  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5399  CPPUNIT_ASSERT(pItem->getName() == "m1");
5400 
5401  // C^3*E*G*I*L*M*m1
5402  ++it;
5403  pProduct = *(it);
5404  CPPUNIT_ASSERT(pProduct != NULL);
5405  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
5406  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
5407 
5408  // C^3
5409  it2 = pProduct->getItemPowers().begin();
5410  pItemPower = *(it2);
5411  CPPUNIT_ASSERT(pItemPower != NULL);
5412  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
5413  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5414  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5415  CPPUNIT_ASSERT(pItem != NULL);
5416  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5417  CPPUNIT_ASSERT(pItem->getName() == "C");
5418 
5419  // E
5420  ++it2;
5421  pItemPower = *(it2);
5422  CPPUNIT_ASSERT(pItemPower != NULL);
5423  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5424  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5425  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5426  CPPUNIT_ASSERT(pItem != NULL);
5427  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5428  CPPUNIT_ASSERT(pItem->getName() == "E");
5429 
5430 
5431  // G
5432  ++it2;
5433  pItemPower = *(it2);
5434  CPPUNIT_ASSERT(pItemPower != NULL);
5435  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5436  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5437  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5438  CPPUNIT_ASSERT(pItem != NULL);
5439  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5440  CPPUNIT_ASSERT(pItem->getName() == "G");
5441 
5442  // I
5443  ++it2;
5444  pItemPower = *(it2);
5445  CPPUNIT_ASSERT(pItemPower != NULL);
5446  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5447  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5448  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5449  CPPUNIT_ASSERT(pItem != NULL);
5450  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5451  CPPUNIT_ASSERT(pItem->getName() == "I");
5452 
5453  // L
5454  ++it2;
5455  pItemPower = *(it2);
5456  CPPUNIT_ASSERT(pItemPower != NULL);
5457  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5458  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5459  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5460  CPPUNIT_ASSERT(pItem != NULL);
5461  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5462  CPPUNIT_ASSERT(pItem->getName() == "L");
5463 
5464  // M
5465  ++it2;
5466  pItemPower = *(it2);
5467  CPPUNIT_ASSERT(pItemPower != NULL);
5468  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5469  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5470  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5471  CPPUNIT_ASSERT(pItem != NULL);
5472  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5473  CPPUNIT_ASSERT(pItem->getName() == "M");
5474 
5475  // m1
5476  ++it2;
5477  pItemPower = *(it2);
5478  CPPUNIT_ASSERT(pItemPower != NULL);
5479  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5480  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5481  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5482  CPPUNIT_ASSERT(pItem != NULL);
5483  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5484  CPPUNIT_ASSERT(pItem->getName() == "m1");
5485 
5486  // D*E*F*G*H*I*L*M*m1
5487  ++it;
5488  pProduct = *(it);
5489  CPPUNIT_ASSERT(pProduct != NULL);
5490  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
5491  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
5492 
5493  // D
5494  it2 = pProduct->getItemPowers().begin();
5495  pItemPower = *(it2);
5496  CPPUNIT_ASSERT(pItemPower != NULL);
5497  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5498  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5499  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5500  CPPUNIT_ASSERT(pItem != NULL);
5501  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5502  CPPUNIT_ASSERT(pItem->getName() == "D");
5503 
5504  // E
5505  ++it2;
5506  pItemPower = *(it2);
5507  CPPUNIT_ASSERT(pItemPower != NULL);
5508  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5509  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5510  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5511  CPPUNIT_ASSERT(pItem != NULL);
5512  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5513  CPPUNIT_ASSERT(pItem->getName() == "E");
5514 
5515  // F
5516  ++it2;
5517  pItemPower = *(it2);
5518  CPPUNIT_ASSERT(pItemPower != NULL);
5519  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5520  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5521  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5522  CPPUNIT_ASSERT(pItem != NULL);
5523  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5524  CPPUNIT_ASSERT(pItem->getName() == "F");
5525 
5526  // G
5527  ++it2;
5528  pItemPower = *(it2);
5529  CPPUNIT_ASSERT(pItemPower != NULL);
5530  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5531  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5532  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5533  CPPUNIT_ASSERT(pItem != NULL);
5534  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5535  CPPUNIT_ASSERT(pItem->getName() == "G");
5536 
5537  // H
5538  ++it2;
5539  pItemPower = *(it2);
5540  CPPUNIT_ASSERT(pItemPower != NULL);
5541  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5542  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5543  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5544  CPPUNIT_ASSERT(pItem != NULL);
5545  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5546  CPPUNIT_ASSERT(pItem->getName() == "H");
5547 
5548  // I
5549  ++it2;
5550  pItemPower = *(it2);
5551  CPPUNIT_ASSERT(pItemPower != NULL);
5552  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5553  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5554  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5555  CPPUNIT_ASSERT(pItem != NULL);
5556  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5557  CPPUNIT_ASSERT(pItem->getName() == "I");
5558 
5559  // L
5560  ++it2;
5561  pItemPower = *(it2);
5562  CPPUNIT_ASSERT(pItemPower != NULL);
5563  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5564  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5565  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5566  CPPUNIT_ASSERT(pItem != NULL);
5567  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5568  CPPUNIT_ASSERT(pItem->getName() == "L");
5569 
5570  // M
5571  ++it2;
5572  pItemPower = *(it2);
5573  CPPUNIT_ASSERT(pItemPower != NULL);
5574  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5575  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5576  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5577  CPPUNIT_ASSERT(pItem != NULL);
5578  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5579  CPPUNIT_ASSERT(pItem->getName() == "M");
5580 
5581  // m1
5582  ++it2;
5583  pItemPower = *(it2);
5584  CPPUNIT_ASSERT(pItemPower != NULL);
5585  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5586  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5587  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5588  CPPUNIT_ASSERT(pItem != NULL);
5589  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5590  CPPUNIT_ASSERT(pItem->getName() == "m1");
5591 
5592  // 3*C^5*H*L*M*m1
5593  ++it;
5594  pProduct = *(it);
5595  CPPUNIT_ASSERT(pProduct != NULL);
5596  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5597  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
5598 
5599  // C^5
5600  it2 = pProduct->getItemPowers().begin();
5601  pItemPower = *(it2);
5602  CPPUNIT_ASSERT(pItemPower != NULL);
5603  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
5604  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5605  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5606  CPPUNIT_ASSERT(pItem != NULL);
5607  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5608  CPPUNIT_ASSERT(pItem->getName() == "C");
5609 
5610  // H
5611  ++it2;
5612  pItemPower = *(it2);
5613  CPPUNIT_ASSERT(pItemPower != NULL);
5614  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5615  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5616  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5617  CPPUNIT_ASSERT(pItem != NULL);
5618  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5619  CPPUNIT_ASSERT(pItem->getName() == "H");
5620 
5621  // L
5622  ++it2;
5623  pItemPower = *(it2);
5624  CPPUNIT_ASSERT(pItemPower != NULL);
5625  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5626  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5627  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5628  CPPUNIT_ASSERT(pItem != NULL);
5629  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5630  CPPUNIT_ASSERT(pItem->getName() == "L");
5631 
5632  // M
5633  ++it2;
5634  pItemPower = *(it2);
5635  CPPUNIT_ASSERT(pItemPower != NULL);
5636  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5637  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5638  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5639  CPPUNIT_ASSERT(pItem != NULL);
5640  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5641  CPPUNIT_ASSERT(pItem->getName() == "M");
5642 
5643  // m1
5644  ++it2;
5645  pItemPower = *(it2);
5646  CPPUNIT_ASSERT(pItemPower != NULL);
5647  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5648  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5649  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5650  CPPUNIT_ASSERT(pItem != NULL);
5651  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5652  CPPUNIT_ASSERT(pItem->getName() == "m1");
5653 
5654  // 3*C^5*I*L*M*m1
5655  ++it;
5656  pProduct = *(it);
5657  CPPUNIT_ASSERT(pProduct != NULL);
5658  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5659  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
5660 
5661  // C^5
5662  it2 = pProduct->getItemPowers().begin();
5663  pItemPower = *(it2);
5664  CPPUNIT_ASSERT(pItemPower != NULL);
5665  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
5666  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5667  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5668  CPPUNIT_ASSERT(pItem != NULL);
5669  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5670  CPPUNIT_ASSERT(pItem->getName() == "C");
5671 
5672  // I
5673  ++it2;
5674  pItemPower = *(it2);
5675  CPPUNIT_ASSERT(pItemPower != NULL);
5676  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5677  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5678  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5679  CPPUNIT_ASSERT(pItem != NULL);
5680  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5681  CPPUNIT_ASSERT(pItem->getName() == "I");
5682 
5683  // L
5684  ++it2;
5685  pItemPower = *(it2);
5686  CPPUNIT_ASSERT(pItemPower != NULL);
5687  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5688  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5689  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5690  CPPUNIT_ASSERT(pItem != NULL);
5691  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5692  CPPUNIT_ASSERT(pItem->getName() == "L");
5693 
5694  // M
5695  ++it2;
5696  pItemPower = *(it2);
5697  CPPUNIT_ASSERT(pItemPower != NULL);
5698  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5699  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5700  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5701  CPPUNIT_ASSERT(pItem != NULL);
5702  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5703  CPPUNIT_ASSERT(pItem->getName() == "M");
5704 
5705  // m1
5706  ++it2;
5707  pItemPower = *(it2);
5708  CPPUNIT_ASSERT(pItemPower != NULL);
5709  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5710  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5711  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5712  CPPUNIT_ASSERT(pItem != NULL);
5713  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5714  CPPUNIT_ASSERT(pItem->getName() == "m1");
5715 
5716  // 3*C^4*F*H*L*M*m1
5717  ++it;
5718  pProduct = *(it);
5719  CPPUNIT_ASSERT(pProduct != NULL);
5720  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5721  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
5722 
5723  // C^4
5724  it2 = pProduct->getItemPowers().begin();
5725  pItemPower = *(it2);
5726  CPPUNIT_ASSERT(pItemPower != NULL);
5727  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
5728  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5729  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5730  CPPUNIT_ASSERT(pItem != NULL);
5731  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5732  CPPUNIT_ASSERT(pItem->getName() == "C");
5733 
5734  // F
5735  ++it2;
5736  pItemPower = *(it2);
5737  CPPUNIT_ASSERT(pItemPower != NULL);
5738  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5739  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5740  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5741  CPPUNIT_ASSERT(pItem != NULL);
5742  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5743  CPPUNIT_ASSERT(pItem->getName() == "F");
5744 
5745  // H
5746  ++it2;
5747  pItemPower = *(it2);
5748  CPPUNIT_ASSERT(pItemPower != NULL);
5749  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5750  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5751  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5752  CPPUNIT_ASSERT(pItem != NULL);
5753  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5754  CPPUNIT_ASSERT(pItem->getName() == "H");
5755 
5756  // L
5757  ++it2;
5758  pItemPower = *(it2);
5759  CPPUNIT_ASSERT(pItemPower != NULL);
5760  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5761  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5762  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5763  CPPUNIT_ASSERT(pItem != NULL);
5764  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5765  CPPUNIT_ASSERT(pItem->getName() == "L");
5766 
5767  // M
5768  ++it2;
5769  pItemPower = *(it2);
5770  CPPUNIT_ASSERT(pItemPower != NULL);
5771  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5772  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5773  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5774  CPPUNIT_ASSERT(pItem != NULL);
5775  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5776  CPPUNIT_ASSERT(pItem->getName() == "M");
5777 
5778  // m1
5779  ++it2;
5780  pItemPower = *(it2);
5781  CPPUNIT_ASSERT(pItemPower != NULL);
5782  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5783  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5784  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5785  CPPUNIT_ASSERT(pItem != NULL);
5786  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5787  CPPUNIT_ASSERT(pItem->getName() == "m1");
5788 
5789  // 3*C^4*G*I*L*M*m1
5790  ++it;
5791  pProduct = *(it);
5792  CPPUNIT_ASSERT(pProduct != NULL);
5793  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5794  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
5795 
5796  // C^4
5797  it2 = pProduct->getItemPowers().begin();
5798  pItemPower = *(it2);
5799  CPPUNIT_ASSERT(pItemPower != NULL);
5800  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
5801  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5802  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5803  CPPUNIT_ASSERT(pItem != NULL);
5804  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5805  CPPUNIT_ASSERT(pItem->getName() == "C");
5806 
5807  // G
5808  ++it2;
5809  pItemPower = *(it2);
5810  CPPUNIT_ASSERT(pItemPower != NULL);
5811  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5812  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5813  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5814  CPPUNIT_ASSERT(pItem != NULL);
5815  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5816  CPPUNIT_ASSERT(pItem->getName() == "G");
5817 
5818  // I
5819  ++it2;
5820  pItemPower = *(it2);
5821  CPPUNIT_ASSERT(pItemPower != NULL);
5822  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5823  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5824  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5825  CPPUNIT_ASSERT(pItem != NULL);
5826  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5827  CPPUNIT_ASSERT(pItem->getName() == "I");
5828 
5829  // L
5830  ++it2;
5831  pItemPower = *(it2);
5832  CPPUNIT_ASSERT(pItemPower != NULL);
5833  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5834  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5835  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5836  CPPUNIT_ASSERT(pItem != NULL);
5837  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5838  CPPUNIT_ASSERT(pItem->getName() == "L");
5839 
5840  // M
5841  ++it2;
5842  pItemPower = *(it2);
5843  CPPUNIT_ASSERT(pItemPower != NULL);
5844  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5845  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5846  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5847  CPPUNIT_ASSERT(pItem != NULL);
5848  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5849  CPPUNIT_ASSERT(pItem->getName() == "M");
5850 
5851  // m1
5852  ++it2;
5853  pItemPower = *(it2);
5854  CPPUNIT_ASSERT(pItemPower != NULL);
5855  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5856  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5857  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5858  CPPUNIT_ASSERT(pItem != NULL);
5859  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5860  CPPUNIT_ASSERT(pItem->getName() == "m1");
5861 
5862  // 3*C^2*D*F*H*I*L*M*m1
5863  ++it;
5864  pProduct = *(it);
5865  CPPUNIT_ASSERT(pProduct != NULL);
5866  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5867  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
5868 
5869  // C^2
5870  it2 = pProduct->getItemPowers().begin();
5871  pItemPower = *(it2);
5872  CPPUNIT_ASSERT(pItemPower != NULL);
5873  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
5874  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5875  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5876  CPPUNIT_ASSERT(pItem != NULL);
5877  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5878  CPPUNIT_ASSERT(pItem->getName() == "C");
5879 
5880  // D
5881  ++it2;
5882  pItemPower = *(it2);
5883  CPPUNIT_ASSERT(pItemPower != NULL);
5884  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5885  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5886  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5887  CPPUNIT_ASSERT(pItem != NULL);
5888  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5889  CPPUNIT_ASSERT(pItem->getName() == "D");
5890 
5891  // F
5892  ++it2;
5893  pItemPower = *(it2);
5894  CPPUNIT_ASSERT(pItemPower != NULL);
5895  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5896  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5897  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5898  CPPUNIT_ASSERT(pItem != NULL);
5899  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5900  CPPUNIT_ASSERT(pItem->getName() == "F");
5901 
5902  // H
5903  ++it2;
5904  pItemPower = *(it2);
5905  CPPUNIT_ASSERT(pItemPower != NULL);
5906  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5907  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5908  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5909  CPPUNIT_ASSERT(pItem != NULL);
5910  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5911  CPPUNIT_ASSERT(pItem->getName() == "H");
5912 
5913  // I
5914  ++it2;
5915  pItemPower = *(it2);
5916  CPPUNIT_ASSERT(pItemPower != NULL);
5917  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5918  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5919  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5920  CPPUNIT_ASSERT(pItem != NULL);
5921  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5922  CPPUNIT_ASSERT(pItem->getName() == "I");
5923 
5924  // L
5925  ++it2;
5926  pItemPower = *(it2);
5927  CPPUNIT_ASSERT(pItemPower != NULL);
5928  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5929  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5930  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5931  CPPUNIT_ASSERT(pItem != NULL);
5932  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5933  CPPUNIT_ASSERT(pItem->getName() == "L");
5934 
5935  // M
5936  ++it2;
5937  pItemPower = *(it2);
5938  CPPUNIT_ASSERT(pItemPower != NULL);
5939  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5940  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5941  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5942  CPPUNIT_ASSERT(pItem != NULL);
5943  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5944  CPPUNIT_ASSERT(pItem->getName() == "M");
5945 
5946  // m1
5947  ++it2;
5948  pItemPower = *(it2);
5949  CPPUNIT_ASSERT(pItemPower != NULL);
5950  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5951  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5952  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5953  CPPUNIT_ASSERT(pItem != NULL);
5954  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5955  CPPUNIT_ASSERT(pItem->getName() == "m1");
5956 
5957  // 3*C^2*E*G*H*I*L*M*m1
5958  ++it;
5959  pProduct = *(it);
5960  CPPUNIT_ASSERT(pProduct != NULL);
5961  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
5962  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
5963 
5964  // C^2
5965  it2 = pProduct->getItemPowers().begin();
5966  pItemPower = *(it2);
5967  CPPUNIT_ASSERT(pItemPower != NULL);
5968  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
5969  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5970  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5971  CPPUNIT_ASSERT(pItem != NULL);
5972  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5973  CPPUNIT_ASSERT(pItem->getName() == "C");
5974 
5975  // E
5976  ++it2;
5977  pItemPower = *(it2);
5978  CPPUNIT_ASSERT(pItemPower != NULL);
5979  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5980  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5981  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5982  CPPUNIT_ASSERT(pItem != NULL);
5983  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5984  CPPUNIT_ASSERT(pItem->getName() == "E");
5985 
5986  // G
5987  ++it2;
5988  pItemPower = *(it2);
5989  CPPUNIT_ASSERT(pItemPower != NULL);
5990  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
5991  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
5992  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
5993  CPPUNIT_ASSERT(pItem != NULL);
5994  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
5995  CPPUNIT_ASSERT(pItem->getName() == "G");
5996 
5997  // H
5998  ++it2;
5999  pItemPower = *(it2);
6000  CPPUNIT_ASSERT(pItemPower != NULL);
6001  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6002  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6003  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6004  CPPUNIT_ASSERT(pItem != NULL);
6005  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6006  CPPUNIT_ASSERT(pItem->getName() == "H");
6007 
6008  // I
6009  ++it2;
6010  pItemPower = *(it2);
6011  CPPUNIT_ASSERT(pItemPower != NULL);
6012  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6013  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6014  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6015  CPPUNIT_ASSERT(pItem != NULL);
6016  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6017  CPPUNIT_ASSERT(pItem->getName() == "I");
6018 
6019  // L
6020  ++it2;
6021  pItemPower = *(it2);
6022  CPPUNIT_ASSERT(pItemPower != NULL);
6023  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6024  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6025  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6026  CPPUNIT_ASSERT(pItem != NULL);
6027  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6028  CPPUNIT_ASSERT(pItem->getName() == "L");
6029 
6030  // M
6031  ++it2;
6032  pItemPower = *(it2);
6033  CPPUNIT_ASSERT(pItemPower != NULL);
6034  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6035  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6036  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6037  CPPUNIT_ASSERT(pItem != NULL);
6038  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6039  CPPUNIT_ASSERT(pItem->getName() == "M");
6040 
6041  // m1
6042  ++it2;
6043  pItemPower = *(it2);
6044  CPPUNIT_ASSERT(pItemPower != NULL);
6045  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6046  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6047  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6048  CPPUNIT_ASSERT(pItem != NULL);
6049  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6050  CPPUNIT_ASSERT(pItem->getName() == "m1");
6051 
6052  // 3*C*D*F*G*H*I*L*M*m1
6053  ++it;
6054  pProduct = *(it);
6055  CPPUNIT_ASSERT(pProduct != NULL);
6056  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
6057  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
6058 
6059  // C
6060  it2 = pProduct->getItemPowers().begin();
6061  pItemPower = *(it2);
6062  CPPUNIT_ASSERT(pItemPower != NULL);
6063  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6064  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6065  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6066  CPPUNIT_ASSERT(pItem != NULL);
6067  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6068  CPPUNIT_ASSERT(pItem->getName() == "C");
6069 
6070  // D
6071  ++it2;
6072  pItemPower = *(it2);
6073  CPPUNIT_ASSERT(pItemPower != NULL);
6074  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6075  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6076  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6077  CPPUNIT_ASSERT(pItem != NULL);
6078  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6079  CPPUNIT_ASSERT(pItem->getName() == "D");
6080 
6081  // F
6082  ++it2;
6083  pItemPower = *(it2);
6084  CPPUNIT_ASSERT(pItemPower != NULL);
6085  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6086  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6087  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6088  CPPUNIT_ASSERT(pItem != NULL);
6089  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6090  CPPUNIT_ASSERT(pItem->getName() == "F");
6091 
6092  // G
6093  ++it2;
6094  pItemPower = *(it2);
6095  CPPUNIT_ASSERT(pItemPower != NULL);
6096  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6097  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6098  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6099  CPPUNIT_ASSERT(pItem != NULL);
6100  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6101  CPPUNIT_ASSERT(pItem->getName() == "G");
6102 
6103  // H
6104  ++it2;
6105  pItemPower = *(it2);
6106  CPPUNIT_ASSERT(pItemPower != NULL);
6107  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6108  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6109  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6110  CPPUNIT_ASSERT(pItem != NULL);
6111  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6112  CPPUNIT_ASSERT(pItem->getName() == "H");
6113 
6114  // I
6115  ++it2;
6116  pItemPower = *(it2);
6117  CPPUNIT_ASSERT(pItemPower != NULL);
6118  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6119  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6120  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6121  CPPUNIT_ASSERT(pItem != NULL);
6122  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6123  CPPUNIT_ASSERT(pItem->getName() == "I");
6124 
6125  // L
6126  ++it2;
6127  pItemPower = *(it2);
6128  CPPUNIT_ASSERT(pItemPower != NULL);
6129  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6130  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6131  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6132  CPPUNIT_ASSERT(pItem != NULL);
6133  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6134  CPPUNIT_ASSERT(pItem->getName() == "L");
6135 
6136  // M
6137  ++it2;
6138  pItemPower = *(it2);
6139  CPPUNIT_ASSERT(pItemPower != NULL);
6140  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6141  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6142  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6143  CPPUNIT_ASSERT(pItem != NULL);
6144  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6145  CPPUNIT_ASSERT(pItem->getName() == "M");
6146 
6147  // m1
6148  ++it2;
6149  pItemPower = *(it2);
6150  CPPUNIT_ASSERT(pItemPower != NULL);
6151  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6152  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6153  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6154  CPPUNIT_ASSERT(pItem != NULL);
6155  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6156  CPPUNIT_ASSERT(pItem->getName() == "m1");
6157 
6158  // 3*C*E*F*G*H*I*L*M*m1
6159  ++it;
6160  pProduct = *(it);
6161  CPPUNIT_ASSERT(pProduct != NULL);
6162  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
6163  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
6164 
6165  // C
6166  it2 = pProduct->getItemPowers().begin();
6167  pItemPower = *(it2);
6168  CPPUNIT_ASSERT(pItemPower != NULL);
6169  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6170  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6171  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6172  CPPUNIT_ASSERT(pItem != NULL);
6173  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6174  CPPUNIT_ASSERT(pItem->getName() == "C");
6175 
6176  // E
6177  ++it2;
6178  pItemPower = *(it2);
6179  CPPUNIT_ASSERT(pItemPower != NULL);
6180  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6181  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6182  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6183  CPPUNIT_ASSERT(pItem != NULL);
6184  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6185  CPPUNIT_ASSERT(pItem->getName() == "E");
6186 
6187  // F
6188  ++it2;
6189  pItemPower = *(it2);
6190  CPPUNIT_ASSERT(pItemPower != NULL);
6191  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6192  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6193  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6194  CPPUNIT_ASSERT(pItem != NULL);
6195  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6196  CPPUNIT_ASSERT(pItem->getName() == "F");
6197 
6198  // G
6199  ++it2;
6200  pItemPower = *(it2);
6201  CPPUNIT_ASSERT(pItemPower != NULL);
6202  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6203  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6204  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6205  CPPUNIT_ASSERT(pItem != NULL);
6206  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6207  CPPUNIT_ASSERT(pItem->getName() == "G");
6208 
6209  // H
6210  ++it2;
6211  pItemPower = *(it2);
6212  CPPUNIT_ASSERT(pItemPower != NULL);
6213  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6214  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6215  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6216  CPPUNIT_ASSERT(pItem != NULL);
6217  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6218  CPPUNIT_ASSERT(pItem->getName() == "H");
6219 
6220  // I
6221  ++it2;
6222  pItemPower = *(it2);
6223  CPPUNIT_ASSERT(pItemPower != NULL);
6224  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6225  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6226  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6227  CPPUNIT_ASSERT(pItem != NULL);
6228  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6229  CPPUNIT_ASSERT(pItem->getName() == "I");
6230 
6231  // L
6232  ++it2;
6233  pItemPower = *(it2);
6234  CPPUNIT_ASSERT(pItemPower != NULL);
6235  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6236  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6237  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6238  CPPUNIT_ASSERT(pItem != NULL);
6239  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6240  CPPUNIT_ASSERT(pItem->getName() == "L");
6241 
6242  // M
6243  ++it2;
6244  pItemPower = *(it2);
6245  CPPUNIT_ASSERT(pItemPower != NULL);
6246  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6247  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6248  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6249  CPPUNIT_ASSERT(pItem != NULL);
6250  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6251  CPPUNIT_ASSERT(pItem->getName() == "M");
6252 
6253  // m1
6254  ++it2;
6255  pItemPower = *(it2);
6256  CPPUNIT_ASSERT(pItemPower != NULL);
6257  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6258  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6259  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6260  CPPUNIT_ASSERT(pItem != NULL);
6261  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6262  CPPUNIT_ASSERT(pItem->getName() == "m1");
6263 
6264  // 9*C^4*H*I*L*M*m1
6265  ++it;
6266  pProduct = *(it);
6267  CPPUNIT_ASSERT(pProduct != NULL);
6268  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
6269  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
6270 
6271  // C^4
6272  it2 = pProduct->getItemPowers().begin();
6273  pItemPower = *(it2);
6274  CPPUNIT_ASSERT(pItemPower != NULL);
6275  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
6276  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6277  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6278  CPPUNIT_ASSERT(pItem != NULL);
6279  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6280  CPPUNIT_ASSERT(pItem->getName() == "C");
6281 
6282  // H
6283  ++it2;
6284  pItemPower = *(it2);
6285  CPPUNIT_ASSERT(pItemPower != NULL);
6286  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6287  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6288  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6289  CPPUNIT_ASSERT(pItem != NULL);
6290  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6291  CPPUNIT_ASSERT(pItem->getName() == "H");
6292 
6293  // I
6294  ++it2;
6295  pItemPower = *(it2);
6296  CPPUNIT_ASSERT(pItemPower != NULL);
6297  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6298  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6299  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6300  CPPUNIT_ASSERT(pItem != NULL);
6301  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6302  CPPUNIT_ASSERT(pItem->getName() == "I");
6303 
6304  // L
6305  ++it2;
6306  pItemPower = *(it2);
6307  CPPUNIT_ASSERT(pItemPower != NULL);
6308  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6309  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6310  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6311  CPPUNIT_ASSERT(pItem != NULL);
6312  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6313  CPPUNIT_ASSERT(pItem->getName() == "L");
6314 
6315  // M
6316  ++it2;
6317  pItemPower = *(it2);
6318  CPPUNIT_ASSERT(pItemPower != NULL);
6319  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6320  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6321  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6322  CPPUNIT_ASSERT(pItem != NULL);
6323  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6324  CPPUNIT_ASSERT(pItem->getName() == "M");
6325 
6326  // m1
6327  ++it2;
6328  pItemPower = *(it2);
6329  CPPUNIT_ASSERT(pItemPower != NULL);
6330  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6331  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6332  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6333  CPPUNIT_ASSERT(pItem != NULL);
6334  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6335  CPPUNIT_ASSERT(pItem->getName() == "m1");
6336 
6337  // 9*C^3*F*H*I*L*M*m1
6338  ++it;
6339  pProduct = *(it);
6340  CPPUNIT_ASSERT(pProduct != NULL);
6341  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
6342  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
6343 
6344  // C^3
6345  it2 = pProduct->getItemPowers().begin();
6346  pItemPower = *(it2);
6347  CPPUNIT_ASSERT(pItemPower != NULL);
6348  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
6349  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6350  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6351  CPPUNIT_ASSERT(pItem != NULL);
6352  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6353  CPPUNIT_ASSERT(pItem->getName() == "C");
6354 
6355  // F
6356  ++it2;
6357  pItemPower = *(it2);
6358  CPPUNIT_ASSERT(pItemPower != NULL);
6359  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6360  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6361  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6362  CPPUNIT_ASSERT(pItem != NULL);
6363  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6364  CPPUNIT_ASSERT(pItem->getName() == "F");
6365 
6366  // H
6367  ++it2;
6368  pItemPower = *(it2);
6369  CPPUNIT_ASSERT(pItemPower != NULL);
6370  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6371  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6372  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6373  CPPUNIT_ASSERT(pItem != NULL);
6374  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6375  CPPUNIT_ASSERT(pItem->getName() == "H");
6376 
6377  // I
6378  ++it2;
6379  pItemPower = *(it2);
6380  CPPUNIT_ASSERT(pItemPower != NULL);
6381  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6382  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6383  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6384  CPPUNIT_ASSERT(pItem != NULL);
6385  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6386  CPPUNIT_ASSERT(pItem->getName() == "I");
6387 
6388  // L
6389  ++it2;
6390  pItemPower = *(it2);
6391  CPPUNIT_ASSERT(pItemPower != NULL);
6392  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6393  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6394  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6395  CPPUNIT_ASSERT(pItem != NULL);
6396  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6397  CPPUNIT_ASSERT(pItem->getName() == "L");
6398 
6399  // M
6400  ++it2;
6401  pItemPower = *(it2);
6402  CPPUNIT_ASSERT(pItemPower != NULL);
6403  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6404  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6405  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6406  CPPUNIT_ASSERT(pItem != NULL);
6407  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6408  CPPUNIT_ASSERT(pItem->getName() == "M");
6409 
6410  // m1
6411  ++it2;
6412  pItemPower = *(it2);
6413  CPPUNIT_ASSERT(pItemPower != NULL);
6414  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6415  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6416  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6417  CPPUNIT_ASSERT(pItem != NULL);
6418  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6419  CPPUNIT_ASSERT(pItem->getName() == "m1");
6420 
6421  // 9*C^3*G*H*I*L*M*m1
6422  ++it;
6423  pProduct = *(it);
6424  CPPUNIT_ASSERT(pProduct != NULL);
6425  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
6426  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
6427 
6428  // C^3
6429  it2 = pProduct->getItemPowers().begin();
6430  pItemPower = *(it2);
6431  CPPUNIT_ASSERT(pItemPower != NULL);
6432  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
6433  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6434  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6435  CPPUNIT_ASSERT(pItem != NULL);
6436  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6437  CPPUNIT_ASSERT(pItem->getName() == "C");
6438 
6439  // G
6440  ++it2;
6441  pItemPower = *(it2);
6442  CPPUNIT_ASSERT(pItemPower != NULL);
6443  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6444  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6445  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6446  CPPUNIT_ASSERT(pItem != NULL);
6447  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6448  CPPUNIT_ASSERT(pItem->getName() == "G");
6449 
6450  // H
6451  ++it2;
6452  pItemPower = *(it2);
6453  CPPUNIT_ASSERT(pItemPower != NULL);
6454  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6455  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6456  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6457  CPPUNIT_ASSERT(pItem != NULL);
6458  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6459  CPPUNIT_ASSERT(pItem->getName() == "H");
6460 
6461  // I
6462  ++it2;
6463  pItemPower = *(it2);
6464  CPPUNIT_ASSERT(pItemPower != NULL);
6465  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6466  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6467  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6468  CPPUNIT_ASSERT(pItem != NULL);
6469  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6470  CPPUNIT_ASSERT(pItem->getName() == "I");
6471 
6472  // L
6473  ++it2;
6474  pItemPower = *(it2);
6475  CPPUNIT_ASSERT(pItemPower != NULL);
6476  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6477  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6478  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6479  CPPUNIT_ASSERT(pItem != NULL);
6480  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6481  CPPUNIT_ASSERT(pItem->getName() == "L");
6482 
6483  // M
6484  ++it2;
6485  pItemPower = *(it2);
6486  CPPUNIT_ASSERT(pItemPower != NULL);
6487  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6488  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6489  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6490  CPPUNIT_ASSERT(pItem != NULL);
6491  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6492  CPPUNIT_ASSERT(pItem->getName() == "M");
6493 
6494  // m1
6495  ++it2;
6496  pItemPower = *(it2);
6497  CPPUNIT_ASSERT(pItemPower != NULL);
6498  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6499  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6500  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6501  CPPUNIT_ASSERT(pItem != NULL);
6502  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6503  CPPUNIT_ASSERT(pItem->getName() == "m1");
6504 
6505  // 9*C^2*F*G*H*I*L*M*m1
6506  ++it;
6507  pProduct = *(it);
6508  CPPUNIT_ASSERT(pProduct != NULL);
6509  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
6510  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
6511 
6512  // C^2
6513  it2 = pProduct->getItemPowers().begin();
6514  pItemPower = *(it2);
6515  CPPUNIT_ASSERT(pItemPower != NULL);
6516  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
6517  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6518  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6519  CPPUNIT_ASSERT(pItem != NULL);
6520  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6521  CPPUNIT_ASSERT(pItem->getName() == "C");
6522 
6523  // F
6524  ++it2;
6525  pItemPower = *(it2);
6526  CPPUNIT_ASSERT(pItemPower != NULL);
6527  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6528  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6529  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6530  CPPUNIT_ASSERT(pItem != NULL);
6531  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6532  CPPUNIT_ASSERT(pItem->getName() == "F");
6533 
6534  // G
6535  ++it2;
6536  pItemPower = *(it2);
6537  CPPUNIT_ASSERT(pItemPower != NULL);
6538  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6539  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6540  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6541  CPPUNIT_ASSERT(pItem != NULL);
6542  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6543  CPPUNIT_ASSERT(pItem->getName() == "G");
6544 
6545  // H
6546  ++it2;
6547  pItemPower = *(it2);
6548  CPPUNIT_ASSERT(pItemPower != NULL);
6549  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6550  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6551  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6552  CPPUNIT_ASSERT(pItem != NULL);
6553  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6554  CPPUNIT_ASSERT(pItem->getName() == "H");
6555 
6556  // I
6557  ++it2;
6558  pItemPower = *(it2);
6559  CPPUNIT_ASSERT(pItemPower != NULL);
6560  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6561  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6562  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6563  CPPUNIT_ASSERT(pItem != NULL);
6564  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6565  CPPUNIT_ASSERT(pItem->getName() == "I");
6566 
6567  // L
6568  ++it2;
6569  pItemPower = *(it2);
6570  CPPUNIT_ASSERT(pItemPower != NULL);
6571  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6572  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6573  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6574  CPPUNIT_ASSERT(pItem != NULL);
6575  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6576  CPPUNIT_ASSERT(pItem->getName() == "L");
6577 
6578  // M
6579  ++it2;
6580  pItemPower = *(it2);
6581  CPPUNIT_ASSERT(pItemPower != NULL);
6582  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6583  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6584  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6585  CPPUNIT_ASSERT(pItem != NULL);
6586  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6587  CPPUNIT_ASSERT(pItem->getName() == "M");
6588 
6589  // m1
6590  ++it2;
6591  pItemPower = *(it2);
6592  CPPUNIT_ASSERT(pItemPower != NULL);
6593  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6594  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6595  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6596  CPPUNIT_ASSERT(pItem != NULL);
6597  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6598  CPPUNIT_ASSERT(pItem->getName() == "m1");
6599 
6600  delete pFraction;
6601 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
ItemType getItemType() const
const std::set< CNormalItemPower *, compareItemPowers > & getItemPowers() const
const C_FLOAT64 & getExp() const
const C_FLOAT64 & getFactor() const
CNormalBase & getItem()
CEvaluationNode * getRoot()
const std::set< CNormalProduct *, compareProducts > & getProducts() const
Definition: CNormalSum.cpp:416
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den67 ( )

Definition at line 8343 of file test_biomodels217_expression.cpp.

References CNormalSum::getFractions(), CEvaluationTree::getRoot(), CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_num6, and term_num7.

8344 {
8345  std::cout << "testing numerator terms 6 to 7" << std::endl;
8346  std::string infix = std::string(term_num6) + std::string(" + ") + std::string(term_num7);
8347 
8348  CEvaluationTree* pTree = new CEvaluationTree();
8349  pTree->setInfix(infix);
8350  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
8352  delete pTree;
8353  CPPUNIT_ASSERT(pFraction != NULL);
8354 
8355  const CNormalSum* pNumerator = &pFraction->getNumerator();
8356  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
8357  const CNormalSum* pDenominator = &pFraction->getDenominator();
8358  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
8359 
8360  delete pFraction;
8361 }
static CNormalFraction * normAndSimplifyReptdly(const CEvaluationTree *tree0, unsigned int depth=0)
const std::set< CNormalFraction * > & getFractions() const
Definition: CNormalSum.cpp:425
CEvaluationNode * getRoot()
virtual bool setInfix(const std::string &infix)
void test_biomodels217_expression::test_term_den7 ( )

Definition at line 6604 of file test_biomodels217_expression.cpp.

References CNormalItemPower::getExp(), CNormalProduct::getFactor(), CNormalSum::getFractions(), CNormalItemPower::getItem(), CNormalProduct::getItemPowers(), CNormalItemPower::getItemType(), CNormalSum::getProducts(), CEvaluationTree::getRoot(), CNormalItemPower::ITEM, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationTree::setInfix(), term_den7, and CNormalItem::VARIABLE.

6605 {
6606  // 3*C^4*B*O*N/(D*E*G*I*J*L*M*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I))*o1)
6607  // -> (3*B*C^4*F*H*N*O)/(C^6*J*L*M*o1 + C^3*D*F*H*J*L*M*o1 + C^3*E*G*I*J*L*M*o1 + D*E*F*G*H*I*J*L*M*o1 + 3*C^5*H*J*L*M*o1 + 3*C^5*I*J*L*M*o1 + 3*C^4*F*H*J*L*M*o1 + 3*C^4*G*I*J*L*M*o1 + 3*C^2*D*F*H*I*J*L*M*o1 + 3*C^2*E*G*H*I*J*L*M*o1 + 3*C*D*F*G*H*I*J*L*M*o1 + 3*C*E*F*G*H*I*J*L*M*o1 + 9*C^4*H*I*J*L*M*o1 + 9*C^3*F*H*I*J*L*M*o1 + 9*C^3*G*H*I*J*L*M*o1 + 9*C^2*F*G*H*I*J*L*M*o1)
6608  CEvaluationTree* pTree = new CEvaluationTree();
6609  pTree->setInfix(term_den7);
6610  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
6612  delete pTree;
6613  CPPUNIT_ASSERT(pFraction != NULL);
6614 
6615  // numerator
6616  // (3*B*C^4*F*H*N*O)
6617  const CNormalSum* pNumerator = &pFraction->getNumerator();
6618  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
6619  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
6620  CPPUNIT_ASSERT(pProducts->size() == 1);
6621  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
6622  const CNormalProduct* pProduct = *(it);
6623  CPPUNIT_ASSERT(pProduct != NULL);
6624  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
6625  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
6626  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
6627  // B
6628  const CNormalItemPower* pItemPower = *(it2);
6629  CPPUNIT_ASSERT(pItemPower != NULL);
6630  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6631  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6632  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6633  CPPUNIT_ASSERT(pItem != NULL);
6634  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6635  CPPUNIT_ASSERT(pItem->getName() == "B");
6636 
6637  ++it2;
6638  // C^4
6639  pItemPower = *(it2);
6640  CPPUNIT_ASSERT(pItemPower != NULL);
6641  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
6642  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6643  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6644  CPPUNIT_ASSERT(pItem != NULL);
6645  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6646  CPPUNIT_ASSERT(pItem->getName() == "C");
6647 
6648  ++it2;
6649  // F
6650  pItemPower = *(it2);
6651  CPPUNIT_ASSERT(pItemPower != NULL);
6652  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6653  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6654  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6655  CPPUNIT_ASSERT(pItem != NULL);
6656  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6657  CPPUNIT_ASSERT(pItem->getName() == "F");
6658 
6659  ++it2;
6660  // H
6661  pItemPower = *(it2);
6662  CPPUNIT_ASSERT(pItemPower != NULL);
6663  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6664  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6665  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6666  CPPUNIT_ASSERT(pItem != NULL);
6667  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6668  CPPUNIT_ASSERT(pItem->getName() == "H");
6669 
6670  ++it2;
6671  // N
6672  pItemPower = *(it2);
6673  CPPUNIT_ASSERT(pItemPower != NULL);
6674  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6675  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6676  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6677  CPPUNIT_ASSERT(pItem != NULL);
6678  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6679  CPPUNIT_ASSERT(pItem->getName() == "N");
6680 
6681  ++it2;
6682  // O
6683  pItemPower = *(it2);
6684  CPPUNIT_ASSERT(pItemPower != NULL);
6685  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6686  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6687  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6688  CPPUNIT_ASSERT(pItem != NULL);
6689  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6690  CPPUNIT_ASSERT(pItem->getName() == "O");
6691 
6692 
6693  // denominator
6694  // (C^6*J*L*M*o1 + C^3*D*F*H*J*L*M*o1 + C^3*E*G*I*J*L*M*o1 + D*E*F*G*H*I*J*L*M*o1 + 3*C^5*H*J*L*M*o1 + 3*C^5*I*J*L*M*o1 + 3*C^4*F*H*J*L*M*o1 + 3*C^4*G*I*J*L*M*o1 + 3*C^2*D*F*H*I*J*L*M*o1 + 3*C^2*E*G*H*I*J*L*M*o1 + 3*C*D*F*G*H*I*J*L*M*o1 + 3*C*E*F*G*H*I*J*L*M*o1 + 9*C^4*H*I*J*L*M*o1 + 9*C^3*F*H*I*J*L*M*o1 + 9*C^3*G*H*I*J*L*M*o1 + 9*C^2*F*G*H*I*J*L*M*o1)
6695  const CNormalSum* pDenominator = &pFraction->getDenominator();
6696  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
6697  pProducts = &pDenominator->getProducts();
6698  CPPUNIT_ASSERT(pProducts->size() == 16);
6699 
6700 
6701  // C^6*J*L*M*o1
6702  it = pProducts->begin();
6703  pProduct = *(it);
6704  CPPUNIT_ASSERT(pProduct != NULL);
6705  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
6706  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
6707 
6708  // C^6
6709  it2 = pProduct->getItemPowers().begin();
6710  pItemPower = *(it2);
6711  CPPUNIT_ASSERT(pItemPower != NULL);
6712  CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
6713  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6714  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6715  CPPUNIT_ASSERT(pItem != NULL);
6716  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6717  CPPUNIT_ASSERT(pItem->getName() == "C");
6718 
6719  // J
6720  ++it2;
6721  pItemPower = *(it2);
6722  CPPUNIT_ASSERT(pItemPower != NULL);
6723  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6724  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6725  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6726  CPPUNIT_ASSERT(pItem != NULL);
6727  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6728  CPPUNIT_ASSERT(pItem->getName() == "J");
6729 
6730  // L
6731  ++it2;
6732  pItemPower = *(it2);
6733  CPPUNIT_ASSERT(pItemPower != NULL);
6734  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6735  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6736  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6737  CPPUNIT_ASSERT(pItem != NULL);
6738  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6739  CPPUNIT_ASSERT(pItem->getName() == "L");
6740 
6741  // M
6742  ++it2;
6743  pItemPower = *(it2);
6744  CPPUNIT_ASSERT(pItemPower != NULL);
6745  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6746  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6747  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6748  CPPUNIT_ASSERT(pItem != NULL);
6749  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6750  CPPUNIT_ASSERT(pItem->getName() == "M");
6751 
6752  // o1
6753  ++it2;
6754  pItemPower = *(it2);
6755  CPPUNIT_ASSERT(pItemPower != NULL);
6756  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6757  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6758  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6759  CPPUNIT_ASSERT(pItem != NULL);
6760  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6761  CPPUNIT_ASSERT(pItem->getName() == "o1");
6762 
6763  // C^3*D*F*H*J*L*M*o1
6764  ++it;
6765  pProduct = *(it);
6766  CPPUNIT_ASSERT(pProduct != NULL);
6767  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
6768  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
6769 
6770  // C^3
6771  it2 = pProduct->getItemPowers().begin();
6772  pItemPower = *(it2);
6773  CPPUNIT_ASSERT(pItemPower != NULL);
6774  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
6775  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6776  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6777  CPPUNIT_ASSERT(pItem != NULL);
6778  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6779  CPPUNIT_ASSERT(pItem->getName() == "C");
6780 
6781  // D
6782  ++it2;
6783  pItemPower = *(it2);
6784  CPPUNIT_ASSERT(pItemPower != NULL);
6785  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6786  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6787  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6788  CPPUNIT_ASSERT(pItem != NULL);
6789  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6790  CPPUNIT_ASSERT(pItem->getName() == "D");
6791 
6792  // F
6793  ++it2;
6794  pItemPower = *(it2);
6795  CPPUNIT_ASSERT(pItemPower != NULL);
6796  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6797  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6798  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6799  CPPUNIT_ASSERT(pItem != NULL);
6800  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6801  CPPUNIT_ASSERT(pItem->getName() == "F");
6802 
6803  // H
6804  ++it2;
6805  pItemPower = *(it2);
6806  CPPUNIT_ASSERT(pItemPower != NULL);
6807  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6808  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6809  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6810  CPPUNIT_ASSERT(pItem != NULL);
6811  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6812  CPPUNIT_ASSERT(pItem->getName() == "H");
6813 
6814  // J
6815  ++it2;
6816  pItemPower = *(it2);
6817  CPPUNIT_ASSERT(pItemPower != NULL);
6818  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6819  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6820  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6821  CPPUNIT_ASSERT(pItem != NULL);
6822  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6823  CPPUNIT_ASSERT(pItem->getName() == "J");
6824 
6825  // L
6826  ++it2;
6827  pItemPower = *(it2);
6828  CPPUNIT_ASSERT(pItemPower != NULL);
6829  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6830  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6831  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6832  CPPUNIT_ASSERT(pItem != NULL);
6833  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6834  CPPUNIT_ASSERT(pItem->getName() == "L");
6835 
6836  // M
6837  ++it2;
6838  pItemPower = *(it2);
6839  CPPUNIT_ASSERT(pItemPower != NULL);
6840  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6841  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6842  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6843  CPPUNIT_ASSERT(pItem != NULL);
6844  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6845  CPPUNIT_ASSERT(pItem->getName() == "M");
6846 
6847  // o1
6848  ++it2;
6849  pItemPower = *(it2);
6850  CPPUNIT_ASSERT(pItemPower != NULL);
6851  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6852  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6853  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6854  CPPUNIT_ASSERT(pItem != NULL);
6855  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6856  CPPUNIT_ASSERT(pItem->getName() == "o1");
6857 
6858  // C^3*E*G*I*J*L*M*o1
6859  ++it;
6860  pProduct = *(it);
6861  CPPUNIT_ASSERT(pProduct != NULL);
6862  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
6863  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
6864 
6865  // C^3
6866  it2 = pProduct->getItemPowers().begin();
6867  pItemPower = *(it2);
6868  CPPUNIT_ASSERT(pItemPower != NULL);
6869  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
6870  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6871  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6872  CPPUNIT_ASSERT(pItem != NULL);
6873  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6874  CPPUNIT_ASSERT(pItem->getName() == "C");
6875 
6876  // E
6877  ++it2;
6878  pItemPower = *(it2);
6879  CPPUNIT_ASSERT(pItemPower != NULL);
6880  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6881  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6882  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6883  CPPUNIT_ASSERT(pItem != NULL);
6884  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6885  CPPUNIT_ASSERT(pItem->getName() == "E");
6886 
6887  // G
6888  ++it2;
6889  pItemPower = *(it2);
6890  CPPUNIT_ASSERT(pItemPower != NULL);
6891  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6892  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6893  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6894  CPPUNIT_ASSERT(pItem != NULL);
6895  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6896  CPPUNIT_ASSERT(pItem->getName() == "G");
6897 
6898  // I
6899  ++it2;
6900  pItemPower = *(it2);
6901  CPPUNIT_ASSERT(pItemPower != NULL);
6902  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6903  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6904  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6905  CPPUNIT_ASSERT(pItem != NULL);
6906  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6907  CPPUNIT_ASSERT(pItem->getName() == "I");
6908 
6909  // J
6910  ++it2;
6911  pItemPower = *(it2);
6912  CPPUNIT_ASSERT(pItemPower != NULL);
6913  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6914  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6915  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6916  CPPUNIT_ASSERT(pItem != NULL);
6917  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6918  CPPUNIT_ASSERT(pItem->getName() == "J");
6919 
6920  // L
6921  ++it2;
6922  pItemPower = *(it2);
6923  CPPUNIT_ASSERT(pItemPower != NULL);
6924  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6925  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6926  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6927  CPPUNIT_ASSERT(pItem != NULL);
6928  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6929  CPPUNIT_ASSERT(pItem->getName() == "L");
6930 
6931  // M
6932  ++it2;
6933  pItemPower = *(it2);
6934  CPPUNIT_ASSERT(pItemPower != NULL);
6935  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6936  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6937  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6938  CPPUNIT_ASSERT(pItem != NULL);
6939  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6940  CPPUNIT_ASSERT(pItem->getName() == "M");
6941 
6942  // o1
6943  ++it2;
6944  pItemPower = *(it2);
6945  CPPUNIT_ASSERT(pItemPower != NULL);
6946  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6947  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6948  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6949  CPPUNIT_ASSERT(pItem != NULL);
6950  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6951  CPPUNIT_ASSERT(pItem->getName() == "o1");
6952 
6953  // D*E*F*G*H*I*J*L*M*o1
6954  ++it;
6955  pProduct = *(it);
6956  CPPUNIT_ASSERT(pProduct != NULL);
6957  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
6958  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 10);
6959 
6960  // D
6961  it2 = pProduct->getItemPowers().begin();
6962  pItemPower = *(it2);
6963  CPPUNIT_ASSERT(pItemPower != NULL);
6964  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6965  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6966  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6967  CPPUNIT_ASSERT(pItem != NULL);
6968  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6969  CPPUNIT_ASSERT(pItem->getName() == "D");
6970 
6971  // E
6972  ++it2;
6973  pItemPower = *(it2);
6974  CPPUNIT_ASSERT(pItemPower != NULL);
6975  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6976  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6977  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6978  CPPUNIT_ASSERT(pItem != NULL);
6979  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6980  CPPUNIT_ASSERT(pItem->getName() == "E");
6981 
6982 
6983  // F
6984  ++it2;
6985  pItemPower = *(it2);
6986  CPPUNIT_ASSERT(pItemPower != NULL);
6987  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6988  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
6989  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
6990  CPPUNIT_ASSERT(pItem != NULL);
6991  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
6992  CPPUNIT_ASSERT(pItem->getName() == "F");
6993 
6994  // G
6995  ++it2;
6996  pItemPower = *(it2);
6997  CPPUNIT_ASSERT(pItemPower != NULL);
6998  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
6999  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7000  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7001  CPPUNIT_ASSERT(pItem != NULL);
7002  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7003  CPPUNIT_ASSERT(pItem->getName() == "G");
7004 
7005  // H
7006  ++it2;
7007  pItemPower = *(it2);
7008  CPPUNIT_ASSERT(pItemPower != NULL);
7009  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7010  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7011  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7012  CPPUNIT_ASSERT(pItem != NULL);
7013  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7014  CPPUNIT_ASSERT(pItem->getName() == "H");
7015 
7016  // I
7017  ++it2;
7018  pItemPower = *(it2);
7019  CPPUNIT_ASSERT(pItemPower != NULL);
7020  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7021  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7022  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7023  CPPUNIT_ASSERT(pItem != NULL);
7024  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7025  CPPUNIT_ASSERT(pItem->getName() == "I");
7026 
7027  // J
7028  ++it2;
7029  pItemPower = *(it2);
7030  CPPUNIT_ASSERT(pItemPower != NULL);
7031  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7032  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7033  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7034  CPPUNIT_ASSERT(pItem != NULL);
7035  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7036  CPPUNIT_ASSERT(pItem->getName() == "J");
7037 
7038  // L
7039  ++it2;
7040  pItemPower = *(it2);
7041  CPPUNIT_ASSERT(pItemPower != NULL);
7042  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7043  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7044  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7045  CPPUNIT_ASSERT(pItem != NULL);
7046  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7047  CPPUNIT_ASSERT(pItem->getName() == "L");
7048 
7049  // M
7050  ++it2;
7051  pItemPower = *(it2);
7052  CPPUNIT_ASSERT(pItemPower != NULL);
7053  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7054  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7055  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7056  CPPUNIT_ASSERT(pItem != NULL);
7057  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7058  CPPUNIT_ASSERT(pItem->getName() == "M");
7059 
7060  // o1
7061  ++it2;
7062  pItemPower = *(it2);
7063  CPPUNIT_ASSERT(pItemPower != NULL);
7064  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7065  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7066  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7067  CPPUNIT_ASSERT(pItem != NULL);
7068  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7069  CPPUNIT_ASSERT(pItem->getName() == "o1");
7070 
7071  // 3*C^5*H*J*L*M*o1
7072  ++it;
7073  pProduct = *(it);
7074  CPPUNIT_ASSERT(pProduct != NULL);
7075  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7076  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
7077 
7078  // C^5
7079  it2 = pProduct->getItemPowers().begin();
7080  pItemPower = *(it2);
7081  CPPUNIT_ASSERT(pItemPower != NULL);
7082  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
7083  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7084  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7085  CPPUNIT_ASSERT(pItem != NULL);
7086  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7087  CPPUNIT_ASSERT(pItem->getName() == "C");
7088 
7089  // H
7090  ++it2;
7091  pItemPower = *(it2);
7092  CPPUNIT_ASSERT(pItemPower != NULL);
7093  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7094  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7095  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7096  CPPUNIT_ASSERT(pItem != NULL);
7097  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7098  CPPUNIT_ASSERT(pItem->getName() == "H");
7099 
7100  // J
7101  ++it2;
7102  pItemPower = *(it2);
7103  CPPUNIT_ASSERT(pItemPower != NULL);
7104  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7105  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7106  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7107  CPPUNIT_ASSERT(pItem != NULL);
7108  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7109  CPPUNIT_ASSERT(pItem->getName() == "J");
7110 
7111  // L
7112  ++it2;
7113  pItemPower = *(it2);
7114  CPPUNIT_ASSERT(pItemPower != NULL);
7115  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7116  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7117  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7118  CPPUNIT_ASSERT(pItem != NULL);
7119  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7120  CPPUNIT_ASSERT(pItem->getName() == "L");
7121 
7122  // M
7123  ++it2;
7124  pItemPower = *(it2);
7125  CPPUNIT_ASSERT(pItemPower != NULL);
7126  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7127  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7128  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7129  CPPUNIT_ASSERT(pItem != NULL);
7130  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7131  CPPUNIT_ASSERT(pItem->getName() == "M");
7132 
7133  // o1
7134  ++it2;
7135  pItemPower = *(it2);
7136  CPPUNIT_ASSERT(pItemPower != NULL);
7137  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7138  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7139  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7140  CPPUNIT_ASSERT(pItem != NULL);
7141  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7142  CPPUNIT_ASSERT(pItem->getName() == "o1");
7143 
7144  // 3*C^5*I*J*L*M*o1
7145  ++it;
7146  pProduct = *(it);
7147  CPPUNIT_ASSERT(pProduct != NULL);
7148  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7149  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
7150 
7151  // C^5
7152  it2 = pProduct->getItemPowers().begin();
7153  pItemPower = *(it2);
7154  CPPUNIT_ASSERT(pItemPower != NULL);
7155  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
7156  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7157  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7158  CPPUNIT_ASSERT(pItem != NULL);
7159  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7160  CPPUNIT_ASSERT(pItem->getName() == "C");
7161 
7162  // I
7163  ++it2;
7164  pItemPower = *(it2);
7165  CPPUNIT_ASSERT(pItemPower != NULL);
7166  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7167  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7168  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7169  CPPUNIT_ASSERT(pItem != NULL);
7170  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7171  CPPUNIT_ASSERT(pItem->getName() == "I");
7172 
7173  // J
7174  ++it2;
7175  pItemPower = *(it2);
7176  CPPUNIT_ASSERT(pItemPower != NULL);
7177  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7178  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7179  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7180  CPPUNIT_ASSERT(pItem != NULL);
7181  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7182  CPPUNIT_ASSERT(pItem->getName() == "J");
7183 
7184  // L
7185  ++it2;
7186  pItemPower = *(it2);
7187  CPPUNIT_ASSERT(pItemPower != NULL);
7188  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7189  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7190  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7191  CPPUNIT_ASSERT(pItem != NULL);
7192  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7193  CPPUNIT_ASSERT(pItem->getName() == "L");
7194 
7195  // M
7196  ++it2;
7197  pItemPower = *(it2);
7198  CPPUNIT_ASSERT(pItemPower != NULL);
7199  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7200  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7201  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7202  CPPUNIT_ASSERT(pItem != NULL);
7203  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7204  CPPUNIT_ASSERT(pItem->getName() == "M");
7205 
7206  // o1
7207  ++it2;
7208  pItemPower = *(it2);
7209  CPPUNIT_ASSERT(pItemPower != NULL);
7210  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7211  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7212  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7213  CPPUNIT_ASSERT(pItem != NULL);
7214  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7215  CPPUNIT_ASSERT(pItem->getName() == "o1");
7216 
7217  // 3*C^4*F*H*J*L*M*o1
7218  ++it;
7219  pProduct = *(it);
7220  CPPUNIT_ASSERT(pProduct != NULL);
7221  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7222  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
7223 
7224  // C^4
7225  it2 = pProduct->getItemPowers().begin();
7226  pItemPower = *(it2);
7227  CPPUNIT_ASSERT(pItemPower != NULL);
7228  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
7229  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7230  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7231  CPPUNIT_ASSERT(pItem != NULL);
7232  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7233  CPPUNIT_ASSERT(pItem->getName() == "C");
7234 
7235  // F
7236  ++it2;
7237  pItemPower = *(it2);
7238  CPPUNIT_ASSERT(pItemPower != NULL);
7239  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7240  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7241  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7242  CPPUNIT_ASSERT(pItem != NULL);
7243  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7244  CPPUNIT_ASSERT(pItem->getName() == "F");
7245 
7246  // H
7247  ++it2;
7248  pItemPower = *(it2);
7249  CPPUNIT_ASSERT(pItemPower != NULL);
7250  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7251  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7252  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7253  CPPUNIT_ASSERT(pItem != NULL);
7254  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7255  CPPUNIT_ASSERT(pItem->getName() == "H");
7256 
7257  // J
7258  ++it2;
7259  pItemPower = *(it2);
7260  CPPUNIT_ASSERT(pItemPower != NULL);
7261  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7262  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7263  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7264  CPPUNIT_ASSERT(pItem != NULL);
7265  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7266  CPPUNIT_ASSERT(pItem->getName() == "J");
7267 
7268  // L
7269  ++it2;
7270  pItemPower = *(it2);
7271  CPPUNIT_ASSERT(pItemPower != NULL);
7272  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7273  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7274  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7275  CPPUNIT_ASSERT(pItem != NULL);
7276  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7277  CPPUNIT_ASSERT(pItem->getName() == "L");
7278 
7279  // M
7280  ++it2;
7281  pItemPower = *(it2);
7282  CPPUNIT_ASSERT(pItemPower != NULL);
7283  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7284  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7285  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7286  CPPUNIT_ASSERT(pItem != NULL);
7287  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7288  CPPUNIT_ASSERT(pItem->getName() == "M");
7289 
7290  // o1
7291  ++it2;
7292  pItemPower = *(it2);
7293  CPPUNIT_ASSERT(pItemPower != NULL);
7294  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7295  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7296  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7297  CPPUNIT_ASSERT(pItem != NULL);
7298  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7299  CPPUNIT_ASSERT(pItem->getName() == "o1");
7300 
7301  // 3*C^4*G*I*J*L*M*o1
7302  ++it;
7303  pProduct = *(it);
7304  CPPUNIT_ASSERT(pProduct != NULL);
7305  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7306  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
7307 
7308  // C^4
7309  it2 = pProduct->getItemPowers().begin();
7310  pItemPower = *(it2);
7311  CPPUNIT_ASSERT(pItemPower != NULL);
7312  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
7313  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7314  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7315  CPPUNIT_ASSERT(pItem != NULL);
7316  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7317  CPPUNIT_ASSERT(pItem->getName() == "C");
7318 
7319  // G
7320  ++it2;
7321  pItemPower = *(it2);
7322  CPPUNIT_ASSERT(pItemPower != NULL);
7323  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7324  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7325  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7326  CPPUNIT_ASSERT(pItem != NULL);
7327  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7328  CPPUNIT_ASSERT(pItem->getName() == "G");
7329 
7330  // I
7331  ++it2;
7332  pItemPower = *(it2);
7333  CPPUNIT_ASSERT(pItemPower != NULL);
7334  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7335  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7336  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7337  CPPUNIT_ASSERT(pItem != NULL);
7338  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7339  CPPUNIT_ASSERT(pItem->getName() == "I");
7340 
7341  // J
7342  ++it2;
7343  pItemPower = *(it2);
7344  CPPUNIT_ASSERT(pItemPower != NULL);
7345  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7346  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7347  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7348  CPPUNIT_ASSERT(pItem != NULL);
7349  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7350  CPPUNIT_ASSERT(pItem->getName() == "J");
7351 
7352  // L
7353  ++it2;
7354  pItemPower = *(it2);
7355  CPPUNIT_ASSERT(pItemPower != NULL);
7356  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7357  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7358  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7359  CPPUNIT_ASSERT(pItem != NULL);
7360  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7361  CPPUNIT_ASSERT(pItem->getName() == "L");
7362 
7363  // M
7364  ++it2;
7365  pItemPower = *(it2);
7366  CPPUNIT_ASSERT(pItemPower != NULL);
7367  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7368  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7369  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7370  CPPUNIT_ASSERT(pItem != NULL);
7371  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7372  CPPUNIT_ASSERT(pItem->getName() == "M");
7373 
7374  // o1
7375  ++it2;
7376  pItemPower = *(it2);
7377  CPPUNIT_ASSERT(pItemPower != NULL);
7378  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7379  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7380  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7381  CPPUNIT_ASSERT(pItem != NULL);
7382  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7383  CPPUNIT_ASSERT(pItem->getName() == "o1");
7384 
7385  // 3*C^2*D*F*H*I*J*L*M*o1
7386  ++it;
7387  pProduct = *(it);
7388  CPPUNIT_ASSERT(pProduct != NULL);
7389  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7390  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
7391 
7392  // C^2
7393  it2 = pProduct->getItemPowers().begin();
7394  pItemPower = *(it2);
7395  CPPUNIT_ASSERT(pItemPower != NULL);
7396  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
7397  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7398  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7399  CPPUNIT_ASSERT(pItem != NULL);
7400  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7401  CPPUNIT_ASSERT(pItem->getName() == "C");
7402 
7403  // D
7404  ++it2;
7405  pItemPower = *(it2);
7406  CPPUNIT_ASSERT(pItemPower != NULL);
7407  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7408  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7409  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7410  CPPUNIT_ASSERT(pItem != NULL);
7411  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7412  CPPUNIT_ASSERT(pItem->getName() == "D");
7413 
7414  // F
7415  ++it2;
7416  pItemPower = *(it2);
7417  CPPUNIT_ASSERT(pItemPower != NULL);
7418  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7419  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7420  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7421  CPPUNIT_ASSERT(pItem != NULL);
7422  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7423  CPPUNIT_ASSERT(pItem->getName() == "F");
7424 
7425  // H
7426  ++it2;
7427  pItemPower = *(it2);
7428  CPPUNIT_ASSERT(pItemPower != NULL);
7429  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7430  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7431  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7432  CPPUNIT_ASSERT(pItem != NULL);
7433  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7434  CPPUNIT_ASSERT(pItem->getName() == "H");
7435 
7436  // I
7437  ++it2;
7438  pItemPower = *(it2);
7439  CPPUNIT_ASSERT(pItemPower != NULL);
7440  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7441  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7442  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7443  CPPUNIT_ASSERT(pItem != NULL);
7444  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7445  CPPUNIT_ASSERT(pItem->getName() == "I");
7446 
7447  // J
7448  ++it2;
7449  pItemPower = *(it2);
7450  CPPUNIT_ASSERT(pItemPower != NULL);
7451  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7452  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7453  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7454  CPPUNIT_ASSERT(pItem != NULL);
7455  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7456  CPPUNIT_ASSERT(pItem->getName() == "J");
7457 
7458  // L
7459  ++it2;
7460  pItemPower = *(it2);
7461  CPPUNIT_ASSERT(pItemPower != NULL);
7462  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7463  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7464  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7465  CPPUNIT_ASSERT(pItem != NULL);
7466  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7467  CPPUNIT_ASSERT(pItem->getName() == "L");
7468 
7469  // M
7470  ++it2;
7471  pItemPower = *(it2);
7472  CPPUNIT_ASSERT(pItemPower != NULL);
7473  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7474  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7475  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7476  CPPUNIT_ASSERT(pItem != NULL);
7477  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7478  CPPUNIT_ASSERT(pItem->getName() == "M");
7479 
7480  // o1
7481  ++it2;
7482  pItemPower = *(it2);
7483  CPPUNIT_ASSERT(pItemPower != NULL);
7484  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7485  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7486  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7487  CPPUNIT_ASSERT(pItem != NULL);
7488  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7489  CPPUNIT_ASSERT(pItem->getName() == "o1");
7490 
7491  // 3*C^2*E*G*H*I*J*L*M*o1
7492  ++it;
7493  pProduct = *(it);
7494  CPPUNIT_ASSERT(pProduct != NULL);
7495  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7496  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
7497 
7498  // C^2
7499  it2 = pProduct->getItemPowers().begin();
7500  pItemPower = *(it2);
7501  CPPUNIT_ASSERT(pItemPower != NULL);
7502  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
7503  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7504  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7505  CPPUNIT_ASSERT(pItem != NULL);
7506  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7507  CPPUNIT_ASSERT(pItem->getName() == "C");
7508 
7509  // E
7510  ++it2;
7511  pItemPower = *(it2);
7512  CPPUNIT_ASSERT(pItemPower != NULL);
7513  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7514  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7515  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7516  CPPUNIT_ASSERT(pItem != NULL);
7517  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7518  CPPUNIT_ASSERT(pItem->getName() == "E");
7519 
7520  // G
7521  ++it2;
7522  pItemPower = *(it2);
7523  CPPUNIT_ASSERT(pItemPower != NULL);
7524  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7525  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7526  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7527  CPPUNIT_ASSERT(pItem != NULL);
7528  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7529  CPPUNIT_ASSERT(pItem->getName() == "G");
7530 
7531  // H
7532  ++it2;
7533  pItemPower = *(it2);
7534  CPPUNIT_ASSERT(pItemPower != NULL);
7535  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7536  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7537  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7538  CPPUNIT_ASSERT(pItem != NULL);
7539  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7540  CPPUNIT_ASSERT(pItem->getName() == "H");
7541 
7542  // I
7543  ++it2;
7544  pItemPower = *(it2);
7545  CPPUNIT_ASSERT(pItemPower != NULL);
7546  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7547  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7548  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7549  CPPUNIT_ASSERT(pItem != NULL);
7550  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7551  CPPUNIT_ASSERT(pItem->getName() == "I");
7552 
7553  // J
7554  ++it2;
7555  pItemPower = *(it2);
7556  CPPUNIT_ASSERT(pItemPower != NULL);
7557  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7558  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7559  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7560  CPPUNIT_ASSERT(pItem != NULL);
7561  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7562  CPPUNIT_ASSERT(pItem->getName() == "J");
7563 
7564  // L
7565  ++it2;
7566  pItemPower = *(it2);
7567  CPPUNIT_ASSERT(pItemPower != NULL);
7568  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7569  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7570  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7571  CPPUNIT_ASSERT(pItem != NULL);
7572  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7573  CPPUNIT_ASSERT(pItem->getName() == "L");
7574 
7575  // M
7576  ++it2;
7577  pItemPower = *(it2);
7578  CPPUNIT_ASSERT(pItemPower != NULL);
7579  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7580  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7581  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7582  CPPUNIT_ASSERT(pItem != NULL);
7583  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7584  CPPUNIT_ASSERT(pItem->getName() == "M");
7585 
7586  // o1
7587  ++it2;
7588  pItemPower = *(it2);
7589  CPPUNIT_ASSERT(pItemPower != NULL);
7590  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7591  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7592  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7593  CPPUNIT_ASSERT(pItem != NULL);
7594  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7595  CPPUNIT_ASSERT(pItem->getName() == "o1");
7596 
7597  // 3*C*D*F*G*H*I*J*L*M*o1
7598  ++it;
7599  pProduct = *(it);
7600  CPPUNIT_ASSERT(pProduct != NULL);
7601  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7602  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 10);
7603 
7604 
7605  // C
7606  it2 = pProduct->getItemPowers().begin();
7607  pItemPower = *(it2);
7608  CPPUNIT_ASSERT(pItemPower != NULL);
7609  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7610  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7611  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7612  CPPUNIT_ASSERT(pItem != NULL);
7613  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7614  CPPUNIT_ASSERT(pItem->getName() == "C");
7615 
7616  // D
7617  ++it2;
7618  pItemPower = *(it2);
7619  CPPUNIT_ASSERT(pItemPower != NULL);
7620  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7621  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7622  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7623  CPPUNIT_ASSERT(pItem != NULL);
7624  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7625  CPPUNIT_ASSERT(pItem->getName() == "D");
7626 
7627  // F
7628  ++it2;
7629  pItemPower = *(it2);
7630  CPPUNIT_ASSERT(pItemPower != NULL);
7631  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7632  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7633  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7634  CPPUNIT_ASSERT(pItem != NULL);
7635  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7636  CPPUNIT_ASSERT(pItem->getName() == "F");
7637 
7638  // G
7639  ++it2;
7640  pItemPower = *(it2);
7641  CPPUNIT_ASSERT(pItemPower != NULL);
7642  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7643  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7644  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7645  CPPUNIT_ASSERT(pItem != NULL);
7646  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7647  CPPUNIT_ASSERT(pItem->getName() == "G");
7648 
7649  // H
7650  ++it2;
7651  pItemPower = *(it2);
7652  CPPUNIT_ASSERT(pItemPower != NULL);
7653  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7654  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7655  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7656  CPPUNIT_ASSERT(pItem != NULL);
7657  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7658  CPPUNIT_ASSERT(pItem->getName() == "H");
7659 
7660  // I
7661  ++it2;
7662  pItemPower = *(it2);
7663  CPPUNIT_ASSERT(pItemPower != NULL);
7664  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7665  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7666  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7667  CPPUNIT_ASSERT(pItem != NULL);
7668  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7669  CPPUNIT_ASSERT(pItem->getName() == "I");
7670 
7671  // J
7672  ++it2;
7673  pItemPower = *(it2);
7674  CPPUNIT_ASSERT(pItemPower != NULL);
7675  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7676  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7677  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7678  CPPUNIT_ASSERT(pItem != NULL);
7679  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7680  CPPUNIT_ASSERT(pItem->getName() == "J");
7681 
7682  // L
7683  ++it2;
7684  pItemPower = *(it2);
7685  CPPUNIT_ASSERT(pItemPower != NULL);
7686  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7687  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7688  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7689  CPPUNIT_ASSERT(pItem != NULL);
7690  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7691  CPPUNIT_ASSERT(pItem->getName() == "L");
7692 
7693  // M
7694  ++it2;
7695  pItemPower = *(it2);
7696  CPPUNIT_ASSERT(pItemPower != NULL);
7697  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7698  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7699  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7700  CPPUNIT_ASSERT(pItem != NULL);
7701  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7702  CPPUNIT_ASSERT(pItem->getName() == "M");
7703 
7704  // o1
7705  ++it2;
7706  pItemPower = *(it2);
7707  CPPUNIT_ASSERT(pItemPower != NULL);
7708  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7709  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7710  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7711  CPPUNIT_ASSERT(pItem != NULL);
7712  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7713  CPPUNIT_ASSERT(pItem->getName() == "o1");
7714 
7715 
7716  // 3*C*E*F*G*H*I*J*L*M*o1
7717  ++it;
7718  pProduct = *(it);
7719  CPPUNIT_ASSERT(pProduct != NULL);
7720  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
7721  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 10);
7722 
7723  // C
7724  it2 = pProduct->getItemPowers().begin();
7725  pItemPower = *(it2);
7726  CPPUNIT_ASSERT(pItemPower != NULL);
7727  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7728  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7729  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7730  CPPUNIT_ASSERT(pItem != NULL);
7731  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7732  CPPUNIT_ASSERT(pItem->getName() == "C");
7733 
7734  // E
7735  ++it2;
7736  pItemPower = *(it2);
7737  CPPUNIT_ASSERT(pItemPower != NULL);
7738  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7739  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7740  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7741  CPPUNIT_ASSERT(pItem != NULL);
7742  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7743  CPPUNIT_ASSERT(pItem->getName() == "E");
7744 
7745 
7746  // F
7747  ++it2;
7748  pItemPower = *(it2);
7749  CPPUNIT_ASSERT(pItemPower != NULL);
7750  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7751  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7752  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7753  CPPUNIT_ASSERT(pItem != NULL);
7754  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7755  CPPUNIT_ASSERT(pItem->getName() == "F");
7756 
7757  // G
7758  ++it2;
7759  pItemPower = *(it2);
7760  CPPUNIT_ASSERT(pItemPower != NULL);
7761  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7762  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7763  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7764  CPPUNIT_ASSERT(pItem != NULL);
7765  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7766  CPPUNIT_ASSERT(pItem->getName() == "G");
7767 
7768  // H
7769  ++it2;
7770  pItemPower = *(it2);
7771  CPPUNIT_ASSERT(pItemPower != NULL);
7772  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7773  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7774  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7775  CPPUNIT_ASSERT(pItem != NULL);
7776  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7777  CPPUNIT_ASSERT(pItem->getName() == "H");
7778 
7779  // I
7780  ++it2;
7781  pItemPower = *(it2);
7782  CPPUNIT_ASSERT(pItemPower != NULL);
7783  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7784  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7785  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7786  CPPUNIT_ASSERT(pItem != NULL);
7787  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7788  CPPUNIT_ASSERT(pItem->getName() == "I");
7789 
7790  // J
7791  ++it2;
7792  pItemPower = *(it2);
7793  CPPUNIT_ASSERT(pItemPower != NULL);
7794  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7795  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7796  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7797  CPPUNIT_ASSERT(pItem != NULL);
7798  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7799  CPPUNIT_ASSERT(pItem->getName() == "J");
7800 
7801  // L
7802  ++it2;
7803  pItemPower = *(it2);
7804  CPPUNIT_ASSERT(pItemPower != NULL);
7805  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7806  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7807  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7808  CPPUNIT_ASSERT(pItem != NULL);
7809  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7810  CPPUNIT_ASSERT(pItem->getName() == "L");
7811 
7812  // M
7813  ++it2;
7814  pItemPower = *(it2);
7815  CPPUNIT_ASSERT(pItemPower != NULL);
7816  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7817  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7818  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7819  CPPUNIT_ASSERT(pItem != NULL);
7820  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7821  CPPUNIT_ASSERT(pItem->getName() == "M");
7822 
7823  // o1
7824  ++it2;
7825  pItemPower = *(it2);
7826  CPPUNIT_ASSERT(pItemPower != NULL);
7827  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7828  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7829  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7830  CPPUNIT_ASSERT(pItem != NULL);
7831  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7832  CPPUNIT_ASSERT(pItem->getName() == "o1");
7833 
7834  // 9*C^4*H*I*J*L*M*o1
7835  ++it;
7836  pProduct = *(it);
7837  CPPUNIT_ASSERT(pProduct != NULL);
7838  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
7839  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
7840 
7841  // C^4
7842  it2 = pProduct->getItemPowers().begin();
7843  pItemPower = *(it2);
7844  CPPUNIT_ASSERT(pItemPower != NULL);
7845  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
7846  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7847  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7848  CPPUNIT_ASSERT(pItem != NULL);
7849  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7850  CPPUNIT_ASSERT(pItem->getName() == "C");
7851 
7852  // H
7853  ++it2;
7854  pItemPower = *(it2);
7855  CPPUNIT_ASSERT(pItemPower != NULL);
7856  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7857  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7858  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7859  CPPUNIT_ASSERT(pItem != NULL);
7860  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7861  CPPUNIT_ASSERT(pItem->getName() == "H");
7862 
7863 
7864  // I
7865  ++it2;
7866  pItemPower = *(it2);
7867  CPPUNIT_ASSERT(pItemPower != NULL);
7868  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7869  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7870  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7871  CPPUNIT_ASSERT(pItem != NULL);
7872  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7873  CPPUNIT_ASSERT(pItem->getName() == "I");
7874 
7875  // J
7876  ++it2;
7877  pItemPower = *(it2);
7878  CPPUNIT_ASSERT(pItemPower != NULL);
7879  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7880  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7881  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7882  CPPUNIT_ASSERT(pItem != NULL);
7883  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7884  CPPUNIT_ASSERT(pItem->getName() == "J");
7885 
7886  // L
7887  ++it2;
7888  pItemPower = *(it2);
7889  CPPUNIT_ASSERT(pItemPower != NULL);
7890  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7891  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7892  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7893  CPPUNIT_ASSERT(pItem != NULL);
7894  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7895  CPPUNIT_ASSERT(pItem->getName() == "L");
7896 
7897  // M
7898  ++it2;
7899  pItemPower = *(it2);
7900  CPPUNIT_ASSERT(pItemPower != NULL);
7901  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7902  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7903  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7904  CPPUNIT_ASSERT(pItem != NULL);
7905  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7906  CPPUNIT_ASSERT(pItem->getName() == "M");
7907 
7908  // o1
7909  ++it2;
7910  pItemPower = *(it2);
7911  CPPUNIT_ASSERT(pItemPower != NULL);
7912  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7913  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7914  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7915  CPPUNIT_ASSERT(pItem != NULL);
7916  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7917  CPPUNIT_ASSERT(pItem->getName() == "o1");
7918 
7919  // 9*C^3*F*H*I*J*L*M*o1
7920  ++it;
7921  pProduct = *(it);
7922  CPPUNIT_ASSERT(pProduct != NULL);
7923  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
7924  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
7925 
7926  // C^3
7927  it2 = pProduct->getItemPowers().begin();
7928  pItemPower = *(it2);
7929  CPPUNIT_ASSERT(pItemPower != NULL);
7930  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
7931  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7932  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7933  CPPUNIT_ASSERT(pItem != NULL);
7934  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7935  CPPUNIT_ASSERT(pItem->getName() == "C");
7936 
7937  // F
7938  ++it2;
7939  pItemPower = *(it2);
7940  CPPUNIT_ASSERT(pItemPower != NULL);
7941  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7942  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7943  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7944  CPPUNIT_ASSERT(pItem != NULL);
7945  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7946  CPPUNIT_ASSERT(pItem->getName() == "F");
7947 
7948 
7949  // H
7950  ++it2;
7951  pItemPower = *(it2);
7952  CPPUNIT_ASSERT(pItemPower != NULL);
7953  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7954  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7955  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7956  CPPUNIT_ASSERT(pItem != NULL);
7957  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7958  CPPUNIT_ASSERT(pItem->getName() == "H");
7959 
7960  // I
7961  ++it2;
7962  pItemPower = *(it2);
7963  CPPUNIT_ASSERT(pItemPower != NULL);
7964  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7965  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7966  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7967  CPPUNIT_ASSERT(pItem != NULL);
7968  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7969  CPPUNIT_ASSERT(pItem->getName() == "I");
7970 
7971  // J
7972  ++it2;
7973  pItemPower = *(it2);
7974  CPPUNIT_ASSERT(pItemPower != NULL);
7975  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7976  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7977  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7978  CPPUNIT_ASSERT(pItem != NULL);
7979  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7980  CPPUNIT_ASSERT(pItem->getName() == "J");
7981 
7982  // L
7983  ++it2;
7984  pItemPower = *(it2);
7985  CPPUNIT_ASSERT(pItemPower != NULL);
7986  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7987  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7988  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
7989  CPPUNIT_ASSERT(pItem != NULL);
7990  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
7991  CPPUNIT_ASSERT(pItem->getName() == "L");
7992 
7993  // M
7994  ++it2;
7995  pItemPower = *(it2);
7996  CPPUNIT_ASSERT(pItemPower != NULL);
7997  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
7998  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
7999  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8000  CPPUNIT_ASSERT(pItem != NULL);
8001  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8002  CPPUNIT_ASSERT(pItem->getName() == "M");
8003 
8004  // o1
8005  ++it2;
8006  pItemPower = *(it2);
8007  CPPUNIT_ASSERT(pItemPower != NULL);
8008  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
8009  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8010  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8011  CPPUNIT_ASSERT(pItem != NULL);
8012  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8013  CPPUNIT_ASSERT(pItem->getName() == "o1");
8014 
8015  // 9*C^3*G*H*I*J*L*M*o1
8016  ++it;
8017  pProduct = *(it);
8018  CPPUNIT_ASSERT(pProduct != NULL);
8019  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
8020  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
8021 
8022  // C^3
8023  it2 = pProduct->getItemPowers().begin();
8024  pItemPower = *(it2);
8025  CPPUNIT_ASSERT(pItemPower != NULL);
8026  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
8027  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8028  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8029  CPPUNIT_ASSERT(pItem != NULL);
8030  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8031  CPPUNIT_ASSERT(pItem->getName() == "C");
8032 
8033  // G
8034  ++it2;
8035  pItemPower = *(it2);
8036  CPPUNIT_ASSERT(pItemPower != NULL);
8037  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
8038  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8039  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8040  CPPUNIT_ASSERT(pItem != NULL);
8041  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8042  CPPUNIT_ASSERT(pItem->getName() == "G");
8043 
8044  // H
8045  ++it2;
8046  pItemPower = *(it2);
8047  CPPUNIT_ASSERT(pItemPower != NULL);
8048  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
8049  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8050  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8051  CPPUNIT_ASSERT(pItem != NULL);
8052  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8053  CPPUNIT_ASSERT(pItem->getName() == "H");
8054 
8055  // I
8056  ++it2;
8057  pItemPower = *(it2);
8058  CPPUNIT_ASSERT(pItemPower != NULL);
8059  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
8060  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8061  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8062  CPPUNIT_ASSERT(pItem != NULL);
8063  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8064  CPPUNIT_ASSERT(pItem->getName() == "I");
8065 
8066  // J
8067  ++it2;
8068  pItemPower = *(it2);
8069  CPPUNIT_ASSERT(pItemPower != NULL);
8070  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
8071  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
8072  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
8073  CPPUNIT_ASSERT(pItem != NULL);
8074  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
8075  CPPUNIT_ASSERT(pItem->getName() == "J");
8076 
8077  // L
8078</