| 764 | } |
| 765 | |
| 766 | shared_ptr<Func1> newPlusConstFunction(shared_ptr<Func1> f, double c) |
| 767 | { |
| 768 | if (c == 0.0) { |
| 769 | return f; |
| 770 | } |
| 771 | if (isConstant(f)) { |
| 772 | return make_shared<Const1>(f->c() + c); |
| 773 | } |
| 774 | if (f->type() == "plus-constant") { |
| 775 | return make_shared<PlusConstant1>(f->func1_shared(), f->c() + c); |
| 776 | } |
| 777 | return make_shared<PlusConstant1>(f, c); |
| 778 | } |
| 779 | |
| 780 | } |
no test coverage detected