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));
54 throw ValueError(
format(
"%s (%d): You have to provide a positive order for integration, %d is not valid. ", __FILE__, __LINE__, times));
55 if (times == 0)
return Eigen::MatrixXd(coefficients);
56 Eigen::MatrixXd oldCoefficients;
57 Eigen::MatrixXd newCoefficients(coefficients);
61 newCoefficients = Eigen::MatrixXd(coefficients);
64 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
68 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
72 std::size_t r = 0, c = 0;
73 for (
int k = 0; k < times; k++) {
74 oldCoefficients = Eigen::MatrixXd(newCoefficients);
75 r = oldCoefficients.rows(), c = oldCoefficients.cols();
76 newCoefficients = Eigen::MatrixXd::Zero(r + 1, c);
77 newCoefficients.block(1, 0, r, c) = oldCoefficients.block(0, 0, r, c);
78 for (
size_t i = 0; i < r; ++i) {
79 for (
size_t j = 0; j < c; ++j)
80 newCoefficients(i + 1, j) /= (i + 1.);
88 newCoefficients.transposeInPlace();
92 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
96 return newCoefficients;
105 throw ValueError(
format(
"%s (%d): You have to provide a positive order for derivation, %d is not valid. ", __FILE__, __LINE__, times));
106 if (times == 0)
return Eigen::MatrixXd(coefficients);
111 Eigen::MatrixXd newCoefficients;
115 newCoefficients = Eigen::MatrixXd(coefficients);
118 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
122 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
126 std::size_t r = 0, c = 0, i = 0, j = 0;
127 for (
int k = 0; k < times; k++) {
128 r = newCoefficients.rows(), c = newCoefficients.cols();
129 for (i = 1; i < r; ++i) {
130 for (j = 0; j < c; ++j)
131 newCoefficients(i, j) *= i;
140 newCoefficients.transposeInPlace();
144 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
148 return newCoefficients;
160 double result = Eigen::poly_eval(
makeVector(coefficients), x_in);
162 std::cout <<
"Running 1D evaluate(" <<
mat_to_string(coefficients) <<
", x_in:" <<
vec_to_string(x_in) <<
"): " << result <<
'\n';
166 size_t r = coefficients.rows();
167 double result =
evaluate(coefficients.row(r - 1), y_in);
168 for (
int i =
static_cast<int>(r) - 2; i >= 0; i--) {
170 result +=
evaluate(coefficients.row(i), y_in);
174 <<
", y_in:" <<
vec_to_string(y_in) <<
"): " << result <<
'\n';
178double Polynomial2D::derivative(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis = -1) {
182double Polynomial2D::integral(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis = -1) {
191 if (
do_debug()) std::cout <<
format(
"Called solve_limits with: min=%f and max=%f", min, max) <<
'\n';
195 double result =
Brent(res, min, max, macheps, tol, maxiter);
196 if (this->
do_debug()) std::cout <<
"Brent solver message: " << res->
errstring <<
'\n';
204 if (
do_debug()) std::cout <<
format(
"Called solve_guess with: guess=%f ", guess) <<
'\n';
208 double result =
Newton(res, guess, tol, maxiter);
209 if (this->
do_debug()) std::cout <<
"Newton solver message: " << res->
errstring <<
'\n';
213Eigen::VectorXd
Polynomial2D::solve(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const int& axis = -1) {
214 std::size_t r = coefficients.rows(), c = coefficients.cols();
215 Eigen::VectorXd tmpCoefficients;
218 tmpCoefficients = Eigen::VectorXd::Zero(r);
219 for (
size_t i = 0; i < r; i++) {
220 tmpCoefficients(i, 0) =
evaluate(coefficients.row(i), in);
224 tmpCoefficients = Eigen::VectorXd::Zero(c);
225 for (
size_t i = 0; i < c; i++) {
226 tmpCoefficients(i, 0) =
evaluate(coefficients.col(i), in);
230 throw ValueError(
format(
"%s (%d): You have to provide a dimension, 0 or 1, for the solver, %d is not valid. ", __FILE__, __LINE__, axis));
233 tmpCoefficients(0, 0) -= z_in;
234 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(tmpCoefficients)) <<
'\n';
235 Eigen::PolynomialSolver<double, Eigen::Dynamic> polySolver(tmpCoefficients);
236 std::vector<double> rootsVec;
237 polySolver.realRoots(rootsVec);
243double Polynomial2D::solve_limits(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const double& min,
const double& max,
249double Polynomial2D::solve_guess(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const double& guess,
const int& axis) {
260 for (
unsigned int i = 0; i < coefficients.size(); i++) {
261 result += coefficients[i] * pow(x, (
int)i);
264 std::cout <<
"Running simplePolynomial(" <<
vec_to_string(coefficients) <<
", " <<
vec_to_string(x) <<
"): " << result <<
'\n';
269 for (
unsigned int i = 0; i < coefficients.size(); i++) {
274 <<
"): " << result <<
'\n';
285 for (
int i =
static_cast<int>(coefficients.size()) - 1; i >= 0; i--) {
287 result += coefficients[i];
296 for (
int i =
static_cast<int>(coefficients.size() - 1); i >= 0; i--) {
302 <<
"): " << result <<
'\n';
313 throw ValueError(
format(
"%s (%d): You have to provide a dimension to the solver, %d is not valid. ", __FILE__, __LINE__,
axis));
365 throw ValueError(
format(
"%s (%d): You have to provide a positive order for derivation, %d is not valid. ", __FILE__, __LINE__, times));
366 if (times == 0)
return Eigen::MatrixXd(coefficients);
371 Eigen::MatrixXd newCoefficients;
375 newCoefficients = Eigen::MatrixXd(coefficients);
378 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
382 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
386 std::size_t r = newCoefficients.rows(), c = newCoefficients.cols();
387 std::size_t i = 0, j = 0;
388 for (
int k = 0; k < times; k++) {
389 for (i = 0; i < r; ++i) {
390 for (j = 0; j < c; ++j) {
391 newCoefficients(i, j) *= double(i) + double(firstExponent);
400 newCoefficients.transposeInPlace();
404 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
408 return newCoefficients;
423 size_t r = coefficients.rows();
424 size_t c = coefficients.cols();
426 if ((r != 1) && (c != 1)) {
427 throw ValueError(
format(
"%s (%d): You have a 2D coefficient matrix (%d,%d), please use the 2D functions. ", __FILE__, __LINE__,
428 coefficients.rows(), coefficients.cols()));
430 if ((firstExponent < 0) && (std::abs(x_in - x_base) <
CPPOLY_EPSILON)) {
434 const double y_lo =
evaluate(coefficients, x_lo, firstExponent, x_base);
435 const double y_hi =
evaluate(coefficients, x_hi, firstExponent, x_base);
436 return (y_hi - y_lo) / (x_hi - x_lo) * (x_in - x_lo) + y_lo;
439 Eigen::MatrixXd tmpCoeffs(coefficients);
441 tmpCoeffs.transposeInPlace();
445 Eigen::MatrixXd newCoeffs;
449 for (
int i = 0; i > firstExponent; i--) {
451 negExp += tmpCoeffs(0, 0);
454 negExp /= x_in - x_base;
455 c = tmpCoeffs.cols();
458 for (
int i = 0; i < firstExponent; i++) {
459 newCoeffs = Eigen::MatrixXd::Zero(r, c + 1);
460 newCoeffs.block(0, 1, r, c) = tmpCoeffs.block(0, 0, r, c);
461 tmpCoeffs = Eigen::MatrixXd(newCoeffs);
462 c = tmpCoeffs.cols();
465 if (c > 0) posExp += Eigen::poly_eval(Eigen::RowVectorXd(tmpCoeffs), x_in - x_base);
466 return negExp + posExp;
469double Polynomial2DFrac::evaluate(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& x_exp,
const int& y_exp,
470 const double& x_base,
const double& y_base) {
473 if (this->
do_debug()) std::cout <<
"Interpolating in x-direction for base " << x_base <<
" and input " << x_in <<
'\n';
476 const double z_lo =
evaluate(coefficients, x_lo, y_in, x_exp, y_exp, x_base, y_base);
477 const double z_hi =
evaluate(coefficients, x_hi, y_in, x_exp, y_exp, x_base, y_base);
478 return (z_hi - z_lo) / (x_hi - x_lo) * (x_in - x_lo) + z_lo;
482 if (this->
do_debug()) std::cout <<
"Interpolating in y-direction for base " << y_base <<
" and input " << y_in <<
'\n';
485 const double z_lo =
evaluate(coefficients, x_in, y_lo, x_exp, y_exp, x_base, y_base);
486 const double z_hi =
evaluate(coefficients, x_in, y_hi, x_exp, y_exp, x_base, y_base);
487 return (z_hi - z_lo) / (y_hi - y_lo) * (y_in - y_lo) + z_lo;
490 Eigen::MatrixXd tmpCoeffs(coefficients);
491 Eigen::MatrixXd newCoeffs;
493 size_t c = tmpCoeffs.cols();
497 for (
int i = 0; i > x_exp; i--) {
498 r = tmpCoeffs.rows();
500 negExp +=
evaluate(tmpCoeffs.row(0), y_in, y_exp, y_base);
503 negExp /= x_in - x_base;
506 r = tmpCoeffs.rows();
507 for (
int i = 0; i < x_exp; i++) {
508 newCoeffs = Eigen::MatrixXd::Zero(r + 1, c);
509 newCoeffs.block(1, 0, r, c) = tmpCoeffs.block(0, 0, r, c);
510 tmpCoeffs = Eigen::MatrixXd(newCoeffs);
515 if (r > 0) posExp +=
evaluate(tmpCoeffs.row(r - 1), y_in, y_exp, y_base);
516 for (
int i =
static_cast<int>(r) - 2; i >= 0; i--) {
517 posExp *= x_in - x_base;
518 posExp +=
evaluate(tmpCoeffs.row(i), y_in, y_exp, y_base);
520 if (this->
do_debug()) std::cout <<
"Running 2D evaluate(" <<
mat_to_string(coefficients) <<
", " <<
'\n';
524 <<
"): " << negExp + posExp <<
'\n';
525 return negExp + posExp;
529 const int& y_exp,
const double& x_base,
const double& y_base) {
530 Eigen::MatrixXd newCoefficients;
531 int der_exp = 0, other_exp = 0;
532 double der_val = NAN, other_val = NAN;
533 double int_base = NAN, other_base = NAN;
537 newCoefficients = Eigen::MatrixXd(coefficients);
546 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
556 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
561 newCoefficients =
deriveCoeffs(newCoefficients, 0, times, der_exp);
564 return evaluate(newCoefficients, der_val, other_val, der_exp, other_exp, int_base, other_base);
567double Polynomial2DFrac::integral(
const Eigen::MatrixXd& coefficients,
const double& x_in,
const double& y_in,
const int& axis,
const int& x_exp,
568 const int& y_exp,
const double& x_base,
const double& y_base,
const double& ax_val) {
570 Eigen::MatrixXd newCoefficients;
571 int int_exp = 0, other_exp = 0;
572 double int_val = NAN, other_val = NAN;
573 double int_base = NAN, other_base = NAN;
577 newCoefficients = Eigen::MatrixXd(coefficients);
586 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
596 format(
"%s (%d): You have to provide a dimension, 0 or 1, for integration, %d is not valid. ", __FILE__, __LINE__, axis));
602 format(
"%s (%d): This function is only implemented for lowest exponents >= -1, int_exp=%d ", __FILE__, __LINE__, int_exp));
606 format(
"%s (%d): This function is only implemented for indefinite integrals, ax_val=%d ", __FILE__, __LINE__, ax_val));
608 size_t r = newCoefficients.rows();
609 size_t c = newCoefficients.cols();
613 Eigen::MatrixXd tmpCoefficients = newCoefficients.row(0) * log(int_val - int_base);
614 newCoefficients =
integrateCoeffs(newCoefficients.block(1, 0, r - 1, c), 0, 1);
615 newCoefficients.row(0) = tmpCoefficients;
616 return evaluate(newCoefficients, int_val, other_val, 0, other_exp, int_base, other_base);
619 newCoefficients = Eigen::MatrixXd(r, 1);
620 for (std::size_t i = 0; i < r; i++) {
621 newCoefficients(i, 0) =
evaluate(coefficients.row(i), other_val, other_exp, other_base);
623 return fracIntCentral(newCoefficients.transpose(), int_val, int_base);
627 Eigen::MatrixXd tmpCoeffs;
628 r = newCoefficients.rows();
629 for (
int i = 0; i < int_exp; i++) {
630 tmpCoeffs = Eigen::MatrixXd::Zero(r + 1, c);
631 tmpCoeffs.block(1, 0, r, c) = newCoefficients.block(0, 0, r, c);
632 newCoefficients = Eigen::MatrixXd(tmpCoeffs);
636 return evaluate(
integrateCoeffs(newCoefficients, 0, 1), int_val, other_val, 0, other_exp, int_base, other_base);
640Eigen::VectorXd
Polynomial2DFrac::solve(
const Eigen::MatrixXd& coefficients,
const double& in,
const double& z_in,
const int& axis,
const int& x_exp,
641 const int& y_exp,
const double& x_base,
const double& y_base) {
643 Eigen::MatrixXd newCoefficients;
644 Eigen::VectorXd tmpCoefficients;
645 int solve_exp = 0, other_exp = 0;
650 newCoefficients = Eigen::MatrixXd(coefficients);
656 newCoefficients = Eigen::MatrixXd(coefficients.transpose());
662 throw ValueError(
format(
"%s (%d): You have to provide a dimension, 0 or 1, for the solver, %d is not valid. ", __FILE__, __LINE__, axis));
666 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(newCoefficients)) <<
'\n';
668 const size_t r = newCoefficients.rows();
669 for (
size_t i = 0; i < r; i++) {
670 newCoefficients(i, 0) =
evaluate(newCoefficients.row(i), input, other_exp);
674 if (solve_exp >= 0) {
675 tmpCoefficients = Eigen::VectorXd::Zero(r + solve_exp);
676 tmpCoefficients.block(solve_exp, 0, r, 1) = newCoefficients.block(0, 0, r, 1);
677 tmpCoefficients(0, 0) -= z_in;
679 int diff = 1 -
static_cast<int>(r) - solve_exp;
680 tmpCoefficients = Eigen::VectorXd::Zero(r + std::max(diff, 0));
681 tmpCoefficients.block(0, 0, r, 1) = newCoefficients.block(0, 0, r, 1);
682 tmpCoefficients(r + diff - 1, 0) -= z_in;
683 throw NotImplementedError(
format(
"%s (%d): Currently, there is no solver for the generalised polynomial, an exponent of %d is not valid. ",
684 __FILE__, __LINE__, solve_exp));
687 if (this->
do_debug()) std::cout <<
"Coefficients: " <<
mat_to_string(Eigen::MatrixXd(tmpCoefficients)) <<
'\n';
688 Eigen::PolynomialSolver<double, -1> polySolver(tmpCoefficients);
689 std::vector<double> rootsVec;
690 polySolver.realRoots(rootsVec);
698 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base) {
700 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)
708 const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base) {
710 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) <<
'\n';
717 const double& max,
const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
718 const double& y_base,
const int& int_axis) {
725 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base,
726 const int& int_axis) {
743 for (
int i = 2; i <= nValue; i++)
750 if (nValue2 == 1)
return nValue * 1.0;
758 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));
760 Eigen::MatrixXd D = Eigen::MatrixXd::Zero(1, m);
763 for (
int j = 0; j < m; j++) {
764 tmp = pow(-1.0, j) * log(x_in) * pow(x_base, j);
765 for (
int k = 0; k < j; k++) {
766 tmp +=
binom(j, k) * pow(-1.0, k) / (j - k) * pow(x_in, j - k) * pow(x_base, k);
777 if (coefficients.rows() != 1) {
778 throw ValueError(
format(
"%s (%d): You have a 2D coefficient matrix (%d,%d), please use the 2D functions. ", __FILE__, __LINE__,
779 coefficients.rows(), coefficients.cols()));
781 int m =
static_cast<int>(coefficients.cols());
784 for (
int j = 0; j < m; j++) {
785 result += coefficients(0, j) * D(0, j);
789 <<
"): " << result <<
'\n';
794 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base)
795 :
Poly2DResidual(poly, coefficients, in, z_in, axis), x_exp(x_exp), y_exp(y_exp), x_base(x_base), y_base(y_base) {}
810 const int& axis,
const int& x_exp,
const int& y_exp,
const double& x_base,
const double& y_base,
812 :
Poly2DFracResidual(poly, coefficients, in, z_in, axis, x_exp, y_exp, x_base, y_base), int_axis(int_axis) {}
831# include <catch2/catch_all.hpp>
833TEST_CASE(
"Internal consistency checks and example use cases for PolyMath.cpp",
"[PolyMath]") {
838 std::vector<double> cHeat;
840 cHeat.push_back(+1.1562261074E+03);
841 cHeat.push_back(+2.0994549103E+00);
842 cHeat.push_back(+7.7175381057E-07);
843 cHeat.push_back(-3.7008444051E-20);
846 double Tmin = 273.15 - 50;
847 double Tmax = 273.15 + 250;
850 std::vector<std::vector<double>> cHeat2D;
851 cHeat2D.push_back(cHeat);
852 cHeat2D.push_back(cHeat);
853 cHeat2D.push_back(cHeat);
857 Eigen::MatrixXd matrix2Dtmp;
858 std::vector<std::vector<double>> vec2Dtmp;
860 SECTION(
"Coefficient parsing") {
866 SECTION(
"Coefficient operations") {
867 Eigen::MatrixXd matrix;
874 if (PRINT) std::cout << tmpStr <<
'\n';
876 if (PRINT) std::cout << tmpStr <<
'\n' <<
'\n';
880 if (PRINT) std::cout << tmpStr <<
'\n';
882 if (PRINT) std::cout << tmpStr <<
'\n' <<
'\n';
888 if (PRINT) std::cout << tmpStr <<
'\n';
890 if (PRINT) std::cout << tmpStr <<
'\n' <<
'\n';
894 if (PRINT) std::cout << tmpStr <<
'\n';
896 if (PRINT) std::cout << tmpStr <<
'\n' <<
'\n';
899 SECTION(
"Evaluation and test values") {
906 double T = 273.15 + 50;
907 double c = poly.
evaluate(matrix,
T, 0.0);
919 c = poly.
solve(matrix, 0.0, d, 0)[0];
956 SECTION(
"Integration and derivation tests") {
960 const Eigen::MatrixXd& matrix(matrix2D);
962 Eigen::MatrixXd matrixDer = poly.
deriveCoeffs(matrix, 1);
964 Eigen::MatrixXd matrixDer2 = poly.
deriveCoeffs(matrix, 1, 2);
966 CHECK_THROWS(poly.
evaluate(matrix, 0.0));
968 double x = 0.3, y = 255.3, val1, val2, val3, val4;
981 const auto N_T =
static_cast<std::size_t
>(std::ceil((Tmax - Tmin) / Tinc));
983 for (std::size_t i = 0; i < N_T; ++i) {
984 const double T = Tmin + i * Tinc;
985 val1 = poly.
evaluate(matrix, x,
T - deltaT);
986 val2 = poly.
evaluate(matrix, x,
T + deltaT);
987 val3 = (val2 - val1) / 2 / deltaT;
999 for (std::size_t i = 0; i < N_T; ++i) {
1000 const double T = Tmin + i * Tinc;
1001 val1 = poly.
evaluate(matrixDer, x,
T - deltaT);
1002 val2 = poly.
evaluate(matrixDer, x,
T + deltaT);
1003 val3 = (val2 - val1) / 2 / deltaT;
1015 for (std::size_t i = 0; i < N_T; ++i) {
1016 const double T = Tmin + i * Tinc;
1017 val1 = poly.
evaluate(matrixInt, x,
T - deltaT);
1018 val2 = poly.
evaluate(matrixInt, x,
T + deltaT);
1019 val3 = (val2 - val1) / 2 / deltaT;
1031 for (std::size_t i = 0; i < N_T; ++i) {
1032 const double T = Tmin + i * Tinc;
1033 val1 = poly.
evaluate(matrixInt2, x,
T - deltaT);
1034 val2 = poly.
evaluate(matrixInt2, x,
T + deltaT);
1035 val3 = (val2 - val1) / 2 / deltaT;
1047 for (std::size_t i = 0; i < N_T; ++i) {
1048 const double T = Tmin + i * Tinc;
1057 for (std::size_t i = 0; i < N_T; ++i) {
1058 const double T = Tmin + i * Tinc;
1068 SECTION(
"Testing Polynomial2DFrac") {
1074 double acc = 0.0001;
1076 double T = 273.15 + 50;
1078 double c = poly.
evaluate(matrix,
T, 0.0);
1079 double d = frac.
evaluate(matrix,
T, 0.0, 0, 0);
1091 d = frac.
evaluate(matrix,
T, 0.0, -2, 0);
1116 c = poly.
evaluate(matrix,
T, y) / y / y;
1129 d = frac.
evaluate(matrix,
T, y, -2, -2);
1154 c = 145.59157247249246;
1155 d = frac.
integral(matrix,
T, 0.0, 0, -1, 0) - frac.
integral(matrix, 273.15 + 25, 0.0, 0, -1, 0);
1168 d = frac.
integral(matrix,
T, 0.0, 0, -1, 0, 348.15, 0.0);
1183 const auto N_T_frac =
static_cast<std::size_t
>(std::ceil((Tmax - Tmin) / Tinc));
1184 for (std::size_t i = 0; i < N_T_frac; ++i) {
1185 T = Tmin + i * Tinc;
1186 a = poly.
evaluate(matrix,
T - deltaT, y);
1187 b = poly.
evaluate(matrix,
T + deltaT, y);
1188 c = (b - a) / 2.0 / deltaT;
1212 c = -0.006456574589;
1223 c = frac.
evaluate(matrix,
T, 0.0, 2, 0);
1224 d = frac.
solve(matrix, 0.0, c, 0, 2, 0)[0];
1234 c = frac.
evaluate(matrix,
T, 0.0, 0, 0);
1235 d = frac.
solve(matrix, 0.0, c, 0, 0, 0)[0];
1245 c = frac.
evaluate(matrix,
T, 0.0, -1, 0);
1246 CHECK_THROWS(d = frac.
solve(matrix, 0.0, c, 0, -1, 0)[0]);
1266 d = frac.
solve_guess(matrix, 0.0, c,
T - 10, 0, -1, 0);
1276 c = -0.00004224550082;
1287 c = frac.
evaluate(matrix,
T, 0.0, 0, 0, 0.0, 0.0);
1288 d = frac.
solve(matrix, 0.0, c, 0, 0, 0, 0.0, 0.0)[0];