COPASI API  4.16.103
test_biomodels217_expression.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/compareExpressions/unittests/test_biomodels217_expression.cpp,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 22:16:01 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
15 
16 #include <string>
17 
33 
34 
36 const char* test_biomodels217_expression::term_num1 = "f1*B/J";
37 const char* test_biomodels217_expression::term_num2 = "3*e1*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))";
38 const char* test_biomodels217_expression::term_num3 = "3*h1*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))";
39 const char* test_biomodels217_expression::term_num4 = "g1*C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))";
40 const char* test_biomodels217_expression::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)))";
41 const char* test_biomodels217_expression::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)))";
42 const char* test_biomodels217_expression::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)))";
43 
45 const char* test_biomodels217_expression::term_den1 = "1+B/J";
46 const char* test_biomodels217_expression::term_den2 = "3*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))";
47 const char* test_biomodels217_expression::term_den3 = "3*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H))*l1)";
48 const char* test_biomodels217_expression::term_den4 = "C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))";
49 const char* test_biomodels217_expression::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)";
50 const char* test_biomodels217_expression::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)";
51 const char* test_biomodels217_expression::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)";
52 
53 
54 
56 {
57  CCopasiRootContainer::init(false, 0, NULL);
58 }
59 
61 {
63 }
64 
65 
66 //----------- denominator ------------------
67 
69 {
70  // f1*B/J -> (B*f1)/J
71  CEvaluationTree* pTree = new CEvaluationTree();
72  pTree->setInfix(term_num1);
73  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
75  std::string s = pFraction->toString();
76  delete pTree;
77  CPPUNIT_ASSERT(pFraction != NULL);
78 
79  // numerator B*f1
80  const CNormalSum* pNumerator = &pFraction->getNumerator();
81  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
82  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
83  CPPUNIT_ASSERT(pProducts->size() == 1);
84  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
85  const CNormalProduct* pProduct = *(it);
86  CPPUNIT_ASSERT(pProduct != NULL);
87  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
88  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
89  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
90  // B
91  const CNormalItemPower* pItemPower = *(it2);
92  CPPUNIT_ASSERT(pItemPower != NULL);
93  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
94  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
95  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
96  CPPUNIT_ASSERT(pItem != NULL);
97  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
98  CPPUNIT_ASSERT(pItem->getName() == "B");
99  ++it2;
100  // f1
101  pItemPower = *(it2);
102  CPPUNIT_ASSERT(pItemPower != NULL);
103  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
104  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
105  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
106  CPPUNIT_ASSERT(pItem != NULL);
107  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
108  CPPUNIT_ASSERT(pItem->getName() == "f1");
109 
110  // denominator
111  // J
112  const CNormalSum* pDenominator = &pFraction->getDenominator();
113  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
114  pProducts = &pDenominator->getProducts();
115  CPPUNIT_ASSERT(pProducts->size() == 1);
116  it = pProducts->begin();
117  pProduct = *(it);
118  CPPUNIT_ASSERT(pProduct != NULL);
119  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
120  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
121  it2 = pProduct->getItemPowers().begin();
122  pItemPower = *(it2);
123  CPPUNIT_ASSERT(pItemPower != NULL);
124  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
125  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
126  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
127  CPPUNIT_ASSERT(pItem != NULL);
128  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
129  CPPUNIT_ASSERT(pItem->getName() == "J");
130 
131  delete pFraction;
132 }
133 
134 
136 {
137  // 3*e1*C*O/(D*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))
138  // -> (3*C*F*H*O*e1)/(C^3*L + D*F*H*L + 3*C^2*H*L + 3*C*F*H*L)
139 
140  CEvaluationTree* pTree = new CEvaluationTree();
141  pTree->setInfix(term_num2);
142  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
144  delete pTree;
145  CPPUNIT_ASSERT(pFraction != NULL);
146 
147  // numerator
148  // (3*C*F*H*O*e1)
149  const CNormalSum* pNumerator = &pFraction->getNumerator();
150  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
151  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
152  CPPUNIT_ASSERT(pProducts->size() == 1);
153  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
154  const CNormalProduct* pProduct = *(it);
155  CPPUNIT_ASSERT(pProduct != NULL);
156  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
157  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
158  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
159  // C
160  const CNormalItemPower* pItemPower = *(it2);
161  CPPUNIT_ASSERT(pItemPower != NULL);
162  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
163  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
164  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
165  CPPUNIT_ASSERT(pItem != NULL);
166  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
167  CPPUNIT_ASSERT(pItem->getName() == "C");
168 
169  ++it2;
170  // F
171  pItemPower = *(it2);
172  CPPUNIT_ASSERT(pItemPower != NULL);
173  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
174  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
175  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
176  CPPUNIT_ASSERT(pItem != NULL);
177  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
178  CPPUNIT_ASSERT(pItem->getName() == "F");
179 
180  ++it2;
181  // H
182  pItemPower = *(it2);
183  CPPUNIT_ASSERT(pItemPower != NULL);
184  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
185  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
186  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
187  CPPUNIT_ASSERT(pItem != NULL);
188  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
189  CPPUNIT_ASSERT(pItem->getName() == "H");
190 
191  ++it2;
192  // O
193  pItemPower = *(it2);
194  CPPUNIT_ASSERT(pItemPower != NULL);
195  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
196  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
197  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
198  CPPUNIT_ASSERT(pItem != NULL);
199  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
200  CPPUNIT_ASSERT(pItem->getName() == "O");
201 
202  ++it2;
203  // e1
204  pItemPower = *(it2);
205  CPPUNIT_ASSERT(pItemPower != NULL);
206  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
207  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
208  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
209  CPPUNIT_ASSERT(pItem != NULL);
210  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
211  CPPUNIT_ASSERT(pItem->getName() == "e1");
212 
213 
214  // denominator
215  // (C^3*L + D*F*H*L + 3*C^2*H*L + 3*C*F*H*L)
216  const CNormalSum* pDenominator = &pFraction->getDenominator();
217  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
218  pProducts = &pDenominator->getProducts();
219  CPPUNIT_ASSERT(pProducts->size() == 4);
220 
221  // C^3*L
222  it = pProducts->begin();
223  pProduct = *(it);
224  CPPUNIT_ASSERT(pProduct != NULL);
225  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
226  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
227 
228  // C^3
229  it2 = pProduct->getItemPowers().begin();
230  pItemPower = *(it2);
231  CPPUNIT_ASSERT(pItemPower != NULL);
232  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
233  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
234  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
235  CPPUNIT_ASSERT(pItem != NULL);
236  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
237  CPPUNIT_ASSERT(pItem->getName() == "C");
238 
239  // L
240  ++it2;
241  pItemPower = *(it2);
242  CPPUNIT_ASSERT(pItemPower != NULL);
243  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
244  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
245  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
246  CPPUNIT_ASSERT(pItem != NULL);
247  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
248  CPPUNIT_ASSERT(pItem->getName() == "L");
249 
250  // D*F*H*L
251  ++it;
252  pProduct = *(it);
253  CPPUNIT_ASSERT(pProduct != NULL);
254  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
255  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
256 
257  // D
258  it2 = pProduct->getItemPowers().begin();
259  pItemPower = *(it2);
260  CPPUNIT_ASSERT(pItemPower != NULL);
261  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
262  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
263  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
264  CPPUNIT_ASSERT(pItem != NULL);
265  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
266  CPPUNIT_ASSERT(pItem->getName() == "D");
267 
268  // F
269  ++it2;
270  pItemPower = *(it2);
271  CPPUNIT_ASSERT(pItemPower != NULL);
272  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
273  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
274  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
275  CPPUNIT_ASSERT(pItem != NULL);
276  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
277  CPPUNIT_ASSERT(pItem->getName() == "F");
278 
279  // H
280  ++it2;
281  pItemPower = *(it2);
282  CPPUNIT_ASSERT(pItemPower != NULL);
283  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
284  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
285  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
286  CPPUNIT_ASSERT(pItem != NULL);
287  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
288  CPPUNIT_ASSERT(pItem->getName() == "H");
289 
290  // L
291  ++it2;
292  pItemPower = *(it2);
293  CPPUNIT_ASSERT(pItemPower != NULL);
294  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
295  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
296  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
297  CPPUNIT_ASSERT(pItem != NULL);
298  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
299  CPPUNIT_ASSERT(pItem->getName() == "L");
300 
301  // 3*C^2*H*L
302  ++it;
303  pProduct = *(it);
304  CPPUNIT_ASSERT(pProduct != NULL);
305  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
306  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
307 
308  // C^2
309  it2 = pProduct->getItemPowers().begin();
310  pItemPower = *(it2);
311  CPPUNIT_ASSERT(pItemPower != NULL);
312  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
313  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
314  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
315  CPPUNIT_ASSERT(pItem != NULL);
316  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
317  CPPUNIT_ASSERT(pItem->getName() == "C");
318 
319  // H
320  ++it2;
321  pItemPower = *(it2);
322  CPPUNIT_ASSERT(pItemPower != NULL);
323  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
324  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
325  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
326  CPPUNIT_ASSERT(pItem != NULL);
327  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
328  CPPUNIT_ASSERT(pItem->getName() == "H");
329 
330  // L
331  ++it2;
332  pItemPower = *(it2);
333  CPPUNIT_ASSERT(pItemPower != NULL);
334  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
335  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
336  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
337  CPPUNIT_ASSERT(pItem != NULL);
338  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
339  CPPUNIT_ASSERT(pItem->getName() == "L");
340 
341  // 3*C*F*H*L
342  ++it;
343  pProduct = *(it);
344  CPPUNIT_ASSERT(pProduct != NULL);
345  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
346  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
347 
348  // C
349  it2 = pProduct->getItemPowers().begin();
350  pItemPower = *(it2);
351  CPPUNIT_ASSERT(pItemPower != NULL);
352  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
353  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
354  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
355  CPPUNIT_ASSERT(pItem != NULL);
356  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
357  CPPUNIT_ASSERT(pItem->getName() == "C");
358 
359  // F
360  ++it2;
361  pItemPower = *(it2);
362  CPPUNIT_ASSERT(pItemPower != NULL);
363  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
364  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
365  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
366  CPPUNIT_ASSERT(pItem != NULL);
367  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
368  CPPUNIT_ASSERT(pItem->getName() == "F");
369 
370  // H
371  ++it2;
372  pItemPower = *(it2);
373  CPPUNIT_ASSERT(pItemPower != NULL);
374  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
375  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
376  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
377  CPPUNIT_ASSERT(pItem != NULL);
378  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
379  CPPUNIT_ASSERT(pItem->getName() == "H");
380 
381  // L
382  ++it2;
383  pItemPower = *(it2);
384  CPPUNIT_ASSERT(pItemPower != NULL);
385  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
386  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
387  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
388  CPPUNIT_ASSERT(pItem != NULL);
389  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
390  CPPUNIT_ASSERT(pItem->getName() == "L");
391 
392  delete pFraction;
393 }
394 
395 
397 {
398  // 3*h1*C*B*O/(D*J*L*(1+3*C/D+3*C^2/(D*F)+C^3/(D*F*H)))
399  // -> (3*B*C*F*H*O*h1)/(C^3*J*L + D*F*H*J*L + 3*C^2*H*J*L + 3*C*F*H*J*L)
400  CEvaluationTree* pTree = new CEvaluationTree();
401  pTree->setInfix(term_num3);
402  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
404  delete pTree;
405  CPPUNIT_ASSERT(pFraction != NULL);
406 
407  // numerator
408  // (3*B*C*F*H*O*h1)
409  const CNormalSum* pNumerator = &pFraction->getNumerator();
410  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
411  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
412  CPPUNIT_ASSERT(pProducts->size() == 1);
413  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
414  const CNormalProduct* pProduct = *(it);
415  CPPUNIT_ASSERT(pProduct != NULL);
416  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
417  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
418  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
419  // B
420  const CNormalItemPower* pItemPower = *(it2);
421  CPPUNIT_ASSERT(pItemPower != NULL);
422  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
423  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
424  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
425  CPPUNIT_ASSERT(pItem != NULL);
426  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
427  CPPUNIT_ASSERT(pItem->getName() == "B");
428 
429  ++it2;
430  // C
431  pItemPower = *(it2);
432  CPPUNIT_ASSERT(pItemPower != NULL);
433  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
434  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
435  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
436  CPPUNIT_ASSERT(pItem != NULL);
437  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
438  CPPUNIT_ASSERT(pItem->getName() == "C");
439 
440  ++it2;
441  // F
442  pItemPower = *(it2);
443  CPPUNIT_ASSERT(pItemPower != NULL);
444  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
445  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
446  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
447  CPPUNIT_ASSERT(pItem != NULL);
448  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
449  CPPUNIT_ASSERT(pItem->getName() == "F");
450 
451  ++it2;
452  // H
453  pItemPower = *(it2);
454  CPPUNIT_ASSERT(pItemPower != NULL);
455  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
456  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
457  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
458  CPPUNIT_ASSERT(pItem != NULL);
459  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
460  CPPUNIT_ASSERT(pItem->getName() == "H");
461 
462  ++it2;
463  // O
464  pItemPower = *(it2);
465  CPPUNIT_ASSERT(pItemPower != NULL);
466  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
467  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
468  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
469  CPPUNIT_ASSERT(pItem != NULL);
470  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
471  CPPUNIT_ASSERT(pItem->getName() == "O");
472 
473  ++it2;
474  // h1
475  pItemPower = *(it2);
476  CPPUNIT_ASSERT(pItemPower != NULL);
477  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
478  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
479  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
480  CPPUNIT_ASSERT(pItem != NULL);
481  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
482  CPPUNIT_ASSERT(pItem->getName() == "h1");
483 
484 
485  // denominator
486  // (C^3*J*L + D*F*H*J*L + 3*C^2*H*J*L + 3*C*F*H*J*L)
487  const CNormalSum* pDenominator = &pFraction->getDenominator();
488  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
489  pProducts = &pDenominator->getProducts();
490  CPPUNIT_ASSERT(pProducts->size() == 4);
491  // C^3*J*L
492  it = pProducts->begin();
493  pProduct = *(it);
494  CPPUNIT_ASSERT(pProduct != NULL);
495  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
496  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
497 
498  // C^3
499  it2 = pProduct->getItemPowers().begin();
500  pItemPower = *(it2);
501  CPPUNIT_ASSERT(pItemPower != NULL);
502  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
503  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
504  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
505  CPPUNIT_ASSERT(pItem != NULL);
506  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
507  CPPUNIT_ASSERT(pItem->getName() == "C");
508 
509  // J
510  ++it2;
511  pItemPower = *(it2);
512  CPPUNIT_ASSERT(pItemPower != NULL);
513  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
514  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
515  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
516  CPPUNIT_ASSERT(pItem != NULL);
517  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
518  CPPUNIT_ASSERT(pItem->getName() == "J");
519 
520  // L
521  ++it2;
522  pItemPower = *(it2);
523  CPPUNIT_ASSERT(pItemPower != NULL);
524  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
525  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
526  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
527  CPPUNIT_ASSERT(pItem != NULL);
528  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
529  CPPUNIT_ASSERT(pItem->getName() == "L");
530 
531  // D*F*H*J*L
532  ++it;
533  pProduct = *(it);
534  CPPUNIT_ASSERT(pProduct != NULL);
535  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
536  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
537 
538  // D
539  it2 = pProduct->getItemPowers().begin();
540  pItemPower = *(it2);
541  CPPUNIT_ASSERT(pItemPower != NULL);
542  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
543  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
544  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
545  CPPUNIT_ASSERT(pItem != NULL);
546  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
547  CPPUNIT_ASSERT(pItem->getName() == "D");
548 
549  // F
550  ++it2;
551  pItemPower = *(it2);
552  CPPUNIT_ASSERT(pItemPower != NULL);
553  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
554  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
555  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
556  CPPUNIT_ASSERT(pItem != NULL);
557  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
558  CPPUNIT_ASSERT(pItem->getName() == "F");
559 
560  // H
561  ++it2;
562  pItemPower = *(it2);
563  CPPUNIT_ASSERT(pItemPower != NULL);
564  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
565  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
566  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
567  CPPUNIT_ASSERT(pItem != NULL);
568  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
569  CPPUNIT_ASSERT(pItem->getName() == "H");
570 
571  // J
572  ++it2;
573  pItemPower = *(it2);
574  CPPUNIT_ASSERT(pItemPower != NULL);
575  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
576  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
577  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
578  CPPUNIT_ASSERT(pItem != NULL);
579  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
580  CPPUNIT_ASSERT(pItem->getName() == "J");
581 
582  // L
583  ++it2;
584  pItemPower = *(it2);
585  CPPUNIT_ASSERT(pItemPower != NULL);
586  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
587  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
588  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
589  CPPUNIT_ASSERT(pItem != NULL);
590  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
591  CPPUNIT_ASSERT(pItem->getName() == "L");
592 
593 
594  // 3*C^2*H*J*L
595  ++it;
596  pProduct = *(it);
597  CPPUNIT_ASSERT(pProduct != NULL);
598  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
599  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
600 
601  // C^2
602  it2 = pProduct->getItemPowers().begin();
603  pItemPower = *(it2);
604  CPPUNIT_ASSERT(pItemPower != NULL);
605  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
606  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
607  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
608  CPPUNIT_ASSERT(pItem != NULL);
609  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
610  CPPUNIT_ASSERT(pItem->getName() == "C");
611 
612  // H
613  ++it2;
614  pItemPower = *(it2);
615  CPPUNIT_ASSERT(pItemPower != NULL);
616  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
617  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
618  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
619  CPPUNIT_ASSERT(pItem != NULL);
620  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
621  CPPUNIT_ASSERT(pItem->getName() == "H");
622 
623  // J
624  ++it2;
625  pItemPower = *(it2);
626  CPPUNIT_ASSERT(pItemPower != NULL);
627  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
628  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
629  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
630  CPPUNIT_ASSERT(pItem != NULL);
631  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
632  CPPUNIT_ASSERT(pItem->getName() == "J");
633 
634  // L
635  ++it2;
636  pItemPower = *(it2);
637  CPPUNIT_ASSERT(pItemPower != NULL);
638  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
639  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
640  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
641  CPPUNIT_ASSERT(pItem != NULL);
642  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
643  CPPUNIT_ASSERT(pItem->getName() == "L");
644 
645  // 3*C*F*H*J*L
646  ++it;
647  pProduct = *(it);
648  CPPUNIT_ASSERT(pProduct != NULL);
649  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
650  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
651 
652 
653  // C
654  it2 = pProduct->getItemPowers().begin();
655  pItemPower = *(it2);
656  CPPUNIT_ASSERT(pItemPower != NULL);
657  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
658  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
659  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
660  CPPUNIT_ASSERT(pItem != NULL);
661  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
662  CPPUNIT_ASSERT(pItem->getName() == "C");
663 
664  // F
665  ++it2;
666  pItemPower = *(it2);
667  CPPUNIT_ASSERT(pItemPower != NULL);
668  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
669  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
670  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
671  CPPUNIT_ASSERT(pItem != NULL);
672  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
673  CPPUNIT_ASSERT(pItem->getName() == "F");
674 
675  // H
676  ++it2;
677  pItemPower = *(it2);
678  CPPUNIT_ASSERT(pItemPower != NULL);
679  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
680  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
681  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
682  CPPUNIT_ASSERT(pItem != NULL);
683  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
684  CPPUNIT_ASSERT(pItem->getName() == "H");
685 
686  // J
687  ++it2;
688  pItemPower = *(it2);
689  CPPUNIT_ASSERT(pItemPower != NULL);
690  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
691  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
692  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
693  CPPUNIT_ASSERT(pItem != NULL);
694  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
695  CPPUNIT_ASSERT(pItem->getName() == "J");
696 
697  // L
698  ++it2;
699  pItemPower = *(it2);
700  CPPUNIT_ASSERT(pItemPower != NULL);
701  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
702  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
703  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
704  CPPUNIT_ASSERT(pItem != NULL);
705  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
706  CPPUNIT_ASSERT(pItem->getName() == "L");
707 
708 
709  delete pFraction;
710 }
711 
713 {
714  // g1*C^3*N/(E*G*I*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))
715  // -> (C^3*N*g1)/(C^3*M + E*G*I*M + 3*C^2*I*M + 3*C*G*I*M)
716  CEvaluationTree* pTree = new CEvaluationTree();
717  pTree->setInfix(term_num4);
718  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
720  delete pTree;
721  CPPUNIT_ASSERT(pFraction != NULL);
722 
723  // numerator
724  // (C^3*N*g1)
725  const CNormalSum* pNumerator = &pFraction->getNumerator();
726  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
727  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
728  CPPUNIT_ASSERT(pProducts->size() == 1);
729  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
730  const CNormalProduct* pProduct = *(it);
731  CPPUNIT_ASSERT(pProduct != NULL);
732  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
733  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
734  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
735  // C^3
736  const CNormalItemPower* pItemPower = *(it2);
737  CPPUNIT_ASSERT(pItemPower != NULL);
738  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
739  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
740  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
741  CPPUNIT_ASSERT(pItem != NULL);
742  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
743  CPPUNIT_ASSERT(pItem->getName() == "C");
744 
745  ++it2;
746  // N
747  pItemPower = *(it2);
748  CPPUNIT_ASSERT(pItemPower != NULL);
749  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
750  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
751  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
752  CPPUNIT_ASSERT(pItem != NULL);
753  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
754  CPPUNIT_ASSERT(pItem->getName() == "N");
755 
756  ++it2;
757  // g1
758  pItemPower = *(it2);
759  CPPUNIT_ASSERT(pItemPower != NULL);
760  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
761  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
762  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
763  CPPUNIT_ASSERT(pItem != NULL);
764  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
765  CPPUNIT_ASSERT(pItem->getName() == "g1");
766 
767 
768  // denominator
769  // (C^3*M + E*G*I*M + 3*C^2*I*M + 3*C*G*I*M)
770  const CNormalSum* pDenominator = &pFraction->getDenominator();
771  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
772  pProducts = &pDenominator->getProducts();
773  CPPUNIT_ASSERT(pProducts->size() == 4);
774 
775  // C^3*M
776  it = pProducts->begin();
777  pProduct = *(it);
778  CPPUNIT_ASSERT(pProduct != NULL);
779  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
780  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 2);
781 
782  // C^3
783  it2 = pProduct->getItemPowers().begin();
784  pItemPower = *(it2);
785  CPPUNIT_ASSERT(pItemPower != NULL);
786  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
787  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
788  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
789  CPPUNIT_ASSERT(pItem != NULL);
790  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
791  CPPUNIT_ASSERT(pItem->getName() == "C");
792 
793  // M
794  ++it2;
795  pItemPower = *(it2);
796  CPPUNIT_ASSERT(pItemPower != NULL);
797  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
798  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
799  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
800  CPPUNIT_ASSERT(pItem != NULL);
801  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
802  CPPUNIT_ASSERT(pItem->getName() == "M");
803 
804  // E*G*I*M
805  ++it;
806  pProduct = *(it);
807  CPPUNIT_ASSERT(pProduct != NULL);
808  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
809  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
810 
811  // E
812  it2 = pProduct->getItemPowers().begin();
813  pItemPower = *(it2);
814  CPPUNIT_ASSERT(pItemPower != NULL);
815  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
816  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
817  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
818  CPPUNIT_ASSERT(pItem != NULL);
819  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
820  CPPUNIT_ASSERT(pItem->getName() == "E");
821 
822  // G
823  ++it2;
824  pItemPower = *(it2);
825  CPPUNIT_ASSERT(pItemPower != NULL);
826  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
827  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
828  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
829  CPPUNIT_ASSERT(pItem != NULL);
830  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
831  CPPUNIT_ASSERT(pItem->getName() == "G");
832 
833  // I
834  ++it2;
835  pItemPower = *(it2);
836  CPPUNIT_ASSERT(pItemPower != NULL);
837  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
838  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
839  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
840  CPPUNIT_ASSERT(pItem != NULL);
841  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
842  CPPUNIT_ASSERT(pItem->getName() == "I");
843 
844  // M
845  ++it2;
846  pItemPower = *(it2);
847  CPPUNIT_ASSERT(pItemPower != NULL);
848  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
849  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
850  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
851  CPPUNIT_ASSERT(pItem != NULL);
852  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
853  CPPUNIT_ASSERT(pItem->getName() == "M");
854 
855  // 3*C^2*I*M
856  ++it;
857  pProduct = *(it);
858  CPPUNIT_ASSERT(pProduct != NULL);
859  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
860  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
861 
862  // C^2
863  it2 = pProduct->getItemPowers().begin();
864  pItemPower = *(it2);
865  CPPUNIT_ASSERT(pItemPower != NULL);
866  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
867  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
868  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
869  CPPUNIT_ASSERT(pItem != NULL);
870  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
871  CPPUNIT_ASSERT(pItem->getName() == "C");
872 
873  // I
874  ++it2;
875  pItemPower = *(it2);
876  CPPUNIT_ASSERT(pItemPower != NULL);
877  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
878  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
879  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
880  CPPUNIT_ASSERT(pItem != NULL);
881  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
882  CPPUNIT_ASSERT(pItem->getName() == "I");
883 
884  // M
885  ++it2;
886  pItemPower = *(it2);
887  CPPUNIT_ASSERT(pItemPower != NULL);
888  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
889  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
890  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
891  CPPUNIT_ASSERT(pItem != NULL);
892  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
893  CPPUNIT_ASSERT(pItem->getName() == "M");
894 
895  // 3*C*G*I*M
896  ++it;
897  pProduct = *(it);
898  CPPUNIT_ASSERT(pProduct != NULL);
899  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
900  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
901 
902 
903  // C
904  it2 = pProduct->getItemPowers().begin();
905  pItemPower = *(it2);
906  CPPUNIT_ASSERT(pItemPower != NULL);
907  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
908  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
909  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
910  CPPUNIT_ASSERT(pItem != NULL);
911  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
912  CPPUNIT_ASSERT(pItem->getName() == "C");
913 
914  // G
915  ++it2;
916  pItemPower = *(it2);
917  CPPUNIT_ASSERT(pItemPower != NULL);
918  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
919  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
920  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
921  CPPUNIT_ASSERT(pItem != NULL);
922  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
923  CPPUNIT_ASSERT(pItem->getName() == "G");
924 
925  // I
926  ++it2;
927  pItemPower = *(it2);
928  CPPUNIT_ASSERT(pItemPower != NULL);
929  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
930  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
931  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
932  CPPUNIT_ASSERT(pItem != NULL);
933  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
934  CPPUNIT_ASSERT(pItem->getName() == "I");
935 
936  // M
937  ++it2;
938  pItemPower = *(it2);
939  CPPUNIT_ASSERT(pItemPower != NULL);
940  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
941  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
942  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
943  CPPUNIT_ASSERT(pItem != NULL);
944  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
945  CPPUNIT_ASSERT(pItem->getName() == "M");
946 
947  delete pFraction;
948 }
949 
951 {
952  // j1*C^3*B*N/(E*G*I*J*M*(1+3*C/E+3*C^2/(E*G)+C^3/(E*G*I)))
953  // -> (B*C^3*N*j1)/(C^3*J*M + E*G*I*J*M + 3*C^2*I*J*M + 3*C*G*I*J*M)
954  CEvaluationTree* pTree = new CEvaluationTree();
955  pTree->setInfix(term_num5);
956  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
958  delete pTree;
959  CPPUNIT_ASSERT(pFraction != NULL);
960 
961  // numerator
962  // (B*C^3*N*j1)
963  const CNormalSum* pNumerator = &pFraction->getNumerator();
964  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
965  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
966  CPPUNIT_ASSERT(pProducts->size() == 1);
967  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
968  const CNormalProduct* pProduct = *(it);
969  CPPUNIT_ASSERT(pProduct != NULL);
970  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
971  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
972  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
973  // B
974  const CNormalItemPower* pItemPower = *(it2);
975  CPPUNIT_ASSERT(pItemPower != NULL);
976  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
977  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
978  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
979  CPPUNIT_ASSERT(pItem != NULL);
980  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
981  CPPUNIT_ASSERT(pItem->getName() == "B");
982 
983  ++it2;
984  // C^3
985  pItemPower = *(it2);
986  CPPUNIT_ASSERT(pItemPower != NULL);
987  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
988  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
989  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
990  CPPUNIT_ASSERT(pItem != NULL);
991  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
992  CPPUNIT_ASSERT(pItem->getName() == "C");
993 
994  ++it2;
995  // N
996  pItemPower = *(it2);
997  CPPUNIT_ASSERT(pItemPower != NULL);
998  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
999  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1000  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1001  CPPUNIT_ASSERT(pItem != NULL);
1002  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1003  CPPUNIT_ASSERT(pItem->getName() == "N");
1004 
1005  ++it2;
1006  // j1
1007  pItemPower = *(it2);
1008  CPPUNIT_ASSERT(pItemPower != NULL);
1009  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1010  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1011  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1012  CPPUNIT_ASSERT(pItem != NULL);
1013  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1014  CPPUNIT_ASSERT(pItem->getName() == "j1");
1015 
1016 
1017  // denominator
1018  // (C^3*J*M + E*G*I*J*M + 3*C^2*I*J*M + 3*C*G*I*J*M)
1019  const CNormalSum* pDenominator = &pFraction->getDenominator();
1020  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
1021  pProducts = &pDenominator->getProducts();
1022  CPPUNIT_ASSERT(pProducts->size() == 4);
1023 
1024 
1025  // C^3*J*M
1026  it = pProducts->begin();
1027  pProduct = *(it);
1028  CPPUNIT_ASSERT(pProduct != NULL);
1029  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1030  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
1031 
1032  // C^3
1033  it2 = pProduct->getItemPowers().begin();
1034  pItemPower = *(it2);
1035  CPPUNIT_ASSERT(pItemPower != NULL);
1036  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
1037  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1038  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1039  CPPUNIT_ASSERT(pItem != NULL);
1040  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1041  CPPUNIT_ASSERT(pItem->getName() == "C");
1042 
1043  // J
1044  ++it2;
1045  pItemPower = *(it2);
1046  CPPUNIT_ASSERT(pItemPower != NULL);
1047  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1048  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1049  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1050  CPPUNIT_ASSERT(pItem != NULL);
1051  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1052  CPPUNIT_ASSERT(pItem->getName() == "J");
1053 
1054  // M
1055  ++it2;
1056  pItemPower = *(it2);
1057  CPPUNIT_ASSERT(pItemPower != NULL);
1058  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1059  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1060  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1061  CPPUNIT_ASSERT(pItem != NULL);
1062  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1063  CPPUNIT_ASSERT(pItem->getName() == "M");
1064 
1065  // E*G*I*J*M
1066  ++it;
1067  pProduct = *(it);
1068  CPPUNIT_ASSERT(pProduct != NULL);
1069  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1070  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
1071 
1072  // E
1073  it2 = pProduct->getItemPowers().begin();
1074  pItemPower = *(it2);
1075  CPPUNIT_ASSERT(pItemPower != NULL);
1076  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1077  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1078  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1079  CPPUNIT_ASSERT(pItem != NULL);
1080  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1081  CPPUNIT_ASSERT(pItem->getName() == "E");
1082 
1083  // G
1084  ++it2;
1085  pItemPower = *(it2);
1086  CPPUNIT_ASSERT(pItemPower != NULL);
1087  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1088  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1089  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1090  CPPUNIT_ASSERT(pItem != NULL);
1091  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1092  CPPUNIT_ASSERT(pItem->getName() == "G");
1093 
1094  // I
1095  ++it2;
1096  pItemPower = *(it2);
1097  CPPUNIT_ASSERT(pItemPower != NULL);
1098  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1099  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1100  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1101  CPPUNIT_ASSERT(pItem != NULL);
1102  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1103  CPPUNIT_ASSERT(pItem->getName() == "I");
1104 
1105  // J
1106  ++it2;
1107  pItemPower = *(it2);
1108  CPPUNIT_ASSERT(pItemPower != NULL);
1109  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1110  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1111  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1112  CPPUNIT_ASSERT(pItem != NULL);
1113  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1114  CPPUNIT_ASSERT(pItem->getName() == "J");
1115 
1116  // M
1117  ++it2;
1118  pItemPower = *(it2);
1119  CPPUNIT_ASSERT(pItemPower != NULL);
1120  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1121  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1122  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1123  CPPUNIT_ASSERT(pItem != NULL);
1124  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1125  CPPUNIT_ASSERT(pItem->getName() == "M");
1126 
1127  // 3*C^2*I*J*M
1128  ++it;
1129  pProduct = *(it);
1130  CPPUNIT_ASSERT(pProduct != NULL);
1131  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1132  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
1133 
1134  // C^2
1135  it2 = pProduct->getItemPowers().begin();
1136  pItemPower = *(it2);
1137  CPPUNIT_ASSERT(pItemPower != NULL);
1138  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
1139  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1140  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1141  CPPUNIT_ASSERT(pItem != NULL);
1142  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1143  CPPUNIT_ASSERT(pItem->getName() == "C");
1144 
1145  // I
1146  ++it2;
1147  pItemPower = *(it2);
1148  CPPUNIT_ASSERT(pItemPower != NULL);
1149  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1150  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1151  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1152  CPPUNIT_ASSERT(pItem != NULL);
1153  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1154  CPPUNIT_ASSERT(pItem->getName() == "I");
1155 
1156  // J
1157  ++it2;
1158  pItemPower = *(it2);
1159  CPPUNIT_ASSERT(pItemPower != NULL);
1160  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1161  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1162  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1163  CPPUNIT_ASSERT(pItem != NULL);
1164  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1165  CPPUNIT_ASSERT(pItem->getName() == "J");
1166 
1167  // M
1168  ++it2;
1169  pItemPower = *(it2);
1170  CPPUNIT_ASSERT(pItemPower != NULL);
1171  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1172  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1173  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1174  CPPUNIT_ASSERT(pItem != NULL);
1175  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1176  CPPUNIT_ASSERT(pItem->getName() == "M");
1177 
1178 
1179  // 3*C*G*I*J*M
1180  ++it;
1181  pProduct = *(it);
1182  CPPUNIT_ASSERT(pProduct != NULL);
1183  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1184  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
1185 
1186 
1187  // C
1188  it2 = pProduct->getItemPowers().begin();
1189  pItemPower = *(it2);
1190  CPPUNIT_ASSERT(pItemPower != NULL);
1191  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1192  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1193  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1194  CPPUNIT_ASSERT(pItem != NULL);
1195  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1196  CPPUNIT_ASSERT(pItem->getName() == "C");
1197 
1198  // G
1199  ++it2;
1200  pItemPower = *(it2);
1201  CPPUNIT_ASSERT(pItemPower != NULL);
1202  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1203  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1204  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1205  CPPUNIT_ASSERT(pItem != NULL);
1206  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1207  CPPUNIT_ASSERT(pItem->getName() == "G");
1208 
1209  // I
1210  ++it2;
1211  pItemPower = *(it2);
1212  CPPUNIT_ASSERT(pItemPower != NULL);
1213  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1214  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1215  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1216  CPPUNIT_ASSERT(pItem != NULL);
1217  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1218  CPPUNIT_ASSERT(pItem->getName() == "I");
1219 
1220  // J
1221  ++it2;
1222  pItemPower = *(it2);
1223  CPPUNIT_ASSERT(pItemPower != NULL);
1224  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1225  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1226  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1227  CPPUNIT_ASSERT(pItem != NULL);
1228  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1229  CPPUNIT_ASSERT(pItem->getName() == "J");
1230 
1231  // M
1232  ++it2;
1233  pItemPower = *(it2);
1234  CPPUNIT_ASSERT(pItemPower != NULL);
1235  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1236  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1237  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1238  CPPUNIT_ASSERT(pItem != NULL);
1239  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1240  CPPUNIT_ASSERT(pItem->getName() == "M");
1241 
1242  delete pFraction;
1243 }
1244 
1245 
1247 {
1248  // 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)))
1249  // -> (3*C^4*F*H*N*O*i1)/(C^6*L*M + C^3*D*F*H*L*M + C^3*E*G*I*L*M + D*E*F*G*H*I*L*M + 3*C^5*H*L*M + 3*C^5*I*L*M + 3*C^4*F*H*L*M + 3*C^4*G*I*L*M + 3*C^2*D*F*H*I*L*M + 3*C^2*E*G*H*I*L*M + 3*C*D*F*G*H*I*L*M + 3*C*E*F*G*H*I*L*M + 9*C^4*H*I*L*M + 9*C^3*F*H*I*L*M + 9*C^3*G*H*I*L*M + 9*C^2*F*G*H*I*L*M)
1250  CEvaluationTree* pTree = new CEvaluationTree();
1251  pTree->setInfix(term_num6);
1252  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
1254  delete pTree;
1255  CPPUNIT_ASSERT(pFraction != NULL);
1256 
1257  // numerator
1258  // (3*C^4*F*H*N*O*i1)
1259  const CNormalSum* pNumerator = &pFraction->getNumerator();
1260  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
1261  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
1262  CPPUNIT_ASSERT(pProducts->size() == 1);
1263  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
1264  const CNormalProduct* pProduct = *(it);
1265  CPPUNIT_ASSERT(pProduct != NULL);
1266  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1267  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
1268  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
1269  // C^4
1270  const CNormalItemPower* pItemPower = *(it2);
1271  CPPUNIT_ASSERT(pItemPower != NULL);
1272  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
1273  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1274  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1275  CPPUNIT_ASSERT(pItem != NULL);
1276  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1277  CPPUNIT_ASSERT(pItem->getName() == "C");
1278 
1279  ++it2;
1280  // F
1281  pItemPower = *(it2);
1282  CPPUNIT_ASSERT(pItemPower != NULL);
1283  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1284  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1285  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1286  CPPUNIT_ASSERT(pItem != NULL);
1287  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1288  CPPUNIT_ASSERT(pItem->getName() == "F");
1289 
1290  ++it2;
1291  // H
1292  pItemPower = *(it2);
1293  CPPUNIT_ASSERT(pItemPower != NULL);
1294  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1295  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1296  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1297  CPPUNIT_ASSERT(pItem != NULL);
1298  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1299  CPPUNIT_ASSERT(pItem->getName() == "H");
1300 
1301  ++it2;
1302  // N
1303  pItemPower = *(it2);
1304  CPPUNIT_ASSERT(pItemPower != NULL);
1305  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1306  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1307  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1308  CPPUNIT_ASSERT(pItem != NULL);
1309  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1310  CPPUNIT_ASSERT(pItem->getName() == "N");
1311 
1312  ++it2;
1313  // O
1314  pItemPower = *(it2);
1315  CPPUNIT_ASSERT(pItemPower != NULL);
1316  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1317  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1318  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1319  CPPUNIT_ASSERT(pItem != NULL);
1320  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1321  CPPUNIT_ASSERT(pItem->getName() == "O");
1322 
1323  ++it2;
1324  // i1
1325  pItemPower = *(it2);
1326  CPPUNIT_ASSERT(pItemPower != NULL);
1327  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1328  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1329  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1330  CPPUNIT_ASSERT(pItem != NULL);
1331  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1332  CPPUNIT_ASSERT(pItem->getName() == "i1");
1333 
1334 
1335  // denominator
1336  // (C^6*L*M + C^3*D*F*H*L*M + C^3*E*G*I*L*M + D*E*F*G*H*I*L*M + 3*C^5*H*L*M + 3*C^5*I*L*M + 3*C^4*F*H*L*M + 3*C^4*G*I*L*M + 3*C^2*D*F*H*I*L*M + 3*C^2*E*G*H*I*L*M + 3*C*D*F*G*H*I*L*M + 3*C*E*F*G*H*I*L*M + 9*C^4*H*I*L*M + 9*C^3*F*H*I*L*M + 9*C^3*G*H*I*L*M + 9*C^2*F*G*H*I*L*M)
1337  const CNormalSum* pDenominator = &pFraction->getDenominator();
1338  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
1339  pProducts = &pDenominator->getProducts();
1340  CPPUNIT_ASSERT(pProducts->size() == 16);
1341 
1342  // C^6*L*M
1343  it = pProducts->begin();
1344  pProduct = *(it);
1345  CPPUNIT_ASSERT(pProduct != NULL);
1346  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1347  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
1348 
1349  // C^6
1350  it2 = pProduct->getItemPowers().begin();
1351  pItemPower = *(it2);
1352  CPPUNIT_ASSERT(pItemPower != NULL);
1353  CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
1354  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1355  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1356  CPPUNIT_ASSERT(pItem != NULL);
1357  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1358  CPPUNIT_ASSERT(pItem->getName() == "C");
1359 
1360  // L
1361  ++it2;
1362  pItemPower = *(it2);
1363  CPPUNIT_ASSERT(pItemPower != NULL);
1364  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1365  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1366  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1367  CPPUNIT_ASSERT(pItem != NULL);
1368  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1369  CPPUNIT_ASSERT(pItem->getName() == "L");
1370 
1371  // M
1372  ++it2;
1373  pItemPower = *(it2);
1374  CPPUNIT_ASSERT(pItemPower != NULL);
1375  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1376  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1377  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1378  CPPUNIT_ASSERT(pItem != NULL);
1379  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1380  CPPUNIT_ASSERT(pItem->getName() == "M");
1381 
1382  // C^3*D*F*H*L*M
1383  ++it;
1384  pProduct = *(it);
1385  CPPUNIT_ASSERT(pProduct != NULL);
1386  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1387  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
1388 
1389  // C^3
1390  it2 = pProduct->getItemPowers().begin();
1391  pItemPower = *(it2);
1392  CPPUNIT_ASSERT(pItemPower != NULL);
1393  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
1394  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1395  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1396  CPPUNIT_ASSERT(pItem != NULL);
1397  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1398  CPPUNIT_ASSERT(pItem->getName() == "C");
1399 
1400  // D
1401  ++it2;
1402  pItemPower = *(it2);
1403  CPPUNIT_ASSERT(pItemPower != NULL);
1404  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1405  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1406  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1407  CPPUNIT_ASSERT(pItem != NULL);
1408  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1409  CPPUNIT_ASSERT(pItem->getName() == "D");
1410 
1411  // F
1412  ++it2;
1413  pItemPower = *(it2);
1414  CPPUNIT_ASSERT(pItemPower != NULL);
1415  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1416  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1417  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1418  CPPUNIT_ASSERT(pItem != NULL);
1419  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1420  CPPUNIT_ASSERT(pItem->getName() == "F");
1421 
1422  // H
1423  ++it2;
1424  pItemPower = *(it2);
1425  CPPUNIT_ASSERT(pItemPower != NULL);
1426  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1427  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1428  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1429  CPPUNIT_ASSERT(pItem != NULL);
1430  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1431  CPPUNIT_ASSERT(pItem->getName() == "H");
1432 
1433  // L
1434  ++it2;
1435  pItemPower = *(it2);
1436  CPPUNIT_ASSERT(pItemPower != NULL);
1437  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1438  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1439  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1440  CPPUNIT_ASSERT(pItem != NULL);
1441  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1442  CPPUNIT_ASSERT(pItem->getName() == "L");
1443 
1444  // M
1445  ++it2;
1446  pItemPower = *(it2);
1447  CPPUNIT_ASSERT(pItemPower != NULL);
1448  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1449  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1450  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1451  CPPUNIT_ASSERT(pItem != NULL);
1452  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1453  CPPUNIT_ASSERT(pItem->getName() == "M");
1454 
1455  // C^3*E*G*I*L*M
1456  ++it;
1457  pProduct = *(it);
1458  CPPUNIT_ASSERT(pProduct != NULL);
1459  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1460  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
1461 
1462  // C^3
1463  it2 = pProduct->getItemPowers().begin();
1464  pItemPower = *(it2);
1465  CPPUNIT_ASSERT(pItemPower != NULL);
1466  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
1467  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1468  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1469  CPPUNIT_ASSERT(pItem != NULL);
1470  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1471  CPPUNIT_ASSERT(pItem->getName() == "C");
1472 
1473  // E
1474  ++it2;
1475  pItemPower = *(it2);
1476  CPPUNIT_ASSERT(pItemPower != NULL);
1477  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1478  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1479  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1480  CPPUNIT_ASSERT(pItem != NULL);
1481  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1482  CPPUNIT_ASSERT(pItem->getName() == "E");
1483 
1484  // G
1485  ++it2;
1486  pItemPower = *(it2);
1487  CPPUNIT_ASSERT(pItemPower != NULL);
1488  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1489  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1490  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1491  CPPUNIT_ASSERT(pItem != NULL);
1492  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1493  CPPUNIT_ASSERT(pItem->getName() == "G");
1494 
1495  // I
1496  ++it2;
1497  pItemPower = *(it2);
1498  CPPUNIT_ASSERT(pItemPower != NULL);
1499  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1500  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1501  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1502  CPPUNIT_ASSERT(pItem != NULL);
1503  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1504  CPPUNIT_ASSERT(pItem->getName() == "I");
1505 
1506  // L
1507  ++it2;
1508  pItemPower = *(it2);
1509  CPPUNIT_ASSERT(pItemPower != NULL);
1510  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1511  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1512  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1513  CPPUNIT_ASSERT(pItem != NULL);
1514  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1515  CPPUNIT_ASSERT(pItem->getName() == "L");
1516 
1517  // M
1518  ++it2;
1519  pItemPower = *(it2);
1520  CPPUNIT_ASSERT(pItemPower != NULL);
1521  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1522  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1523  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1524  CPPUNIT_ASSERT(pItem != NULL);
1525  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1526  CPPUNIT_ASSERT(pItem->getName() == "M");
1527 
1528  // D*E*F*G*H*I*L*M
1529  ++it;
1530  pProduct = *(it);
1531  CPPUNIT_ASSERT(pProduct != NULL);
1532  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1533  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
1534 
1535  // D
1536  it2 = pProduct->getItemPowers().begin();
1537  pItemPower = *(it2);
1538  CPPUNIT_ASSERT(pItemPower != NULL);
1539  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1540  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1541  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1542  CPPUNIT_ASSERT(pItem != NULL);
1543  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1544  CPPUNIT_ASSERT(pItem->getName() == "D");
1545 
1546  // E
1547  ++it2;
1548  pItemPower = *(it2);
1549  CPPUNIT_ASSERT(pItemPower != NULL);
1550  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1551  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1552  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1553  CPPUNIT_ASSERT(pItem != NULL);
1554  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1555  CPPUNIT_ASSERT(pItem->getName() == "E");
1556 
1557  // F
1558  ++it2;
1559  pItemPower = *(it2);
1560  CPPUNIT_ASSERT(pItemPower != NULL);
1561  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1562  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1563  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1564  CPPUNIT_ASSERT(pItem != NULL);
1565  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1566  CPPUNIT_ASSERT(pItem->getName() == "F");
1567 
1568  // G
1569  ++it2;
1570  pItemPower = *(it2);
1571  CPPUNIT_ASSERT(pItemPower != NULL);
1572  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1573  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1574  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1575  CPPUNIT_ASSERT(pItem != NULL);
1576  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1577  CPPUNIT_ASSERT(pItem->getName() == "G");
1578 
1579  // H
1580  ++it2;
1581  pItemPower = *(it2);
1582  CPPUNIT_ASSERT(pItemPower != NULL);
1583  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1584  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1585  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1586  CPPUNIT_ASSERT(pItem != NULL);
1587  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1588  CPPUNIT_ASSERT(pItem->getName() == "H");
1589 
1590  // I
1591  ++it2;
1592  pItemPower = *(it2);
1593  CPPUNIT_ASSERT(pItemPower != NULL);
1594  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1595  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1596  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1597  CPPUNIT_ASSERT(pItem != NULL);
1598  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1599  CPPUNIT_ASSERT(pItem->getName() == "I");
1600 
1601  // L
1602  ++it2;
1603  pItemPower = *(it2);
1604  CPPUNIT_ASSERT(pItemPower != NULL);
1605  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1606  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1607  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1608  CPPUNIT_ASSERT(pItem != NULL);
1609  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1610  CPPUNIT_ASSERT(pItem->getName() == "L");
1611 
1612  // M
1613  ++it2;
1614  pItemPower = *(it2);
1615  CPPUNIT_ASSERT(pItemPower != NULL);
1616  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1617  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1618  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1619  CPPUNIT_ASSERT(pItem != NULL);
1620  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1621  CPPUNIT_ASSERT(pItem->getName() == "M");
1622 
1623  // 3*C^5*H*L*M
1624  ++it;
1625  pProduct = *(it);
1626  CPPUNIT_ASSERT(pProduct != NULL);
1627  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1628  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
1629 
1630  // C^5
1631  it2 = pProduct->getItemPowers().begin();
1632  pItemPower = *(it2);
1633  CPPUNIT_ASSERT(pItemPower != NULL);
1634  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
1635  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1636  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1637  CPPUNIT_ASSERT(pItem != NULL);
1638  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1639  CPPUNIT_ASSERT(pItem->getName() == "C");
1640 
1641  // H
1642  ++it2;
1643  pItemPower = *(it2);
1644  CPPUNIT_ASSERT(pItemPower != NULL);
1645  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1646  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1647  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1648  CPPUNIT_ASSERT(pItem != NULL);
1649  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1650  CPPUNIT_ASSERT(pItem->getName() == "H");
1651 
1652  // L
1653  ++it2;
1654  pItemPower = *(it2);
1655  CPPUNIT_ASSERT(pItemPower != NULL);
1656  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1657  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1658  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1659  CPPUNIT_ASSERT(pItem != NULL);
1660  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1661  CPPUNIT_ASSERT(pItem->getName() == "L");
1662 
1663  // M
1664  ++it2;
1665  pItemPower = *(it2);
1666  CPPUNIT_ASSERT(pItemPower != NULL);
1667  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1668  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1669  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1670  CPPUNIT_ASSERT(pItem != NULL);
1671  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1672  CPPUNIT_ASSERT(pItem->getName() == "M");
1673 
1674  // 3*C^5*I*L*M
1675  ++it;
1676  pProduct = *(it);
1677  CPPUNIT_ASSERT(pProduct != NULL);
1678  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1679  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
1680 
1681  // C^5
1682  it2 = pProduct->getItemPowers().begin();
1683  pItemPower = *(it2);
1684  CPPUNIT_ASSERT(pItemPower != NULL);
1685  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
1686  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1687  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1688  CPPUNIT_ASSERT(pItem != NULL);
1689  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1690  CPPUNIT_ASSERT(pItem->getName() == "C");
1691 
1692  // I
1693  ++it2;
1694  pItemPower = *(it2);
1695  CPPUNIT_ASSERT(pItemPower != NULL);
1696  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1697  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1698  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1699  CPPUNIT_ASSERT(pItem != NULL);
1700  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1701  CPPUNIT_ASSERT(pItem->getName() == "I");
1702 
1703  // L
1704  ++it2;
1705  pItemPower = *(it2);
1706  CPPUNIT_ASSERT(pItemPower != NULL);
1707  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1708  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1709  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1710  CPPUNIT_ASSERT(pItem != NULL);
1711  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1712  CPPUNIT_ASSERT(pItem->getName() == "L");
1713 
1714  // M
1715  ++it2;
1716  pItemPower = *(it2);
1717  CPPUNIT_ASSERT(pItemPower != NULL);
1718  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1719  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1720  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1721  CPPUNIT_ASSERT(pItem != NULL);
1722  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1723  CPPUNIT_ASSERT(pItem->getName() == "M");
1724 
1725  // 3*C^4*F*H*L*M
1726  ++it;
1727  pProduct = *(it);
1728  CPPUNIT_ASSERT(pProduct != NULL);
1729  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1730  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
1731 
1732  // C^4
1733  it2 = pProduct->getItemPowers().begin();
1734  pItemPower = *(it2);
1735  CPPUNIT_ASSERT(pItemPower != NULL);
1736  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
1737  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1738  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1739  CPPUNIT_ASSERT(pItem != NULL);
1740  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1741  CPPUNIT_ASSERT(pItem->getName() == "C");
1742 
1743  // F
1744  ++it2;
1745  pItemPower = *(it2);
1746  CPPUNIT_ASSERT(pItemPower != NULL);
1747  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1748  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1749  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1750  CPPUNIT_ASSERT(pItem != NULL);
1751  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1752  CPPUNIT_ASSERT(pItem->getName() == "F");
1753 
1754  // H
1755  ++it2;
1756  pItemPower = *(it2);
1757  CPPUNIT_ASSERT(pItemPower != NULL);
1758  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1759  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1760  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1761  CPPUNIT_ASSERT(pItem != NULL);
1762  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1763  CPPUNIT_ASSERT(pItem->getName() == "H");
1764 
1765  // L
1766  ++it2;
1767  pItemPower = *(it2);
1768  CPPUNIT_ASSERT(pItemPower != NULL);
1769  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1770  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1771  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1772  CPPUNIT_ASSERT(pItem != NULL);
1773  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1774  CPPUNIT_ASSERT(pItem->getName() == "L");
1775 
1776  // M
1777  ++it2;
1778  pItemPower = *(it2);
1779  CPPUNIT_ASSERT(pItemPower != NULL);
1780  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1781  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1782  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1783  CPPUNIT_ASSERT(pItem != NULL);
1784  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1785  CPPUNIT_ASSERT(pItem->getName() == "M");
1786 
1787  // 3*C^4*G*I*L*M
1788  ++it;
1789  pProduct = *(it);
1790  CPPUNIT_ASSERT(pProduct != NULL);
1791  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1792  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
1793 
1794  // C^4
1795  it2 = pProduct->getItemPowers().begin();
1796  pItemPower = *(it2);
1797  CPPUNIT_ASSERT(pItemPower != NULL);
1798  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
1799  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1800  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1801  CPPUNIT_ASSERT(pItem != NULL);
1802  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1803  CPPUNIT_ASSERT(pItem->getName() == "C");
1804 
1805  // G
1806  ++it2;
1807  pItemPower = *(it2);
1808  CPPUNIT_ASSERT(pItemPower != NULL);
1809  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1810  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1811  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1812  CPPUNIT_ASSERT(pItem != NULL);
1813  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1814  CPPUNIT_ASSERT(pItem->getName() == "G");
1815 
1816  // I
1817  ++it2;
1818  pItemPower = *(it2);
1819  CPPUNIT_ASSERT(pItemPower != NULL);
1820  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1821  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1822  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1823  CPPUNIT_ASSERT(pItem != NULL);
1824  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1825  CPPUNIT_ASSERT(pItem->getName() == "I");
1826 
1827  // L
1828  ++it2;
1829  pItemPower = *(it2);
1830  CPPUNIT_ASSERT(pItemPower != NULL);
1831  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1832  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1833  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1834  CPPUNIT_ASSERT(pItem != NULL);
1835  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1836  CPPUNIT_ASSERT(pItem->getName() == "L");
1837 
1838  // M
1839  ++it2;
1840  pItemPower = *(it2);
1841  CPPUNIT_ASSERT(pItemPower != NULL);
1842  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1843  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1844  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1845  CPPUNIT_ASSERT(pItem != NULL);
1846  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1847  CPPUNIT_ASSERT(pItem->getName() == "M");
1848 
1849  // 3*C^2*D*F*H*I*L*M
1850  ++it;
1851  pProduct = *(it);
1852  CPPUNIT_ASSERT(pProduct != NULL);
1853  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1854  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
1855 
1856  // C^2
1857  it2 = pProduct->getItemPowers().begin();
1858  pItemPower = *(it2);
1859  CPPUNIT_ASSERT(pItemPower != NULL);
1860  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
1861  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1862  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1863  CPPUNIT_ASSERT(pItem != NULL);
1864  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1865  CPPUNIT_ASSERT(pItem->getName() == "C");
1866 
1867  // D
1868  ++it2;
1869  pItemPower = *(it2);
1870  CPPUNIT_ASSERT(pItemPower != NULL);
1871  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1872  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1873  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1874  CPPUNIT_ASSERT(pItem != NULL);
1875  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1876  CPPUNIT_ASSERT(pItem->getName() == "D");
1877 
1878  // F
1879  ++it2;
1880  pItemPower = *(it2);
1881  CPPUNIT_ASSERT(pItemPower != NULL);
1882  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1883  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1884  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1885  CPPUNIT_ASSERT(pItem != NULL);
1886  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1887  CPPUNIT_ASSERT(pItem->getName() == "F");
1888 
1889 
1890  // H
1891  ++it2;
1892  pItemPower = *(it2);
1893  CPPUNIT_ASSERT(pItemPower != NULL);
1894  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1895  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1896  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1897  CPPUNIT_ASSERT(pItem != NULL);
1898  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1899  CPPUNIT_ASSERT(pItem->getName() == "H");
1900 
1901  // I
1902  ++it2;
1903  pItemPower = *(it2);
1904  CPPUNIT_ASSERT(pItemPower != NULL);
1905  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1906  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1907  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1908  CPPUNIT_ASSERT(pItem != NULL);
1909  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1910  CPPUNIT_ASSERT(pItem->getName() == "I");
1911 
1912  // L
1913  ++it2;
1914  pItemPower = *(it2);
1915  CPPUNIT_ASSERT(pItemPower != NULL);
1916  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1917  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1918  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1919  CPPUNIT_ASSERT(pItem != NULL);
1920  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1921  CPPUNIT_ASSERT(pItem->getName() == "L");
1922 
1923  // M
1924  ++it2;
1925  pItemPower = *(it2);
1926  CPPUNIT_ASSERT(pItemPower != NULL);
1927  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1928  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1929  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1930  CPPUNIT_ASSERT(pItem != NULL);
1931  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1932  CPPUNIT_ASSERT(pItem->getName() == "M");
1933 
1934  // 3*C^2*E*G*H*I*L*M
1935  ++it;
1936  pProduct = *(it);
1937  CPPUNIT_ASSERT(pProduct != NULL);
1938  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
1939  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
1940 
1941  // C^2
1942  it2 = pProduct->getItemPowers().begin();
1943  pItemPower = *(it2);
1944  CPPUNIT_ASSERT(pItemPower != NULL);
1945  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
1946  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1947  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1948  CPPUNIT_ASSERT(pItem != NULL);
1949  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1950  CPPUNIT_ASSERT(pItem->getName() == "C");
1951 
1952  // E
1953  ++it2;
1954  pItemPower = *(it2);
1955  CPPUNIT_ASSERT(pItemPower != NULL);
1956  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1957  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1958  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1959  CPPUNIT_ASSERT(pItem != NULL);
1960  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1961  CPPUNIT_ASSERT(pItem->getName() == "E");
1962 
1963  // G
1964  ++it2;
1965  pItemPower = *(it2);
1966  CPPUNIT_ASSERT(pItemPower != NULL);
1967  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1968  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1969  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1970  CPPUNIT_ASSERT(pItem != NULL);
1971  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1972  CPPUNIT_ASSERT(pItem->getName() == "G");
1973 
1974  // H
1975  ++it2;
1976  pItemPower = *(it2);
1977  CPPUNIT_ASSERT(pItemPower != NULL);
1978  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1979  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1980  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1981  CPPUNIT_ASSERT(pItem != NULL);
1982  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1983  CPPUNIT_ASSERT(pItem->getName() == "H");
1984 
1985  // I
1986  ++it2;
1987  pItemPower = *(it2);
1988  CPPUNIT_ASSERT(pItemPower != NULL);
1989  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1990  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
1991  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
1992  CPPUNIT_ASSERT(pItem != NULL);
1993  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
1994  CPPUNIT_ASSERT(pItem->getName() == "I");
1995 
1996  // L
1997  ++it2;
1998  pItemPower = *(it2);
1999  CPPUNIT_ASSERT(pItemPower != NULL);
2000  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2001  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2002  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2003  CPPUNIT_ASSERT(pItem != NULL);
2004  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2005  CPPUNIT_ASSERT(pItem->getName() == "L");
2006 
2007  // M
2008  ++it2;
2009  pItemPower = *(it2);
2010  CPPUNIT_ASSERT(pItemPower != NULL);
2011  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2012  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2013  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2014  CPPUNIT_ASSERT(pItem != NULL);
2015  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2016  CPPUNIT_ASSERT(pItem->getName() == "M");
2017 
2018  // 3*C*D*F*G*H*I*L*M
2019  ++it;
2020  pProduct = *(it);
2021  CPPUNIT_ASSERT(pProduct != NULL);
2022  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
2023  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
2024 
2025 
2026  // C
2027  it2 = pProduct->getItemPowers().begin();
2028  pItemPower = *(it2);
2029  CPPUNIT_ASSERT(pItemPower != NULL);
2030  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2031  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2032  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2033  CPPUNIT_ASSERT(pItem != NULL);
2034  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2035  CPPUNIT_ASSERT(pItem->getName() == "C");
2036 
2037  // D
2038  ++it2;
2039  pItemPower = *(it2);
2040  CPPUNIT_ASSERT(pItemPower != NULL);
2041  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2042  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2043  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2044  CPPUNIT_ASSERT(pItem != NULL);
2045  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2046  CPPUNIT_ASSERT(pItem->getName() == "D");
2047 
2048  // F
2049  ++it2;
2050  pItemPower = *(it2);
2051  CPPUNIT_ASSERT(pItemPower != NULL);
2052  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2053  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2054  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2055  CPPUNIT_ASSERT(pItem != NULL);
2056  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2057  CPPUNIT_ASSERT(pItem->getName() == "F");
2058 
2059  // G
2060  ++it2;
2061  pItemPower = *(it2);
2062  CPPUNIT_ASSERT(pItemPower != NULL);
2063  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2064  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2065  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2066  CPPUNIT_ASSERT(pItem != NULL);
2067  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2068  CPPUNIT_ASSERT(pItem->getName() == "G");
2069 
2070  // H
2071  ++it2;
2072  pItemPower = *(it2);
2073  CPPUNIT_ASSERT(pItemPower != NULL);
2074  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2075  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2076  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2077  CPPUNIT_ASSERT(pItem != NULL);
2078  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2079  CPPUNIT_ASSERT(pItem->getName() == "H");
2080 
2081  // I
2082  ++it2;
2083  pItemPower = *(it2);
2084  CPPUNIT_ASSERT(pItemPower != NULL);
2085  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2086  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2087  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2088  CPPUNIT_ASSERT(pItem != NULL);
2089  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2090  CPPUNIT_ASSERT(pItem->getName() == "I");
2091 
2092  // L
2093  ++it2;
2094  pItemPower = *(it2);
2095  CPPUNIT_ASSERT(pItemPower != NULL);
2096  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2097  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2098  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2099  CPPUNIT_ASSERT(pItem != NULL);
2100  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2101  CPPUNIT_ASSERT(pItem->getName() == "L");
2102 
2103  // M
2104  ++it2;
2105  pItemPower = *(it2);
2106  CPPUNIT_ASSERT(pItemPower != NULL);
2107  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2108  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2109  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2110  CPPUNIT_ASSERT(pItem != NULL);
2111  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2112  CPPUNIT_ASSERT(pItem->getName() == "M");
2113 
2114  // 3*C*E*F*G*H*I*L*M
2115  ++it;
2116  pProduct = *(it);
2117  CPPUNIT_ASSERT(pProduct != NULL);
2118  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
2119  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
2120 
2121  // C
2122  it2 = pProduct->getItemPowers().begin();
2123  pItemPower = *(it2);
2124  CPPUNIT_ASSERT(pItemPower != NULL);
2125  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2126  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2127  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2128  CPPUNIT_ASSERT(pItem != NULL);
2129  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2130  CPPUNIT_ASSERT(pItem->getName() == "C");
2131 
2132  // E
2133  ++it2;
2134  pItemPower = *(it2);
2135  CPPUNIT_ASSERT(pItemPower != NULL);
2136  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2137  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2138  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2139  CPPUNIT_ASSERT(pItem != NULL);
2140  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2141  CPPUNIT_ASSERT(pItem->getName() == "E");
2142 
2143  // F
2144  ++it2;
2145  pItemPower = *(it2);
2146  CPPUNIT_ASSERT(pItemPower != NULL);
2147  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2148  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2149  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2150  CPPUNIT_ASSERT(pItem != NULL);
2151  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2152  CPPUNIT_ASSERT(pItem->getName() == "F");
2153 
2154  // G
2155  ++it2;
2156  pItemPower = *(it2);
2157  CPPUNIT_ASSERT(pItemPower != NULL);
2158  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2159  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2160  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2161  CPPUNIT_ASSERT(pItem != NULL);
2162  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2163  CPPUNIT_ASSERT(pItem->getName() == "G");
2164 
2165  // H
2166  ++it2;
2167  pItemPower = *(it2);
2168  CPPUNIT_ASSERT(pItemPower != NULL);
2169  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2170  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2171  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2172  CPPUNIT_ASSERT(pItem != NULL);
2173  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2174  CPPUNIT_ASSERT(pItem->getName() == "H");
2175 
2176  // I
2177  ++it2;
2178  pItemPower = *(it2);
2179  CPPUNIT_ASSERT(pItemPower != NULL);
2180  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2181  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2182  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2183  CPPUNIT_ASSERT(pItem != NULL);
2184  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2185  CPPUNIT_ASSERT(pItem->getName() == "I");
2186 
2187  // L
2188  ++it2;
2189  pItemPower = *(it2);
2190  CPPUNIT_ASSERT(pItemPower != NULL);
2191  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2192  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2193  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2194  CPPUNIT_ASSERT(pItem != NULL);
2195  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2196  CPPUNIT_ASSERT(pItem->getName() == "L");
2197 
2198  // M
2199  ++it2;
2200  pItemPower = *(it2);
2201  CPPUNIT_ASSERT(pItemPower != NULL);
2202  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2203  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2204  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2205  CPPUNIT_ASSERT(pItem != NULL);
2206  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2207  CPPUNIT_ASSERT(pItem->getName() == "M");
2208 
2209  // 9*C^4*H*I*L*M
2210  ++it;
2211  pProduct = *(it);
2212  CPPUNIT_ASSERT(pProduct != NULL);
2213  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
2214  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
2215 
2216  // C^4
2217  it2 = pProduct->getItemPowers().begin();
2218  pItemPower = *(it2);
2219  CPPUNIT_ASSERT(pItemPower != NULL);
2220  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
2221  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2222  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2223  CPPUNIT_ASSERT(pItem != NULL);
2224  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2225  CPPUNIT_ASSERT(pItem->getName() == "C");
2226 
2227  // H
2228  ++it2;
2229  pItemPower = *(it2);
2230  CPPUNIT_ASSERT(pItemPower != NULL);
2231  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2232  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2233  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2234  CPPUNIT_ASSERT(pItem != NULL);
2235  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2236  CPPUNIT_ASSERT(pItem->getName() == "H");
2237 
2238  // I
2239  ++it2;
2240  pItemPower = *(it2);
2241  CPPUNIT_ASSERT(pItemPower != NULL);
2242  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2243  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2244  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2245  CPPUNIT_ASSERT(pItem != NULL);
2246  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2247  CPPUNIT_ASSERT(pItem->getName() == "I");
2248 
2249  // L
2250  ++it2;
2251  pItemPower = *(it2);
2252  CPPUNIT_ASSERT(pItemPower != NULL);
2253  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2254  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2255  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2256  CPPUNIT_ASSERT(pItem != NULL);
2257  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2258  CPPUNIT_ASSERT(pItem->getName() == "L");
2259 
2260  // M
2261  ++it2;
2262  pItemPower = *(it2);
2263  CPPUNIT_ASSERT(pItemPower != NULL);
2264  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2265  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2266  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2267  CPPUNIT_ASSERT(pItem != NULL);
2268  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2269  CPPUNIT_ASSERT(pItem->getName() == "M");
2270 
2271 
2272  // 9*C^3*F*H*I*L*M
2273  ++it;
2274  pProduct = *(it);
2275  CPPUNIT_ASSERT(pProduct != NULL);
2276  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
2277  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
2278 
2279  // C^3
2280  it2 = pProduct->getItemPowers().begin();
2281  pItemPower = *(it2);
2282  CPPUNIT_ASSERT(pItemPower != NULL);
2283  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
2284  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2285  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2286  CPPUNIT_ASSERT(pItem != NULL);
2287  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2288  CPPUNIT_ASSERT(pItem->getName() == "C");
2289 
2290  // F
2291  ++it2;
2292  pItemPower = *(it2);
2293  CPPUNIT_ASSERT(pItemPower != NULL);
2294  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2295  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2296  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2297  CPPUNIT_ASSERT(pItem != NULL);
2298  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2299  CPPUNIT_ASSERT(pItem->getName() == "F");
2300 
2301 
2302  // H
2303  ++it2;
2304  pItemPower = *(it2);
2305  CPPUNIT_ASSERT(pItemPower != NULL);
2306  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2307  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2308  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2309  CPPUNIT_ASSERT(pItem != NULL);
2310  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2311  CPPUNIT_ASSERT(pItem->getName() == "H");
2312 
2313  // I
2314  ++it2;
2315  pItemPower = *(it2);
2316  CPPUNIT_ASSERT(pItemPower != NULL);
2317  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2318  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2319  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2320  CPPUNIT_ASSERT(pItem != NULL);
2321  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2322  CPPUNIT_ASSERT(pItem->getName() == "I");
2323 
2324  // L
2325  ++it2;
2326  pItemPower = *(it2);
2327  CPPUNIT_ASSERT(pItemPower != NULL);
2328  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2329  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2330  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2331  CPPUNIT_ASSERT(pItem != NULL);
2332  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2333  CPPUNIT_ASSERT(pItem->getName() == "L");
2334 
2335  // M
2336  ++it2;
2337  pItemPower = *(it2);
2338  CPPUNIT_ASSERT(pItemPower != NULL);
2339  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2340  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2341  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2342  CPPUNIT_ASSERT(pItem != NULL);
2343  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2344  CPPUNIT_ASSERT(pItem->getName() == "M");
2345 
2346  // 9*C^3*G*H*I*L*M
2347  ++it;
2348  pProduct = *(it);
2349  CPPUNIT_ASSERT(pProduct != NULL);
2350  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
2351  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
2352 
2353  // C^3
2354  it2 = pProduct->getItemPowers().begin();
2355  pItemPower = *(it2);
2356  CPPUNIT_ASSERT(pItemPower != NULL);
2357  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
2358  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2359  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2360  CPPUNIT_ASSERT(pItem != NULL);
2361  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2362  CPPUNIT_ASSERT(pItem->getName() == "C");
2363 
2364  // G
2365  ++it2;
2366  pItemPower = *(it2);
2367  CPPUNIT_ASSERT(pItemPower != NULL);
2368  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2369  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2370  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2371  CPPUNIT_ASSERT(pItem != NULL);
2372  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2373  CPPUNIT_ASSERT(pItem->getName() == "G");
2374 
2375  // H
2376  ++it2;
2377  pItemPower = *(it2);
2378  CPPUNIT_ASSERT(pItemPower != NULL);
2379  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2380  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2381  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2382  CPPUNIT_ASSERT(pItem != NULL);
2383  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2384  CPPUNIT_ASSERT(pItem->getName() == "H");
2385 
2386  // I
2387  ++it2;
2388  pItemPower = *(it2);
2389  CPPUNIT_ASSERT(pItemPower != NULL);
2390  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2391  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2392  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2393  CPPUNIT_ASSERT(pItem != NULL);
2394  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2395  CPPUNIT_ASSERT(pItem->getName() == "I");
2396 
2397  // L
2398  ++it2;
2399  pItemPower = *(it2);
2400  CPPUNIT_ASSERT(pItemPower != NULL);
2401  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2402  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2403  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2404  CPPUNIT_ASSERT(pItem != NULL);
2405  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2406  CPPUNIT_ASSERT(pItem->getName() == "L");
2407 
2408  // M
2409  ++it2;
2410  pItemPower = *(it2);
2411  CPPUNIT_ASSERT(pItemPower != NULL);
2412  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2413  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2414  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2415  CPPUNIT_ASSERT(pItem != NULL);
2416  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2417  CPPUNIT_ASSERT(pItem->getName() == "M");
2418 
2419  // 9*C^2*F*G*H*I*L*M
2420  ++it;
2421  pProduct = *(it);
2422  CPPUNIT_ASSERT(pProduct != NULL);
2423  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
2424  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
2425 
2426  // C^2
2427  it2 = pProduct->getItemPowers().begin();
2428  pItemPower = *(it2);
2429  CPPUNIT_ASSERT(pItemPower != NULL);
2430  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
2431  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2432  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2433  CPPUNIT_ASSERT(pItem != NULL);
2434  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2435  CPPUNIT_ASSERT(pItem->getName() == "C");
2436 
2437  // F
2438  ++it2;
2439  pItemPower = *(it2);
2440  CPPUNIT_ASSERT(pItemPower != NULL);
2441  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2442  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2443  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2444  CPPUNIT_ASSERT(pItem != NULL);
2445  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2446  CPPUNIT_ASSERT(pItem->getName() == "F");
2447 
2448  // G
2449  ++it2;
2450  pItemPower = *(it2);
2451  CPPUNIT_ASSERT(pItemPower != NULL);
2452  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2453  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2454  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2455  CPPUNIT_ASSERT(pItem != NULL);
2456  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2457  CPPUNIT_ASSERT(pItem->getName() == "G");
2458 
2459  // H
2460  ++it2;
2461  pItemPower = *(it2);
2462  CPPUNIT_ASSERT(pItemPower != NULL);
2463  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2464  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2465  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2466  CPPUNIT_ASSERT(pItem != NULL);
2467  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2468  CPPUNIT_ASSERT(pItem->getName() == "H");
2469 
2470  // I
2471  ++it2;
2472  pItemPower = *(it2);
2473  CPPUNIT_ASSERT(pItemPower != NULL);
2474  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2475  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2476  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2477  CPPUNIT_ASSERT(pItem != NULL);
2478  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2479  CPPUNIT_ASSERT(pItem->getName() == "I");
2480 
2481  // L
2482  ++it2;
2483  pItemPower = *(it2);
2484  CPPUNIT_ASSERT(pItemPower != NULL);
2485  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2486  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2487  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2488  CPPUNIT_ASSERT(pItem != NULL);
2489  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2490  CPPUNIT_ASSERT(pItem->getName() == "L");
2491 
2492  // M
2493  ++it2;
2494  pItemPower = *(it2);
2495  CPPUNIT_ASSERT(pItemPower != NULL);
2496  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2497  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2498  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2499  CPPUNIT_ASSERT(pItem != NULL);
2500  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2501  CPPUNIT_ASSERT(pItem->getName() == "M");
2502 
2503  delete pFraction;
2504 }
2505 
2506 
2508 {
2509  // 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)))
2510  // -> (3*B*C^4*F*H*N*O*k1)/(C^6*J*L*M + C^3*D*F*H*J*L*M + C^3*E*G*I*J*L*M + D*E*F*G*H*I*J*L*M + 3*C^5*H*J*L*M + 3*C^5*I*J*L*M + 3*C^4*F*H*J*L*M + 3*C^4*G*I*J*L*M + 3*C^2*D*F*H*I*J*L*M + 3*C^2*E*G*H*I*J*L*M + 3*C*D*F*G*H*I*J*L*M + 3*C*E*F*G*H*I*J*L*M + 9*C^4*H*I*J*L*M + 9*C^3*F*H*I*J*L*M + 9*C^3*G*H*I*J*L*M + 9*C^2*F*G*H*I*J*L*M)
2511  CEvaluationTree* pTree = new CEvaluationTree();
2512  pTree->setInfix(term_num7);
2513  CPPUNIT_ASSERT(pTree->getRoot() != NULL);
2515  delete pTree;
2516  CPPUNIT_ASSERT(pFraction != NULL);
2517 
2518  // numerator
2519  // (3*B*C^4*F*H*N*O*k1)
2520  const CNormalSum* pNumerator = &pFraction->getNumerator();
2521  CPPUNIT_ASSERT(pNumerator->getFractions().size() == 0);
2522  const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->getProducts();
2523  CPPUNIT_ASSERT(pProducts->size() == 1);
2524  std::set<CNormalProduct*, compareProducts >::const_iterator it = pProducts->begin();
2525  const CNormalProduct* pProduct = *(it);
2526  CPPUNIT_ASSERT(pProduct != NULL);
2527  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
2528  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
2529  std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->getItemPowers().begin();
2530  // B
2531  const CNormalItemPower* pItemPower = *(it2);
2532  CPPUNIT_ASSERT(pItemPower != NULL);
2533  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2534  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2535  const CNormalItem* pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2536  CPPUNIT_ASSERT(pItem != NULL);
2537  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2538  CPPUNIT_ASSERT(pItem->getName() == "B");
2539 
2540  ++it2;
2541  // C^4
2542  pItemPower = *(it2);
2543  CPPUNIT_ASSERT(pItemPower != NULL);
2544  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
2545  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2546  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2547  CPPUNIT_ASSERT(pItem != NULL);
2548  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2549  CPPUNIT_ASSERT(pItem->getName() == "C");
2550 
2551  ++it2;
2552  // F
2553  pItemPower = *(it2);
2554  CPPUNIT_ASSERT(pItemPower != NULL);
2555  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2556  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2557  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2558  CPPUNIT_ASSERT(pItem != NULL);
2559  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2560  CPPUNIT_ASSERT(pItem->getName() == "F");
2561 
2562  ++it2;
2563  // H
2564  pItemPower = *(it2);
2565  CPPUNIT_ASSERT(pItemPower != NULL);
2566  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2567  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2568  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2569  CPPUNIT_ASSERT(pItem != NULL);
2570  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2571  CPPUNIT_ASSERT(pItem->getName() == "H");
2572 
2573  ++it2;
2574  // N
2575  pItemPower = *(it2);
2576  CPPUNIT_ASSERT(pItemPower != NULL);
2577  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2578  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2579  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2580  CPPUNIT_ASSERT(pItem != NULL);
2581  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2582  CPPUNIT_ASSERT(pItem->getName() == "N");
2583 
2584  ++it2;
2585  // O
2586  pItemPower = *(it2);
2587  CPPUNIT_ASSERT(pItemPower != NULL);
2588  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2589  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2590  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2591  CPPUNIT_ASSERT(pItem != NULL);
2592  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2593  CPPUNIT_ASSERT(pItem->getName() == "O");
2594 
2595  ++it2;
2596  // k1
2597  pItemPower = *(it2);
2598  CPPUNIT_ASSERT(pItemPower != NULL);
2599  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2600  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2601  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2602  CPPUNIT_ASSERT(pItem != NULL);
2603  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2604  CPPUNIT_ASSERT(pItem->getName() == "k1");
2605 
2606 
2607  // denominator
2608  // (C^6*J*L*M + C^3*D*F*H*J*L*M + C^3*E*G*I*J*L*M + D*E*F*G*H*I*J*L*M + 3*C^5*H*J*L*M + 3*C^5*I*J*L*M + 3*C^4*F*H*J*L*M + 3*C^4*G*I*J*L*M + 3*C^2*D*F*H*I*J*L*M + 3*C^2*E*G*H*I*J*L*M + 3*C*D*F*G*H*I*J*L*M + 3*C*E*F*G*H*I*J*L*M + 9*C^4*H*I*J*L*M + 9*C^3*F*H*I*J*L*M + 9*C^3*G*H*I*J*L*M + 9*C^2*F*G*H*I*J*L*M)
2609  const CNormalSum* pDenominator = &pFraction->getDenominator();
2610  CPPUNIT_ASSERT(pDenominator->getFractions().size() == 0);
2611  pProducts = &pDenominator->getProducts();
2612  CPPUNIT_ASSERT(pProducts->size() == 16);
2613 
2614  // C^6*J*L*M
2615  it = pProducts->begin();
2616  pProduct = *(it);
2617  CPPUNIT_ASSERT(pProduct != NULL);
2618  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2619  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 4);
2620 
2621  // C^6
2622  it2 = pProduct->getItemPowers().begin();
2623  pItemPower = *(it2);
2624  CPPUNIT_ASSERT(pItemPower != NULL);
2625  CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
2626  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2627  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2628  CPPUNIT_ASSERT(pItem != NULL);
2629  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2630  CPPUNIT_ASSERT(pItem->getName() == "C");
2631 
2632  // J
2633  ++it2;
2634  pItemPower = *(it2);
2635  CPPUNIT_ASSERT(pItemPower != NULL);
2636  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2637  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2638  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2639  CPPUNIT_ASSERT(pItem != NULL);
2640  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2641  CPPUNIT_ASSERT(pItem->getName() == "J");
2642 
2643  // L
2644  ++it2;
2645  pItemPower = *(it2);
2646  CPPUNIT_ASSERT(pItemPower != NULL);
2647  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2648  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2649  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2650  CPPUNIT_ASSERT(pItem != NULL);
2651  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2652  CPPUNIT_ASSERT(pItem->getName() == "L");
2653 
2654  // M
2655  ++it2;
2656  pItemPower = *(it2);
2657  CPPUNIT_ASSERT(pItemPower != NULL);
2658  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2659  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2660  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2661  CPPUNIT_ASSERT(pItem != NULL);
2662  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2663  CPPUNIT_ASSERT(pItem->getName() == "M");
2664 
2665 
2666  // C^3*D*F*H*J*L*M
2667  ++it;
2668  pProduct = *(it);
2669  CPPUNIT_ASSERT(pProduct != NULL);
2670  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2671  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
2672 
2673 
2674  // C^3
2675  it2 = pProduct->getItemPowers().begin();
2676  pItemPower = *(it2);
2677  CPPUNIT_ASSERT(pItemPower != NULL);
2678  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
2679  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2680  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2681  CPPUNIT_ASSERT(pItem != NULL);
2682  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2683  CPPUNIT_ASSERT(pItem->getName() == "C");
2684 
2685  // D
2686  ++it2;
2687  pItemPower = *(it2);
2688  CPPUNIT_ASSERT(pItemPower != NULL);
2689  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2690  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2691  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2692  CPPUNIT_ASSERT(pItem != NULL);
2693  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2694  CPPUNIT_ASSERT(pItem->getName() == "D");
2695 
2696  // F
2697  ++it2;
2698  pItemPower = *(it2);
2699  CPPUNIT_ASSERT(pItemPower != NULL);
2700  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2701  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2702  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2703  CPPUNIT_ASSERT(pItem != NULL);
2704  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2705  CPPUNIT_ASSERT(pItem->getName() == "F");
2706 
2707  // H
2708  ++it2;
2709  pItemPower = *(it2);
2710  CPPUNIT_ASSERT(pItemPower != NULL);
2711  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2712  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2713  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2714  CPPUNIT_ASSERT(pItem != NULL);
2715  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2716  CPPUNIT_ASSERT(pItem->getName() == "H");
2717 
2718  // J
2719  ++it2;
2720  pItemPower = *(it2);
2721  CPPUNIT_ASSERT(pItemPower != NULL);
2722  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2723  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2724  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2725  CPPUNIT_ASSERT(pItem != NULL);
2726  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2727  CPPUNIT_ASSERT(pItem->getName() == "J");
2728 
2729  // L
2730  ++it2;
2731  pItemPower = *(it2);
2732  CPPUNIT_ASSERT(pItemPower != NULL);
2733  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2734  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2735  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2736  CPPUNIT_ASSERT(pItem != NULL);
2737  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2738  CPPUNIT_ASSERT(pItem->getName() == "L");
2739 
2740  // M
2741  ++it2;
2742  pItemPower = *(it2);
2743  CPPUNIT_ASSERT(pItemPower != NULL);
2744  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2745  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2746  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2747  CPPUNIT_ASSERT(pItem != NULL);
2748  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2749  CPPUNIT_ASSERT(pItem->getName() == "M");
2750 
2751  // C^3*E*G*I*J*L*M
2752  ++it;
2753  pProduct = *(it);
2754  CPPUNIT_ASSERT(pProduct != NULL);
2755  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2756  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
2757 
2758  // C^3
2759  it2 = pProduct->getItemPowers().begin();
2760  pItemPower = *(it2);
2761  CPPUNIT_ASSERT(pItemPower != NULL);
2762  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
2763  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2764  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2765  CPPUNIT_ASSERT(pItem != NULL);
2766  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2767  CPPUNIT_ASSERT(pItem->getName() == "C");
2768 
2769  // E
2770  ++it2;
2771  pItemPower = *(it2);
2772  CPPUNIT_ASSERT(pItemPower != NULL);
2773  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2774  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2775  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2776  CPPUNIT_ASSERT(pItem != NULL);
2777  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2778  CPPUNIT_ASSERT(pItem->getName() == "E");
2779 
2780  // G
2781  ++it2;
2782  pItemPower = *(it2);
2783  CPPUNIT_ASSERT(pItemPower != NULL);
2784  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2785  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2786  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2787  CPPUNIT_ASSERT(pItem != NULL);
2788  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2789  CPPUNIT_ASSERT(pItem->getName() == "G");
2790 
2791  // I
2792  ++it2;
2793  pItemPower = *(it2);
2794  CPPUNIT_ASSERT(pItemPower != NULL);
2795  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2796  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2797  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2798  CPPUNIT_ASSERT(pItem != NULL);
2799  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2800  CPPUNIT_ASSERT(pItem->getName() == "I");
2801 
2802  // J
2803  ++it2;
2804  pItemPower = *(it2);
2805  CPPUNIT_ASSERT(pItemPower != NULL);
2806  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2807  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2808  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2809  CPPUNIT_ASSERT(pItem != NULL);
2810  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2811  CPPUNIT_ASSERT(pItem->getName() == "J");
2812 
2813  // L
2814  ++it2;
2815  pItemPower = *(it2);
2816  CPPUNIT_ASSERT(pItemPower != NULL);
2817  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2818  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2819  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2820  CPPUNIT_ASSERT(pItem != NULL);
2821  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2822  CPPUNIT_ASSERT(pItem->getName() == "L");
2823 
2824  // M
2825  ++it2;
2826  pItemPower = *(it2);
2827  CPPUNIT_ASSERT(pItemPower != NULL);
2828  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2829  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2830  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2831  CPPUNIT_ASSERT(pItem != NULL);
2832  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2833  CPPUNIT_ASSERT(pItem->getName() == "M");
2834 
2835  // D*E*F*G*H*I*J*L*M
2836  ++it;
2837  pProduct = *(it);
2838  CPPUNIT_ASSERT(pProduct != NULL);
2839  CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2840  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
2841 
2842  // D
2843  it2 = pProduct->getItemPowers().begin();
2844  pItemPower = *(it2);
2845  CPPUNIT_ASSERT(pItemPower != NULL);
2846  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2847  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2848  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2849  CPPUNIT_ASSERT(pItem != NULL);
2850  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2851  CPPUNIT_ASSERT(pItem->getName() == "D");
2852 
2853  // E
2854  ++it2;
2855  pItemPower = *(it2);
2856  CPPUNIT_ASSERT(pItemPower != NULL);
2857  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2858  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2859  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2860  CPPUNIT_ASSERT(pItem != NULL);
2861  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2862  CPPUNIT_ASSERT(pItem->getName() == "E");
2863 
2864  // F
2865  ++it2;
2866  pItemPower = *(it2);
2867  CPPUNIT_ASSERT(pItemPower != NULL);
2868  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2869  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2870  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2871  CPPUNIT_ASSERT(pItem != NULL);
2872  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2873  CPPUNIT_ASSERT(pItem->getName() == "F");
2874 
2875  // G
2876  ++it2;
2877  pItemPower = *(it2);
2878  CPPUNIT_ASSERT(pItemPower != NULL);
2879  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2880  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2881  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2882  CPPUNIT_ASSERT(pItem != NULL);
2883  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2884  CPPUNIT_ASSERT(pItem->getName() == "G");
2885 
2886  // H
2887  ++it2;
2888  pItemPower = *(it2);
2889  CPPUNIT_ASSERT(pItemPower != NULL);
2890  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2891  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2892  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2893  CPPUNIT_ASSERT(pItem != NULL);
2894  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2895  CPPUNIT_ASSERT(pItem->getName() == "H");
2896 
2897  // I
2898  ++it2;
2899  pItemPower = *(it2);
2900  CPPUNIT_ASSERT(pItemPower != NULL);
2901  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2902  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2903  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2904  CPPUNIT_ASSERT(pItem != NULL);
2905  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2906  CPPUNIT_ASSERT(pItem->getName() == "I");
2907 
2908  // J
2909  ++it2;
2910  pItemPower = *(it2);
2911  CPPUNIT_ASSERT(pItemPower != NULL);
2912  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2913  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2914  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2915  CPPUNIT_ASSERT(pItem != NULL);
2916  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2917  CPPUNIT_ASSERT(pItem->getName() == "J");
2918 
2919  // L
2920  ++it2;
2921  pItemPower = *(it2);
2922  CPPUNIT_ASSERT(pItemPower != NULL);
2923  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2924  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2925  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2926  CPPUNIT_ASSERT(pItem != NULL);
2927  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2928  CPPUNIT_ASSERT(pItem->getName() == "L");
2929 
2930  // M
2931  ++it2;
2932  pItemPower = *(it2);
2933  CPPUNIT_ASSERT(pItemPower != NULL);
2934  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2935  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2936  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2937  CPPUNIT_ASSERT(pItem != NULL);
2938  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2939  CPPUNIT_ASSERT(pItem->getName() == "M");
2940 
2941  // 3*C^5*H*J*L*M
2942  ++it;
2943  pProduct = *(it);
2944  CPPUNIT_ASSERT(pProduct != NULL);
2945  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
2946  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
2947 
2948  // C^5
2949  it2 = pProduct->getItemPowers().begin();
2950  pItemPower = *(it2);
2951  CPPUNIT_ASSERT(pItemPower != NULL);
2952  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
2953  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2954  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2955  CPPUNIT_ASSERT(pItem != NULL);
2956  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2957  CPPUNIT_ASSERT(pItem->getName() == "C");
2958 
2959  // H
2960  ++it2;
2961  pItemPower = *(it2);
2962  CPPUNIT_ASSERT(pItemPower != NULL);
2963  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2964  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2965  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2966  CPPUNIT_ASSERT(pItem != NULL);
2967  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2968  CPPUNIT_ASSERT(pItem->getName() == "H");
2969 
2970  // J
2971  ++it2;
2972  pItemPower = *(it2);
2973  CPPUNIT_ASSERT(pItemPower != NULL);
2974  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2975  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2976  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2977  CPPUNIT_ASSERT(pItem != NULL);
2978  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2979  CPPUNIT_ASSERT(pItem->getName() == "J");
2980 
2981  // L
2982  ++it2;
2983  pItemPower = *(it2);
2984  CPPUNIT_ASSERT(pItemPower != NULL);
2985  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2986  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2987  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2988  CPPUNIT_ASSERT(pItem != NULL);
2989  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
2990  CPPUNIT_ASSERT(pItem->getName() == "L");
2991 
2992  // M
2993  ++it2;
2994  pItemPower = *(it2);
2995  CPPUNIT_ASSERT(pItemPower != NULL);
2996  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2997  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
2998  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
2999  CPPUNIT_ASSERT(pItem != NULL);
3000  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3001  CPPUNIT_ASSERT(pItem->getName() == "M");
3002 
3003 
3004  // 3*C^5*I*J*L*M
3005  ++it;
3006  pProduct = *(it);
3007  CPPUNIT_ASSERT(pProduct != NULL);
3008  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3009  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 5);
3010 
3011  // C^5
3012  it2 = pProduct->getItemPowers().begin();
3013  pItemPower = *(it2);
3014  CPPUNIT_ASSERT(pItemPower != NULL);
3015  CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
3016  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3017  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3018  CPPUNIT_ASSERT(pItem != NULL);
3019  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3020  CPPUNIT_ASSERT(pItem->getName() == "C");
3021 
3022  // I
3023  ++it2;
3024  pItemPower = *(it2);
3025  CPPUNIT_ASSERT(pItemPower != NULL);
3026  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3027  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3028  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3029  CPPUNIT_ASSERT(pItem != NULL);
3030  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3031  CPPUNIT_ASSERT(pItem->getName() == "I");
3032 
3033  // J
3034  ++it2;
3035  pItemPower = *(it2);
3036  CPPUNIT_ASSERT(pItemPower != NULL);
3037  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3038  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3039  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3040  CPPUNIT_ASSERT(pItem != NULL);
3041  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3042  CPPUNIT_ASSERT(pItem->getName() == "J");
3043 
3044  // L
3045  ++it2;
3046  pItemPower = *(it2);
3047  CPPUNIT_ASSERT(pItemPower != NULL);
3048  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3049  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3050  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3051  CPPUNIT_ASSERT(pItem != NULL);
3052  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3053  CPPUNIT_ASSERT(pItem->getName() == "L");
3054 
3055  // M
3056  ++it2;
3057  pItemPower = *(it2);
3058  CPPUNIT_ASSERT(pItemPower != NULL);
3059  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3060  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3061  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3062  CPPUNIT_ASSERT(pItem != NULL);
3063  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3064  CPPUNIT_ASSERT(pItem->getName() == "M");
3065 
3066  // 3*C^4*F*H*J*L*M
3067  ++it;
3068  pProduct = *(it);
3069  CPPUNIT_ASSERT(pProduct != NULL);
3070  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3071  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
3072 
3073  // C^4
3074  it2 = pProduct->getItemPowers().begin();
3075  pItemPower = *(it2);
3076  CPPUNIT_ASSERT(pItemPower != NULL);
3077  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
3078  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3079  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3080  CPPUNIT_ASSERT(pItem != NULL);
3081  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3082  CPPUNIT_ASSERT(pItem->getName() == "C");
3083 
3084  // F
3085  ++it2;
3086  pItemPower = *(it2);
3087  CPPUNIT_ASSERT(pItemPower != NULL);
3088  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3089  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3090  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3091  CPPUNIT_ASSERT(pItem != NULL);
3092  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3093  CPPUNIT_ASSERT(pItem->getName() == "F");
3094 
3095  // H
3096  ++it2;
3097  pItemPower = *(it2);
3098  CPPUNIT_ASSERT(pItemPower != NULL);
3099  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3100  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3101  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3102  CPPUNIT_ASSERT(pItem != NULL);
3103  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3104  CPPUNIT_ASSERT(pItem->getName() == "H");
3105 
3106  // J
3107  ++it2;
3108  pItemPower = *(it2);
3109  CPPUNIT_ASSERT(pItemPower != NULL);
3110  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3111  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3112  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3113  CPPUNIT_ASSERT(pItem != NULL);
3114  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3115  CPPUNIT_ASSERT(pItem->getName() == "J");
3116 
3117  // L
3118  ++it2;
3119  pItemPower = *(it2);
3120  CPPUNIT_ASSERT(pItemPower != NULL);
3121  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3122  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3123  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3124  CPPUNIT_ASSERT(pItem != NULL);
3125  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3126  CPPUNIT_ASSERT(pItem->getName() == "L");
3127 
3128  // M
3129  ++it2;
3130  pItemPower = *(it2);
3131  CPPUNIT_ASSERT(pItemPower != NULL);
3132  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3133  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3134  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3135  CPPUNIT_ASSERT(pItem != NULL);
3136  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3137  CPPUNIT_ASSERT(pItem->getName() == "M");
3138 
3139  // 3*C^4*G*I*J*L*M
3140  ++it;
3141  pProduct = *(it);
3142  CPPUNIT_ASSERT(pProduct != NULL);
3143  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3144  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
3145 
3146  // C^4
3147  it2 = pProduct->getItemPowers().begin();
3148  pItemPower = *(it2);
3149  CPPUNIT_ASSERT(pItemPower != NULL);
3150  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
3151  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3152  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3153  CPPUNIT_ASSERT(pItem != NULL);
3154  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3155  CPPUNIT_ASSERT(pItem->getName() == "C");
3156 
3157  // G
3158  ++it2;
3159  pItemPower = *(it2);
3160  CPPUNIT_ASSERT(pItemPower != NULL);
3161  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3162  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3163  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3164  CPPUNIT_ASSERT(pItem != NULL);
3165  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3166  CPPUNIT_ASSERT(pItem->getName() == "G");
3167 
3168  // I
3169  ++it2;
3170  pItemPower = *(it2);
3171  CPPUNIT_ASSERT(pItemPower != NULL);
3172  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3173  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3174  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3175  CPPUNIT_ASSERT(pItem != NULL);
3176  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3177  CPPUNIT_ASSERT(pItem->getName() == "I");
3178 
3179  // J
3180  ++it2;
3181  pItemPower = *(it2);
3182  CPPUNIT_ASSERT(pItemPower != NULL);
3183  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3184  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3185  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3186  CPPUNIT_ASSERT(pItem != NULL);
3187  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3188  CPPUNIT_ASSERT(pItem->getName() == "J");
3189 
3190  // L
3191  ++it2;
3192  pItemPower = *(it2);
3193  CPPUNIT_ASSERT(pItemPower != NULL);
3194  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3195  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3196  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3197  CPPUNIT_ASSERT(pItem != NULL);
3198  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3199  CPPUNIT_ASSERT(pItem->getName() == "L");
3200 
3201  // M
3202  ++it2;
3203  pItemPower = *(it2);
3204  CPPUNIT_ASSERT(pItemPower != NULL);
3205  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3206  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3207  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3208  CPPUNIT_ASSERT(pItem != NULL);
3209  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3210  CPPUNIT_ASSERT(pItem->getName() == "M");
3211 
3212  // 3*C^2*D*F*H*I*J*L*M
3213  ++it;
3214  pProduct = *(it);
3215  CPPUNIT_ASSERT(pProduct != NULL);
3216  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3217  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
3218 
3219  // C^2
3220  it2 = pProduct->getItemPowers().begin();
3221  pItemPower = *(it2);
3222  CPPUNIT_ASSERT(pItemPower != NULL);
3223  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
3224  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3225  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3226  CPPUNIT_ASSERT(pItem != NULL);
3227  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3228  CPPUNIT_ASSERT(pItem->getName() == "C");
3229 
3230  // D
3231  ++it2;
3232  pItemPower = *(it2);
3233  CPPUNIT_ASSERT(pItemPower != NULL);
3234  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3235  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3236  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3237  CPPUNIT_ASSERT(pItem != NULL);
3238  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3239  CPPUNIT_ASSERT(pItem->getName() == "D");
3240 
3241  // F
3242  ++it2;
3243  pItemPower = *(it2);
3244  CPPUNIT_ASSERT(pItemPower != NULL);
3245  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3246  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3247  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3248  CPPUNIT_ASSERT(pItem != NULL);
3249  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3250  CPPUNIT_ASSERT(pItem->getName() == "F");
3251 
3252  // H
3253  ++it2;
3254  pItemPower = *(it2);
3255  CPPUNIT_ASSERT(pItemPower != NULL);
3256  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3257  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3258  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3259  CPPUNIT_ASSERT(pItem != NULL);
3260  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3261  CPPUNIT_ASSERT(pItem->getName() == "H");
3262 
3263  // I
3264  ++it2;
3265  pItemPower = *(it2);
3266  CPPUNIT_ASSERT(pItemPower != NULL);
3267  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3268  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3269  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3270  CPPUNIT_ASSERT(pItem != NULL);
3271  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3272  CPPUNIT_ASSERT(pItem->getName() == "I");
3273 
3274  // J
3275  ++it2;
3276  pItemPower = *(it2);
3277  CPPUNIT_ASSERT(pItemPower != NULL);
3278  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3279  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3280  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3281  CPPUNIT_ASSERT(pItem != NULL);
3282  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3283  CPPUNIT_ASSERT(pItem->getName() == "J");
3284 
3285  // L
3286  ++it2;
3287  pItemPower = *(it2);
3288  CPPUNIT_ASSERT(pItemPower != NULL);
3289  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3290  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3291  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3292  CPPUNIT_ASSERT(pItem != NULL);
3293  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3294  CPPUNIT_ASSERT(pItem->getName() == "L");
3295 
3296  // M
3297  ++it2;
3298  pItemPower = *(it2);
3299  CPPUNIT_ASSERT(pItemPower != NULL);
3300  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3301  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3302  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3303  CPPUNIT_ASSERT(pItem != NULL);
3304  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3305  CPPUNIT_ASSERT(pItem->getName() == "M");
3306 
3307  // 3*C^2*E*G*H*I*J*L*M
3308  ++it;
3309  pProduct = *(it);
3310  CPPUNIT_ASSERT(pProduct != NULL);
3311  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3312  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
3313 
3314  // C^2
3315  it2 = pProduct->getItemPowers().begin();
3316  pItemPower = *(it2);
3317  CPPUNIT_ASSERT(pItemPower != NULL);
3318  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
3319  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3320  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3321  CPPUNIT_ASSERT(pItem != NULL);
3322  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3323  CPPUNIT_ASSERT(pItem->getName() == "C");
3324 
3325  // E
3326  ++it2;
3327  pItemPower = *(it2);
3328  CPPUNIT_ASSERT(pItemPower != NULL);
3329  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3330  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3331  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3332  CPPUNIT_ASSERT(pItem != NULL);
3333  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3334  CPPUNIT_ASSERT(pItem->getName() == "E");
3335 
3336  // G
3337  ++it2;
3338  pItemPower = *(it2);
3339  CPPUNIT_ASSERT(pItemPower != NULL);
3340  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3341  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3342  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3343  CPPUNIT_ASSERT(pItem != NULL);
3344  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3345  CPPUNIT_ASSERT(pItem->getName() == "G");
3346 
3347  // H
3348  ++it2;
3349  pItemPower = *(it2);
3350  CPPUNIT_ASSERT(pItemPower != NULL);
3351  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3352  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3353  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3354  CPPUNIT_ASSERT(pItem != NULL);
3355  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3356  CPPUNIT_ASSERT(pItem->getName() == "H");
3357 
3358 
3359  // I
3360  ++it2;
3361  pItemPower = *(it2);
3362  CPPUNIT_ASSERT(pItemPower != NULL);
3363  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3364  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3365  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3366  CPPUNIT_ASSERT(pItem != NULL);
3367  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3368  CPPUNIT_ASSERT(pItem->getName() == "I");
3369 
3370  // J
3371  ++it2;
3372  pItemPower = *(it2);
3373  CPPUNIT_ASSERT(pItemPower != NULL);
3374  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3375  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3376  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3377  CPPUNIT_ASSERT(pItem != NULL);
3378  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3379  CPPUNIT_ASSERT(pItem->getName() == "J");
3380 
3381  // L
3382  ++it2;
3383  pItemPower = *(it2);
3384  CPPUNIT_ASSERT(pItemPower != NULL);
3385  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3386  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3387  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3388  CPPUNIT_ASSERT(pItem != NULL);
3389  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3390  CPPUNIT_ASSERT(pItem->getName() == "L");
3391 
3392  // M
3393  ++it2;
3394  pItemPower = *(it2);
3395  CPPUNIT_ASSERT(pItemPower != NULL);
3396  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3397  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3398  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3399  CPPUNIT_ASSERT(pItem != NULL);
3400  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3401  CPPUNIT_ASSERT(pItem->getName() == "M");
3402 
3403  // 3*C*D*F*G*H*I*J*L*M
3404  ++it;
3405  pProduct = *(it);
3406  CPPUNIT_ASSERT(pProduct != NULL);
3407  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3408  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
3409 
3410  // C
3411  it2 = pProduct->getItemPowers().begin();
3412  pItemPower = *(it2);
3413  CPPUNIT_ASSERT(pItemPower != NULL);
3414  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3415  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3416  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3417  CPPUNIT_ASSERT(pItem != NULL);
3418  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3419  CPPUNIT_ASSERT(pItem->getName() == "C");
3420 
3421  // D
3422  ++it2;
3423  pItemPower = *(it2);
3424  CPPUNIT_ASSERT(pItemPower != NULL);
3425  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3426  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3427  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3428  CPPUNIT_ASSERT(pItem != NULL);
3429  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3430  CPPUNIT_ASSERT(pItem->getName() == "D");
3431 
3432  // F
3433  ++it2;
3434  pItemPower = *(it2);
3435  CPPUNIT_ASSERT(pItemPower != NULL);
3436  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3437  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3438  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3439  CPPUNIT_ASSERT(pItem != NULL);
3440  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3441  CPPUNIT_ASSERT(pItem->getName() == "F");
3442 
3443  // G
3444  ++it2;
3445  pItemPower = *(it2);
3446  CPPUNIT_ASSERT(pItemPower != NULL);
3447  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3448  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3449  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3450  CPPUNIT_ASSERT(pItem != NULL);
3451  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3452  CPPUNIT_ASSERT(pItem->getName() == "G");
3453 
3454  // H
3455  ++it2;
3456  pItemPower = *(it2);
3457  CPPUNIT_ASSERT(pItemPower != NULL);
3458  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3459  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3460  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3461  CPPUNIT_ASSERT(pItem != NULL);
3462  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3463  CPPUNIT_ASSERT(pItem->getName() == "H");
3464 
3465  // I
3466  ++it2;
3467  pItemPower = *(it2);
3468  CPPUNIT_ASSERT(pItemPower != NULL);
3469  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3470  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3471  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3472  CPPUNIT_ASSERT(pItem != NULL);
3473  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3474  CPPUNIT_ASSERT(pItem->getName() == "I");
3475 
3476  // J
3477  ++it2;
3478  pItemPower = *(it2);
3479  CPPUNIT_ASSERT(pItemPower != NULL);
3480  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3481  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3482  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3483  CPPUNIT_ASSERT(pItem != NULL);
3484  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3485  CPPUNIT_ASSERT(pItem->getName() == "J");
3486 
3487  // L
3488  ++it2;
3489  pItemPower = *(it2);
3490  CPPUNIT_ASSERT(pItemPower != NULL);
3491  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3492  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3493  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3494  CPPUNIT_ASSERT(pItem != NULL);
3495  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3496  CPPUNIT_ASSERT(pItem->getName() == "L");
3497 
3498  // M
3499  ++it2;
3500  pItemPower = *(it2);
3501  CPPUNIT_ASSERT(pItemPower != NULL);
3502  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3503  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3504  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3505  CPPUNIT_ASSERT(pItem != NULL);
3506  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3507  CPPUNIT_ASSERT(pItem->getName() == "M");
3508 
3509  // 3*C*E*F*G*H*I*J*L*M
3510  ++it;
3511  pProduct = *(it);
3512  CPPUNIT_ASSERT(pProduct != NULL);
3513  CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
3514  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 9);
3515 
3516  // C
3517  it2 = pProduct->getItemPowers().begin();
3518  pItemPower = *(it2);
3519  CPPUNIT_ASSERT(pItemPower != NULL);
3520  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3521  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3522  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3523  CPPUNIT_ASSERT(pItem != NULL);
3524  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3525  CPPUNIT_ASSERT(pItem->getName() == "C");
3526 
3527  // E
3528  ++it2;
3529  pItemPower = *(it2);
3530  CPPUNIT_ASSERT(pItemPower != NULL);
3531  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3532  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3533  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3534  CPPUNIT_ASSERT(pItem != NULL);
3535  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3536  CPPUNIT_ASSERT(pItem->getName() == "E");
3537 
3538  // F
3539  ++it2;
3540  pItemPower = *(it2);
3541  CPPUNIT_ASSERT(pItemPower != NULL);
3542  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3543  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3544  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3545  CPPUNIT_ASSERT(pItem != NULL);
3546  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3547  CPPUNIT_ASSERT(pItem->getName() == "F");
3548 
3549  // G
3550  ++it2;
3551  pItemPower = *(it2);
3552  CPPUNIT_ASSERT(pItemPower != NULL);
3553  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3554  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3555  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3556  CPPUNIT_ASSERT(pItem != NULL);
3557  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3558  CPPUNIT_ASSERT(pItem->getName() == "G");
3559 
3560  // H
3561  ++it2;
3562  pItemPower = *(it2);
3563  CPPUNIT_ASSERT(pItemPower != NULL);
3564  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3565  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3566  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3567  CPPUNIT_ASSERT(pItem != NULL);
3568  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3569  CPPUNIT_ASSERT(pItem->getName() == "H");
3570 
3571  // I
3572  ++it2;
3573  pItemPower = *(it2);
3574  CPPUNIT_ASSERT(pItemPower != NULL);
3575  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3576  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3577  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3578  CPPUNIT_ASSERT(pItem != NULL);
3579  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3580  CPPUNIT_ASSERT(pItem->getName() == "I");
3581 
3582  // J
3583  ++it2;
3584  pItemPower = *(it2);
3585  CPPUNIT_ASSERT(pItemPower != NULL);
3586  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3587  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3588  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3589  CPPUNIT_ASSERT(pItem != NULL);
3590  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3591  CPPUNIT_ASSERT(pItem->getName() == "J");
3592 
3593  // L
3594  ++it2;
3595  pItemPower = *(it2);
3596  CPPUNIT_ASSERT(pItemPower != NULL);
3597  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3598  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3599  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3600  CPPUNIT_ASSERT(pItem != NULL);
3601  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3602  CPPUNIT_ASSERT(pItem->getName() == "L");
3603 
3604  // M
3605  ++it2;
3606  pItemPower = *(it2);
3607  CPPUNIT_ASSERT(pItemPower != NULL);
3608  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3609  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3610  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3611  CPPUNIT_ASSERT(pItem != NULL);
3612  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3613  CPPUNIT_ASSERT(pItem->getName() == "M");
3614 
3615  // 9*C^4*H*I*J*L*M
3616  ++it;
3617  pProduct = *(it);
3618  CPPUNIT_ASSERT(pProduct != NULL);
3619  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
3620  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 6);
3621 
3622  // C^4
3623  it2 = pProduct->getItemPowers().begin();
3624  pItemPower = *(it2);
3625  CPPUNIT_ASSERT(pItemPower != NULL);
3626  CPPUNIT_ASSERT(pItemPower->getExp() == 4.0);
3627  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3628  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3629  CPPUNIT_ASSERT(pItem != NULL);
3630  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3631  CPPUNIT_ASSERT(pItem->getName() == "C");
3632 
3633  // H
3634  ++it2;
3635  pItemPower = *(it2);
3636  CPPUNIT_ASSERT(pItemPower != NULL);
3637  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3638  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3639  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3640  CPPUNIT_ASSERT(pItem != NULL);
3641  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3642  CPPUNIT_ASSERT(pItem->getName() == "H");
3643 
3644  // I
3645  ++it2;
3646  pItemPower = *(it2);
3647  CPPUNIT_ASSERT(pItemPower != NULL);
3648  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3649  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3650  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3651  CPPUNIT_ASSERT(pItem != NULL);
3652  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3653  CPPUNIT_ASSERT(pItem->getName() == "I");
3654 
3655  // J
3656  ++it2;
3657  pItemPower = *(it2);
3658  CPPUNIT_ASSERT(pItemPower != NULL);
3659  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3660  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3661  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3662  CPPUNIT_ASSERT(pItem != NULL);
3663  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3664  CPPUNIT_ASSERT(pItem->getName() == "J");
3665 
3666  // L
3667  ++it2;
3668  pItemPower = *(it2);
3669  CPPUNIT_ASSERT(pItemPower != NULL);
3670  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3671  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3672  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3673  CPPUNIT_ASSERT(pItem != NULL);
3674  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3675  CPPUNIT_ASSERT(pItem->getName() == "L");
3676 
3677  // M
3678  ++it2;
3679  pItemPower = *(it2);
3680  CPPUNIT_ASSERT(pItemPower != NULL);
3681  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3682  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3683  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3684  CPPUNIT_ASSERT(pItem != NULL);
3685  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3686  CPPUNIT_ASSERT(pItem->getName() == "M");
3687 
3688  // 9*C^3*F*H*I*J*L*M
3689  ++it;
3690  pProduct = *(it);
3691  CPPUNIT_ASSERT(pProduct != NULL);
3692  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
3693  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
3694 
3695  // C^3
3696  it2 = pProduct->getItemPowers().begin();
3697  pItemPower = *(it2);
3698  CPPUNIT_ASSERT(pItemPower != NULL);
3699  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
3700  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3701  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3702  CPPUNIT_ASSERT(pItem != NULL);
3703  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3704  CPPUNIT_ASSERT(pItem->getName() == "C");
3705 
3706  // F
3707  ++it2;
3708  pItemPower = *(it2);
3709  CPPUNIT_ASSERT(pItemPower != NULL);
3710  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3711  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3712  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3713  CPPUNIT_ASSERT(pItem != NULL);
3714  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3715  CPPUNIT_ASSERT(pItem->getName() == "F");
3716 
3717  // H
3718  ++it2;
3719  pItemPower = *(it2);
3720  CPPUNIT_ASSERT(pItemPower != NULL);
3721  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3722  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3723  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3724  CPPUNIT_ASSERT(pItem != NULL);
3725  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3726  CPPUNIT_ASSERT(pItem->getName() == "H");
3727 
3728  // I
3729  ++it2;
3730  pItemPower = *(it2);
3731  CPPUNIT_ASSERT(pItemPower != NULL);
3732  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3733  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3734  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3735  CPPUNIT_ASSERT(pItem != NULL);
3736  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3737  CPPUNIT_ASSERT(pItem->getName() == "I");
3738 
3739  // J
3740  ++it2;
3741  pItemPower = *(it2);
3742  CPPUNIT_ASSERT(pItemPower != NULL);
3743  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3744  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3745  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3746  CPPUNIT_ASSERT(pItem != NULL);
3747  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3748  CPPUNIT_ASSERT(pItem->getName() == "J");
3749 
3750  // L
3751  ++it2;
3752  pItemPower = *(it2);
3753  CPPUNIT_ASSERT(pItemPower != NULL);
3754  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3755  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3756  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3757  CPPUNIT_ASSERT(pItem != NULL);
3758  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3759  CPPUNIT_ASSERT(pItem->getName() == "L");
3760 
3761  // M
3762  ++it2;
3763  pItemPower = *(it2);
3764  CPPUNIT_ASSERT(pItemPower != NULL);
3765  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3766  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3767  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3768  CPPUNIT_ASSERT(pItem != NULL);
3769  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3770  CPPUNIT_ASSERT(pItem->getName() == "M");
3771 
3772  // 9*C^3*G*H*I*J*L*M
3773  ++it;
3774  pProduct = *(it);
3775  CPPUNIT_ASSERT(pProduct != NULL);
3776  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
3777  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 7);
3778 
3779  // C^3
3780  it2 = pProduct->getItemPowers().begin();
3781  pItemPower = *(it2);
3782  CPPUNIT_ASSERT(pItemPower != NULL);
3783  CPPUNIT_ASSERT(pItemPower->getExp() == 3.0);
3784  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3785  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3786  CPPUNIT_ASSERT(pItem != NULL);
3787  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3788  CPPUNIT_ASSERT(pItem->getName() == "C");
3789 
3790  // G
3791  ++it2;
3792  pItemPower = *(it2);
3793  CPPUNIT_ASSERT(pItemPower != NULL);
3794  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3795  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3796  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3797  CPPUNIT_ASSERT(pItem != NULL);
3798  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3799  CPPUNIT_ASSERT(pItem->getName() == "G");
3800 
3801  // H
3802  ++it2;
3803  pItemPower = *(it2);
3804  CPPUNIT_ASSERT(pItemPower != NULL);
3805  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3806  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3807  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3808  CPPUNIT_ASSERT(pItem != NULL);
3809  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3810  CPPUNIT_ASSERT(pItem->getName() == "H");
3811 
3812  // I
3813  ++it2;
3814  pItemPower = *(it2);
3815  CPPUNIT_ASSERT(pItemPower != NULL);
3816  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3817  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3818  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3819  CPPUNIT_ASSERT(pItem != NULL);
3820  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3821  CPPUNIT_ASSERT(pItem->getName() == "I");
3822 
3823  // J
3824  ++it2;
3825  pItemPower = *(it2);
3826  CPPUNIT_ASSERT(pItemPower != NULL);
3827  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3828  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3829  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3830  CPPUNIT_ASSERT(pItem != NULL);
3831  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3832  CPPUNIT_ASSERT(pItem->getName() == "J");
3833 
3834  // L
3835  ++it2;
3836  pItemPower = *(it2);
3837  CPPUNIT_ASSERT(pItemPower != NULL);
3838  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3839  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3840  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3841  CPPUNIT_ASSERT(pItem != NULL);
3842  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3843  CPPUNIT_ASSERT(pItem->getName() == "L");
3844 
3845  // M
3846  ++it2;
3847  pItemPower = *(it2);
3848  CPPUNIT_ASSERT(pItemPower != NULL);
3849  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3850  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3851  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3852  CPPUNIT_ASSERT(pItem != NULL);
3853  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3854  CPPUNIT_ASSERT(pItem->getName() == "M");
3855 
3856  // 9*C^2*F*G*H*I*J*L*M
3857  ++it;
3858  pProduct = *(it);
3859  CPPUNIT_ASSERT(pProduct != NULL);
3860  CPPUNIT_ASSERT(pProduct->getFactor() == 9.0);
3861  CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 8);
3862 
3863  // C^2
3864  it2 = pProduct->getItemPowers().begin();
3865  pItemPower = *(it2);
3866  CPPUNIT_ASSERT(pItemPower != NULL);
3867  CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
3868  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3869  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3870  CPPUNIT_ASSERT(pItem != NULL);
3871  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3872  CPPUNIT_ASSERT(pItem->getName() == "C");
3873 
3874  // F
3875  ++it2;
3876  pItemPower = *(it2);
3877  CPPUNIT_ASSERT(pItemPower != NULL);
3878  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3879  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3880  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3881  CPPUNIT_ASSERT(pItem != NULL);
3882  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3883  CPPUNIT_ASSERT(pItem->getName() == "F");
3884 
3885  // G
3886  ++it2;
3887  pItemPower = *(it2);
3888  CPPUNIT_ASSERT(pItemPower != NULL);
3889  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3890  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3891  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3892  CPPUNIT_ASSERT(pItem != NULL);
3893  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3894  CPPUNIT_ASSERT(pItem->getName() == "G");
3895 
3896  // H
3897  ++it2;
3898  pItemPower = *(it2);
3899  CPPUNIT_ASSERT(pItemPower != NULL);
3900  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3901  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3902  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3903  CPPUNIT_ASSERT(pItem != NULL);
3904  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3905  CPPUNIT_ASSERT(pItem->getName() == "H");
3906 
3907  // I
3908  ++it2;
3909  pItemPower = *(it2);
3910  CPPUNIT_ASSERT(pItemPower != NULL);
3911  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3912  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3913  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3914  CPPUNIT_ASSERT(pItem != NULL);
3915  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3916  CPPUNIT_ASSERT(pItem->getName() == "I");
3917 
3918  // J
3919  ++it2;
3920  pItemPower = *(it2);
3921  CPPUNIT_ASSERT(pItemPower != NULL);
3922  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3923  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3924  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3925  CPPUNIT_ASSERT(pItem != NULL);
3926  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3927  CPPUNIT_ASSERT(pItem->getName() == "J");
3928 
3929  // L
3930  ++it2;
3931  pItemPower = *(it2);
3932  CPPUNIT_ASSERT(pItemPower != NULL);
3933  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3934  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3935  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3936  CPPUNIT_ASSERT(pItem != NULL);
3937  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3938  CPPUNIT_ASSERT(pItem->getName() == "L");
3939 
3940  // M
3941  ++it2;
3942  pItemPower = *(it2);
3943  CPPUNIT_ASSERT(pItemPower != NULL);
3944  CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3945  CPPUNIT_ASSERT(pItemPower->getItemType() == CNormalItemPower::ITEM);
3946  pItem = dynamic_cast<const CNormalItem*>(&pItemPower->getItem());
3947  CPPUNIT_ASSERT(pItem != NULL);
3948  CPPUNIT_ASSERT(pItem->getType() == CNormalItem::VARIABLE);
3949  CPPUNIT_ASSERT(pItem->getName() == "M");
3950 
3951 
3952  delete pFraction;
3953 }
3954 
3955 
3956 //----------- denominator ------------------
3957 
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 }
4029 
4030 
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 }
4278 
4279 
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 }
4627 
4628 
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 }
4853 
4854 
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 }
5179 
5180 
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::