23 #include "test_normalform.hpp"
46 typedef std::set<CNormalProduct*, compareProducts>::iterator
ProductIterator;
47 typedef std::set<CNormalItemPower*, compareItemPowers>::iterator
ItemPowerIterator;
49 typedef std::set<CNormalProduct*, compareProducts>::const_iterator
ProductIterator;
53 void test_normalform::setUp()
59 void test_normalform::tearDown()
61 if (pFraction != NULL)
delete pFraction;
66 void test_normalform::test_item_number()
68 std::string infix(
"7.0");
71 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
74 CPPUNIT_ASSERT(pFraction != NULL);
75 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
77 const CNormalSum& numerator = pFraction->getNumerator();
78 CPPUNIT_ASSERT(numerator.getFractions().size() == 0);
79 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
80 CPPUNIT_ASSERT(products.size() == 1);
82 CPPUNIT_ASSERT(pProduct != NULL);
83 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
84 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
87 void test_normalform::test_item_variable()
89 std::string infix(
"Vmax");
92 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
95 CPPUNIT_ASSERT(pFraction != NULL);
96 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
98 const CNormalSum& numerator = pFraction->getNumerator();
99 CPPUNIT_ASSERT(numerator.getFractions().size() == 0);
100 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
101 CPPUNIT_ASSERT(products.size() == 1);
103 CPPUNIT_ASSERT(pProduct != NULL);
104 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
105 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
107 CPPUNIT_ASSERT(pItemPower != NULL);
108 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
111 CPPUNIT_ASSERT(pItem != NULL);
113 CPPUNIT_ASSERT(pItem->getName() ==
"Vmax");
116 void test_normalform::test_item_constant()
118 std::string infix(
"PI");
121 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
124 CPPUNIT_ASSERT(pFraction != NULL);
125 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
127 const CNormalSum& numerator = pFraction->getNumerator();
128 CPPUNIT_ASSERT(numerator.getFractions().size() == 0);
129 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
130 CPPUNIT_ASSERT(products.size() == 1);
132 CPPUNIT_ASSERT(pProduct != NULL);
133 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
134 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
136 CPPUNIT_ASSERT(pItemPower != NULL);
137 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
140 CPPUNIT_ASSERT(pItem != NULL);
142 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
145 void test_normalform::test_item_function()
147 std::string infix(
"SIN(3.0)");
150 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
153 CPPUNIT_ASSERT(pFraction != NULL);
154 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
156 const CNormalSum& numerator = pFraction->getNumerator();
157 CPPUNIT_ASSERT(numerator.getFractions().size() == 0);
158 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
159 CPPUNIT_ASSERT(products.size() == 1);
161 CPPUNIT_ASSERT(pProduct != NULL);
162 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
163 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
165 CPPUNIT_ASSERT(pItemPower != NULL);
166 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
169 CPPUNIT_ASSERT(pFunction != NULL);
173 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
174 const CNormalSum& numerator2 = pFraction2->getNumerator();
175 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
176 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
177 CPPUNIT_ASSERT(products2.size() == 1);
178 pProduct = *(products2.begin());
179 CPPUNIT_ASSERT(pProduct != NULL);
180 CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
181 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
184 void test_normalform::test_sum_numbers()
186 std::string infix(
"7.0+3.0");
189 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
192 CPPUNIT_ASSERT(pFraction != NULL);
194 const CNormalSum& numerator = pFraction->getNumerator();
196 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
197 ProductIterator it = products.begin();
198 CPPUNIT_ASSERT(products.size() == 1);
200 CPPUNIT_ASSERT(pProduct != NULL);
201 CPPUNIT_ASSERT(pProduct->getFactor() == 10.0);
202 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
205 void test_normalform::test_sum_variables()
207 std::string infix(
"A+B");
210 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
213 CPPUNIT_ASSERT(pFraction != NULL);
215 const CNormalSum& numerator = pFraction->getNumerator();
217 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
218 CPPUNIT_ASSERT(products.size() == 2);
219 ProductIterator it = products.begin();
221 CPPUNIT_ASSERT(pProduct != NULL);
222 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
225 CPPUNIT_ASSERT(pItemPower != NULL);
226 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
229 CPPUNIT_ASSERT(pItem != NULL);
231 CPPUNIT_ASSERT(pItem->getName() ==
"A");
234 CPPUNIT_ASSERT(pProduct != NULL);
235 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
238 CPPUNIT_ASSERT(pItemPower != NULL);
239 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
241 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
242 CPPUNIT_ASSERT(pItem != NULL);
244 CPPUNIT_ASSERT(pItem->getName() ==
"B");
247 void test_normalform::test_sum_constants()
249 std::string infix(
"PI+EXPONENTIALE");
252 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
255 CPPUNIT_ASSERT(pFraction != NULL);
257 const CNormalSum& numerator = pFraction->getNumerator();
259 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
260 CPPUNIT_ASSERT(products.size() == 2);
261 ProductIterator it = products.begin();
263 CPPUNIT_ASSERT(pProduct != NULL);
264 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
267 CPPUNIT_ASSERT(pItemPower != NULL);
268 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
271 CPPUNIT_ASSERT(pItem != NULL);
273 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
276 CPPUNIT_ASSERT(pProduct != NULL);
277 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
280 CPPUNIT_ASSERT(pItemPower != NULL);
281 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
283 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
284 CPPUNIT_ASSERT(pItem != NULL);
286 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
289 void test_normalform::test_sum_functions()
291 std::string infix(
"SIN(5.0)+COS(3.0)");
294 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
297 CPPUNIT_ASSERT(pFraction != NULL);
299 const CNormalSum& numerator = pFraction->getNumerator();
301 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
302 CPPUNIT_ASSERT(products.size() == 2);
303 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
305 CPPUNIT_ASSERT(pProduct != NULL);
306 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
309 CPPUNIT_ASSERT(pItemPower != NULL);
310 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
313 CPPUNIT_ASSERT(pFunction != NULL);
317 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
318 const CNormalSum& numerator2 = pFraction2->getNumerator();
319 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
320 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
321 CPPUNIT_ASSERT(products2.size() == 1);
322 pProduct = *(products2.begin());
323 CPPUNIT_ASSERT(pProduct != NULL);
324 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
325 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
328 CPPUNIT_ASSERT(pProduct != NULL);
329 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
330 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
331 pItemPower = *(pProduct->getItemPowers().begin());
332 CPPUNIT_ASSERT(pItemPower != NULL);
333 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
335 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
336 CPPUNIT_ASSERT(pFunction != NULL);
339 pFraction2 = &pFunction->getFraction();
340 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
341 const CNormalSum& numerator3 = pFraction2->getNumerator();
342 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
343 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
344 CPPUNIT_ASSERT(products3.size() == 1);
345 pProduct = *(products3.begin());
346 CPPUNIT_ASSERT(pProduct != NULL);
347 CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
348 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
351 void test_normalform::test_sum_functions_reversed()
353 std::string infix(
"COS(3.0)+SIN(5.0)");
356 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
359 CPPUNIT_ASSERT(pFraction != NULL);
361 const CNormalSum& numerator = pFraction->getNumerator();
363 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
364 CPPUNIT_ASSERT(products.size() == 2);
365 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
367 CPPUNIT_ASSERT(pProduct != NULL);
368 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
371 CPPUNIT_ASSERT(pItemPower != NULL);
372 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
375 CPPUNIT_ASSERT(pFunction != NULL);
379 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
380 const CNormalSum& numerator2 = pFraction2->getNumerator();
381 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
382 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
383 CPPUNIT_ASSERT(products2.size() == 1);
384 pProduct = *(products2.begin());
385 CPPUNIT_ASSERT(pProduct != NULL);
386 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
387 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
390 CPPUNIT_ASSERT(pProduct != NULL);
391 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
392 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
393 pItemPower = *(pProduct->getItemPowers().begin());
394 CPPUNIT_ASSERT(pItemPower != NULL);
395 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
397 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
398 CPPUNIT_ASSERT(pFunction != NULL);
401 pFraction2 = &pFunction->getFraction();
402 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
403 const CNormalSum& numerator3 = pFraction2->getNumerator();
404 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
405 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
406 CPPUNIT_ASSERT(products3.size() == 1);
407 pProduct = *(products3.begin());
408 CPPUNIT_ASSERT(pProduct != NULL);
409 CPPUNIT_ASSERT(pProduct->getFactor() == 3.0);
410 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
413 void test_normalform::test_sum_mixed_1()
415 std::string infix(
"7.0+SIN(4.0)");
418 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
421 CPPUNIT_ASSERT(pFraction != NULL);
423 const CNormalSum& numerator = pFraction->getNumerator();
425 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
426 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
427 CPPUNIT_ASSERT(products.size() == 2);
429 CPPUNIT_ASSERT(pProduct != NULL);
430 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
431 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
433 CPPUNIT_ASSERT(pItemPower != NULL);
434 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
437 CPPUNIT_ASSERT(pFunction != NULL);
441 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
442 const CNormalSum& numerator3 = pFraction2->getNumerator();
443 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
444 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
445 CPPUNIT_ASSERT(products3.size() == 1);
446 pProduct = *(products3.begin());
447 CPPUNIT_ASSERT(pProduct != NULL);
448 CPPUNIT_ASSERT(pProduct->getFactor() == 4.0);
449 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
453 CPPUNIT_ASSERT(pProduct != NULL);
454 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
455 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
458 void test_normalform::test_sum_mixed_1_reversed()
460 std::string infix(
"SIN(4.0)+7.0");
463 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
466 CPPUNIT_ASSERT(pFraction != NULL);
468 const CNormalSum& numerator = pFraction->getNumerator();
470 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
471 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
472 CPPUNIT_ASSERT(products.size() == 2);
474 CPPUNIT_ASSERT(pProduct != NULL);
475 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
476 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
478 CPPUNIT_ASSERT(pItemPower != NULL);
479 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
482 CPPUNIT_ASSERT(pFunction != NULL);
486 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
487 const CNormalSum& numerator3 = pFraction2->getNumerator();
488 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
489 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
490 CPPUNIT_ASSERT(products3.size() == 1);
491 pProduct = *(products3.begin());
492 CPPUNIT_ASSERT(pProduct != NULL);
493 CPPUNIT_ASSERT(pProduct->getFactor() == 4.0);
494 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
498 CPPUNIT_ASSERT(pProduct != NULL);
499 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
500 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
503 void test_normalform::test_sum_mixed_2()
505 std::string infix(
"A+COS(0.0)+PI");
508 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
511 CPPUNIT_ASSERT(pFraction != NULL);
513 const CNormalSum& numerator = pFraction->getNumerator();
515 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
516 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
517 CPPUNIT_ASSERT(products.size() == 3);
519 CPPUNIT_ASSERT(pProduct != NULL);
520 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
521 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
523 CPPUNIT_ASSERT(pItemPower != NULL);
524 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
527 CPPUNIT_ASSERT(pItem != NULL);
529 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
533 CPPUNIT_ASSERT(pProduct != NULL);
534 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
535 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
536 pItemPower = *(pProduct->getItemPowers().begin());
537 CPPUNIT_ASSERT(pItemPower != NULL);
538 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
540 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
541 CPPUNIT_ASSERT(pItem != NULL);
543 CPPUNIT_ASSERT(pItem->getName() ==
"A");
547 CPPUNIT_ASSERT(pProduct != NULL);
548 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
549 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
550 pItemPower = *(pProduct->getItemPowers().begin());
551 CPPUNIT_ASSERT(pItemPower != NULL);
552 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
555 CPPUNIT_ASSERT(pFunction != NULL);
559 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
560 const CNormalSum& numerator3 = pFraction2->getNumerator();
561 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
562 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
563 CPPUNIT_ASSERT(products3.size() == 0);
566 void test_normalform::test_sum_mixed_2_reversed()
568 std::string infix(
"PI+COS(0.0)+A");
571 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
574 CPPUNIT_ASSERT(pFraction != NULL);
576 const CNormalSum& numerator = pFraction->getNumerator();
578 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
579 std::set<CNormalProduct*, compareProducts >::iterator it = products.begin();
580 CPPUNIT_ASSERT(products.size() == 3);
582 CPPUNIT_ASSERT(pProduct != NULL);
583 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
584 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
586 CPPUNIT_ASSERT(pItemPower != NULL);
587 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
590 CPPUNIT_ASSERT(pItem != NULL);
592 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
596 CPPUNIT_ASSERT(pProduct != NULL);
597 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
598 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
599 pItemPower = *(pProduct->getItemPowers().begin());
600 CPPUNIT_ASSERT(pItemPower != NULL);
601 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
603 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
604 CPPUNIT_ASSERT(pItem != NULL);
606 CPPUNIT_ASSERT(pItem->getName() ==
"A");
610 CPPUNIT_ASSERT(pProduct != NULL);
611 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
612 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
613 pItemPower = *(pProduct->getItemPowers().begin());
614 CPPUNIT_ASSERT(pItemPower != NULL);
615 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
618 CPPUNIT_ASSERT(pFunction != NULL);
622 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
623 const CNormalSum& numerator3 = pFraction2->getNumerator();
624 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
625 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
626 CPPUNIT_ASSERT(products3.size() == 0);
629 void test_normalform::test_product_numbers()
631 std::string infix(
"7.0*3.0");
634 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
637 CPPUNIT_ASSERT(pFraction != NULL);
639 const CNormalSum& numerator = pFraction->getNumerator();
641 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
642 CPPUNIT_ASSERT(products.size() == 1);
644 CPPUNIT_ASSERT(pProduct != NULL);
645 CPPUNIT_ASSERT(pProduct->getFactor() == 21.0);
646 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
649 void test_normalform::test_product_variables()
651 std::string infix(
"A*B");
654 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
657 CPPUNIT_ASSERT(pFraction != NULL);
659 const CNormalSum& numerator = pFraction->getNumerator();
661 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
662 CPPUNIT_ASSERT(products.size() == 1);
663 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
665 CPPUNIT_ASSERT(pProduct != NULL);
666 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
668 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
670 CPPUNIT_ASSERT(pItemPower != NULL);
671 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
674 CPPUNIT_ASSERT(pItem != NULL);
676 CPPUNIT_ASSERT(pItem->getName() ==
"A");
679 CPPUNIT_ASSERT(pItemPower != NULL);
680 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
683 CPPUNIT_ASSERT(pItem != NULL);
685 CPPUNIT_ASSERT(pItem->getName() ==
"B");
688 void test_normalform::test_product_variables_reversed()
690 std::string infix(
"B*A");
693 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
696 CPPUNIT_ASSERT(pFraction != NULL);
698 const CNormalSum& numerator = pFraction->getNumerator();
700 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
701 CPPUNIT_ASSERT(products.size() == 1);
702 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
704 CPPUNIT_ASSERT(pProduct != NULL);
705 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
707 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
709 CPPUNIT_ASSERT(pItemPower != NULL);
710 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
713 CPPUNIT_ASSERT(pItem != NULL);
715 CPPUNIT_ASSERT(pItem->getName() ==
"A");
718 CPPUNIT_ASSERT(pItemPower != NULL);
719 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
722 CPPUNIT_ASSERT(pItem != NULL);
724 CPPUNIT_ASSERT(pItem->getName() ==
"B");
727 void test_normalform::test_product_constants()
729 std::string infix(
"PI*EXPONENTIALE");
732 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
735 CPPUNIT_ASSERT(pFraction != NULL);
737 const CNormalSum& numerator = pFraction->getNumerator();
739 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
740 CPPUNIT_ASSERT(products.size() == 1);
741 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
743 CPPUNIT_ASSERT(pProduct != NULL);
744 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
746 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
748 CPPUNIT_ASSERT(pItemPower != NULL);
749 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
752 CPPUNIT_ASSERT(pItem != NULL);
754 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
757 CPPUNIT_ASSERT(pItemPower != NULL);
758 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
761 CPPUNIT_ASSERT(pItem != NULL);
763 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
766 void test_normalform::test_product_constants_reversed()
768 std::string infix(
"EXPONENTIALE*PI");
771 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
774 CPPUNIT_ASSERT(pFraction != NULL);
776 const CNormalSum& numerator = pFraction->getNumerator();
778 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
779 CPPUNIT_ASSERT(products.size() == 1);
780 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
782 CPPUNIT_ASSERT(pProduct != NULL);
783 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
785 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
787 CPPUNIT_ASSERT(pItemPower != NULL);
788 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
791 CPPUNIT_ASSERT(pItem != NULL);
793 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
796 CPPUNIT_ASSERT(pItemPower != NULL);
797 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
800 CPPUNIT_ASSERT(pItem != NULL);
802 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
805 void test_normalform::test_product_functions()
807 std::string infix(
"SIN(2.1)*COS(3.5)");
810 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
813 CPPUNIT_ASSERT(pFraction != NULL);
815 const CNormalSum& numerator = pFraction->getNumerator();
817 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
818 CPPUNIT_ASSERT(products.size() == 1);
819 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
821 CPPUNIT_ASSERT(pProduct != NULL);
822 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
824 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
826 CPPUNIT_ASSERT(pItemPower != NULL);
827 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
830 CPPUNIT_ASSERT(pItem != NULL);
834 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
835 const CNormalSum& numerator2 = pFraction2->getNumerator();
836 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
837 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
838 CPPUNIT_ASSERT(products2.size() == 1);
839 pProduct = *(products2.begin());
840 CPPUNIT_ASSERT(pProduct != NULL);
841 CPPUNIT_ASSERT(pProduct->getFactor() == 2.1);
842 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
845 CPPUNIT_ASSERT(pItemPower != NULL);
846 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
849 CPPUNIT_ASSERT(pItem != NULL);
853 CPPUNIT_ASSERT(pFraction3->checkDenominatorOne() ==
true);
854 const CNormalSum& numerator3 = pFraction3->getNumerator();
855 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
856 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
857 CPPUNIT_ASSERT(products3.size() == 1);
858 pProduct = *(products3.begin());
859 CPPUNIT_ASSERT(pProduct != NULL);
860 CPPUNIT_ASSERT(pProduct->getFactor() == 3.5);
861 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
864 void test_normalform::test_product_functions_reversed()
866 std::string infix(
"COS(3.5)*SIN(2.1)");
869 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
872 CPPUNIT_ASSERT(pFraction != NULL);
874 const CNormalSum& numerator = pFraction->getNumerator();
876 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
877 CPPUNIT_ASSERT(products.size() == 1);
878 std::set<CNormalProduct*, compareProducts >::const_iterator it = products.begin();
880 CPPUNIT_ASSERT(pProduct != NULL);
881 CPPUNIT_ASSERT(pProduct->
getFactor() == 1.0);
883 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it2 = pProduct->
getItemPowers().begin();
885 CPPUNIT_ASSERT(pItemPower != NULL);
886 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
889 CPPUNIT_ASSERT(pItem != NULL);
893 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
894 const CNormalSum& numerator2 = pFraction2->getNumerator();
895 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
896 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
897 CPPUNIT_ASSERT(products2.size() == 1);
898 pProduct = *(products2.begin());
899 CPPUNIT_ASSERT(pProduct != NULL);
900 CPPUNIT_ASSERT(pProduct->getFactor() == 2.1);
901 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
904 CPPUNIT_ASSERT(pItemPower != NULL);
905 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
908 CPPUNIT_ASSERT(pItem != NULL);
912 CPPUNIT_ASSERT(pFraction3->checkDenominatorOne() ==
true);
913 const CNormalSum& numerator3 = pFraction3->getNumerator();
914 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
915 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
916 CPPUNIT_ASSERT(products3.size() == 1);
917 pProduct = *(products3.begin());
918 CPPUNIT_ASSERT(pProduct != NULL);
919 CPPUNIT_ASSERT(pProduct->getFactor() == 3.5);
920 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
923 void test_normalform::test_product_mixed_1()
925 std::string infix(
"7.0*SIN(1.5)");
928 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
931 CPPUNIT_ASSERT(pFraction != NULL);
933 const CNormalSum& numerator = pFraction->getNumerator();
935 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
936 CPPUNIT_ASSERT(products.size() == 1);
938 CPPUNIT_ASSERT(pProduct != NULL);
939 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
940 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
942 CPPUNIT_ASSERT(pItemPower != NULL);
943 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
946 CPPUNIT_ASSERT(pFunction != NULL);
950 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
951 const CNormalSum& numerator2 = pFraction2->getNumerator();
952 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
953 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
954 CPPUNIT_ASSERT(products2.size() == 1);
955 pProduct = *(products2.begin());
956 CPPUNIT_ASSERT(pProduct != NULL);
957 CPPUNIT_ASSERT(pProduct->getFactor() == 1.5);
958 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
961 void test_normalform::test_product_mixed_1_reversed()
963 std::string infix(
"SIN(1.5)*7.0");
966 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
969 CPPUNIT_ASSERT(pFraction != NULL);
971 const CNormalSum& numerator = pFraction->getNumerator();
973 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
974 CPPUNIT_ASSERT(products.size() == 1);
976 CPPUNIT_ASSERT(pProduct != NULL);
977 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
978 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
980 CPPUNIT_ASSERT(pItemPower != NULL);
981 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
984 CPPUNIT_ASSERT(pFunction != NULL);
988 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
989 const CNormalSum& numerator2 = pFraction2->getNumerator();
990 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
991 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
992 CPPUNIT_ASSERT(products2.size() == 1);
993 pProduct = *(products2.begin());
994 CPPUNIT_ASSERT(pProduct != NULL);
995 CPPUNIT_ASSERT(pProduct->getFactor() == 1.5);
996 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
999 void test_normalform::test_product_mixed_2()
1001 std::string infix(
"A*COS(1.2)*7.0*PI");
1004 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1007 CPPUNIT_ASSERT(pFraction != NULL);
1009 const CNormalSum& numerator = pFraction->getNumerator();
1011 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1012 CPPUNIT_ASSERT(products.size() == 1);
1014 CPPUNIT_ASSERT(pProduct != NULL);
1015 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
1016 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
1017 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it = pProduct->getItemPowers().begin();
1020 CPPUNIT_ASSERT(pItemPower != NULL);
1021 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1024 CPPUNIT_ASSERT(pItem != NULL);
1026 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1030 CPPUNIT_ASSERT(pItemPower != NULL);
1031 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1034 CPPUNIT_ASSERT(pItem != NULL);
1036 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1040 CPPUNIT_ASSERT(pItemPower != NULL);
1041 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1044 CPPUNIT_ASSERT(pFunction != NULL);
1048 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1049 const CNormalSum& numerator2 = pFraction2->getNumerator();
1050 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
1051 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1052 CPPUNIT_ASSERT(products2.size() == 1);
1053 pProduct = *(products2.begin());
1054 CPPUNIT_ASSERT(pProduct != NULL);
1055 CPPUNIT_ASSERT(pProduct->getFactor() == 1.2);
1056 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1059 void test_normalform::test_product_mixed_2_reversed()
1061 std::string infix(
"PI*7.0*COS(1.2)*A");
1064 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1067 CPPUNIT_ASSERT(pFraction != NULL);
1069 const CNormalSum& numerator = pFraction->getNumerator();
1071 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1072 CPPUNIT_ASSERT(products.size() == 1);
1074 CPPUNIT_ASSERT(pProduct != NULL);
1075 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
1076 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 3);
1077 std::set<CNormalItemPower*, compareItemPowers>::const_iterator it = pProduct->getItemPowers().begin();
1080 CPPUNIT_ASSERT(pItemPower != NULL);
1081 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1084 CPPUNIT_ASSERT(pItem != NULL);
1086 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1090 CPPUNIT_ASSERT(pItemPower != NULL);
1091 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1094 CPPUNIT_ASSERT(pItem != NULL);
1096 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1100 CPPUNIT_ASSERT(pItemPower != NULL);
1101 CPPUNIT_ASSERT(pItemPower->
getExp() == 1.0);
1104 CPPUNIT_ASSERT(pFunction != NULL);
1108 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1109 const CNormalSum& numerator2 = pFraction2->getNumerator();
1110 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
1111 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1112 CPPUNIT_ASSERT(products2.size() == 1);
1113 pProduct = *(products2.begin());
1114 CPPUNIT_ASSERT(pProduct != NULL);
1115 CPPUNIT_ASSERT(pProduct->getFactor() == 1.2);
1116 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1119 void test_normalform::test_fraction_numbers()
1121 std::string infix(
"7.0/3.0");
1124 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1127 CPPUNIT_ASSERT(pFraction != NULL);
1128 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
1130 const CNormalSum& numerator = pFraction->getNumerator();
1131 CPPUNIT_ASSERT(numerator.getFractions().size() == 0);
1132 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1133 CPPUNIT_ASSERT(products.size() == 1);
1135 CPPUNIT_ASSERT(pProduct != NULL);
1136 double quotient = (double)7.0 / (
double)3.0;
1137 CPPUNIT_ASSERT(fabs((pProduct->getFactor() - quotient) / quotient) < 1e-15);
1138 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1141 void test_normalform::test_fraction_variables()
1143 std::string infix(
"A/B");
1146 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1149 CPPUNIT_ASSERT(pFraction != NULL);
1151 const CNormalSum& numerator = pFraction->getNumerator();
1153 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1154 CPPUNIT_ASSERT(products.size() == 1);
1156 CPPUNIT_ASSERT(pProduct != NULL);
1157 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1158 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1160 CPPUNIT_ASSERT(pItemPower != NULL);
1161 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1164 CPPUNIT_ASSERT(pItem != NULL);
1166 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1168 const CNormalSum& denominator = pFraction->getDenominator();
1169 CPPUNIT_ASSERT(denominator.getFractions().size() == 0);
1170 const std::set<CNormalProduct*, compareProducts >& products2 = denominator.
getProducts();
1171 CPPUNIT_ASSERT(products2.size() == 1);
1172 pProduct = *(products2.begin());
1173 CPPUNIT_ASSERT(pProduct != NULL);
1174 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1175 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1176 pItemPower = *(pProduct->getItemPowers().begin());
1177 CPPUNIT_ASSERT(pItemPower != NULL);
1178 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1180 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1181 CPPUNIT_ASSERT(pItem != NULL);
1183 CPPUNIT_ASSERT(pItem->getName() ==
"B");
1186 void test_normalform::test_fraction_constants()
1188 std::string infix(
"PI/EXPONENTIALE");
1191 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1194 CPPUNIT_ASSERT(pFraction != NULL);
1196 const CNormalSum& numerator = pFraction->getNumerator();
1198 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1199 CPPUNIT_ASSERT(products.size() == 1);
1201 CPPUNIT_ASSERT(pProduct != NULL);
1202 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1203 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1205 CPPUNIT_ASSERT(pItemPower != NULL);
1206 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1209 CPPUNIT_ASSERT(pItem != NULL);
1211 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1213 const CNormalSum& denominator = pFraction->getDenominator();
1214 CPPUNIT_ASSERT(denominator.getFractions().size() == 0);
1215 const std::set<CNormalProduct*, compareProducts >& products2 = denominator.
getProducts();
1216 CPPUNIT_ASSERT(products2.size() == 1);
1217 pProduct = *(products2.begin());
1218 CPPUNIT_ASSERT(pProduct != NULL);
1219 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1220 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1221 pItemPower = *(pProduct->getItemPowers().begin());
1222 CPPUNIT_ASSERT(pItemPower != NULL);
1223 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1225 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1226 CPPUNIT_ASSERT(pItem != NULL);
1228 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
1231 void test_normalform::test_fraction_functions()
1233 std::string infix(
"SIN(1.4)/COS(1.3)");
1236 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1239 CPPUNIT_ASSERT(pFraction != NULL);
1241 const CNormalSum& numerator = pFraction->getNumerator();
1243 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1244 CPPUNIT_ASSERT(products.size() == 1);
1246 CPPUNIT_ASSERT(pProduct != NULL);
1247 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1248 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1250 CPPUNIT_ASSERT(pItemPower != NULL);
1251 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1254 CPPUNIT_ASSERT(pFunction != NULL);
1258 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1259 const CNormalSum& numerator2 = pFraction2->getNumerator();
1260 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
1261 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1262 CPPUNIT_ASSERT(products2.size() == 1);
1263 pProduct = *(products2.begin());
1264 CPPUNIT_ASSERT(pProduct != NULL);
1265 CPPUNIT_ASSERT(pProduct->getFactor() == 1.4);
1266 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1268 const CNormalSum& denominator = pFraction->getDenominator();
1269 CPPUNIT_ASSERT(denominator.getFractions().size() == 0);
1270 const std::set<CNormalProduct*, compareProducts >& products3 = denominator.
getProducts();
1271 CPPUNIT_ASSERT(products3.size() == 1);
1272 pProduct = *(products3.begin());
1273 CPPUNIT_ASSERT(pProduct != NULL);
1274 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1275 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1276 pItemPower = *(pProduct->getItemPowers().begin());
1277 CPPUNIT_ASSERT(pItemPower != NULL);
1278 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1280 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
1281 CPPUNIT_ASSERT(pFunction != NULL);
1284 pFraction2 = &pFunction->getFraction();
1285 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1286 const CNormalSum& numerator3 = pFraction2->getNumerator();
1287 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
1288 const std::set<CNormalProduct*, compareProducts >& products4 = numerator3.
getProducts();
1289 CPPUNIT_ASSERT(products4.size() == 1);
1290 pProduct = *(products4.begin());
1291 CPPUNIT_ASSERT(pProduct != NULL);
1292 CPPUNIT_ASSERT(pProduct->getFactor() == 1.3);
1293 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1296 void test_normalform::test_fraction_mixed_1()
1298 std::string infix(
"7.0/A");
1301 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1304 CPPUNIT_ASSERT(pFraction != NULL);
1306 const CNormalSum& numerator = pFraction->getNumerator();
1308 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1309 CPPUNIT_ASSERT(products.size() == 1);
1311 CPPUNIT_ASSERT(pProduct != NULL);
1312 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
1313 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1315 const CNormalSum& denominator = pFraction->getDenominator();
1316 CPPUNIT_ASSERT(denominator.getFractions().size() == 0);
1317 const std::set<CNormalProduct*, compareProducts >& products2 = denominator.
getProducts();
1318 CPPUNIT_ASSERT(products2.size() == 1);
1319 pProduct = *(products2.begin());
1320 CPPUNIT_ASSERT(pProduct != NULL);
1321 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1322 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1324 CPPUNIT_ASSERT(pItemPower != NULL);
1325 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1328 CPPUNIT_ASSERT(pItem != NULL);
1330 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1333 void test_normalform::test_fraction_mixed_2()
1335 std::string infix(
"PI/TAN(A)");
1338 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1341 CPPUNIT_ASSERT(pFraction != NULL);
1343 const CNormalSum& numerator = pFraction->getNumerator();
1345 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1346 CPPUNIT_ASSERT(products.size() == 1);
1348 CPPUNIT_ASSERT(pProduct != NULL);
1349 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1350 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1352 CPPUNIT_ASSERT(pItemPower != NULL);
1353 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1356 CPPUNIT_ASSERT(pItem != NULL);
1358 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1360 const CNormalSum& denominator = pFraction->getDenominator();
1361 CPPUNIT_ASSERT(denominator.getFractions().size() == 0);
1362 const std::set<CNormalProduct*, compareProducts >& products3 = denominator.
getProducts();
1363 CPPUNIT_ASSERT(products3.size() == 1);
1364 pProduct = *(products3.begin());
1365 CPPUNIT_ASSERT(pProduct != NULL);
1366 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1367 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1368 pItemPower = *(pProduct->getItemPowers().begin());
1369 CPPUNIT_ASSERT(pItemPower != NULL);
1370 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1373 CPPUNIT_ASSERT(pFunction != NULL);
1377 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1378 const CNormalSum& numerator3 = pFraction2->getNumerator();
1379 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
1380 const std::set<CNormalProduct*, compareProducts >& products4 = numerator3.
getProducts();
1381 CPPUNIT_ASSERT(products4.size() == 1);
1382 pProduct = *(products4.begin());
1383 CPPUNIT_ASSERT(pProduct != NULL);
1384 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1385 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1386 pItemPower = *(pProduct->getItemPowers().begin());
1387 CPPUNIT_ASSERT(pItemPower != NULL);
1389 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1390 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1391 CPPUNIT_ASSERT(pItem != NULL);
1393 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1396 void test_normalform::test_itempower_numbers()
1398 std::string infix(
"4.0^3");
1401 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1404 CPPUNIT_ASSERT(pFraction != NULL);
1406 const CNormalSum& numerator = pFraction->getNumerator();
1408 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1409 CPPUNIT_ASSERT(products.size() == 1);
1411 CPPUNIT_ASSERT(pProduct != NULL);
1412 CPPUNIT_ASSERT(pProduct->getFactor() == 64.0);
1413 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1416 void test_normalform::test_itempower_variables()
1418 std::string infix(
"A^2");
1421 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1424 CPPUNIT_ASSERT(pFraction != NULL);
1426 const CNormalSum& numerator = pFraction->getNumerator();
1428 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1429 CPPUNIT_ASSERT(products.size() == 1);
1431 CPPUNIT_ASSERT(pProduct != NULL);
1432 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1433 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1435 CPPUNIT_ASSERT(pItemPower != NULL);
1436 CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
1439 CPPUNIT_ASSERT(pItem != NULL);
1441 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1444 void test_normalform::test_itempower_constants()
1446 std::string infix(
"PI^2");
1449 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1452 CPPUNIT_ASSERT(pFraction != NULL);
1454 const CNormalSum& numerator = pFraction->getNumerator();
1456 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1457 CPPUNIT_ASSERT(products.size() == 1);
1459 CPPUNIT_ASSERT(pProduct != NULL);
1460 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1461 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1463 CPPUNIT_ASSERT(pItemPower != NULL);
1464 CPPUNIT_ASSERT(pItemPower->getExp() == 2.0);
1467 CPPUNIT_ASSERT(pItem != NULL);
1469 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1472 void test_normalform::test_itempower_functions()
1474 std::string infix(
"SIN(5.5)^5");
1477 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1480 CPPUNIT_ASSERT(pFraction != NULL);
1482 const CNormalSum& numerator = pFraction->getNumerator();
1484 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1485 CPPUNIT_ASSERT(products.size() == 1);
1487 CPPUNIT_ASSERT(pProduct != NULL);
1488 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1489 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1491 CPPUNIT_ASSERT(pItemPower != NULL);
1492 CPPUNIT_ASSERT(pItemPower->getExp() == 5.0);
1495 CPPUNIT_ASSERT(pFunction != NULL);
1499 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1500 const CNormalSum& numerator2 = pFraction2->getNumerator();
1501 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
1502 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1503 CPPUNIT_ASSERT(products2.size() == 1);
1504 pProduct = *(products2.begin());
1505 CPPUNIT_ASSERT(pProduct != NULL);
1506 CPPUNIT_ASSERT(pProduct->getFactor() == 5.5);
1507 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1510 void test_normalform::test_generalpower_number_and_variable()
1512 std::string infix(
"7.0^A");
1515 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1518 CPPUNIT_ASSERT(pFraction != NULL);
1520 const CNormalSum& numerator = pFraction->getNumerator();
1522 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1523 CPPUNIT_ASSERT(products.size() == 1);
1525 CPPUNIT_ASSERT(pProduct != NULL);
1526 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1527 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1529 CPPUNIT_ASSERT(pItemPower != NULL);
1530 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1533 CPPUNIT_ASSERT(pPower != NULL);
1537 CPPUNIT_ASSERT(pFraction2 != NULL);
1538 const CNormalSum& numerator2 = pFraction2->getNumerator();
1540 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1541 CPPUNIT_ASSERT(products2.size() == 1);
1542 pProduct = *(products2.begin());
1543 CPPUNIT_ASSERT(pProduct != NULL);
1544 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
1545 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1547 pFraction2 = &pPower->getRight();
1548 CPPUNIT_ASSERT(pFraction2 != NULL);
1549 const CNormalSum& numerator3 = pFraction2->getNumerator();
1551 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1552 CPPUNIT_ASSERT(products3.size() == 1);
1553 pProduct = *(products3.begin());
1554 CPPUNIT_ASSERT(pProduct != NULL);
1555 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1556 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1557 pItemPower = *(pProduct->getItemPowers().begin());
1558 CPPUNIT_ASSERT(pItemPower != NULL);
1559 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1562 CPPUNIT_ASSERT(pItem != NULL);
1564 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1567 void test_normalform::test_generalpower_variable_and_variable()
1569 std::string infix(
"B^A");
1572 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1575 CPPUNIT_ASSERT(pFraction != NULL);
1577 const CNormalSum& numerator = pFraction->getNumerator();
1579 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1580 CPPUNIT_ASSERT(products.size() == 1);
1582 CPPUNIT_ASSERT(pProduct != NULL);
1583 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1584 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1586 CPPUNIT_ASSERT(pItemPower != NULL);
1587 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1590 CPPUNIT_ASSERT(pPower != NULL);
1594 CPPUNIT_ASSERT(pFraction2 != NULL);
1595 const CNormalSum& numerator2 = pFraction2->getNumerator();
1597 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1598 CPPUNIT_ASSERT(products2.size() == 1);
1599 pProduct = *(products2.begin());
1600 CPPUNIT_ASSERT(pProduct != NULL);
1601 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1602 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1603 pItemPower = *(pProduct->getItemPowers().begin());
1604 CPPUNIT_ASSERT(pItemPower != NULL);
1605 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1608 CPPUNIT_ASSERT(pItem != NULL);
1610 CPPUNIT_ASSERT(pItem->getName() ==
"B");
1612 pFraction2 = &pPower->getRight();
1613 CPPUNIT_ASSERT(pFraction2 != NULL);
1614 const CNormalSum& numerator3 = pFraction2->getNumerator();
1616 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1617 CPPUNIT_ASSERT(products3.size() == 1);
1618 pProduct = *(products3.begin());
1619 CPPUNIT_ASSERT(pProduct != NULL);
1620 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1621 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1622 pItemPower = *(pProduct->getItemPowers().begin());
1623 CPPUNIT_ASSERT(pItemPower != NULL);
1624 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1626 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1627 CPPUNIT_ASSERT(pItem != NULL);
1629 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1632 void test_normalform::test_generalpower_constant_and_constant()
1634 std::string infix(
"PI^EXPONENTIALE");
1637 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1640 CPPUNIT_ASSERT(pFraction != NULL);
1642 const CNormalSum& numerator = pFraction->getNumerator();
1644 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1645 CPPUNIT_ASSERT(products.size() == 1);
1647 CPPUNIT_ASSERT(pProduct != NULL);
1648 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1649 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1651 CPPUNIT_ASSERT(pItemPower != NULL);
1652 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1655 CPPUNIT_ASSERT(pPower != NULL);
1659 CPPUNIT_ASSERT(pFraction2 != NULL);
1660 const CNormalSum& numerator2 = pFraction2->getNumerator();
1662 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1663 CPPUNIT_ASSERT(products2.size() == 1);
1664 pProduct = *(products2.begin());
1665 CPPUNIT_ASSERT(pProduct != NULL);
1666 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1667 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1668 pItemPower = *(pProduct->getItemPowers().begin());
1669 CPPUNIT_ASSERT(pItemPower != NULL);
1670 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1673 CPPUNIT_ASSERT(pItem != NULL);
1675 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1677 pFraction2 = &pPower->getRight();
1678 CPPUNIT_ASSERT(pFraction2 != NULL);
1679 const CNormalSum& numerator3 = pFraction2->getNumerator();
1681 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1682 CPPUNIT_ASSERT(products3.size() == 1);
1683 pProduct = *(products3.begin());
1684 CPPUNIT_ASSERT(pProduct != NULL);
1685 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1686 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1687 pItemPower = *(pProduct->getItemPowers().begin());
1688 CPPUNIT_ASSERT(pItemPower != NULL);
1689 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1691 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1692 CPPUNIT_ASSERT(pItem != NULL);
1694 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
1697 void test_normalform::test_generalpower_function_and_function()
1699 std::string infix(
"COS(5.0)^SIN(2.0)");
1702 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1705 CPPUNIT_ASSERT(pFraction != NULL);
1707 const CNormalSum& numerator = pFraction->getNumerator();
1709 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1710 CPPUNIT_ASSERT(products.size() == 1);
1712 CPPUNIT_ASSERT(pProduct != NULL);
1713 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1714 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1716 CPPUNIT_ASSERT(pItemPower != NULL);
1717 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1720 CPPUNIT_ASSERT(pPower != NULL);
1724 CPPUNIT_ASSERT(pFraction2 != NULL);
1725 const CNormalSum& numerator2 = pFraction2->getNumerator();
1727 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1728 CPPUNIT_ASSERT(products2.size() == 1);
1729 pProduct = *(products2.begin());
1730 CPPUNIT_ASSERT(pProduct != NULL);
1731 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1732 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1733 pItemPower = *(pProduct->getItemPowers().begin());
1734 CPPUNIT_ASSERT(pItemPower != NULL);
1735 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1738 CPPUNIT_ASSERT(pFunction != NULL);
1741 pFraction2 = &pFunction->getFraction();
1742 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1743 const CNormalSum& numerator3 = pFraction2->getNumerator();
1744 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
1745 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1746 CPPUNIT_ASSERT(products3.size() == 1);
1747 pProduct = *(products3.begin());
1748 CPPUNIT_ASSERT(pProduct != NULL);
1749 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
1750 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1752 pFraction2 = &pPower->getRight();
1753 CPPUNIT_ASSERT(pFraction2 != NULL);
1754 const CNormalSum& numerator4 = pFraction2->getNumerator();
1756 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
1757 CPPUNIT_ASSERT(products4.size() == 1);
1758 pProduct = *(products4.begin());
1759 CPPUNIT_ASSERT(pProduct != NULL);
1760 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1761 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1762 pItemPower = *(pProduct->getItemPowers().begin());
1763 CPPUNIT_ASSERT(pItemPower != NULL);
1764 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1766 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
1767 CPPUNIT_ASSERT(pFunction != NULL);
1770 pFraction2 = &pFunction->getFraction();
1771 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
1772 const CNormalSum& numerator5 = pFraction2->getNumerator();
1773 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
1774 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
1775 CPPUNIT_ASSERT(products5.size() == 1);
1776 pProduct = *(products5.begin());
1777 CPPUNIT_ASSERT(pProduct != NULL);
1778 CPPUNIT_ASSERT(pProduct->getFactor() == 2.0);
1779 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1782 void test_normalform::test_generalmodulus_number_and_variable()
1784 std::string infix(
"7.0%A");
1787 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1790 CPPUNIT_ASSERT(pFraction != NULL);
1792 const CNormalSum& numerator = pFraction->getNumerator();
1794 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1795 CPPUNIT_ASSERT(products.size() == 1);
1797 CPPUNIT_ASSERT(pProduct != NULL);
1798 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1799 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1801 CPPUNIT_ASSERT(pItemPower != NULL);
1802 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1805 CPPUNIT_ASSERT(pPower != NULL);
1809 CPPUNIT_ASSERT(pFraction2 != NULL);
1810 const CNormalSum& numerator2 = pFraction2->getNumerator();
1812 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1813 CPPUNIT_ASSERT(products2.size() == 1);
1814 pProduct = *(products2.begin());
1815 CPPUNIT_ASSERT(pProduct != NULL);
1816 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
1817 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
1819 pFraction2 = &pPower->getRight();
1820 CPPUNIT_ASSERT(pFraction2 != NULL);
1821 const CNormalSum& numerator3 = pFraction2->getNumerator();
1823 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1824 CPPUNIT_ASSERT(products3.size() == 1);
1825 pProduct = *(products3.begin());
1826 CPPUNIT_ASSERT(pProduct != NULL);
1827 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1828 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1829 pItemPower = *(pProduct->getItemPowers().begin());
1830 CPPUNIT_ASSERT(pItemPower != NULL);
1831 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1834 CPPUNIT_ASSERT(pItem != NULL);
1836 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1839 void test_normalform::test_generalmodulus_variable_and_variable()
1841 std::string infix(
"B%A");
1844 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1847 CPPUNIT_ASSERT(pFraction != NULL);
1849 const CNormalSum& numerator = pFraction->getNumerator();
1851 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1852 CPPUNIT_ASSERT(products.size() == 1);
1854 CPPUNIT_ASSERT(pProduct != NULL);
1855 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1856 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1858 CPPUNIT_ASSERT(pItemPower != NULL);
1859 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1862 CPPUNIT_ASSERT(pPower != NULL);
1866 CPPUNIT_ASSERT(pFraction2 != NULL);
1867 const CNormalSum& numerator2 = pFraction2->getNumerator();
1869 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1870 CPPUNIT_ASSERT(products2.size() == 1);
1871 pProduct = *(products2.begin());
1872 CPPUNIT_ASSERT(pProduct != NULL);
1873 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1874 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1875 pItemPower = *(pProduct->getItemPowers().begin());
1876 CPPUNIT_ASSERT(pItemPower != NULL);
1877 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1880 CPPUNIT_ASSERT(pItem != NULL);
1882 CPPUNIT_ASSERT(pItem->getName() ==
"B");
1884 pFraction2 = &pPower->getRight();
1885 CPPUNIT_ASSERT(pFraction2 != NULL);
1886 const CNormalSum& numerator3 = pFraction2->getNumerator();
1888 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1889 CPPUNIT_ASSERT(products3.size() == 1);
1890 pProduct = *(products3.begin());
1891 CPPUNIT_ASSERT(pProduct != NULL);
1892 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1893 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1894 pItemPower = *(pProduct->getItemPowers().begin());
1895 CPPUNIT_ASSERT(pItemPower != NULL);
1896 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1898 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1899 CPPUNIT_ASSERT(pItem != NULL);
1901 CPPUNIT_ASSERT(pItem->getName() ==
"A");
1904 void test_normalform::test_generalmodulus_constant_and_constant()
1906 std::string infix(
"PI%EXPONENTIALE");
1909 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1912 CPPUNIT_ASSERT(pFraction != NULL);
1914 const CNormalSum& numerator = pFraction->getNumerator();
1916 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1917 CPPUNIT_ASSERT(products.size() == 1);
1919 CPPUNIT_ASSERT(pProduct != NULL);
1920 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1921 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1923 CPPUNIT_ASSERT(pItemPower != NULL);
1924 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1927 CPPUNIT_ASSERT(pPower != NULL);
1931 CPPUNIT_ASSERT(pFraction2 != NULL);
1932 const CNormalSum& numerator2 = pFraction2->getNumerator();
1934 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
1935 CPPUNIT_ASSERT(products2.size() == 1);
1936 pProduct = *(products2.begin());
1937 CPPUNIT_ASSERT(pProduct != NULL);
1938 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1939 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1940 pItemPower = *(pProduct->getItemPowers().begin());
1941 CPPUNIT_ASSERT(pItemPower != NULL);
1942 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1945 CPPUNIT_ASSERT(pItem != NULL);
1947 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
1949 pFraction2 = &pPower->getRight();
1950 CPPUNIT_ASSERT(pFraction2 != NULL);
1951 const CNormalSum& numerator3 = pFraction2->getNumerator();
1953 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
1954 CPPUNIT_ASSERT(products3.size() == 1);
1955 pProduct = *(products3.begin());
1956 CPPUNIT_ASSERT(pProduct != NULL);
1957 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1958 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1959 pItemPower = *(pProduct->getItemPowers().begin());
1960 CPPUNIT_ASSERT(pItemPower != NULL);
1961 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1963 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
1964 CPPUNIT_ASSERT(pItem != NULL);
1966 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
1969 void test_normalform::test_generalmodulus_function_and_function()
1971 std::string infix(
"COS(5.0)%SIN(2.0)");
1974 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
1977 CPPUNIT_ASSERT(pFraction != NULL);
1979 const CNormalSum& numerator = pFraction->getNumerator();
1981 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
1982 CPPUNIT_ASSERT(products.size() == 1);
1984 CPPUNIT_ASSERT(pProduct != NULL);
1985 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
1986 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
1988 CPPUNIT_ASSERT(pItemPower != NULL);
1989 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
1992 CPPUNIT_ASSERT(pPower != NULL);
1996 CPPUNIT_ASSERT(pFraction2 != NULL);
1997 const CNormalSum& numerator2 = pFraction2->getNumerator();
1999 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2000 CPPUNIT_ASSERT(products2.size() == 1);
2001 pProduct = *(products2.begin());
2002 CPPUNIT_ASSERT(pProduct != NULL);
2003 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2004 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2005 pItemPower = *(pProduct->getItemPowers().begin());
2006 CPPUNIT_ASSERT(pItemPower != NULL);
2007 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2010 CPPUNIT_ASSERT(pFunction != NULL);
2013 pFraction2 = &pFunction->getFraction();
2014 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2015 const CNormalSum& numerator3 = pFraction2->getNumerator();
2016 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
2017 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
2018 CPPUNIT_ASSERT(products3.size() == 1);
2019 pProduct = *(products3.begin());
2020 CPPUNIT_ASSERT(pProduct != NULL);
2021 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
2022 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2024 pFraction2 = &pPower->getRight();
2025 CPPUNIT_ASSERT(pFraction2 != NULL);
2026 const CNormalSum& numerator4 = pFraction2->getNumerator();
2028 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2029 CPPUNIT_ASSERT(products4.size() == 1);
2030 pProduct = *(products4.begin());
2031 CPPUNIT_ASSERT(pProduct != NULL);
2032 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2033 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2034 pItemPower = *(pProduct->getItemPowers().begin());
2035 CPPUNIT_ASSERT(pItemPower != NULL);
2036 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2038 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
2039 CPPUNIT_ASSERT(pFunction != NULL);
2042 pFraction2 = &pFunction->getFraction();
2043 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2044 const CNormalSum& numerator5 = pFraction2->getNumerator();
2045 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
2046 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
2047 CPPUNIT_ASSERT(products5.size() == 1);
2048 pProduct = *(products5.begin());
2049 CPPUNIT_ASSERT(pProduct != NULL);
2050 CPPUNIT_ASSERT(pProduct->getFactor() == 2.0);
2051 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2054 void test_normalform::test_generalpower_mixed_1()
2056 std::string infix(
"(7.0+X)^FLOOR(PI/2)");
2059 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2062 CPPUNIT_ASSERT(pFraction != NULL);
2064 const CNormalSum& numerator = pFraction->getNumerator();
2066 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2067 CPPUNIT_ASSERT(products.size() == 1);
2069 CPPUNIT_ASSERT(pProduct != NULL);
2070 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2071 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2073 CPPUNIT_ASSERT(pItemPower != NULL);
2074 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2077 CPPUNIT_ASSERT(pPower != NULL);
2081 CPPUNIT_ASSERT(pFraction2 != NULL);
2082 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2083 const CNormalSum& numerator2 = pFraction2->getNumerator();
2084 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
2085 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2086 CPPUNIT_ASSERT(products2.size() == 2);
2087 ProductIterator it = products2.begin();
2089 CPPUNIT_ASSERT(pProduct != NULL);
2090 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2091 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2092 pItemPower = *(pProduct->getItemPowers().begin());
2093 CPPUNIT_ASSERT(pItemPower != NULL);
2094 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2097 CPPUNIT_ASSERT(pItem != NULL);
2099 CPPUNIT_ASSERT(pItem->getName() ==
"X");
2102 CPPUNIT_ASSERT(pProduct != NULL);
2103 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
2104 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2106 pFraction2 = &pPower->getRight();
2107 CPPUNIT_ASSERT(pFraction2 != NULL);
2108 const CNormalSum& numerator4 = pFraction2->getNumerator();
2110 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2111 CPPUNIT_ASSERT(products4.size() == 1);
2112 pProduct = *(products4.begin());
2113 CPPUNIT_ASSERT(pProduct != NULL);
2114 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2115 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2116 pItemPower = *(pProduct->getItemPowers().begin());
2117 CPPUNIT_ASSERT(pItemPower != NULL);
2118 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2121 CPPUNIT_ASSERT(pFunction != NULL);
2124 pFraction2 = &pFunction->getFraction();
2125 CPPUNIT_ASSERT(pFraction2 != NULL);
2126 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2127 const CNormalSum& numerator5 = pFraction2->getNumerator();
2128 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
2129 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
2130 CPPUNIT_ASSERT(products5.size() == 1);
2131 pProduct = *(products5.begin());
2132 CPPUNIT_ASSERT(pProduct != NULL);
2133 CPPUNIT_ASSERT(pProduct->getFactor() == 0.5);
2134 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2135 pItemPower = *pProduct->getItemPowers().begin();
2137 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2138 CPPUNIT_ASSERT(pItem != NULL);
2140 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
2143 void test_normalform::test_generalpower_mixed_2()
2145 std::string infix(
"TAN(5.0)^A");
2148 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2151 CPPUNIT_ASSERT(pFraction != NULL);
2153 const CNormalSum& numerator = pFraction->getNumerator();
2155 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2156 CPPUNIT_ASSERT(products.size() == 1);
2158 CPPUNIT_ASSERT(pProduct != NULL);
2159 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2160 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2162 CPPUNIT_ASSERT(pItemPower != NULL);
2163 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2166 CPPUNIT_ASSERT(pPower != NULL);
2170 CPPUNIT_ASSERT(pFraction2 != NULL);
2171 const CNormalSum& numerator2 = pFraction2->getNumerator();
2173 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2174 CPPUNIT_ASSERT(products2.size() == 1);
2175 pProduct = *(products2.begin());
2176 CPPUNIT_ASSERT(pProduct != NULL);
2177 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2178 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2179 pItemPower = *(pProduct->getItemPowers().begin());
2180 CPPUNIT_ASSERT(pItemPower != NULL);
2181 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2184 CPPUNIT_ASSERT(pFunction != NULL);
2187 pFraction2 = &pFunction->getFraction();
2188 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2189 const CNormalSum& numerator3 = pFraction2->getNumerator();
2190 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
2191 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
2192 CPPUNIT_ASSERT(products3.size() == 1);
2193 pProduct = *(products3.begin());
2194 CPPUNIT_ASSERT(pProduct != NULL);
2195 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
2196 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2198 pFraction2 = &pPower->getRight();
2199 CPPUNIT_ASSERT(pFraction2 != NULL);
2200 const CNormalSum& numerator4 = pFraction2->getNumerator();
2202 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2203 CPPUNIT_ASSERT(products4.size() == 1);
2204 pProduct = *(products4.begin());
2205 CPPUNIT_ASSERT(pProduct != NULL);
2206 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2207 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2208 pItemPower = *(pProduct->getItemPowers().begin());
2209 CPPUNIT_ASSERT(pItemPower != NULL);
2210 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2213 CPPUNIT_ASSERT(pItem != NULL);
2215 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2218 void test_normalform::test_generalpower_mixed_3()
2220 std::string infix(
"A^CEIL(PI)");
2223 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2226 CPPUNIT_ASSERT(pFraction != NULL);
2228 const CNormalSum& numerator = pFraction->getNumerator();
2230 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2231 CPPUNIT_ASSERT(products.size() == 1);
2233 CPPUNIT_ASSERT(pProduct != NULL);
2234 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2235 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2237 CPPUNIT_ASSERT(pItemPower != NULL);
2238 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2241 CPPUNIT_ASSERT(pPower != NULL);
2245 CPPUNIT_ASSERT(pFraction2 != NULL);
2246 const CNormalSum& numerator2 = pFraction2->getNumerator();
2248 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2249 CPPUNIT_ASSERT(products2.size() == 1);
2250 pProduct = *(products2.begin());
2251 CPPUNIT_ASSERT(pProduct != NULL);
2252 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2253 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2254 pItemPower = *(pProduct->getItemPowers().begin());
2255 CPPUNIT_ASSERT(pItemPower != NULL);
2256 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2259 CPPUNIT_ASSERT(pItem != NULL);
2261 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2263 pFraction2 = &pPower->getRight();
2264 CPPUNIT_ASSERT(pFraction2 != NULL);
2265 const CNormalSum& numerator4 = pFraction2->getNumerator();
2267 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2268 CPPUNIT_ASSERT(products4.size() == 1);
2269 pProduct = *(products4.begin());
2270 CPPUNIT_ASSERT(pProduct != NULL);
2271 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2272 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2273 pItemPower = *(pProduct->getItemPowers().begin());
2274 CPPUNIT_ASSERT(pItemPower != NULL);
2275 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2278 CPPUNIT_ASSERT(pFunction != NULL);
2281 pFraction2 = &pFunction->getFraction();
2282 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2283 const CNormalSum& numerator5 = pFraction2->getNumerator();
2284 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
2285 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
2286 CPPUNIT_ASSERT(products5.size() == 1);
2287 pProduct = *(products5.begin());
2288 CPPUNIT_ASSERT(pProduct != NULL);
2289 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2290 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2291 pItemPower = *pProduct->getItemPowers().begin();
2293 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2294 CPPUNIT_ASSERT(pItem != NULL);
2296 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
2299 void test_normalform::test_generalpower_mixed_4()
2301 std::string infix(
"EXPONENTIALE^A");
2304 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2307 CPPUNIT_ASSERT(pFraction != NULL);
2309 const CNormalSum& numerator = pFraction->getNumerator();
2311 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2312 CPPUNIT_ASSERT(products.size() == 1);
2314 CPPUNIT_ASSERT(pProduct != NULL);
2315 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2316 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2318 CPPUNIT_ASSERT(pItemPower != NULL);
2319 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2322 CPPUNIT_ASSERT(pPower != NULL);
2326 CPPUNIT_ASSERT(pFraction2 != NULL);
2327 const CNormalSum& numerator2 = pFraction2->getNumerator();
2329 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2330 CPPUNIT_ASSERT(products2.size() == 1);
2331 pProduct = *(products2.begin());
2332 CPPUNIT_ASSERT(pProduct != NULL);
2333 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2334 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2335 pItemPower = *(pProduct->getItemPowers().begin());
2336 CPPUNIT_ASSERT(pItemPower != NULL);
2337 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2340 CPPUNIT_ASSERT(pItem != NULL);
2342 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
2344 pFraction2 = &pPower->getRight();
2345 CPPUNIT_ASSERT(pFraction2 != NULL);
2346 const CNormalSum& numerator3 = pFraction2->getNumerator();
2348 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
2349 CPPUNIT_ASSERT(products3.size() == 1);
2350 pProduct = *(products3.begin());
2351 CPPUNIT_ASSERT(pProduct != NULL);
2352 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2353 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2354 pItemPower = *(pProduct->getItemPowers().begin());
2355 CPPUNIT_ASSERT(pItemPower != NULL);
2356 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2358 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2359 CPPUNIT_ASSERT(pItem != NULL);
2361 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2364 void test_normalform::test_generalmodulus_mixed_1()
2366 std::string infix(
"(7.0+X)%FLOOR(PI/2)");
2369 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2372 CPPUNIT_ASSERT(pFraction != NULL);
2374 const CNormalSum& numerator = pFraction->getNumerator();
2376 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2377 CPPUNIT_ASSERT(products.size() == 1);
2379 CPPUNIT_ASSERT(pProduct != NULL);
2380 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2381 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2383 CPPUNIT_ASSERT(pItemPower != NULL);
2384 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2387 CPPUNIT_ASSERT(pPower != NULL);
2391 CPPUNIT_ASSERT(pFraction2 != NULL);
2392 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2393 const CNormalSum& numerator2 = pFraction2->getNumerator();
2394 CPPUNIT_ASSERT(numerator2.getFractions().size() == 0);
2395 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2396 CPPUNIT_ASSERT(products2.size() == 2);
2397 ProductIterator it = products2.begin();
2399 CPPUNIT_ASSERT(pProduct != NULL);
2400 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2401 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2402 pItemPower = *(pProduct->getItemPowers().begin());
2403 CPPUNIT_ASSERT(pItemPower != NULL);
2404 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2407 CPPUNIT_ASSERT(pItem != NULL);
2409 CPPUNIT_ASSERT(pItem->getName() ==
"X");
2412 CPPUNIT_ASSERT(pProduct != NULL);
2413 CPPUNIT_ASSERT(pProduct->getFactor() == 7.0);
2414 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2416 pFraction2 = &pPower->getRight();
2417 CPPUNIT_ASSERT(pFraction2 != NULL);
2418 const CNormalSum& numerator4 = pFraction2->getNumerator();
2420 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2421 CPPUNIT_ASSERT(products4.size() == 1);
2422 pProduct = *(products4.begin());
2423 CPPUNIT_ASSERT(pProduct != NULL);
2424 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2425 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2426 pItemPower = *(pProduct->getItemPowers().begin());
2427 CPPUNIT_ASSERT(pItemPower != NULL);
2428 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2431 CPPUNIT_ASSERT(pFunction != NULL);
2434 pFraction2 = &pFunction->getFraction();
2435 CPPUNIT_ASSERT(pFraction2 != NULL);
2436 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2437 const CNormalSum& numerator5 = pFraction2->getNumerator();
2438 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
2439 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
2440 CPPUNIT_ASSERT(products5.size() == 1);
2441 pProduct = *(products5.begin());
2442 CPPUNIT_ASSERT(pProduct != NULL);
2443 CPPUNIT_ASSERT(pProduct->getFactor() == 0.5);
2444 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2445 pItemPower = *pProduct->getItemPowers().begin();
2447 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2448 CPPUNIT_ASSERT(pItem != NULL);
2450 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
2453 void test_normalform::test_generalmodulus_mixed_2()
2455 std::string infix(
"TAN(5.0)%A");
2458 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2461 CPPUNIT_ASSERT(pFraction != NULL);
2463 const CNormalSum& numerator = pFraction->getNumerator();
2465 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2466 CPPUNIT_ASSERT(products.size() == 1);
2468 CPPUNIT_ASSERT(pProduct != NULL);
2469 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2470 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2472 CPPUNIT_ASSERT(pItemPower != NULL);
2473 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2476 CPPUNIT_ASSERT(pPower != NULL);
2480 CPPUNIT_ASSERT(pFraction2 != NULL);
2481 const CNormalSum& numerator2 = pFraction2->getNumerator();
2483 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2484 CPPUNIT_ASSERT(products2.size() == 1);
2485 pProduct = *(products2.begin());
2486 CPPUNIT_ASSERT(pProduct != NULL);
2487 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2488 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2489 pItemPower = *(pProduct->getItemPowers().begin());
2490 CPPUNIT_ASSERT(pItemPower != NULL);
2491 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2494 CPPUNIT_ASSERT(pFunction != NULL);
2497 pFraction2 = &pFunction->getFraction();
2498 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2499 const CNormalSum& numerator3 = pFraction2->getNumerator();
2500 CPPUNIT_ASSERT(numerator3.getFractions().size() == 0);
2501 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
2502 CPPUNIT_ASSERT(products3.size() == 1);
2503 pProduct = *(products3.begin());
2504 CPPUNIT_ASSERT(pProduct != NULL);
2505 CPPUNIT_ASSERT(pProduct->getFactor() == 5.0);
2506 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2508 pFraction2 = &pPower->getRight();
2509 CPPUNIT_ASSERT(pFraction2 != NULL);
2510 const CNormalSum& numerator4 = pFraction2->getNumerator();
2512 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2513 CPPUNIT_ASSERT(products4.size() == 1);
2514 pProduct = *(products4.begin());
2515 CPPUNIT_ASSERT(pProduct != NULL);
2516 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2517 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2518 pItemPower = *(pProduct->getItemPowers().begin());
2519 CPPUNIT_ASSERT(pItemPower != NULL);
2520 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2523 CPPUNIT_ASSERT(pItem != NULL);
2525 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2528 void test_normalform::test_generalmodulus_mixed_3()
2530 std::string infix(
"A%CEIL(PI)");
2533 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2536 CPPUNIT_ASSERT(pFraction != NULL);
2538 const CNormalSum& numerator = pFraction->getNumerator();
2540 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2541 CPPUNIT_ASSERT(products.size() == 1);
2543 CPPUNIT_ASSERT(pProduct != NULL);
2544 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2545 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2547 CPPUNIT_ASSERT(pItemPower != NULL);
2548 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2551 CPPUNIT_ASSERT(pPower != NULL);
2555 CPPUNIT_ASSERT(pFraction2 != NULL);
2556 const CNormalSum& numerator2 = pFraction2->getNumerator();
2558 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2559 CPPUNIT_ASSERT(products2.size() == 1);
2560 pProduct = *(products2.begin());
2561 CPPUNIT_ASSERT(pProduct != NULL);
2562 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2563 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2564 pItemPower = *(pProduct->getItemPowers().begin());
2565 CPPUNIT_ASSERT(pItemPower != NULL);
2566 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2569 CPPUNIT_ASSERT(pItem != NULL);
2571 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2573 pFraction2 = &pPower->getRight();
2574 CPPUNIT_ASSERT(pFraction2 != NULL);
2575 const CNormalSum& numerator4 = pFraction2->getNumerator();
2577 const std::set<CNormalProduct*, compareProducts >& products4 = numerator4.
getProducts();
2578 CPPUNIT_ASSERT(products4.size() == 1);
2579 pProduct = *(products4.begin());
2580 CPPUNIT_ASSERT(pProduct != NULL);
2581 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2582 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2583 pItemPower = *(pProduct->getItemPowers().begin());
2584 CPPUNIT_ASSERT(pItemPower != NULL);
2585 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2588 CPPUNIT_ASSERT(pFunction != NULL);
2591 pFraction2 = &pFunction->getFraction();
2592 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2593 const CNormalSum& numerator5 = pFraction2->getNumerator();
2594 CPPUNIT_ASSERT(numerator5.getFractions().size() == 0);
2595 const std::set<CNormalProduct*, compareProducts >& products5 = numerator5.
getProducts();
2596 CPPUNIT_ASSERT(products5.size() == 1);
2597 pProduct = *(products5.begin());
2598 CPPUNIT_ASSERT(pProduct != NULL);
2599 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2600 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2601 pItemPower = *pProduct->getItemPowers().begin();
2603 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2604 CPPUNIT_ASSERT(pItem != NULL);
2606 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
2609 void test_normalform::test_generalmodulus_mixed_4()
2611 std::string infix(
"EXPONENTIALE%A");
2614 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2617 CPPUNIT_ASSERT(pFraction != NULL);
2619 const CNormalSum& numerator = pFraction->getNumerator();
2621 const std::set<CNormalProduct*, compareProducts >& products = numerator.
getProducts();
2622 CPPUNIT_ASSERT(products.size() == 1);
2624 CPPUNIT_ASSERT(pProduct != NULL);
2625 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2626 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2628 CPPUNIT_ASSERT(pItemPower != NULL);
2629 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2632 CPPUNIT_ASSERT(pPower != NULL);
2636 CPPUNIT_ASSERT(pFraction2 != NULL);
2637 const CNormalSum& numerator2 = pFraction2->getNumerator();
2639 const std::set<CNormalProduct*, compareProducts >& products2 = numerator2.
getProducts();
2640 CPPUNIT_ASSERT(products2.size() == 1);
2641 pProduct = *(products2.begin());
2642 CPPUNIT_ASSERT(pProduct != NULL);
2643 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2644 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2645 pItemPower = *(pProduct->getItemPowers().begin());
2646 CPPUNIT_ASSERT(pItemPower != NULL);
2647 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2650 CPPUNIT_ASSERT(pItem != NULL);
2652 CPPUNIT_ASSERT(pItem->getName() ==
"EXPONENTIALE");
2654 pFraction2 = &pPower->getRight();
2655 CPPUNIT_ASSERT(pFraction2 != NULL);
2656 const CNormalSum& numerator3 = pFraction2->getNumerator();
2658 const std::set<CNormalProduct*, compareProducts >& products3 = numerator3.
getProducts();
2659 CPPUNIT_ASSERT(products3.size() == 1);
2660 pProduct = *(products3.begin());
2661 CPPUNIT_ASSERT(pProduct != NULL);
2662 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2663 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2664 pItemPower = *(pProduct->getItemPowers().begin());
2665 CPPUNIT_ASSERT(pItemPower != NULL);
2666 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2668 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2669 CPPUNIT_ASSERT(pItem != NULL);
2671 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2674 void test_normalform::test_simple_stepwise_numbers()
2676 std::string infix(
"IF(TRUE,2.3,4.5)");
2679 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2682 CPPUNIT_ASSERT(pFraction != NULL);
2683 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
2685 const CNormalSum* numerator = &pFraction->getNumerator();
2686 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2687 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
2688 CPPUNIT_ASSERT(products->size() == 1);
2690 CPPUNIT_ASSERT(pProduct != NULL);
2691 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2692 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2694 CPPUNIT_ASSERT(pItemPower != NULL);
2695 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2698 CPPUNIT_ASSERT(pChoice != NULL);
2702 CPPUNIT_ASSERT(pLogical != NULL);
2703 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
2704 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
2705 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
2706 std::pair<CNormalLogical::ItemSet, bool> outerpair = *(pLogical->
getAndSets().begin());
2707 CPPUNIT_ASSERT(outerpair.second ==
false);
2708 CPPUNIT_ASSERT(outerpair.first.size() == 1);
2709 std::pair<CNormalLogicalItem*, bool> innerpair = *(outerpair.first.begin());
2710 CPPUNIT_ASSERT(innerpair.second ==
false);
2712 CPPUNIT_ASSERT(pLogicalItem != NULL);
2714 pItemPower = *(pProduct->getItemPowers().begin());
2715 CPPUNIT_ASSERT(pItemPower != NULL);
2716 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2721 CPPUNIT_ASSERT(pFraction2 != NULL);
2722 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2723 numerator = &pFraction2->getNumerator();
2724 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2725 products = &numerator->getProducts();
2726 CPPUNIT_ASSERT(products->size() == 1);
2727 pProduct = *(products->begin());
2728 CPPUNIT_ASSERT(pProduct != NULL);
2729 CPPUNIT_ASSERT(pProduct->getFactor() == 2.3);
2730 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2733 pFraction2 = &pChoice->getFalseExpression();
2734 CPPUNIT_ASSERT(pFraction2 != NULL);
2735 numerator = &pFraction2->getNumerator();
2736 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2737 products = &numerator->getProducts();
2738 CPPUNIT_ASSERT(products->size() == 1);
2739 pProduct = *(products->begin());
2740 CPPUNIT_ASSERT(pProduct != NULL);
2741 CPPUNIT_ASSERT(pProduct->getFactor() == 4.5);
2742 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2745 void test_normalform::test_simple_stepwise_fractions()
2747 std::string infix(
"IF(TRUE,A/TAN(X)^R,SIN(PI)/A^6)");
2750 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2753 CPPUNIT_ASSERT(pFraction != NULL);
2754 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
2756 const CNormalSum* numerator = &pFraction->getNumerator();
2757 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2758 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
2759 CPPUNIT_ASSERT(products->size() == 1);
2761 CPPUNIT_ASSERT(pProduct != NULL);
2762 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2763 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2765 CPPUNIT_ASSERT(pItemPower != NULL);
2766 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2769 CPPUNIT_ASSERT(pChoice != NULL);
2773 CPPUNIT_ASSERT(pLogical != NULL);
2774 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
2775 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
2776 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
2777 std::pair<CNormalLogical::ItemSet, bool> outerpair = *(pLogical->
getAndSets().begin());
2778 CPPUNIT_ASSERT(outerpair.second ==
false);
2779 CPPUNIT_ASSERT(outerpair.first.size() == 1);
2780 std::pair<CNormalLogicalItem*, bool> innerpair = *(outerpair.first.begin());
2781 CPPUNIT_ASSERT(innerpair.second ==
false);
2783 CPPUNIT_ASSERT(pLogicalItem != NULL);
2788 CPPUNIT_ASSERT(pFraction2 != NULL);
2789 numerator = &pFraction2->getNumerator();
2790 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2791 products = &numerator->getProducts();
2792 CPPUNIT_ASSERT(products->size() == 1);
2793 pProduct = *(products->begin());
2794 CPPUNIT_ASSERT(pProduct != NULL);
2795 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2796 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2797 pItemPower = *(pProduct->getItemPowers().begin());
2798 CPPUNIT_ASSERT(pItemPower != NULL);
2799 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2802 CPPUNIT_ASSERT(pItem != NULL);
2804 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2805 const CNormalSum* denominator = &pFraction2->getDenominator();
2806 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
2808 CPPUNIT_ASSERT(products->size() == 1);
2809 pProduct = *(products->begin());
2810 CPPUNIT_ASSERT(pProduct != NULL);
2811 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2812 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2813 pItemPower = *(pProduct->getItemPowers().begin());
2814 CPPUNIT_ASSERT(pItemPower != NULL);
2815 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2818 CPPUNIT_ASSERT(pGeneralPower != NULL);
2820 pFraction2 = &pGeneralPower->getLeft();
2821 CPPUNIT_ASSERT(pFraction2 != NULL);
2822 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2823 numerator = &pFraction2->getNumerator();
2824 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2825 products = &numerator->getProducts();
2826 CPPUNIT_ASSERT(products->size() == 1);
2827 pProduct = *(products->begin());
2828 CPPUNIT_ASSERT(pProduct != NULL);
2829 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2830 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2831 pItemPower = *(pProduct->getItemPowers().begin());
2832 CPPUNIT_ASSERT(pItemPower != NULL);
2833 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2836 CPPUNIT_ASSERT(pFunction != NULL);
2838 pFraction2 = &pFunction->getFraction();
2839 CPPUNIT_ASSERT(pFraction2 != NULL);
2840 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2841 numerator = &pFraction2->getNumerator();
2842 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2843 products = &numerator->getProducts();
2844 CPPUNIT_ASSERT(products->size() == 1);
2845 pProduct = *(products->begin());
2846 CPPUNIT_ASSERT(pProduct != NULL);
2847 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2848 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2849 pItemPower = *(pProduct->getItemPowers().begin());
2850 CPPUNIT_ASSERT(pItemPower != NULL);
2851 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2853 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2854 CPPUNIT_ASSERT(pItem != NULL);
2856 CPPUNIT_ASSERT(pItem->getName() ==
"X");
2857 pFraction2 = &pGeneralPower->getRight();
2858 CPPUNIT_ASSERT(pFraction2 != NULL);
2859 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2860 numerator = &pFraction2->getNumerator();
2861 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2862 products = &numerator->getProducts();
2863 CPPUNIT_ASSERT(products->size() == 1);
2864 pProduct = *(products->begin());
2865 CPPUNIT_ASSERT(pProduct != NULL);
2866 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2867 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2868 pItemPower = *(pProduct->getItemPowers().begin());
2869 CPPUNIT_ASSERT(pItemPower != NULL);
2870 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2872 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2873 CPPUNIT_ASSERT(pItem != NULL);
2875 CPPUNIT_ASSERT(pItem->getName() ==
"R");
2878 pFraction2 = &pChoice->getFalseExpression();
2879 CPPUNIT_ASSERT(pFraction2 != NULL);
2880 numerator = &pFraction2->getNumerator();
2881 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2882 products = &numerator->getProducts();
2883 CPPUNIT_ASSERT(products->size() == 1);
2884 pProduct = *(products->begin());
2885 CPPUNIT_ASSERT(pProduct != NULL);
2886 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2887 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2888 pItemPower = *(pProduct->getItemPowers().begin());
2889 CPPUNIT_ASSERT(pItemPower != NULL);
2890 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2892 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
2893 CPPUNIT_ASSERT(pFunction != NULL);
2895 pFraction2 = &pFunction->getFraction();
2896 CPPUNIT_ASSERT(pFraction2 != NULL);
2897 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2898 numerator = &pFraction2->getNumerator();
2899 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2900 products = &numerator->getProducts();
2901 CPPUNIT_ASSERT(products->size() == 1);
2902 pProduct = *(products->begin());
2903 CPPUNIT_ASSERT(pProduct != NULL);
2904 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2905 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2906 pItemPower = *(pProduct->getItemPowers().begin());
2907 CPPUNIT_ASSERT(pItemPower != NULL);
2908 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2910 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2911 CPPUNIT_ASSERT(pItem != NULL);
2913 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
2917 pFraction2 = &pChoice->getFalseExpression();
2918 denominator = &pFraction2->getDenominator();
2919 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
2920 products = &denominator->getProducts();
2921 CPPUNIT_ASSERT(products->size() == 1);
2922 pProduct = *(products->begin());
2923 CPPUNIT_ASSERT(pProduct != NULL);
2924 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2925 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2926 pItemPower = *(pProduct->getItemPowers().begin());
2927 CPPUNIT_ASSERT(pItemPower != NULL);
2928 CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
2930 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
2931 CPPUNIT_ASSERT(pItem != NULL);
2933 CPPUNIT_ASSERT(pItem->getName() ==
"A");
2936 void test_normalform::test_simple_nested_stepwise_numbers()
2938 std::string infix(
"IF(IF(IF(TRUE,FALSE,TRUE),IF(FALSE,TRUE,FALSE),IF(FALSE,FALSE,FALSE)),2.3,4.5)");
2941 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
2944 CPPUNIT_ASSERT(pFraction != NULL);
2945 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
2947 const CNormalSum* numerator = &pFraction->getNumerator();
2948 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2949 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
2950 CPPUNIT_ASSERT(products->size() == 1);
2952 CPPUNIT_ASSERT(pProduct != NULL);
2953 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
2954 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
2956 CPPUNIT_ASSERT(pItemPower != NULL);
2957 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
2960 CPPUNIT_ASSERT(pChoice != NULL);
2964 CPPUNIT_ASSERT(pLogical != NULL);
2965 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
2966 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
2967 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
2968 std::pair<CNormalLogical::ItemSet, bool> outerpair = *(pLogical->
getAndSets().begin());
2969 CPPUNIT_ASSERT(outerpair.second ==
false);
2970 CPPUNIT_ASSERT(outerpair.first.size() == 1);
2971 std::pair<CNormalLogicalItem*, bool> innerpair = *(outerpair.first.begin());
2972 CPPUNIT_ASSERT(innerpair.second ==
false);
2974 CPPUNIT_ASSERT(pLogicalItem != NULL);
2979 CPPUNIT_ASSERT(pFraction2 != NULL);
2980 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
2981 numerator = &pFraction2->getNumerator();
2982 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2983 products = &numerator->getProducts();
2984 CPPUNIT_ASSERT(products->size() == 1);
2985 pProduct = *(products->begin());
2986 CPPUNIT_ASSERT(pProduct != NULL);
2987 CPPUNIT_ASSERT(pProduct->getFactor() == 2.3);
2988 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
2991 pFraction2 = &pChoice->getFalseExpression();
2992 CPPUNIT_ASSERT(pFraction2 != NULL);
2993 numerator = &pFraction2->getNumerator();
2994 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
2995 products = &numerator->getProducts();
2996 CPPUNIT_ASSERT(products->size() == 1);
2997 pProduct = *(products->begin());
2998 CPPUNIT_ASSERT(pProduct != NULL);
2999 CPPUNIT_ASSERT(pProduct->getFactor() == 4.5);
3000 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3003 void test_normalform::test_simple_nested_stepwise_fractions()
3005 std::string infix(
"IF(IF(IF(TRUE,FALSE,TRUE),IF(FALSE,TRUE,FALSE),IF(FALSE,FALSE,FALSE)),A/TAN(X)^R,SIN(PI)/A^6)");
3008 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
3011 CPPUNIT_ASSERT(pFraction != NULL);
3012 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
3014 const CNormalSum* numerator = &pFraction->getNumerator();
3015 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3016 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
3017 CPPUNIT_ASSERT(products->size() == 1);
3019 CPPUNIT_ASSERT(pProduct != NULL);
3020 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3021 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3023 CPPUNIT_ASSERT(pItemPower != NULL);
3024 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3027 CPPUNIT_ASSERT(pChoice != NULL);
3031 CPPUNIT_ASSERT(pLogical != NULL);
3032 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
3033 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
3034 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
3035 std::pair<CNormalLogical::ItemSet, bool> outerpair = *(pLogical->
getAndSets().begin());
3036 CPPUNIT_ASSERT(outerpair.second ==
false);
3037 CPPUNIT_ASSERT(outerpair.first.size() == 1);
3038 std::pair<CNormalLogicalItem*, bool> innerpair = *(outerpair.first.begin());
3039 CPPUNIT_ASSERT(innerpair.second ==
false);
3041 CPPUNIT_ASSERT(pLogicalItem != NULL);
3046 CPPUNIT_ASSERT(pFraction2 != NULL);
3047 numerator = &pFraction2->getNumerator();
3048 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3049 products = &numerator->getProducts();
3050 CPPUNIT_ASSERT(products->size() == 1);
3051 pProduct = *(products->begin());
3052 CPPUNIT_ASSERT(pProduct != NULL);
3053 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3054 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3055 pItemPower = *(pProduct->getItemPowers().begin());
3056 CPPUNIT_ASSERT(pItemPower != NULL);
3057 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3060 CPPUNIT_ASSERT(pItem != NULL);
3062 CPPUNIT_ASSERT(pItem->getName() ==
"A");
3063 const CNormalSum* denominator = &pFraction2->getDenominator();
3064 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
3066 CPPUNIT_ASSERT(products->size() == 1);
3067 pProduct = *(products->begin());
3068 CPPUNIT_ASSERT(pProduct != NULL);
3069 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3070 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3071 pItemPower = *(pProduct->getItemPowers().begin());
3072 CPPUNIT_ASSERT(pItemPower != NULL);
3073 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3076 CPPUNIT_ASSERT(pGeneralPower != NULL);
3078 pFraction2 = &pGeneralPower->getLeft();
3079 CPPUNIT_ASSERT(pFraction2 != NULL);
3080 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
3081 numerator = &pFraction2->getNumerator();
3082 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3083 products = &numerator->getProducts();
3084 CPPUNIT_ASSERT(products->size() == 1);
3085 pProduct = *(products->begin());
3086 CPPUNIT_ASSERT(pProduct != NULL);
3087 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3088 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3089 pItemPower = *(pProduct->getItemPowers().begin());
3090 CPPUNIT_ASSERT(pItemPower != NULL);
3091 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3094 CPPUNIT_ASSERT(pFunction != NULL);
3096 pFraction2 = &pFunction->getFraction();
3097 CPPUNIT_ASSERT(pFraction2 != NULL);
3098 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
3099 numerator = &pFraction2->getNumerator();
3100 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3101 products = &numerator->getProducts();
3102 CPPUNIT_ASSERT(products->size() == 1);
3103 pProduct = *(products->begin());
3104 CPPUNIT_ASSERT(pProduct != NULL);
3105 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3106 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3107 pItemPower = *(pProduct->getItemPowers().begin());
3108 CPPUNIT_ASSERT(pItemPower != NULL);
3109 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3111 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
3112 CPPUNIT_ASSERT(pItem != NULL);
3114 CPPUNIT_ASSERT(pItem->getName() ==
"X");
3115 pFraction2 = &pGeneralPower->getRight();
3116 CPPUNIT_ASSERT(pFraction2 != NULL);
3117 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
3118 numerator = &pFraction2->getNumerator();
3119 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3120 products = &numerator->getProducts();
3121 CPPUNIT_ASSERT(products->size() == 1);
3122 pProduct = *(products->begin());
3123 CPPUNIT_ASSERT(pProduct != NULL);
3124 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3125 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3126 pItemPower = *(pProduct->getItemPowers().begin());
3127 CPPUNIT_ASSERT(pItemPower != NULL);
3128 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3130 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
3131 CPPUNIT_ASSERT(pItem != NULL);
3133 CPPUNIT_ASSERT(pItem->getName() ==
"R");
3136 pFraction2 = &pChoice->getFalseExpression();
3137 CPPUNIT_ASSERT(pFraction2 != NULL);
3138 numerator = &pFraction2->getNumerator();
3139 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3140 products = &numerator->getProducts();
3141 CPPUNIT_ASSERT(products->size() == 1);
3142 pProduct = *(products->begin());
3143 CPPUNIT_ASSERT(pProduct != NULL);
3144 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3145 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3146 pItemPower = *(pProduct->getItemPowers().begin());
3147 CPPUNIT_ASSERT(pItemPower != NULL);
3148 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3150 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
3151 CPPUNIT_ASSERT(pFunction != NULL);
3153 pFraction2 = &pFunction->getFraction();
3154 CPPUNIT_ASSERT(pFraction2 != NULL);
3155 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
3156 numerator = &pFraction2->getNumerator();
3157 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3158 products = &numerator->getProducts();
3159 CPPUNIT_ASSERT(products->size() == 1);
3160 pProduct = *(products->begin());
3161 CPPUNIT_ASSERT(pProduct != NULL);
3162 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3163 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3164 pItemPower = *(pProduct->getItemPowers().begin());
3165 CPPUNIT_ASSERT(pItemPower != NULL);
3166 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3168 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
3169 CPPUNIT_ASSERT(pItem != NULL);
3171 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
3175 pFraction2 = &pChoice->getFalseExpression();
3176 denominator = &pFraction2->getDenominator();
3177 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
3178 products = &denominator->getProducts();
3179 CPPUNIT_ASSERT(products->size() == 1);
3180 pProduct = *(products->begin());
3181 CPPUNIT_ASSERT(pProduct != NULL);
3182 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3183 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3184 pItemPower = *(pProduct->getItemPowers().begin());
3185 CPPUNIT_ASSERT(pItemPower != NULL);
3186 CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
3188 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
3189 CPPUNIT_ASSERT(pItem != NULL);
3191 CPPUNIT_ASSERT(pItem->getName() ==
"A");
3194 void test_normalform::test_nested_stepwise_numbers_2levels_1()
3196 std::string infix(
"IF(IF(A gt PI,FALSE,4.0 ne A),2.3,4.5)");
3199 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
3202 CPPUNIT_ASSERT(pFraction != NULL);
3203 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
3205 const CNormalSum* numerator = &pFraction->getNumerator();
3206 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3207 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
3208 CPPUNIT_ASSERT(products->size() == 1);
3210 CPPUNIT_ASSERT(pProduct != NULL);
3211 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3212 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3214 CPPUNIT_ASSERT(pItemPower != NULL);
3215 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3218 CPPUNIT_ASSERT(pChoice != NULL);
3222 CPPUNIT_ASSERT(pLogical != NULL);
3223 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
3224 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
3225 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
3227 CNormalLogical::ItemSetOfSets::const_iterator outerIt = pLogical->
getAndSets().begin();
3228 CPPUNIT_ASSERT(outerIt->second ==
false);
3229 CPPUNIT_ASSERT(outerIt->first.size() == 2);
3230 CNormalLogical::ItemSet::const_iterator innerIt = outerIt->first.begin();
3231 CPPUNIT_ASSERT(innerIt->second ==
false);
3233 CPPUNIT_ASSERT(check_LogicalItemB(pLogicalItem) ==
true);
3236 CPPUNIT_ASSERT(innerIt->second ==
false);
3237 pLogicalItem = innerIt->first;
3238 CPPUNIT_ASSERT(check_LogicalItemNotA(pLogicalItem) ==
true);
3242 CPPUNIT_ASSERT(pFraction2 != NULL);
3245 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3247 CPPUNIT_ASSERT(products->size() == 1);
3248 pProduct = *(products->begin());
3249 CPPUNIT_ASSERT(pProduct != NULL);
3250 CPPUNIT_ASSERT(pProduct->getFactor() == 2.3);
3251 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3254 pFraction2 = &pChoice->getFalseExpression();
3255 CPPUNIT_ASSERT(pFraction2 != NULL);
3256 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
3257 numerator = &pFraction2->getNumerator();
3258 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3259 products = &numerator->getProducts();
3260 CPPUNIT_ASSERT(products->size() == 1);
3261 pProduct = *(products->begin());
3262 CPPUNIT_ASSERT(pProduct != NULL);
3263 CPPUNIT_ASSERT(pProduct->getFactor() == 4.5);
3264 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3267 void test_normalform::test_nested_stepwise_numbers_2levels_2()
3269 std::string infix(
"IF(IF(2 eq T,FALSE,NOT (D eq F)),2.3,4.5)");
3272 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
3275 CPPUNIT_ASSERT(pFraction != NULL);
3276 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
3278 const CNormalSum* numerator = &pFraction->getNumerator();
3279 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3280 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
3281 CPPUNIT_ASSERT(products->size() == 1);
3283 CPPUNIT_ASSERT(pProduct != NULL);
3284 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3285 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3287 CPPUNIT_ASSERT(pItemPower != NULL);
3288 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3291 CPPUNIT_ASSERT(pChoice != NULL);
3295 CPPUNIT_ASSERT(pLogical != NULL);
3296 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
3297 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
3298 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 1);
3299 CNormalLogical::ItemSetOfSets::const_iterator outerIt = pLogical->
getAndSets().begin();
3300 CPPUNIT_ASSERT(outerIt->second ==
false);
3301 CPPUNIT_ASSERT(outerIt->first.size() == 2);
3302 CNormalLogical::ItemSet::const_iterator innerIt = outerIt->first.begin();
3303 CPPUNIT_ASSERT(innerIt->second ==
false);
3307 CPPUNIT_ASSERT(check_LogicalItemD(pLogicalItem) ==
true);
3310 CPPUNIT_ASSERT(innerIt->second ==
false);
3311 pLogicalItem = innerIt->first;
3313 CPPUNIT_ASSERT(check_LogicalItemNotC(pLogicalItem) ==
true);
3317 CPPUNIT_ASSERT(pFraction2 != NULL);
3320 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3322 CPPUNIT_ASSERT(products->size() == 1);
3323 pProduct = *(products->begin());
3324 CPPUNIT_ASSERT(pProduct != NULL);
3325 CPPUNIT_ASSERT(pProduct->getFactor() == 2.3);
3326 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3329 pFraction2 = &pChoice->getFalseExpression();
3330 CPPUNIT_ASSERT(pFraction2 != NULL);
3331 numerator = &pFraction2->getNumerator();
3332 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3333 products = &numerator->getProducts();
3334 CPPUNIT_ASSERT(products->size() == 1);
3335 pProduct = *(products->begin());
3336 CPPUNIT_ASSERT(pProduct != NULL);
3337 CPPUNIT_ASSERT(pProduct->getFactor() == 4.5);
3338 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3341 void test_normalform::test_nested_stepwise_numbers_2levels_3()
3343 std::string infix(
"IF(IF(SIN(D*PI) lt X,TRUE,2*T^(3*J) ne 6.2),2.3,4.5)");
3346 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
3349 CPPUNIT_ASSERT(pFraction != NULL);
3350 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
3352 const CNormalSum* numerator = &pFraction->getNumerator();
3353 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3354 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
3355 CPPUNIT_ASSERT(products->size() == 1);
3357 CPPUNIT_ASSERT(pProduct != NULL);
3358 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3359 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3361 CPPUNIT_ASSERT(pItemPower != NULL);
3362 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3365 CPPUNIT_ASSERT(pChoice != NULL);
3369 CPPUNIT_ASSERT(pLogical != NULL);
3370 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
3371 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
3372 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 3);
3373 CNormalLogical::ItemSetOfSets::const_iterator outerIt = pLogical->
getAndSets().begin();
3375 CPPUNIT_ASSERT(outerIt->second ==
false);
3376 CPPUNIT_ASSERT(outerIt->first.size() == 2);
3377 CNormalLogical::ItemSet::const_iterator innerIt = outerIt->first.begin();
3378 CPPUNIT_ASSERT(innerIt->second ==
false);
3381 CPPUNIT_ASSERT(check_LogicalItemNotF(pLogicalItem) ==
true);
3384 CPPUNIT_ASSERT(innerIt->second ==
false);
3385 pLogicalItem = innerIt->first;
3387 CPPUNIT_ASSERT(check_LogicalItemE(pLogicalItem) ==
true);
3392 CPPUNIT_ASSERT(outerIt->second ==
false);
3393 CPPUNIT_ASSERT(outerIt->first.size() == 2);
3394 innerIt = outerIt->first.begin();
3395 CPPUNIT_ASSERT(innerIt->second ==
false);
3396 pLogicalItem = innerIt->first;
3398 CPPUNIT_ASSERT(check_LogicalItemF(pLogicalItem) ==
true);
3401 CPPUNIT_ASSERT(innerIt->second ==
false);
3402 pLogicalItem = innerIt->first;
3404 CPPUNIT_ASSERT(check_LogicalItemE(pLogicalItem) ==
true);
3409 CPPUNIT_ASSERT(outerIt->second ==
false);
3410 CPPUNIT_ASSERT(outerIt->first.size() == 2);
3411 innerIt = outerIt->first.begin();
3412 CPPUNIT_ASSERT(innerIt->second ==
false);
3413 pLogicalItem = innerIt->first;
3415 CPPUNIT_ASSERT(check_LogicalItemF(pLogicalItem) ==
true);
3418 CPPUNIT_ASSERT(innerIt->second ==
false);
3419 pLogicalItem = innerIt->first;
3421 CPPUNIT_ASSERT(check_LogicalItemNotE(pLogicalItem) ==
true);
3424 CPPUNIT_ASSERT(pFraction2 != NULL);
3427 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3429 CPPUNIT_ASSERT(products->size() == 1);
3430 pProduct = *(products->begin());
3431 CPPUNIT_ASSERT(pProduct != NULL);
3432 CPPUNIT_ASSERT(pProduct->getFactor() == 2.3);
3433 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3436 pFraction2 = &pChoice->getFalseExpression();
3437 CPPUNIT_ASSERT(pFraction2 != NULL);
3438 numerator = &pFraction2->getNumerator();
3439 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3440 products = &numerator->getProducts();
3441 CPPUNIT_ASSERT(products->size() == 1);
3442 pProduct = *(products->begin());
3443 CPPUNIT_ASSERT(pProduct != NULL);
3444 CPPUNIT_ASSERT(pProduct->getFactor() == 4.5);
3445 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 0);
3448 void test_normalform::test_nested_stepwise_fractions_3levels()
3586 std::string infix(
"IF(IF(IF(A gt PI,FALSE,4.0 ne A),IF(2 eq T,FALSE,NOT (D eq F)),IF(SIN(D*PI) lt X,TRUE,2*T^(3*J) ne 6.2)),A/TAN(X)^R,SIN(PI)/A^6)");
3589 CPPUNIT_ASSERT(pTree->
getRoot() != NULL);
3593 CPPUNIT_ASSERT(pFraction != NULL);
3594 CPPUNIT_ASSERT(pFraction->checkDenominatorOne() ==
true);
3596 const CNormalSum* numerator = &pFraction->getNumerator();
3597 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
3598 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
3599 CPPUNIT_ASSERT(products->size() == 1);
3601 CPPUNIT_ASSERT(pProduct != NULL);
3602 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
3603 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
3605 CPPUNIT_ASSERT(pItemPower != NULL);
3606 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
3609 CPPUNIT_ASSERT(pChoice != NULL);
3613 CPPUNIT_ASSERT(pLogical != NULL);
3614 CPPUNIT_ASSERT(pLogical->
isNegated() ==
false);
3615 CPPUNIT_ASSERT(pLogical->
getChoices().size() == 0);
3616 CPPUNIT_ASSERT(pLogical->
getAndSets().size() == 40);
3619 CNormalLogical::ItemSetOfSets::const_iterator outerIt = pLogical->
getAndSets().begin();
3620 CPPUNIT_ASSERT(outerIt->second ==
false);
3621 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3624 CNormalLogical::ItemSet::const_iterator innerIt = outerIt->first.begin();
3625 CPPUNIT_ASSERT(innerIt->second ==
false);
3626 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3628 CPPUNIT_ASSERT(innerIt->second ==
false);
3629 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3631 CPPUNIT_ASSERT(innerIt->second ==
false);
3632 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3634 CPPUNIT_ASSERT(innerIt->second ==
false);
3635 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3637 CPPUNIT_ASSERT(innerIt->second ==
false);
3638 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3640 CPPUNIT_ASSERT(innerIt->second ==
false);
3641 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3644 CPPUNIT_ASSERT(outerIt->second ==
false);
3645 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3647 innerIt = outerIt->first.begin();
3648 CPPUNIT_ASSERT(innerIt->second ==
false);
3649 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3651 CPPUNIT_ASSERT(innerIt->second ==
false);
3652 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3654 CPPUNIT_ASSERT(innerIt->second ==
false);
3655 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3657 CPPUNIT_ASSERT(innerIt->second ==
false);
3658 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3660 CPPUNIT_ASSERT(innerIt->second ==
false);
3661 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3663 CPPUNIT_ASSERT(innerIt->second ==
false);
3664 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3667 CPPUNIT_ASSERT(outerIt->second ==
false);
3668 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3670 innerIt = outerIt->first.begin();
3671 CPPUNIT_ASSERT(innerIt->second ==
false);
3672 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3674 CPPUNIT_ASSERT(innerIt->second ==
false);
3675 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3677 CPPUNIT_ASSERT(innerIt->second ==
false);
3678 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3680 CPPUNIT_ASSERT(innerIt->second ==
false);
3681 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
3683 CPPUNIT_ASSERT(innerIt->second ==
false);
3684 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3686 CPPUNIT_ASSERT(innerIt->second ==
false);
3687 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3690 CPPUNIT_ASSERT(outerIt->second ==
false);
3691 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3693 innerIt = outerIt->first.begin();
3694 CPPUNIT_ASSERT(innerIt->second ==
false);
3695 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3697 CPPUNIT_ASSERT(innerIt->second ==
false);
3698 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3700 CPPUNIT_ASSERT(innerIt->second ==
false);
3701 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3703 CPPUNIT_ASSERT(innerIt->second ==
false);
3704 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3706 CPPUNIT_ASSERT(innerIt->second ==
false);
3707 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3709 CPPUNIT_ASSERT(innerIt->second ==
false);
3710 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3713 CPPUNIT_ASSERT(outerIt->second ==
false);
3714 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3716 innerIt = outerIt->first.begin();
3717 CPPUNIT_ASSERT(innerIt->second ==
false);
3718 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3720 CPPUNIT_ASSERT(innerIt->second ==
false);
3721 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3723 CPPUNIT_ASSERT(innerIt->second ==
false);
3724 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3726 CPPUNIT_ASSERT(innerIt->second ==
false);
3727 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3729 CPPUNIT_ASSERT(innerIt->second ==
false);
3730 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3732 CPPUNIT_ASSERT(innerIt->second ==
false);
3733 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
3736 CPPUNIT_ASSERT(outerIt->second ==
false);
3737 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3739 innerIt = outerIt->first.begin();
3740 CPPUNIT_ASSERT(innerIt->second ==
false);
3741 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3743 CPPUNIT_ASSERT(innerIt->second ==
false);
3744 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3746 CPPUNIT_ASSERT(innerIt->second ==
false);
3747 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3749 CPPUNIT_ASSERT(innerIt->second ==
false);
3750 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3752 CPPUNIT_ASSERT(innerIt->second ==
false);
3753 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3755 CPPUNIT_ASSERT(innerIt->second ==
false);
3756 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3759 CPPUNIT_ASSERT(outerIt->second ==
false);
3760 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3762 innerIt = outerIt->first.begin();
3763 CPPUNIT_ASSERT(innerIt->second ==
false);
3764 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3766 CPPUNIT_ASSERT(innerIt->second ==
false);
3767 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3769 CPPUNIT_ASSERT(innerIt->second ==
false);
3770 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3772 CPPUNIT_ASSERT(innerIt->second ==
false);
3773 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3775 CPPUNIT_ASSERT(innerIt->second ==
false);
3776 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3778 CPPUNIT_ASSERT(innerIt->second ==
false);
3779 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
3782 CPPUNIT_ASSERT(outerIt->second ==
false);
3783 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3785 innerIt = outerIt->first.begin();
3786 CPPUNIT_ASSERT(innerIt->second ==
false);
3787 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3789 CPPUNIT_ASSERT(innerIt->second ==
false);
3790 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3792 CPPUNIT_ASSERT(innerIt->second ==
false);
3793 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3795 CPPUNIT_ASSERT(innerIt->second ==
false);
3796 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
3798 CPPUNIT_ASSERT(innerIt->second ==
false);
3799 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3801 CPPUNIT_ASSERT(innerIt->second ==
false);
3802 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3805 CPPUNIT_ASSERT(outerIt->second ==
false);
3806 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3808 innerIt = outerIt->first.begin();
3809 CPPUNIT_ASSERT(innerIt->second ==
false);
3810 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3812 CPPUNIT_ASSERT(innerIt->second ==
false);
3813 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
3815 CPPUNIT_ASSERT(innerIt->second ==
false);
3816 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3818 CPPUNIT_ASSERT(innerIt->second ==
false);
3819 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
3821 CPPUNIT_ASSERT(innerIt->second ==
false);
3822 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3824 CPPUNIT_ASSERT(innerIt->second ==
false);
3825 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
3828 CPPUNIT_ASSERT(outerIt->second ==
false);
3829 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3831 innerIt = outerIt->first.begin();
3832 CPPUNIT_ASSERT(innerIt->second ==
false);
3833 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3835 CPPUNIT_ASSERT(innerIt->second ==
false);
3836 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3838 CPPUNIT_ASSERT(innerIt->second ==
false);
3839 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3841 CPPUNIT_ASSERT(innerIt->second ==
false);
3842 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3844 CPPUNIT_ASSERT(innerIt->second ==
false);
3845 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3847 CPPUNIT_ASSERT(innerIt->second ==
false);
3848 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3851 CPPUNIT_ASSERT(outerIt->second ==
false);
3852 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3854 innerIt = outerIt->first.begin();
3855 CPPUNIT_ASSERT(innerIt->second ==
false);
3856 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3858 CPPUNIT_ASSERT(innerIt->second ==
false);
3859 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3861 CPPUNIT_ASSERT(innerIt->second ==
false);
3862 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3864 CPPUNIT_ASSERT(innerIt->second ==
false);
3865 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3867 CPPUNIT_ASSERT(innerIt->second ==
false);
3868 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3870 CPPUNIT_ASSERT(innerIt->second ==
false);
3871 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3874 CPPUNIT_ASSERT(outerIt->second ==
false);
3875 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3877 innerIt = outerIt->first.begin();
3878 CPPUNIT_ASSERT(innerIt->second ==
false);
3879 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3881 CPPUNIT_ASSERT(innerIt->second ==
false);
3882 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
3884 CPPUNIT_ASSERT(innerIt->second ==
false);
3885 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3887 CPPUNIT_ASSERT(innerIt->second ==
false);
3888 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
3890 CPPUNIT_ASSERT(innerIt->second ==
false);
3891 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3893 CPPUNIT_ASSERT(innerIt->second ==
false);
3894 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3897 CPPUNIT_ASSERT(outerIt->second ==
false);
3898 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3900 innerIt = outerIt->first.begin();
3901 CPPUNIT_ASSERT(innerIt->second ==
false);
3902 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3904 CPPUNIT_ASSERT(innerIt->second ==
false);
3905 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3907 CPPUNIT_ASSERT(innerIt->second ==
false);
3908 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3910 CPPUNIT_ASSERT(innerIt->second ==
false);
3911 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3913 CPPUNIT_ASSERT(innerIt->second ==
false);
3914 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3916 CPPUNIT_ASSERT(innerIt->second ==
false);
3917 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3920 CPPUNIT_ASSERT(outerIt->second ==
false);
3921 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3923 innerIt = outerIt->first.begin();
3924 CPPUNIT_ASSERT(innerIt->second ==
false);
3925 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3927 CPPUNIT_ASSERT(innerIt->second ==
false);
3928 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3930 CPPUNIT_ASSERT(innerIt->second ==
false);
3931 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3933 CPPUNIT_ASSERT(innerIt->second ==
false);
3934 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3936 CPPUNIT_ASSERT(innerIt->second ==
false);
3937 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
3939 CPPUNIT_ASSERT(innerIt->second ==
false);
3940 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
3943 CPPUNIT_ASSERT(outerIt->second ==
false);
3944 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3946 innerIt = outerIt->first.begin();
3947 CPPUNIT_ASSERT(innerIt->second ==
false);
3948 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3950 CPPUNIT_ASSERT(innerIt->second ==
false);
3951 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3953 CPPUNIT_ASSERT(innerIt->second ==
false);
3954 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3956 CPPUNIT_ASSERT(innerIt->second ==
false);
3957 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3959 CPPUNIT_ASSERT(innerIt->second ==
false);
3960 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
3962 CPPUNIT_ASSERT(innerIt->second ==
false);
3963 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3966 CPPUNIT_ASSERT(outerIt->second ==
false);
3967 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3969 innerIt = outerIt->first.begin();
3970 CPPUNIT_ASSERT(innerIt->second ==
false);
3971 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3973 CPPUNIT_ASSERT(innerIt->second ==
false);
3974 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
3976 CPPUNIT_ASSERT(innerIt->second ==
false);
3977 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3979 CPPUNIT_ASSERT(innerIt->second ==
false);
3980 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
3982 CPPUNIT_ASSERT(innerIt->second ==
false);
3983 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
3985 CPPUNIT_ASSERT(innerIt->second ==
false);
3986 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
3989 CPPUNIT_ASSERT(outerIt->second ==
false);
3990 CPPUNIT_ASSERT(outerIt->first.size() == 6);
3992 innerIt = outerIt->first.begin();
3993 CPPUNIT_ASSERT(innerIt->second ==
false);
3994 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
3996 CPPUNIT_ASSERT(innerIt->second ==
false);
3997 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
3999 CPPUNIT_ASSERT(innerIt->second ==
false);
4000 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4002 CPPUNIT_ASSERT(innerIt->second ==
false);
4003 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4005 CPPUNIT_ASSERT(innerIt->second ==
false);
4006 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4008 CPPUNIT_ASSERT(innerIt->second ==
false);
4009 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4012 CPPUNIT_ASSERT(outerIt->second ==
false);
4013 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4015 innerIt = outerIt->first.begin();
4016 CPPUNIT_ASSERT(innerIt->second ==
false);
4017 CPPUNIT_ASSERT(check_LogicalItemNotD(innerIt->first) ==
true);
4019 CPPUNIT_ASSERT(innerIt->second ==
false);
4020 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4022 CPPUNIT_ASSERT(innerIt->second ==
false);
4023 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4025 CPPUNIT_ASSERT(innerIt->second ==
false);
4026 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4028 CPPUNIT_ASSERT(innerIt->second ==
false);
4029 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4031 CPPUNIT_ASSERT(innerIt->second ==
false);
4032 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4035 CPPUNIT_ASSERT(outerIt->second ==
false);
4036 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4038 innerIt = outerIt->first.begin();
4039 CPPUNIT_ASSERT(innerIt->second ==
false);
4040 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4042 CPPUNIT_ASSERT(innerIt->second ==
false);
4043 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4045 CPPUNIT_ASSERT(innerIt->second ==
false);
4046 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4048 CPPUNIT_ASSERT(innerIt->second ==
false);
4049 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4051 CPPUNIT_ASSERT(innerIt->second ==
false);
4052 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4054 CPPUNIT_ASSERT(innerIt->second ==
false);
4055 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4058 CPPUNIT_ASSERT(outerIt->second ==
false);
4059 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4061 innerIt = outerIt->first.begin();
4062 CPPUNIT_ASSERT(innerIt->second ==
false);
4063 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4065 CPPUNIT_ASSERT(innerIt->second ==
false);
4066 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4068 CPPUNIT_ASSERT(innerIt->second ==
false);
4069 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4071 CPPUNIT_ASSERT(innerIt->second ==
false);
4072 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4074 CPPUNIT_ASSERT(innerIt->second ==
false);
4075 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4077 CPPUNIT_ASSERT(innerIt->second ==
false);
4078 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4081 CPPUNIT_ASSERT(outerIt->second ==
false);
4082 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4084 innerIt = outerIt->first.begin();
4085 CPPUNIT_ASSERT(innerIt->second ==
false);
4086 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4088 CPPUNIT_ASSERT(innerIt->second ==
false);
4089 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4091 CPPUNIT_ASSERT(innerIt->second ==
false);
4092 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4094 CPPUNIT_ASSERT(innerIt->second ==
false);
4095 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4097 CPPUNIT_ASSERT(innerIt->second ==
false);
4098 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4100 CPPUNIT_ASSERT(innerIt->second ==
false);
4101 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4104 CPPUNIT_ASSERT(outerIt->second ==
false);
4105 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4107 innerIt = outerIt->first.begin();
4108 CPPUNIT_ASSERT(innerIt->second ==
false);
4109 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4111 CPPUNIT_ASSERT(innerIt->second ==
false);
4112 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4114 CPPUNIT_ASSERT(innerIt->second ==
false);
4115 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4117 CPPUNIT_ASSERT(innerIt->second ==
false);
4118 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4120 CPPUNIT_ASSERT(innerIt->second ==
false);
4121 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4123 CPPUNIT_ASSERT(innerIt->second ==
false);
4124 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4127 CPPUNIT_ASSERT(outerIt->second ==
false);
4128 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4130 innerIt = outerIt->first.begin();
4131 CPPUNIT_ASSERT(innerIt->second ==
false);
4132 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4134 CPPUNIT_ASSERT(innerIt->second ==
false);
4135 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4137 CPPUNIT_ASSERT(innerIt->second ==
false);
4138 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4140 CPPUNIT_ASSERT(innerIt->second ==
false);
4141 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4143 CPPUNIT_ASSERT(innerIt->second ==
false);
4144 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4146 CPPUNIT_ASSERT(innerIt->second ==
false);
4147 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4150 CPPUNIT_ASSERT(outerIt->second ==
false);
4151 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4153 innerIt = outerIt->first.begin();
4154 CPPUNIT_ASSERT(innerIt->second ==
false);
4155 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4157 CPPUNIT_ASSERT(innerIt->second ==
false);
4158 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4160 CPPUNIT_ASSERT(innerIt->second ==
false);
4161 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4163 CPPUNIT_ASSERT(innerIt->second ==
false);
4164 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4166 CPPUNIT_ASSERT(innerIt->second ==
false);
4167 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4169 CPPUNIT_ASSERT(innerIt->second ==
false);
4170 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4173 CPPUNIT_ASSERT(outerIt->second ==
false);
4174 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4176 innerIt = outerIt->first.begin();
4177 CPPUNIT_ASSERT(innerIt->second ==
false);
4178 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4180 CPPUNIT_ASSERT(innerIt->second ==
false);
4181 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4183 CPPUNIT_ASSERT(innerIt->second ==
false);
4184 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4186 CPPUNIT_ASSERT(innerIt->second ==
false);
4187 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4189 CPPUNIT_ASSERT(innerIt->second ==
false);
4190 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4192 CPPUNIT_ASSERT(innerIt->second ==
false);
4193 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4196 CPPUNIT_ASSERT(outerIt->second ==
false);
4197 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4199 innerIt = outerIt->first.begin();
4200 CPPUNIT_ASSERT(innerIt->second ==
false);
4201 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4203 CPPUNIT_ASSERT(innerIt->second ==
false);
4204 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4206 CPPUNIT_ASSERT(innerIt->second ==
false);
4207 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4209 CPPUNIT_ASSERT(innerIt->second ==
false);
4210 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4212 CPPUNIT_ASSERT(innerIt->second ==
false);
4213 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4215 CPPUNIT_ASSERT(innerIt->second ==
false);
4216 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4219 CPPUNIT_ASSERT(outerIt->second ==
false);
4220 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4222 innerIt = outerIt->first.begin();
4223 CPPUNIT_ASSERT(innerIt->second ==
false);
4224 CPPUNIT_ASSERT(check_LogicalItemC(innerIt->first) ==
true);
4226 CPPUNIT_ASSERT(innerIt->second ==
false);
4227 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4229 CPPUNIT_ASSERT(innerIt->second ==
false);
4230 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4232 CPPUNIT_ASSERT(innerIt->second ==
false);
4233 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4235 CPPUNIT_ASSERT(innerIt->second ==
false);
4236 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4238 CPPUNIT_ASSERT(innerIt->second ==
false);
4239 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4242 CPPUNIT_ASSERT(outerIt->second ==
false);
4243 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4245 innerIt = outerIt->first.begin();
4246 CPPUNIT_ASSERT(innerIt->second ==
false);
4247 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4249 CPPUNIT_ASSERT(innerIt->second ==
false);
4250 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4252 CPPUNIT_ASSERT(innerIt->second ==
false);
4253 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4255 CPPUNIT_ASSERT(innerIt->second ==
false);
4256 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4258 CPPUNIT_ASSERT(innerIt->second ==
false);
4259 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4261 CPPUNIT_ASSERT(innerIt->second ==
false);
4262 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4265 CPPUNIT_ASSERT(outerIt->second ==
false);
4266 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4268 innerIt = outerIt->first.begin();
4269 CPPUNIT_ASSERT(innerIt->second ==
false);
4270 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4272 CPPUNIT_ASSERT(innerIt->second ==
false);
4273 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4275 CPPUNIT_ASSERT(innerIt->second ==
false);
4276 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4278 CPPUNIT_ASSERT(innerIt->second ==
false);
4279 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4281 CPPUNIT_ASSERT(innerIt->second ==
false);
4282 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4284 CPPUNIT_ASSERT(innerIt->second ==
false);
4285 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4288 CPPUNIT_ASSERT(outerIt->second ==
false);
4289 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4291 innerIt = outerIt->first.begin();
4292 CPPUNIT_ASSERT(innerIt->second ==
false);
4293 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4295 CPPUNIT_ASSERT(innerIt->second ==
false);
4296 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4298 CPPUNIT_ASSERT(innerIt->second ==
false);
4299 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4301 CPPUNIT_ASSERT(innerIt->second ==
false);
4302 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4304 CPPUNIT_ASSERT(innerIt->second ==
false);
4305 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4307 CPPUNIT_ASSERT(innerIt->second ==
false);
4308 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4311 CPPUNIT_ASSERT(outerIt->second ==
false);
4312 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4314 innerIt = outerIt->first.begin();
4315 CPPUNIT_ASSERT(innerIt->second ==
false);
4316 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4318 CPPUNIT_ASSERT(innerIt->second ==
false);
4319 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4321 CPPUNIT_ASSERT(innerIt->second ==
false);
4322 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4324 CPPUNIT_ASSERT(innerIt->second ==
false);
4325 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4327 CPPUNIT_ASSERT(innerIt->second ==
false);
4328 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4330 CPPUNIT_ASSERT(innerIt->second ==
false);
4331 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4334 CPPUNIT_ASSERT(outerIt->second ==
false);
4335 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4337 innerIt = outerIt->first.begin();
4338 CPPUNIT_ASSERT(innerIt->second ==
false);
4339 CPPUNIT_ASSERT(check_LogicalItemNotF(innerIt->first) ==
true);
4341 CPPUNIT_ASSERT(innerIt->second ==
false);
4342 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4344 CPPUNIT_ASSERT(innerIt->second ==
false);
4345 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4347 CPPUNIT_ASSERT(innerIt->second ==
false);
4348 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4350 CPPUNIT_ASSERT(innerIt->second ==
false);
4351 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4353 CPPUNIT_ASSERT(innerIt->second ==
false);
4354 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4357 CPPUNIT_ASSERT(outerIt->second ==
false);
4358 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4360 innerIt = outerIt->first.begin();
4361 CPPUNIT_ASSERT(innerIt->second ==
false);
4362 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4364 CPPUNIT_ASSERT(innerIt->second ==
false);
4365 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4367 CPPUNIT_ASSERT(innerIt->second ==
false);
4368 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4370 CPPUNIT_ASSERT(innerIt->second ==
false);
4371 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4373 CPPUNIT_ASSERT(innerIt->second ==
false);
4374 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4376 CPPUNIT_ASSERT(innerIt->second ==
false);
4377 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4380 CPPUNIT_ASSERT(outerIt->second ==
false);
4381 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4383 innerIt = outerIt->first.begin();
4384 CPPUNIT_ASSERT(innerIt->second ==
false);
4385 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4387 CPPUNIT_ASSERT(innerIt->second ==
false);
4388 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4390 CPPUNIT_ASSERT(innerIt->second ==
false);
4391 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4393 CPPUNIT_ASSERT(innerIt->second ==
false);
4394 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4396 CPPUNIT_ASSERT(innerIt->second ==
false);
4397 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4399 CPPUNIT_ASSERT(innerIt->second ==
false);
4400 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4403 CPPUNIT_ASSERT(outerIt->second ==
false);
4404 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4406 innerIt = outerIt->first.begin();
4407 CPPUNIT_ASSERT(innerIt->second ==
false);
4408 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4410 CPPUNIT_ASSERT(innerIt->second ==
false);
4411 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4413 CPPUNIT_ASSERT(innerIt->second ==
false);
4414 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4416 CPPUNIT_ASSERT(innerIt->second ==
false);
4417 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4419 CPPUNIT_ASSERT(innerIt->second ==
false);
4420 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4422 CPPUNIT_ASSERT(innerIt->second ==
false);
4423 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4426 CPPUNIT_ASSERT(outerIt->second ==
false);
4427 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4429 innerIt = outerIt->first.begin();
4430 CPPUNIT_ASSERT(innerIt->second ==
false);
4431 CPPUNIT_ASSERT(check_LogicalItemNotB(innerIt->first) ==
true);
4433 CPPUNIT_ASSERT(innerIt->second ==
false);
4434 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4436 CPPUNIT_ASSERT(innerIt->second ==
false);
4437 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4439 CPPUNIT_ASSERT(innerIt->second ==
false);
4440 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4442 CPPUNIT_ASSERT(innerIt->second ==
false);
4443 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4445 CPPUNIT_ASSERT(innerIt->second ==
false);
4446 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4449 CPPUNIT_ASSERT(outerIt->second ==
false);
4450 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4452 innerIt = outerIt->first.begin();
4453 CPPUNIT_ASSERT(innerIt->second ==
false);
4454 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4456 CPPUNIT_ASSERT(innerIt->second ==
false);
4457 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4459 CPPUNIT_ASSERT(innerIt->second ==
false);
4460 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4462 CPPUNIT_ASSERT(innerIt->second ==
false);
4463 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4465 CPPUNIT_ASSERT(innerIt->second ==
false);
4466 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4468 CPPUNIT_ASSERT(innerIt->second ==
false);
4469 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4472 CPPUNIT_ASSERT(outerIt->second ==
false);
4473 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4475 innerIt = outerIt->first.begin();
4476 CPPUNIT_ASSERT(innerIt->second ==
false);
4477 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4479 CPPUNIT_ASSERT(innerIt->second ==
false);
4480 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4482 CPPUNIT_ASSERT(innerIt->second ==
false);
4483 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4485 CPPUNIT_ASSERT(innerIt->second ==
false);
4486 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4488 CPPUNIT_ASSERT(innerIt->second ==
false);
4489 CPPUNIT_ASSERT(check_LogicalItemA(innerIt->first) ==
true);
4491 CPPUNIT_ASSERT(innerIt->second ==
false);
4492 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4495 CPPUNIT_ASSERT(outerIt->second ==
false);
4496 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4498 innerIt = outerIt->first.begin();
4499 CPPUNIT_ASSERT(innerIt->second ==
false);
4500 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4502 CPPUNIT_ASSERT(innerIt->second ==
false);
4503 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4505 CPPUNIT_ASSERT(innerIt->second ==
false);
4506 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4508 CPPUNIT_ASSERT(innerIt->second ==
false);
4509 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4511 CPPUNIT_ASSERT(innerIt->second ==
false);
4512 CPPUNIT_ASSERT(check_LogicalItemE(innerIt->first) ==
true);
4514 CPPUNIT_ASSERT(innerIt->second ==
false);
4515 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4518 CPPUNIT_ASSERT(outerIt->second ==
false);
4519 CPPUNIT_ASSERT(outerIt->first.size() == 6);
4521 innerIt = outerIt->first.begin();
4522 CPPUNIT_ASSERT(innerIt->second ==
false);
4523 CPPUNIT_ASSERT(check_LogicalItemD(innerIt->first) ==
true);
4525 CPPUNIT_ASSERT(innerIt->second ==
false);
4526 CPPUNIT_ASSERT(check_LogicalItemNotC(innerIt->first) ==
true);
4528 CPPUNIT_ASSERT(innerIt->second ==
false);
4529 CPPUNIT_ASSERT(check_LogicalItemF(innerIt->first) ==
true);
4531 CPPUNIT_ASSERT(innerIt->second ==
false);
4532 CPPUNIT_ASSERT(check_LogicalItemB(innerIt->first) ==
true);
4534 CPPUNIT_ASSERT(innerIt->second ==
false);
4535 CPPUNIT_ASSERT(check_LogicalItemNotA(innerIt->first) ==
true);
4537 CPPUNIT_ASSERT(innerIt->second ==
false);
4538 CPPUNIT_ASSERT(check_LogicalItemNotE(innerIt->first) ==
true);
4542 CPPUNIT_ASSERT(pFraction2 != NULL);
4544 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4546 CPPUNIT_ASSERT(products->size() == 1);
4547 pProduct = *(products->begin());
4548 CPPUNIT_ASSERT(pProduct != NULL);
4549 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4550 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4551 pItemPower = *(pProduct->getItemPowers().begin());
4552 CPPUNIT_ASSERT(pItemPower != NULL);
4553 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4556 CPPUNIT_ASSERT(pItem != NULL);
4558 CPPUNIT_ASSERT(pItem->getName() ==
"A");
4560 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
4562 CPPUNIT_ASSERT(products->size() == 1);
4563 pProduct = *(products->begin());
4564 CPPUNIT_ASSERT(pProduct != NULL);
4565 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4566 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4567 pItemPower = *(pProduct->getItemPowers().begin());
4568 CPPUNIT_ASSERT(pItemPower != NULL);
4569 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4572 CPPUNIT_ASSERT(pGeneralPower != NULL);
4574 pFraction2 = &pGeneralPower->getLeft();
4575 CPPUNIT_ASSERT(pFraction2 != NULL);
4576 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
4577 numerator = &pFraction2->getNumerator();
4578 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4579 products = &numerator->getProducts();
4580 CPPUNIT_ASSERT(products->size() == 1);
4581 pProduct = *(products->begin());
4582 CPPUNIT_ASSERT(pProduct != NULL);
4583 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4584 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4585 pItemPower = *(pProduct->getItemPowers().begin());
4586 CPPUNIT_ASSERT(pItemPower != NULL);
4587 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4590 CPPUNIT_ASSERT(pFunction != NULL);
4592 pFraction2 = &pFunction->getFraction();
4593 CPPUNIT_ASSERT(pFraction2 != NULL);
4594 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
4595 numerator = &pFraction2->getNumerator();
4596 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4597 products = &numerator->getProducts();
4598 CPPUNIT_ASSERT(products->size() == 1);
4599 pProduct = *(products->begin());
4600 CPPUNIT_ASSERT(pProduct != NULL);
4601 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4602 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4603 pItemPower = *(pProduct->getItemPowers().begin());
4604 CPPUNIT_ASSERT(pItemPower != NULL);
4605 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4607 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
4608 CPPUNIT_ASSERT(pItem != NULL);
4610 CPPUNIT_ASSERT(pItem->getName() ==
"X");
4611 pFraction2 = &pGeneralPower->getRight();
4612 CPPUNIT_ASSERT(pFraction2 != NULL);
4613 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
4614 numerator = &pFraction2->getNumerator();
4615 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4616 products = &numerator->getProducts();
4617 CPPUNIT_ASSERT(products->size() == 1);
4618 pProduct = *(products->begin());
4619 CPPUNIT_ASSERT(pProduct != NULL);
4620 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4621 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4622 pItemPower = *(pProduct->getItemPowers().begin());
4623 CPPUNIT_ASSERT(pItemPower != NULL);
4624 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4626 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
4627 CPPUNIT_ASSERT(pItem != NULL);
4629 CPPUNIT_ASSERT(pItem->getName() ==
"R");
4632 pFraction2 = &pChoice->getFalseExpression();
4633 CPPUNIT_ASSERT(pFraction2 != NULL);
4634 numerator = &pFraction2->getNumerator();
4635 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4636 products = &numerator->getProducts();
4637 CPPUNIT_ASSERT(products->size() == 1);
4638 pProduct = *(products->begin());
4639 CPPUNIT_ASSERT(pProduct != NULL);
4640 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4641 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4642 pItemPower = *(pProduct->getItemPowers().begin());
4643 CPPUNIT_ASSERT(pItemPower != NULL);
4644 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4646 pFunction =
dynamic_cast<const CNormalFunction*
>(&pItemPower->getItem());
4647 CPPUNIT_ASSERT(pFunction != NULL);
4649 pFraction2 = &pFunction->getFraction();
4650 CPPUNIT_ASSERT(pFraction2 != NULL);
4651 CPPUNIT_ASSERT(pFraction2->checkDenominatorOne() ==
true);
4652 numerator = &pFraction2->getNumerator();
4653 CPPUNIT_ASSERT(numerator->getFractions().size() == 0);
4654 products = &numerator->getProducts();
4655 CPPUNIT_ASSERT(products->size() == 1);
4656 pProduct = *(products->begin());
4657 CPPUNIT_ASSERT(pProduct != NULL);
4658 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4659 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4660 pItemPower = *(pProduct->getItemPowers().begin());
4661 CPPUNIT_ASSERT(pItemPower != NULL);
4662 CPPUNIT_ASSERT(pItemPower->getExp() == 1.0);
4664 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
4665 CPPUNIT_ASSERT(pItem != NULL);
4667 CPPUNIT_ASSERT(pItem->getName() ==
"PI");
4671 pFraction2 = &pChoice->getFalseExpression();
4672 denominator = &pFraction2->getDenominator();
4673 CPPUNIT_ASSERT(denominator->getFractions().size() == 0);
4674 products = &denominator->getProducts();
4675 CPPUNIT_ASSERT(products->size() == 1);
4676 pProduct = *(products->begin());
4677 CPPUNIT_ASSERT(pProduct != NULL);
4678 CPPUNIT_ASSERT(pProduct->getFactor() == 1.0);
4679 CPPUNIT_ASSERT(pProduct->getItemPowers().size() == 1);
4680 pItemPower = *(pProduct->getItemPowers().begin());
4681 CPPUNIT_ASSERT(pItemPower != NULL);
4682 CPPUNIT_ASSERT(pItemPower->getExp() == 6.0);
4684 pItem =
dynamic_cast<const CNormalItem*
>(&pItemPower->getItem());
4685 CPPUNIT_ASSERT(pItem != NULL);
4687 CPPUNIT_ASSERT(pItem->getName() ==
"A");
4695 if (pLogicalItem == NULL)
return false;
4701 if (pTmpFraction == NULL)
return false;
4707 if (pNumerator->
getFractions().size() != 0)
return false;
4709 const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->
getProducts();
4711 if (pProducts->size() != 1)
return false;
4715 if (pProduct == NULL)
return false;
4717 if (pProduct->
getFactor() != 1.0)
return false;
4723 if (pItemPower == NULL)
return false;
4725 if (pItemPower->
getExp() != 1.0)
return false;
4731 if (pNormalItem == NULL)
return false;
4735 if (pNormalItem->
getName() !=
"PI")
return false;
4737 pTmpFraction = &pLogicalItem->
getRight();
4739 if (pTmpFraction == NULL)
return false;
4745 if (pNumerator->
getFractions().size() != 0)
return false;
4749 if (pProducts->size() != 1)
return false;
4751 pProduct = *(pProducts->begin());
4753 if (pProduct == NULL)
return false;
4755 if (pProduct->
getFactor() != 1.0)
return false;
4761 if (pItemPower == NULL)
return false;
4763 if (pItemPower->
getExp() != 1.0)
return false;
4769 if (pNormalItem == NULL)
return false;
4773 if (pNormalItem->
getName() !=
"A")
return false;
4783 if (pLogicalItem == NULL)
return false;
4789 if (pTmpFraction == NULL)
return false;
4795 if (pNumerator->
getFractions().size() != 0)
return false;
4797 const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->
getProducts();
4799 if (pProducts->size() != 1)
return false;
4803 if (pProduct == NULL)
return false;
4805 if (pProduct->
getFactor() != 4.0)
return false;
4809 pTmpFraction = &pLogicalItem->
getRight();
4811 if (pTmpFraction == NULL)
return false;
4817 if (pNumerator->
getFractions().size() != 0)
return false;
4821 if (pProducts->size() != 1)
return false;
4823 pProduct = *(pProducts->begin());
4825 if (pProduct == NULL)
return false;
4827 if (pProduct->
getFactor() != 1.0)
return false;
4833 if (pItemPower == NULL)
return false;
4835 if (pItemPower->
getExp() != 1.0)
return false;
4841 if (pNormalItem == NULL)
return false;
4845 if (pNormalItem->
getName() !=
"A")
return false;
4855 if (pLogicalItem == NULL)
return false;
4861 if (pTmpFraction == NULL)
return false;
4867 if (numerator->
getFractions().size() != 0)
return false;
4869 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
4871 if (products->size() != 1)
return false;
4875 if (pProduct == NULL)
return false;
4877 if (pProduct->
getFactor() != 2.0)
return false;
4881 pTmpFraction = &pLogicalItem->
getRight();
4883 if (pTmpFraction == NULL)
return false;
4889 if (numerator->
getFractions().size() != 0)
return false;
4893 if (products->size() != 1)
return false;
4895 pProduct = *(products->begin());
4897 if (pProduct == NULL)
return false;
4899 if (pProduct->
getFactor() != 1.0)
return false;
4905 if (pItemPower == NULL)
return false;
4907 if (pItemPower->
getExp() != 1.0)
return false;
4913 if (pNormalItem == NULL)
return false;
4917 if (pNormalItem->
getName() !=
"T")
return false;
4927 if (pLogicalItem == NULL)
return false;
4933 if (pTmpFraction == NULL)
return false;
4939 if (numerator->
getFractions().size() != 0)
return false;
4941 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
4943 if (products->size() != 1)
return false;
4947 if (pProduct == NULL)
return false;
4949 if (pProduct->
getFactor() != 1.0)
return false;
4955 if (pItemPower == NULL)
return false;
4957 if (pItemPower->
getExp() != 1.0)
return false;
4963 if (pNormalItem == NULL)
return false;
4967 if (pNormalItem->
getName() !=
"D")
return false;
4969 pTmpFraction = &pLogicalItem->
getRight();
4971 if (pTmpFraction == NULL)
return false;
4977 if (numerator->
getFractions().size() != 0)
return false;
4981 if (products->size() != 1)
return false;
4983 pProduct = *(products->begin());
4985 if (pProduct == NULL)
return false;
4987 if (pProduct->
getFactor() != 1.0)
return false;
4993 if (pItemPower == NULL)
return false;
4995 if (pItemPower->
getExp() != 1.0)
return false;
5001 if (pNormalItem == NULL)
return false;
5005 if (pNormalItem->
getName() !=
"F")
return false;
5015 if (pLogicalItem == NULL)
return false;
5021 if (pTmpFraction == NULL)
return false;
5025 if (numerator->
getFractions().size() != 0)
return false;
5027 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5029 if (products->size() != 1)
return false;
5033 if (pProduct == NULL)
return false;
5035 if (pProduct->
getFactor() != 1.0)
return false;
5041 if (pItemPower == NULL)
return false;
5043 if (pItemPower->
getExp() != 1.0)
return false;
5049 if (pFunction == NULL)
return false;
5055 if (pTmpFraction == NULL)
return false;
5061 if (numerator->
getFractions().size() != 0)
return false;
5065 if (products->size() != 1)
return false;
5067 ProductIterator productsIt = products->begin();
5068 pProduct = *(productsIt);
5070 if (pProduct == NULL)
return false;
5072 if (pProduct->
getFactor() != 1.0)
return false;
5076 std::set<CNormalItemPower*, compareItemPowers>::const_iterator itemPowersIt = pProduct->
getItemPowers().begin();
5077 pItemPower = *(itemPowersIt);
5079 if (pItemPower == NULL)
return false;
5081 if (pItemPower->
getExp() != 1.0)
return false;
5087 if (pItem == NULL)
return false;
5091 if (pItem->
getName() !=
"PI")
return false;
5094 pItemPower = *(itemPowersIt);
5096 if (pItemPower == NULL)
return false;
5098 if (pItemPower->
getExp() != 1.0)
return false;
5104 if (pItem == NULL)
return false;
5108 if (pItem->
getName() !=
"D")
return false;
5110 pTmpFraction = &pLogicalItem->
getRight();
5112 if (pTmpFraction == NULL)
return false;
5116 if (numerator->
getFractions().size() != 0)
return false;
5120 if (products->size() != 1)
return false;
5122 pProduct = *(products->begin());
5124 if (pProduct == NULL)
return false;
5126 if (pProduct->
getFactor() != 1.0)
return false;
5132 if (pItemPower == NULL)
return false;
5134 if (pItemPower->
getExp() != 1.0)
return false;
5140 if (pItem == NULL)
return false;
5144 if (pItem->
getName() !=
"X")
return false;
5154 if (pLogicalItem == NULL)
return false;
5160 if (pTmpFraction == NULL)
return false;
5166 if (numerator->
getFractions().size() != 0)
return false;
5168 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5170 if (products->size() != 1)
return false;
5174 if (pProduct == NULL)
return false;
5176 if (pProduct->
getFactor() != 2.0)
return false;
5182 if (pItemPower->
getExp() != 1.0)
return false;
5188 if (pGeneralPower == NULL)
return false;
5193 pTmpFraction = &pGeneralPower->
getLeft();
5195 if (pTmpFraction == NULL)
return false;
5201 if (numerator->
getFractions().size() != 0)
return false;
5205 if (products->size() != 1)
return false;
5207 pProduct = *(products->begin());
5209 if (pProduct == NULL)
return false;
5211 if (pProduct->
getFactor() != 1.0)
return false;
5217 if (pItemPower == NULL)
return false;
5219 if (pItemPower->
getExp() != 1.0)
return false;
5225 if (pItem == NULL)
return false;
5229 if (pItem->
getName() !=
"T")
return false;
5231 pTmpFraction = &pGeneralPower->
getRight();
5233 if (pTmpFraction == NULL)
return false;
5239 if (numerator->
getFractions().size() != 0)
return false;
5243 if (products->size() != 1)
return false;
5245 pProduct = *(products->begin());
5247 if (pProduct == NULL)
return false;
5249 if (pProduct->
getFactor() != 3.0)
return false;
5255 if (pItemPower == NULL)
return false;
5257 if (pItemPower->
getExp() != 1.0)
return false;
5263 if (pItem == NULL)
return false;
5267 if (pItem->
getName() !=
"J")
return false;
5269 pTmpFraction = &pLogicalItem->
getRight();
5271 if (pTmpFraction == NULL)
return false;
5277 if (numerator->
getFractions().size() != 0)
return false;
5281 if (products->size() != 1)
return false;
5283 pProduct = *(products->begin());
5285 if (pProduct == NULL)
return false;
5287 if (pProduct->
getFactor() != 6.2)
return false;
5299 if (pLogicalItem == NULL)
return false;
5305 if (pTmpFraction == NULL)
return false;
5311 if (pNumerator->
getFractions().size() != 0)
return false;
5313 const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->
getProducts();
5315 if (pProducts->size() != 1)
return false;
5319 if (pProduct == NULL)
return false;
5321 if (pProduct->
getFactor() != 1.0)
return false;
5327 if (pItemPower == NULL)
return false;
5329 if (pItemPower->
getExp() != 1.0)
return false;
5335 if (pNormalItem == NULL)
return false;
5339 if (pNormalItem->
getName() !=
"A")
return false;
5341 pTmpFraction = &pLogicalItem->
getRight();
5343 if (pTmpFraction == NULL)
return false;
5349 if (pNumerator->
getFractions().size() != 0)
return false;
5353 if (pProducts->size() != 1)
return false;
5355 pProduct = *(pProducts->begin());
5357 if (pProduct == NULL)
return false;
5359 if (pProduct->
getFactor() != 1.0)
return false;
5365 if (pItemPower == NULL)
return false;
5367 if (pItemPower->
getExp() != 1.0)
return false;
5373 if (pNormalItem == NULL)
return false;
5377 if (pNormalItem->
getName() !=
"PI")
return false;
5387 if (pLogicalItem == NULL)
return false;
5393 if (pTmpFraction == NULL)
return false;
5399 if (pNumerator->
getFractions().size() != 0)
return false;
5401 const std::set<CNormalProduct*, compareProducts >* pProducts = &pNumerator->
getProducts();
5403 if (pProducts->size() != 1)
return false;
5407 if (pProduct == NULL)
return false;
5409 if (pProduct->
getFactor() != 4.0)
return false;
5413 pTmpFraction = &pLogicalItem->
getRight();
5415 if (pTmpFraction == NULL)
return false;
5421 if (pNumerator->
getFractions().size() != 0)
return false;
5425 if (pProducts->size() != 1)
return false;
5427 pProduct = *(pProducts->begin());
5429 if (pProduct == NULL)
return false;
5431 if (pProduct->
getFactor() != 1.0)
return false;
5437 if (pItemPower == NULL)
return false;
5439 if (pItemPower->
getExp() != 1.0)
return false;
5445 if (pNormalItem == NULL)
return false;
5449 if (pNormalItem->
getName() !=
"A")
return false;
5459 if (pLogicalItem == NULL)
return false;
5465 if (pTmpFraction == NULL)
return false;
5471 if (numerator->
getFractions().size() != 0)
return false;
5473 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5475 if (products->size() != 1)
return false;
5479 if (pProduct == NULL)
return false;
5481 if (pProduct->
getFactor() != 2.0)
return false;
5485 pTmpFraction = &pLogicalItem->
getRight();
5487 if (pTmpFraction == NULL)
return false;
5493 if (numerator->
getFractions().size() != 0)
return false;
5497 if (products->size() != 1)
return false;
5499 pProduct = *(products->begin());
5501 if (pProduct == NULL)
return false;
5503 if (pProduct->
getFactor() != 1.0)
return false;
5509 if (pItemPower == NULL)
return false;
5511 if (pItemPower->
getExp() != 1.0)
return false;
5517 if (pNormalItem == NULL)
return false;
5521 if (pNormalItem->
getName() !=
"T")
return false;
5531 if (pLogicalItem == NULL)
return false;
5537 if (pTmpFraction == NULL)
return false;
5543 if (numerator->
getFractions().size() != 0)
return false;
5545 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5547 if (products->size() != 1)
return false;
5551 if (pProduct == NULL)
return false;
5553 if (pProduct->
getFactor() != 1.0)
return false;
5559 if (pItemPower == NULL)
return false;
5561 if (pItemPower->
getExp() != 1.0)
return false;
5567 if (pNormalItem == NULL)
return false;
5571 if (pNormalItem->
getName() !=
"D")
return false;
5573 pTmpFraction = &pLogicalItem->
getRight();
5575 if (pTmpFraction == NULL)
return false;
5581 if (numerator->
getFractions().size() != 0)
return false;
5585 if (products->size() != 1)
return false;
5587 pProduct = *(products->begin());
5589 if (pProduct == NULL)
return false;
5591 if (pProduct->
getFactor() != 1.0)
return false;
5597 if (pItemPower == NULL)
return false;
5599 if (pItemPower->
getExp() != 1.0)
return false;
5605 if (pNormalItem == NULL)
return false;
5609 if (pNormalItem->
getName() !=
"F")
return false;
5619 if (pLogicalItem == NULL)
return false;
5625 if (pTmpFraction == NULL)
return false;
5629 if (numerator->
getFractions().size() != 0)
return false;
5631 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5633 if (products->size() != 1)
return false;
5637 if (pProduct == NULL)
return false;
5639 if (pProduct->
getFactor() != 1.0)
return false;
5645 if (pItemPower == NULL)
return false;
5647 if (pItemPower->
getExp() != 1.0)
return false;
5653 if (pItem == NULL)
return false;
5657 if (pItem->
getName() !=
"X")
return false;
5659 pTmpFraction = &pLogicalItem->
getRight();
5661 if (pTmpFraction == NULL)
return false;
5665 if (numerator->
getFractions().size() != 0)
return false;
5669 if (products->size() != 1)
return false;
5671 pProduct = *(products->begin());
5673 if (pProduct == NULL)
return false;
5675 if (pProduct->
getFactor() != 1.0)
return false;
5681 if (pItemPower == NULL)
return false;
5683 if (pItemPower->
getExp() != 1.0)
return false;
5689 if (pFunction == NULL)
return false;
5695 if (pTmpFraction == NULL)
return false;
5701 if (numerator->
getFractions().size() != 0)
return false;
5705 if (products->size() != 1)
return false;
5707 ProductIterator productsIt = products->begin();
5708 pProduct = *(productsIt);
5710 if (pProduct == NULL)
return false;
5712 if (pProduct->
getFactor() != 1.0)
return false;
5716 std::set<CNormalItemPower*, compareItemPowers>::const_iterator itemPowersIt = pProduct->
getItemPowers().begin();
5717 pItemPower = *(itemPowersIt);
5719 if (pItemPower == NULL)
return false;
5721 if (pItemPower->
getExp() != 1.0)
return false;
5727 if (pItem == NULL)
return false;
5731 if (pItem->
getName() !=
"PI")
return false;
5734 pItemPower = *(itemPowersIt);
5736 if (pItemPower == NULL)
return false;
5738 if (pItemPower->
getExp() != 1.0)
return false;
5744 if (pItem == NULL)
return false;
5748 if (pItem->
getName() !=
"D")
return false;
5758 if (pLogicalItem == NULL)
return false;
5764 if (pTmpFraction == NULL)
return false;
5770 if (numerator->
getFractions().size() != 0)
return false;
5772 const std::set<CNormalProduct*, compareProducts >* products = &numerator->
getProducts();
5774 if (products->size() != 1)
return false;
5778 if (pProduct == NULL)
return false;
5780 if (pProduct->
getFactor() != 2.0)
return false;
5786 if (pItemPower->
getExp() != 1.0)
return false;
5792 if (pGeneralPower == NULL)
return false;
5797 pTmpFraction = &pGeneralPower->
getLeft();
5799 if (pTmpFraction == NULL)
return false;
5805 if (numerator->
getFractions().size() != 0)
return false;
5809 if (products->size() != 1)
return false;
5811 pProduct = *(products->begin());
5813 if (pProduct == NULL)
return false;
5815 if (pProduct->
getFactor() != 1.0)
return false;
5821 if (pItemPower == NULL)
return false;
5823 if (pItemPower->
getExp() != 1.0)
return false;
5829 if (pItem == NULL)
return false;
5833 if (pItem->
getName() !=
"T")
return false;
5835 pTmpFraction = &pGeneralPower->
getRight();
5837 if (pTmpFraction == NULL)
return false;
5843 if (numerator->
getFractions().size() != 0)
return false;
5847 if (products->size() != 1)
return false;
5849 pProduct = *(products->begin());
5851 if (pProduct == NULL)
return false;
5853 if (pProduct->
getFactor() != 3.0)
return false;
5859 if (pItemPower == NULL)
return false;
5861 if (pItemPower->
getExp() != 1.0)
return false;
5867 if (pItem == NULL)
return false;
5871 if (pItem->
getName() !=
"J")
return false;
5873 pTmpFraction = &pLogicalItem->
getRight();
5875 if (pTmpFraction == NULL)
return false;
5881 if (numerator->
getFractions().size() != 0)
return false;
5885 if (products->size() != 1)
return false;
5887 pProduct = *(products->begin());
5889 if (pProduct == NULL)
return false;
5891 if (pProduct->
getFactor() != 6.2)
return false;