16Func1::Func1(
const Func1& right) :
20 m_parent(right.m_parent)
32 m_parent = right.m_parent;
39 "To be removed after Cantera 3.0. No longer needed.");
69 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
70 cout <<
"derivative error... ERR: ID = " <<
ID() << endl;
71 cout <<
write(
"x") << endl;
78 "Needs to be overloaded by Func1 specialization.");
83 if (
ID() != other.
ID() || m_c != other.m_c) {
155Sin1::Sin1(
const vector<double>& params)
157 if (params.size() != 1) {
159 "Constructor needs exactly one parameter (frequency).");
167 return fmt::format(
"\\sin({})", arg);
169 return fmt::format(
"\\sin({}{})", m_c, arg);
175 "To be removed after Cantera 3.0; no longer needed.");
177 return (
Func1&) *nfunc;
183 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
185 Func1* r = &newTimesConstFunction(*
c, m_c);
191 auto c = make_shared<Cos1>(m_c);
192 return newTimesConstFunction(
c, m_c);
197Cos1::Cos1(
const vector<double>& params)
199 if (params.size() != 1) {
201 "Constructor needs exactly one parameter (frequency).");
208 "To be removed after Cantera 3.0; no longer needed.");
210 return (
Func1&) *nfunc;
216 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
218 Func1* r = &newTimesConstFunction(*s, -m_c);
224 auto s = make_shared<Sin1>(m_c);
225 return newTimesConstFunction(s, -m_c);
231 return fmt::format(
"\\cos({})", arg);
233 return fmt::format(
"\\cos({}{})", m_c, arg);
239Exp1::Exp1(
const vector<double>& params)
241 if (params.size() != 1) {
243 "Constructor needs exactly one parameter (exponent factor).");
250 "To be removed after Cantera 3.0; no longer needed.");
251 return *(
new Exp1(m_c));
257 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
260 return newTimesConstFunction(*f, m_c);
268 auto f = make_shared<Exp1>(m_c);
270 return newTimesConstFunction(f, m_c);
278 return fmt::format(
"\\exp({})", arg);
280 return fmt::format(
"\\exp({}{})", m_c, arg);
284Log1::Log1(
const vector<double>& params)
286 if (params.size() != 1) {
288 "Constructor needs exactly one parameter (factor).");
295 auto f = make_shared<Pow1>(-1.);
297 return newTimesConstFunction(f, m_c);
305 return fmt::format(
"\\log({})", arg);
307 return fmt::format(
"\\log({}{})", m_c, arg);
312Pow1::Pow1(
const vector<double>& params)
314 if (params.size() != 1) {
316 "Constructor needs exactly one parameter (exponent).");
323 "To be removed after Cantera 3.0; no longer needed.");
324 return *(
new Pow1(m_c));
330 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
334 }
else if (m_c == 1.0) {
338 r = &newTimesConstFunction(*f, m_c);
346 return make_shared<Const1>(0.0);
349 return make_shared<Const1>(1.0);
351 auto f = make_shared<Pow1>(m_c - 1.);
352 return newTimesConstFunction(f, m_c);
357Const1::Const1(
const vector<double>& params)
359 if (params.size() != 1) {
361 "Constructor needs exactly one parameter (constant).");
366Poly1::Poly1(
const vector<double>& params)
368 if (params.size() == 0) {
370 "Constructor needs an array that is not empty.");
372 size_t n = params.size() - 1;
373 m_cpoly.resize(n + 1);
374 copy(params.data(), params.data() + m_cpoly.size(), m_cpoly.begin());
377Fourier1::Fourier1(
const vector<double>& params)
379 if (params.size() < 4) {
381 "Constructor needs an array with at least 4 entries.");
383 if (params.size() % 2 != 0) {
385 "Constructor needs an array with an even number of entries.");
387 size_t n = params.size() / 2 - 1;
388 m_omega = params[n + 1];
389 m_a0_2 = 0.5 * params[0];
392 copy(params.data() + 1, params.data() + n + 1, m_ccos.begin());
393 copy(params.data() + n + 2, params.data() + 2 * n + 2, m_csin.begin());
396Gaussian1::Gaussian1(
const vector<double>& params)
398 if (params.size() != 3) {
400 "Constructor needs exactly 3 parameters (amplitude, center, width).");
404 m_tau = params[2] / (2. * sqrt(log(2.)));
407Arrhenius1::Arrhenius1(
const vector<double>& params)
409 if (params.size() < 3) {
411 "Constructor needs an array with at least 3 entries.");
413 if (params.size() % 3 != 0) {
415 "Constructor needs an array with multiples of 3 entries.");
417 size_t n = params.size() / 3;
421 for (
size_t i = 0; i < n; i++) {
423 m_A[i] = params[loc];
424 m_b[i] = params[loc + 1];
425 m_E[i] = params[loc + 2];
430 const string& method)
433 std::copy(tvals, tvals + n,
m_tvec.begin());
434 for (
auto it = std::begin(
m_tvec) + 1; it != std::end(
m_tvec); it++) {
435 if (*(it - 1) > *it) {
437 "time values are not increasing monotonically.");
441 std::copy(fvals, fvals + n,
m_fvec.begin());
447 if (params.size() < 4) {
449 "Constructor needs an array with at least 4 entries.");
451 if (params.size() % 2 != 0) {
453 "Constructor needs an array with an even number of entries.");
455 size_t n = params.size() / 2;
457 copy(params.data(), params.data() + n,
m_tvec.begin());
458 for (
auto it = std::begin(
m_tvec) + 1; it != std::end(
m_tvec); it++) {
459 if (*(it - 1) > *it) {
461 "Time values are not monotonically increasing.");
465 copy(params.data() + n, params.data() + 2 * n,
m_fvec.begin());
470 if (method ==
"linear") {
472 }
else if (method ==
"previous") {
476 "Interpolation method '{}' is not implemented.", method);
481 size_t siz =
m_tvec.size();
485 }
else if (t >=
m_tvec[siz-1]) {
489 while (t >
m_tvec[ix+1]) {
505 "To be removed after Cantera 3.0; no longer needed.");
517 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
520 size_t siz =
m_tvec.size();
524 for (
size_t i=1; i<siz; i++) {
527 tvec.push_back(
m_tvec[i-1]);
531 tvec.push_back(
m_tvec[siz-1]);
535 tvec.push_back(
m_tvec[0]);
536 tvec.push_back(
m_tvec[siz-1]);
540 return *(
new Tabulated1(tvec.size(), &tvec[0], &dvec[0],
"previous"));
546 size_t siz =
m_tvec.size();
550 for (
size_t i=1; i<siz; i++) {
553 tvec.push_back(
m_tvec[i-1]);
557 tvec.push_back(
m_tvec[siz-1]);
561 tvec.push_back(
m_tvec[0]);
562 tvec.push_back(
m_tvec[siz-1]);
566 return make_shared<Tabulated1>(tvec.size(), &tvec[0], &dvec[0],
"previous");
571Gaussian::Gaussian(
double A,
double t0,
double fwhm) :
Gaussian1(A, t0, fwhm)
573 warn_deprecated(
"Gaussian::Gaussian",
"To be removed after Cantera 3.0. "
574 "Replaced by 'Gaussian1'.");
577Gaussian::Gaussian(
const Gaussian& b) : Gaussian1(b)
579 warn_deprecated(
"Gaussian::Gaussian",
"To be removed after Cantera 3.0. "
580 "Replaced by 'Gaussian1'.");
585 "To be removed after Cantera 3.0; no longer needed.");
587 return *((
Func1*)np);
592 "To be removed after Cantera 3.0; no longer needed.");
594 return *((
Func1*)np);
599 "To be removed after Cantera 3.0; no longer needed.");
601 return *((
Func1*)np);
606 "To be removed after Cantera 3.0; no longer needed.");
608 return *((
Func1*)np);
613 "To be removed after Cantera 3.0; no longer needed.");
615 return *((
Func1*)np);
620 return fmt::format(
"\\mathrm{{{}}}({})",
type(), arg);
626 return "\\sqrt{" + arg +
"}";
629 return "\\frac{1}{\\sqrt{" + arg +
"}}";
632 return fmt::format(
"\\left({}\\right)^{{{}}}", arg, m_c);
640 return fmt::format(
"\\mathrm{{Tabulated}}({})", arg);
645 return fmt::format(
"{}", m_c);
650 "To be removed after Cantera 3.0; no longer needed.");
651 return *(
new Const1(m_c));
656 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
663 return "\\frac{" + m_f1->
write(arg) +
"}{"
664 + m_f2->
write(arg) +
"}";
669 "To be removed after Cantera 3.0; no longer needed.");
672 return newRatioFunction(f1d, f2d);
677 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
680 Func1& s = newDiffFunction(a1, a2);
682 return newRatioFunction(s, p);
686 auto a1 = newProdFunction(m_f1_shared->derivative3(), m_f2_shared);
687 auto a2 = newProdFunction(m_f1_shared, m_f2_shared->derivative3());
688 auto s = newDiffFunction(a1, a2);
689 auto p = newProdFunction(m_f2_shared, m_f2_shared);
690 return newRatioFunction(s, p);
695 string s = m_f1->
write(arg);
697 s =
"\\left(" + s +
"\\right)";
699 string s2 = m_f2->
write(arg);
701 s2 =
"\\left(" + s2 +
"\\right)";
708 "To be removed after Cantera 3.0; no longer needed.");
711 return newProdFunction(f1d, f2d);
716 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
719 return newSumFunction(a1, a2);
723 auto a1 = newProdFunction(m_f1_shared, m_f2_shared->derivative3());
724 auto a2 = newProdFunction(m_f2_shared, m_f1_shared->derivative3());
725 return newSumFunction(a1, a2);
730 string s1 = m_f1->
write(arg);
731 string s2 = m_f2->
write(arg);
733 return s1 +
" - " + s2.substr(1,s2.size());
735 return s1 +
" + " + s2;
741 "To be removed after Cantera 3.0; no longer needed.");
744 return newSumFunction(f1d, f2d);
749 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
752 return newSumFunction(d1, d2);
757 string s1 = m_f1->
write(arg);
758 string s2 = m_f2->
write(arg);
760 return s1 +
" + " + s2.substr(1,s2.size());
762 return s1 +
" - " + s2;
768 "To be removed after Cantera 3.0; no longer needed.");
771 return newDiffFunction(f1d, f2d);
776 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
782 string g = m_f2->
write(arg);
783 return m_f1->
write(g);
788 "To be removed after Cantera 3.0; no longer needed.");
791 return newCompositeFunction(f1d, f2d);
796 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
800 Func1* p = &newProdFunction(*d3, *d2);
805 auto d1 = m_f1_shared->derivative3();
806 auto d2 = m_f2_shared->derivative3();
807 auto d3 = newCompositeFunction(d1, m_f2_shared);
808 return newProdFunction(d3, d2);
813 string s = m_f1->
write(arg);
815 s =
"\\left(" + s +
"\\right)";
824 if (n >=
'0' && n <=
'9') {
825 s =
"\\left(" + s +
"\\right)";
827 return fmt::format(
"{}{}", m_c, s);
832 "To be removed after Cantera 3.0; no longer needed.");
840 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
842 Func1* d = &newTimesConstFunction(f1d, m_c);
849 return m_f1->
write(arg);
851 return fmt::format(
"{} + {}", m_f1->
write(arg), m_c);
856 "To be removed after Cantera 3.0; no longer needed.");
864 "To be changed after Cantera 3.0; for new behavior, see 'derivative3'.");
876double Func1::isProportional(Func1& other)
887static bool isConstant(Func1& f)
889 if (f.type() ==
"constant") {
896bool isConstant(
const shared_ptr<Func1>& f)
898 return f->type() ==
"constant";
901static bool isZero(Func1& f)
903 if (f.type() ==
"constant" && f.c() == 0.0) {
910bool isZero(
const shared_ptr<Func1>& f)
912 return f->type() ==
"constant" && f->c() == 0.0;
915static bool isOne(Func1& f)
917 if (f.type() ==
"constant" && f.c() == 1.0) {
924bool isOne(
const shared_ptr<Func1>& f)
926 return f->type() ==
"constant" && f->c() == 1.0;
929static bool isTimesConst(Func1& f)
931 if (f.type() ==
"times-constant") {
938bool isTimesConst(
const shared_ptr<Func1>& f)
940 return f->type() ==
"times-constant";
943static bool isExp(Func1& f)
945 if (f.type() ==
"exp") {
952bool isExp(
const shared_ptr<Func1>& f)
954 return f->type() ==
"exp";
957static bool isPow(Func1& f)
959 if (f.type() ==
"pow") {
966bool isPow(
const shared_ptr<Func1>& f)
968 return f->type() ==
"pow";
973Func1& newSumFunction(Func1& f1, Func1& f2)
976 "To be removed after Cantera 3.0; replaced by shared pointer version.");
978 if (f1.isIdentical(f2)) {
979 return newTimesConstFunction(f1, 2.0);
989 double c = f1.isProportional(f2);
992 return *(
new Const1(0.0));
994 return newTimesConstFunction(f1, c + 1.0);
997 return *(
new Sum1(f1, f2));
1000shared_ptr<Func1> newSumFunction(shared_ptr<Func1> f1, shared_ptr<Func1> f2)
1002 if (f1->isIdentical(*f2)) {
1003 return newTimesConstFunction(f1, 2.);
1011 double c = f1->isProportional(*f2);
1014 return make_shared<Const1>(0.);
1016 return newTimesConstFunction(f1, c + 1.);
1018 return make_shared<Sum1>(f1, f2);
1021Func1& newDiffFunction(Func1& f1, Func1& f2)
1024 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1030 if (f1.isIdentical(f2)) {
1033 return *(
new Const1(0.0));
1035 double c = f1.isProportional(f2);
1038 return *(
new Const1(0.0));
1040 return newTimesConstFunction(f1, 1.0 - c);
1043 return *(
new Diff1(f1, f2));
1046shared_ptr<Func1> newDiffFunction(shared_ptr<Func1> f1, shared_ptr<Func1> f2)
1052 return newTimesConstFunction(f2, -1.);
1055 if (f1->isIdentical(*f2)) {
1056 return make_shared<Const1>(0.);
1058 double c = f1->isProportional(*f2);
1061 return make_shared<Const1>(0.);
1063 return newTimesConstFunction(f1, 1. - c);
1066 return make_shared<Diff1>(f1, f2);
1069Func1& newProdFunction(Func1& f1, Func1& f2)
1072 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1082 if (isZero(f1) || isZero(f2)) {
1085 return *(
new Const1(0.0));
1087 if (isConstant(f1) && isConstant(f2)) {
1088 double c1c2 = f1.c() * f2.c();
1091 return *(
new Const1(c1c2));
1093 if (isConstant(f1)) {
1096 return newTimesConstFunction(f2, c);
1098 if (isConstant(f2)) {
1101 return newTimesConstFunction(f1, c);
1104 if (isPow(f1) && isPow(f2)) {
1105 Func1& p = *(
new Pow1(f1.c() + f2.c()));
1111 if (isExp(f1) && isExp(f2)) {
1112 Func1& p = *(
new Exp1(f1.c() + f2.c()));
1118 bool tc1 = isTimesConst(f1);
1119 bool tc2 = isTimesConst(f2);
1122 double c1 = 1.0, c2 = 1.0;
1123 Func1* ff1 = 0, *ff2 = 0;
1126 ff1 = &f1.func1_dup();
1133 ff2 = &f2.func1_dup();
1138 Func1& p = newProdFunction(*ff1, *ff2);
1140 if (c1* c2 != 1.0) {
1141 return newTimesConstFunction(p, c1*c2);
1146 return *(
new Product1(f1, f2));
1150shared_ptr<Func1> newProdFunction(shared_ptr<Func1> f1, shared_ptr<Func1> f2)
1158 if (isZero(f1) || isZero(f2)) {
1159 return make_shared<Const1>(0.);
1161 if (isConstant(f1) && isConstant(f2)) {
1162 return make_shared<Const1>(f1->c() * f2->c());
1164 if (isConstant(f1)) {
1165 return newTimesConstFunction(f2, f1->c());
1167 if (isConstant(f2)) {
1168 return newTimesConstFunction(f1, f2->c());
1170 if (isPow(f1) && isPow(f2)) {
1171 return make_shared<Pow1>(f1->c() + f2->c());
1173 if (isExp(f1) && isExp(f2)) {
1174 return make_shared<Exp1>(f1->c() + f2->c());
1177 bool tc1 = isTimesConst(f1);
1178 bool tc2 = isTimesConst(f2);
1185 ff1 = f1->func1_shared();
1191 ff2 = f2->func1_shared();
1193 auto p = newProdFunction(ff1, ff2);
1195 if (c1 * c2 != 1.0) {
1196 return newTimesConstFunction(p, c1 * c2);
1200 return make_shared<Product1>(f1, f2);
1203Func1& newRatioFunction(Func1& f1, Func1& f2)
1206 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1212 return *(
new Const1(0.0));
1214 if (f1.isIdentical(f2)) {
1217 return *(
new Const1(1.0));
1219 if (f1.ID() == PowFuncType && f2.ID() == PowFuncType) {
1220 return *(
new Pow1(f1.c() - f2.c()));
1222 if (f1.ID() == ExpFuncType && f2.ID() == ExpFuncType) {
1223 return *(
new Exp1(f1.c() - f2.c()));
1225 return *(
new Ratio1(f1, f2));
1228shared_ptr<Func1> newRatioFunction(shared_ptr<Func1> f1, shared_ptr<Func1> f2)
1234 return make_shared<Const1>(0.);
1236 if (f1->isIdentical(*f2)) {
1237 return make_shared<Const1>(1.);
1239 if (isPow(f1) && isPow(f2)) {
1240 return make_shared<Pow1>(f1->c() - f2->c());
1242 if (isExp(f1) && isExp(f2)) {
1243 return make_shared<Exp1>(f1->c() - f2->c());
1245 return make_shared<Ratio1>(f1, f2);
1248Func1& newCompositeFunction(Func1& f1, Func1& f2)
1251 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1256 return *(
new Const1(0.0));
1258 if (isConstant(f1)) {
1262 if (isPow(f1) && f1.c() == 1.0) {
1266 if (isPow(f1) && f1.c() == 0.0) {
1269 return *(
new Const1(1.0));
1271 if (isPow(f1) && isPow(f2)) {
1272 double c1c2 = f1.c() * f2.c();
1275 return *(
new Pow1(c1c2));
1277 return *(
new Composite1(f1, f2));
1280shared_ptr<Func1> newCompositeFunction(shared_ptr<Func1> f1, shared_ptr<Func1> f2)
1283 return make_shared<Const1>(0.0);
1285 if (isConstant(f1)) {
1288 if (isPow(f1) && f1->c() == 1.0) {
1291 if (isPow(f1) && f1->c() == 0.0) {
1292 return make_shared<Const1>(1.);
1294 if (isPow(f1) && isPow(f2)) {
1295 return make_shared<Pow1>(f1->c() * f2->c());
1297 return make_shared<Composite1>(f1, f2);
1300Func1& newTimesConstFunction(Func1& f,
double c)
1303 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1307 return *(
new Const1(0.0));
1312 if (f.type() ==
"times-constant") {
1316 return *(
new TimesConstant1(f, c));
1319shared_ptr<Func1> newTimesConstFunction(shared_ptr<Func1> f,
double c)
1322 return make_shared<Const1>(0.0);
1327 if (f->type() ==
"times-constant") {
1328 return make_shared<TimesConstant1>(f->func1_shared(), f->c() * c);
1330 return make_shared<TimesConstant1>(f, c);
1333Func1& newPlusConstFunction(Func1& f,
double c)
1336 "To be removed after Cantera 3.0; replaced by shared pointer version.");
1341 if (isConstant(f)) {
1342 double cc = f.c() + c;
1344 return *(
new Const1(cc));
1346 if (f.type() ==
"plus-constant") {
1350 return *(
new PlusConstant1(f, c));
1353shared_ptr<Func1> newPlusConstFunction(shared_ptr<Func1> f,
double c)
1358 if (isConstant(f)) {
1359 return make_shared<Const1>(f->c() + c);
1361 if (f->type() ==
"plus-constant") {
1362 return make_shared<PlusConstant1>(f->func1_shared(), f->c() + c);
1364 return make_shared<PlusConstant1>(f, c);
Implements a sum of Arrhenius terms.
Func1 & duplicate() const override
Duplicate the current function.
Base class for exceptions thrown by Cantera classes.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
Func1 & duplicate() const override
Duplicate the current function.
Implements the cos() function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
Func1 & duplicate() const override
Duplicate the current function.
Implements the exp() (exponential) function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Implements a Fourier cosine/sine series.
Func1 & duplicate() const override
Duplicate the current function.
Base class for 'functor' classes that evaluate a function of one variable.
string typeName() const
Returns a string with the class name of the functor.
virtual string type() const
Returns a string describing the type of the function.
Func1 & operator=(const Func1 &right)
void setC(double c)
Function to set the stored constant.
virtual double eval(double t) const
Evaluate the function.
virtual shared_ptr< Func1 > derivative3() const
Creates a derivative to the current function.
Func1 & func1_dup() const
Func1 & func2() const
accessor function for m_f2
virtual string write(const string &arg) const
Write LaTeX string describing function.
double operator()(double t) const
Calls method eval to evaluate the function.
Func1 & func1() const
accessor function for m_f1
virtual int order() const
Return the order of the function, if it makes sense.
bool isIdentical(Func1 &other) const
Routine to determine if two functions are the same.
virtual Func1 & duplicate() const
Duplicate the current function.
virtual Func1 & derivative() const
Creates a derivative to the current function.
double c() const
Accessor function for the stored constant.
Func1 & func2_dup() const
Implements a Gaussian function.
Func1 & duplicate() const override
Duplicate the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
An error indicating that an unimplemented function has been called.
Implements a periodic function.
Func1 & duplicate() const override
Duplicate the current function.
Implements the sum of a function and a constant.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
Func1 & duplicate() const override
Duplicate the current function.
Implements a polynomial of degree n.
Func1 & duplicate() const override
Duplicate the current function.
Implements the pow() (power) function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Func1 & derivative() const override
Creates a derivative to the current function.
int order() const override
Return the order of the function, if it makes sense.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Implements the sin() function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Func1 & duplicate() const override
Duplicate the current function.
Func1 & derivative() const override
Creates a derivative to the current function.
string write(const string &arg) const override
Write LaTeX string describing function.
Func1 & duplicate() const override
Duplicate the current function.
Implements a tabulated function.
Func1 & derivative() const override
Creates a derivative to the current function.
double eval(double t) const override
Evaluate the function.
string write(const string &arg) const override
Write LaTeX string describing function.
void setMethod(const string &method)
Set the interpolation method.
vector< double > m_tvec
Vector of time values.
bool m_isLinear
Boolean indicating interpolation method.
vector< double > m_fvec
Vector of function values.
shared_ptr< Func1 > derivative3() const override
Creates a derivative to the current function.
Tabulated1(size_t n, const double *tvals, const double *fvals, const string &method="linear")
Constructor.
Func1 & duplicate() const override
Duplicate the current function.
Implements the product of a function and a constant.
Func1 & derivative() const override
Creates a derivative to the current function.
int order() const override
Return the order of the function, if it makes sense.
string write(const string &arg) const override
Write LaTeX string describing function.
Func1 & duplicate() const override
Duplicate the current function.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
string demangle(const std::type_info &type)
Convert a type name to a human readable string, using boost::core::demangle if available.
Namespace for the Cantera kernel.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Contains declarations for string manipulation functions within Cantera.