MCPcopy Create free account
hub / github.com/Cantera/cantera / newPlusConstFunction

Function newPlusConstFunction

src/numerics/Func1.cpp:766–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766shared_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}

Callers 2

newSumFunctionFunction · 0.85
newDiffFunctionFunction · 0.85

Calls 4

isConstantFunction · 0.85
cMethod · 0.80
func1_sharedMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected