16 #include "unsupported/Eigen/Polynomials"
31 if (
static_cast<size_t>(coefficients.rows()) == rows) {
32 if (
static_cast<size_t>(coefficients.cols()) == columns) {
35 throw ValueError(
format(
"%s (%d): The number of columns %d does not match with %d. ", __FILE__, __LINE__, coefficients.cols(), columns));
38 throw ValueError(
format(
"%s (%d): The number of rows %d does not match with %d. ", __FILE__, __LINE__, coefficients.rows(), rows));
57 throw ValueError(
format(
"%s (%d): You have to provide a positive order for integration, %d is not valid. ", __FILE__, __LINE__, times));
58 if (times == 0)
return Eigen::MatrixXd(coefficients);
59 Eigen::MatrixXd oldCoefficients;
60 Eigen::MatrixXd newCoefficients(coefficients);
64 newCoefficients = Eigen::MatrixXd(coefficients);
67 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
71 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
76 for (
int k = 0; k < times; k++) {
77 oldCoefficients = Eigen::MatrixXd(newCoefficients);
78 r = oldCoefficients.rows(), c = oldCoefficients.cols();
79 newCoefficients = Eigen::MatrixXd::Zero(r + 1, c);
80 newCoefficients.block(1, 0, r, c) = oldCoefficients.block(0, 0, r, c);
81 for (
size_t i = 0; i < r; ++i) {
82 for (
size_t j = 0; j < c; ++j)
83 newCoefficients(i + 1, j) /= (i + 1.);
91 newCoefficients.transposeInPlace();
95 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
99 return newCoefficients;
111 throw ValueError(
format(
"%s (%d): You have to provide a positive order for derivation, %d is not valid. ", __FILE__, __LINE__, times));
112 if (times == 0)
return Eigen::MatrixXd(coefficients);
117 Eigen::MatrixXd newCoefficients;
121 newCoefficients = Eigen::MatrixXd(coefficients);
124 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
128 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
132 std::size_t r, c, i, j;
133 for (
int k = 0; k < times; k++) {
134 r = newCoefficients.rows(), c = newCoefficients.cols();
135 for (i = 1; i < r; ++i) {
136 for (j = 0; j < c; ++j)
137 newCoefficients(i, j) *= i;
146 newCoefficients.transposeInPlace();
150 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
154 return newCoefficients;
168 double result = Eigen::poly_eval(
makeVector(coefficients), x_in);
170 std::cout <<
"Running 1D evaluate(" <<
mat_to_string(coefficients) <<
", x_in:" <<
vec_to_string(x_in) <<
"): " << result << std::endl;
177 size_t r = coefficients.rows();
178 double result =
evaluate(coefficients.row(r - 1), y_in);
179 for (
int i =
static_cast<int>(r) - 2; i >= 0; i--) {
181 result +=
evaluate(coefficients.row(i), y_in);
185 <<
", y_in:" <<
vec_to_string(y_in) <<
"): " << result << std::endl;
193 double Polynomial2D::derivative(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis = -1) {
201 double Polynomial2D::integral(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis = -1) {
210 if (
do_debug()) std::cout <<
format(
"Called solve_limits with: min=%f and max=%f", min, max) << std::endl;
214 double result =
Brent(res, min, max, macheps, tol, maxiter);
215 if (this->
do_debug()) std::cout <<
"Brent solver message: " << res->
errstring << std::endl;
223 if (
do_debug()) std::cout <<
format(
"Called solve_guess with: guess=%f ", guess) << std::endl;
227 double result =
Newton(res, guess, tol, maxiter);
228 if (this->
do_debug()) std::cout <<
"Newton solver message: " << res->
errstring << std::endl;
236 Eigen::VectorXd
Polynomial2D::solve(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const int& axis = -1) {
237 std::size_t r = coefficients.rows(), c = coefficients.cols();
238 Eigen::VectorXd tmpCoefficients;
241 tmpCoefficients = Eigen::VectorXd::Zero(r);
242 for (
size_t i = 0; i < r; i++) {
243 tmpCoefficients(i, 0) =
evaluate(coefficients.row(i), in);
247 tmpCoefficients = Eigen::VectorXd::Zero(c);
248 for (
size_t i = 0; i < c; i++) {
249 tmpCoefficients(i, 0) =
evaluate(coefficients.col(i), in);
253 throw ValueError(
format(
"%s (%d): You have to provide a dimension, 0 or 1, for the solver, %d is not valid. ", __FILE__, __LINE__, axis));
256 tmpCoefficients(0, 0) -= z_in;
257 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(tmpCoefficients)) << std::endl;
258 Eigen::PolynomialSolver<double, Eigen::Dynamic> polySolver(tmpCoefficients);
259 std::vector<double> rootsVec;
260 polySolver.realRoots(rootsVec);
269 double Polynomial2D::solve_limits(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const double& min,
const double& max,
279 double Polynomial2D::solve_guess(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const double& guess,
const int& axis) {
290 for (
unsigned int i = 0; i < coefficients.size(); i++) {
291 result += coefficients[i] * pow(x, (
int)i);
294 std::cout <<
"Running simplePolynomial(" <<
vec_to_string(coefficients) <<
", " <<
vec_to_string(x) <<
"): " << result << std::endl;
299 for (
unsigned int i = 0; i < coefficients.size(); i++) {
304 <<
"): " << result << std::endl;
315 for (
int i =
static_cast<int>(coefficients.size()) - 1; i >= 0; i--) {
317 result += coefficients[i];
320 std::cout <<
"Running baseHorner(" <<
vec_to_string(coefficients) <<
", " <<
vec_to_string(x) <<
"): " << result << std::endl;
326 for (
int i =
static_cast<int>(coefficients.size() - 1); i >= 0; i--) {
332 <<
"): " << result << std::endl;
343 throw ValueError(
format(
"%s (%d): You have to provide a dimension to the solver, %d is not valid. ", __FILE__, __LINE__,
axis));
399 throw ValueError(
format(
"%s (%d): You have to provide a positive order for derivation, %d is not valid. ", __FILE__, __LINE__, times));
400 if (times == 0)
return Eigen::MatrixXd(coefficients);
405 Eigen::MatrixXd newCoefficients;
409 newCoefficients = Eigen::MatrixXd(coefficients);
412 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
416 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
420 std::size_t r = newCoefficients.rows(), c = newCoefficients.cols();
422 for (
int k = 0; k < times; k++) {
423 for (i = 0; i < r; ++i) {
424 for (j = 0; j < c; ++j) {
425 newCoefficients(i, j) *= double(i) + double(firstExponent);
434 newCoefficients.transposeInPlace();
438 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
442 return newCoefficients;
461 size_t r = coefficients.rows();
462 size_t c = coefficients.cols();
464 if ((r != 1) && (c != 1)) {
465 throw ValueError(
format(
"%s (%d): You have a 2D coefficient matrix (%d,%d), please use the 2D functions. ", __FILE__, __LINE__,
466 coefficients.rows(), coefficients.cols()));
468 if ((firstExponent < 0) && (std::abs(x_in - x_base) <
CPPOLY_EPSILON)) {
472 const double y_lo =
evaluate(coefficients, x_lo, firstExponent, x_base);
473 const double y_hi =
evaluate(coefficients, x_hi, firstExponent, x_base);
474 return (y_hi - y_lo)/(x_hi - x_lo) * (x_in - x_lo) + y_lo;
477 Eigen::MatrixXd tmpCoeffs(coefficients);
479 tmpCoeffs.transposeInPlace();
483 Eigen::MatrixXd newCoeffs;
487 for (
int i = 0; i > firstExponent; i--) {
489 negExp += tmpCoeffs(0, 0);
492 negExp /= x_in - x_base;
493 c = tmpCoeffs.cols();
496 for (
int i = 0; i < firstExponent; i++) {
497 newCoeffs = Eigen::MatrixXd::Zero(r, c + 1);
498 newCoeffs.block(0, 1, r, c) = tmpCoeffs.block(0, 0, r, c);
499 tmpCoeffs = Eigen::MatrixXd(newCoeffs);
500 c = tmpCoeffs.cols();
503 if (c > 0) posExp += Eigen::poly_eval(Eigen::RowVectorXd(tmpCoeffs), x_in - x_base);
504 return negExp + posExp;
514 double Polynomial2DFrac::evaluate(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& x_exp,
const int& y_exp,
515 const double& x_base,
const double& y_base) {
518 if (this->
do_debug()) std::cout <<
"Interpolating in x-direction for base " << x_base <<
" and input " << x_in << std::endl;
521 const double z_lo =
evaluate(coefficients, x_lo, y_in, x_exp, y_exp, x_base, y_base);
522 const double z_hi =
evaluate(coefficients, x_hi, y_in, x_exp, y_exp, x_base, y_base);
523 return (z_hi - z_lo)/(x_hi - x_lo) * (x_in - x_lo) + z_lo;
527 if (this->
do_debug()) std::cout <<
"Interpolating in y-direction for base " << y_base <<
" and input " << y_in << std::endl;
530 const double z_lo =
evaluate(coefficients, x_in, y_lo, x_exp, y_exp, x_base, y_base);
531 const double z_hi =
evaluate(coefficients, x_in, y_hi, x_exp, y_exp, x_base, y_base);
532 return (z_hi - z_lo)/(y_hi - y_lo) * (y_in - y_lo) + z_lo;
535 Eigen::MatrixXd tmpCoeffs(coefficients);
536 Eigen::MatrixXd newCoeffs;
537 size_t r = tmpCoeffs.rows();
538 size_t c = tmpCoeffs.cols();
542 for (
int i = 0; i > x_exp; i--) {
543 r = tmpCoeffs.rows();
545 negExp +=
evaluate(tmpCoeffs.row(0), y_in, y_exp, y_base);
548 negExp /= x_in - x_base;
551 r = tmpCoeffs.rows();
552 for (
int i = 0; i < x_exp; i++) {
553 newCoeffs = Eigen::MatrixXd::Zero(r + 1, c);
554 newCoeffs.block(1, 0, r, c) = tmpCoeffs.block(0, 0, r, c);
555 tmpCoeffs = Eigen::MatrixXd(newCoeffs);
560 if (r > 0) posExp +=
evaluate(tmpCoeffs.row(r - 1), y_in, y_exp, y_base);
561 for (
int i =
static_cast<int>(r) - 2; i >= 0; i--) {
562 posExp *= x_in - x_base;
563 posExp +=
evaluate(tmpCoeffs.row(i), y_in, y_exp, y_base);
565 if (this->
do_debug()) std::cout <<
"Running 2D evaluate(" <<
mat_to_string(coefficients) <<
", " << std::endl;
569 <<
"): " << negExp + posExp << std::endl;
570 return negExp + posExp;
582 const int& y_exp,
const double& x_base,
const double& y_base) {
583 Eigen::MatrixXd newCoefficients;
584 int der_exp, other_exp;
585 double der_val, other_val;
586 double int_base, other_base;
590 newCoefficients = Eigen::MatrixXd(coefficients);
599 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
609 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
614 newCoefficients =
deriveCoeffs(newCoefficients, 0, times, der_exp);
617 return evaluate(newCoefficients, der_val, other_val, der_exp, other_exp, int_base, other_base);
629 double Polynomial2DFrac::integral(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis,
const int& x_exp,
630 const int& y_exp,
const double& x_base,
const double& y_base,
const double& ax_val) {
632 Eigen::MatrixXd newCoefficients;
633 int int_exp, other_exp;
634 double int_val, other_val;
635 double int_base, other_base;
639 newCoefficients = Eigen::MatrixXd(coefficients);
648 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
658 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
664 format(
"%s (%d): This function is only implemented for lowest exponents >= -1, int_exp=%d ", __FILE__, __LINE__, int_exp));
668 format(
"%s (%d): This function is only implemented for indefinite integrals, ax_val=%d ", __FILE__, __LINE__, ax_val));
670 size_t r = newCoefficients.rows();
671 size_t c = newCoefficients.cols();
675 Eigen::MatrixXd tmpCoefficients = newCoefficients.row(0) * log(int_val - int_base);
676 newCoefficients =
integrateCoeffs(newCoefficients.block(1, 0, r - 1, c), 0, 1);
677 newCoefficients.row(0) = tmpCoefficients;
678 return evaluate(newCoefficients, int_val, other_val, 0, other_exp, int_base, other_base);
681 newCoefficients = Eigen::MatrixXd(r, 1);
682 for (std::size_t i = 0; i < r; i++) {
683 newCoefficients(i, 0) =
evaluate(coefficients.row(i), other_val, other_exp, other_base);
685 return fracIntCentral(newCoefficients.transpose(), int_val, int_base);
689 Eigen::MatrixXd tmpCoeffs;
690 r = newCoefficients.rows();
691 for (
int i = 0; i < int_exp; i++) {
692 tmpCoeffs = Eigen::MatrixXd::Zero(r + 1, c);
693 tmpCoeffs.block(1, 0, r, c) = newCoefficients.block(0, 0, r, c);
694 newCoefficients = Eigen::MatrixXd(tmpCoeffs);
698 return evaluate(
integrateCoeffs(newCoefficients, 0, 1), int_val, other_val, 0, other_exp, int_base, other_base);
710 Eigen::VectorXd
Polynomial2DFrac::solve(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const int& axis,
const int& x_exp,
711 const int& y_exp,
const double& x_base,
const double& y_base) {
713 Eigen::MatrixXd newCoefficients;
714 Eigen::VectorXd tmpCoefficients;
715 int solve_exp, other_exp;
720 newCoefficients = Eigen::MatrixXd(coefficients);
726 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
732 throw ValueError(
format(
"%s (%d): You have to provide a dimension, 0 or 1, for the solver, %d is not valid. ", __FILE__, __LINE__, axis));
736 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(newCoefficients)) << std::endl;
738 const size_t r = newCoefficients.rows();
739 for (
size_t i = 0; i < r; i++) {
740 newCoefficients(i, 0) =
evaluate(newCoefficients.row(i), input, other_exp);
744 if (solve_exp >= 0) {
745 tmpCoefficients = Eigen::VectorXd::Zero(r + solve_exp);
746 tmpCoefficients.block(solve_exp, 0, r, 1) = newCoefficients.block(0, 0, r, 1);
747 tmpCoefficients(0, 0) -= z_in;
749 int diff = 1 -
static_cast<int>(r) - solve_exp;
750 tmpCoefficients = Eigen::VectorXd::Zero(r + std::max(diff, 0));
751 tmpCoefficients.block(0, 0, r, 1) = newCoefficients.block(0, 0, r, 1);
752 tmpCoefficients(r + diff - 1, 0) -= z_in;
753 throw NotImplementedError(
format(
"%s (%d): Currently, there is no solver for the generalised polynomial, an exponent of %d is not valid. ",
754 __FILE__, __LINE__, solve_exp));
757 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(tmpCoefficients)) << std::endl;
758 Eigen::PolynomialSolver<double, -1> polySolver(tmpCoefficients);
759 std::vector<double> rootsVec;
760 polySolver.realRoots(rootsVec);
778 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base) {
780 std::cout <<
format(
"Called solve_limits with: %f, %f, %f, %f, %d, %d, %d, %f, %f", in, z_in, min, max, axis, x_exp, y_exp, x_base, y_base)
797 const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base) {
799 std::cout <<
format(
"Called solve_guess with: %f, %f, %f, %d, %d, %d, %f, %f", in, z_in, guess, axis, x_exp, y_exp, x_base, y_base)
818 const double& max,
const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
819 const double& y_base,
const int& int_axis) {
836 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base,
837 const int& int_axis) {
855 for (
int i = 2; i <= nValue; i++)
862 if (nValue2 == 1)
return nValue * 1.0;
870 if (m < 1)
throw ValueError(
format(
"%s (%d): You have to provide coefficients, a vector length of %d is not a valid. ", __FILE__, __LINE__, m));
872 Eigen::MatrixXd D = Eigen::MatrixXd::Zero(1, m);
875 for (
int j = 0; j < m; j++) {
876 tmp = pow(-1.0, j) * log(x_in) * pow(x_base, j);
877 for (
int k = 0; k < j; k++) {
878 tmp +=
binom(j, k) * pow(-1.0, k) / (j - k) * pow(x_in, j - k) * pow(x_base, k);
889 if (coefficients.rows() != 1) {
890 throw ValueError(
format(
"%s (%d): You have a 2D coefficient matrix (%d,%d), please use the 2D functions. ", __FILE__, __LINE__,
891 coefficients.rows(), coefficients.cols()));
893 int m =
static_cast<int>(coefficients.cols());
896 for (
int j = 0; j < m; j++) {
897 result += coefficients(0, j) * D(0, j);
901 <<
"): " << result << std::endl;
906 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base)
927 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base,
929 :
Poly2DFracResidual(poly, coefficients, in, z_in, axis, x_exp, y_exp, x_base, y_base) {
950 # include <catch2/catch_all.hpp>
952 TEST_CASE(
"Internal consistency checks and example use cases for PolyMath.cpp",
"[PolyMath]") {
957 std::vector<double> cHeat;
959 cHeat.push_back(+1.1562261074E+03);
960 cHeat.push_back(+2.0994549103E+00);
961 cHeat.push_back(+7.7175381057E-07);
962 cHeat.push_back(-3.7008444051E-20);
965 double Tmin = 273.15 - 50;
966 double Tmax = 273.15 + 250;
969 std::vector<std::vector<double>> cHeat2D;
970 cHeat2D.push_back(cHeat);
971 cHeat2D.push_back(cHeat);
972 cHeat2D.push_back(cHeat);
976 Eigen::MatrixXd matrix2Dtmp;
977 std::vector<std::vector<double>> vec2Dtmp;
979 SECTION(
"Coefficient parsing") {
985 SECTION(
"Coefficient operations") {
986 Eigen::MatrixXd matrix;
993 if (PRINT) std::cout << tmpStr << std::endl;
995 if (PRINT) std::cout << tmpStr << std::endl << std::endl;
999 if (PRINT) std::cout << tmpStr << std::endl;
1001 if (PRINT) std::cout << tmpStr << std::endl << std::endl;
1005 CHECK_NOTHROW(matrix = poly.
deriveCoeffs(matrix2D, 0));
1007 if (PRINT) std::cout << tmpStr << std::endl;
1009 if (PRINT) std::cout << tmpStr << std::endl << std::endl;
1011 CHECK_NOTHROW(matrix = poly.
deriveCoeffs(matrix2D, 1));
1013 if (PRINT) std::cout << tmpStr << std::endl;
1015 if (PRINT) std::cout << tmpStr << std::endl << std::endl;
1018 SECTION(
"Evaluation and test values") {
1023 double acc = 0.0001;
1025 double T = 273.15 + 50;
1026 double c = poly.
evaluate(matrix, T, 0.0);
1027 double d = 1834.746;
1039 c = poly.
solve(matrix, 0.0, d, 0)[0];
1078 SECTION(
"Integration and derivation tests") {
1082 Eigen::MatrixXd matrix(matrix2D);
1084 Eigen::MatrixXd matrixDer = poly.
deriveCoeffs(matrix, 1);
1086 Eigen::MatrixXd matrixDer2 = poly.
deriveCoeffs(matrix, 1, 2);
1088 CHECK_THROWS(poly.
evaluate(matrix, 0.0));
1090 double x = 0.3, y = 255.3, val1, val2, val3, val4;
1098 for (
double T = Tmin; T < Tmax; T += Tinc) {
1099 val1 = poly.
evaluate(matrix, x, T - deltaT);
1100 val2 = poly.
evaluate(matrix, x, T + deltaT);
1101 val3 = (val2 - val1) / 2 / deltaT;
1102 val4 = poly.
evaluate(matrixDer, x, T);
1113 for (
double T = Tmin; T < Tmax; T += Tinc) {
1114 val1 = poly.
evaluate(matrixDer, x, T - deltaT);
1115 val2 = poly.
evaluate(matrixDer, x, T + deltaT);
1116 val3 = (val2 - val1) / 2 / deltaT;
1117 val4 = poly.
evaluate(matrixDer2, x, T);
1128 for (
double T = Tmin; T < Tmax; T += Tinc) {
1129 val1 = poly.
evaluate(matrixInt, x, T - deltaT);
1130 val2 = poly.
evaluate(matrixInt, x, T + deltaT);
1131 val3 = (val2 - val1) / 2 / deltaT;
1132 val4 = poly.
evaluate(matrix, x, T);
1143 for (
double T = Tmin; T < Tmax; T += Tinc) {
1144 val1 = poly.
evaluate(matrixInt2, x, T - deltaT);
1145 val2 = poly.
evaluate(matrixInt2, x, T + deltaT);
1146 val3 = (val2 - val1) / 2 / deltaT;
1147 val4 = poly.
evaluate(matrixInt, x, T);
1158 for (
double T = Tmin; T < Tmax; T += Tinc) {
1159 val1 = poly.
evaluate(matrix, x, T);
1167 for (
double T = Tmin; T < Tmax; T += Tinc) {
1169 val2 = poly.
evaluate(matrixDer, x, T);
1177 SECTION(
"Testing Polynomial2DFrac") {
1183 double acc = 0.0001;
1185 double T = 273.15 + 50;
1187 double c = poly.
evaluate(matrix, T, 0.0);
1188 double d = frac.
evaluate(matrix, T, 0.0, 0, 0);
1199 c = poly.
evaluate(matrix, T, 0.0) / T / T;
1200 d = frac.
evaluate(matrix, T, 0.0, -2, 0);
1213 c = poly.
evaluate(matrix, T, y) / T / T;
1214 d = frac.
evaluate(matrix, T, y, -2, 0);
1225 c = poly.
evaluate(matrix, T, y) / y / y;
1226 d = frac.
evaluate(matrix, T, y, 0, -2);
1237 c = poly.
evaluate(matrix, T, y) / T / T / y / y;
1238 d = frac.
evaluate(matrix, T, y, -2, -2);
1249 c = poly.
evaluate(matrix, T, y) / T / T * y * y;
1250 d = frac.
evaluate(matrix, T, y, -2, 2);
1263 c = 145.59157247249246;
1264 d = frac.
integral(matrix, T, 0.0, 0, -1, 0) - frac.
integral(matrix, 273.15 + 25, 0.0, 0, -1, 0);
1277 d = frac.
integral(matrix, T, 0.0, 0, -1, 0, 348.15, 0.0);
1289 for (T = Tmin; T < Tmax; T += Tinc) {
1290 a = poly.
evaluate(matrix, T - deltaT, y);
1291 b = poly.
evaluate(matrix, T + deltaT, y);
1292 c = (b - a) / 2.0 / deltaT;
1306 d = frac.
derivative(matrix, T, 0.0, 0, 0, 0);
1316 c = -0.006456574589;
1317 d = frac.
derivative(matrix, T, 0.0, 0, -1, 0);
1327 c = frac.
evaluate(matrix, T, 0.0, 2, 0);
1328 d = frac.
solve(matrix, 0.0, c, 0, 2, 0)[0];
1338 c = frac.
evaluate(matrix, T, 0.0, 0, 0);
1339 d = frac.
solve(matrix, 0.0, c, 0, 0, 0)[0];
1349 c = frac.
evaluate(matrix, T, 0.0, -1, 0);
1350 CHECK_THROWS(d = frac.
solve(matrix, 0.0, c, 0, -1, 0)[0]);
1360 d = frac.
solve_limits(matrix, 0.0, c, T - 10, T + 10, 0, -1, 0);
1370 d = frac.
solve_guess(matrix, 0.0, c, T - 10, 0, -1, 0);
1380 c = -0.00004224550082;
1381 d = frac.
derivative(matrix, T, 0.0, 0, -2, 0);
1391 c = frac.
evaluate(matrix, T, 0.0, 0, 0, 0.0, 0.0);
1392 d = frac.
solve(matrix, 0.0, c, 0, 0, 0, 0.0, 0.0)[0];