50 const std::vector<Eigen::MatrixXd>& mathist) {
52 Index size = dmathist.size();
54 const Eigen::MatrixXd& dmat = dmathist.back();
55 const Eigen::MatrixXd&
H = mathist.back();
56 Eigen::VectorXd DiF = Eigen::VectorXd::Zero(size);
57 Eigen::MatrixXd DiFj = Eigen::MatrixXd::Zero(size, size);
59 for (
Index i = 0; i < size; i++) {
60 DiF(i) = ((dmathist[i]) - dmat).cwiseProduct(
H).sum();
63 for (
Index i = 0; i < size; i++) {
64 for (
Index j = 0; j < size; j++) {
65 DiFj(i, j) = ((dmathist[i]) - dmat).cwiseProduct((mathist[j]) -
H).sum();
76 Eigen::VectorXd coeffs = Eigen::VectorXd::Constant(size, 1.0 /
double(size));
80 double xnorm = coeffs.sum();
83 if (std::abs(coeffs.tail(1).value()) < 0.001) {
93 const std::vector<Eigen::MatrixXd>& dmathist_alpha,
94 const std::vector<Eigen::MatrixXd>& dmathist_beta,
95 const std::vector<Eigen::MatrixXd>& mathist_alpha,
96 const std::vector<Eigen::MatrixXd>& mathist_beta) {
99 Index size = dmathist_alpha.size();
101 const Eigen::MatrixXd& dmat_alpha = dmathist_alpha.back();
102 const Eigen::MatrixXd& dmat_beta = dmathist_beta.back();
103 const Eigen::MatrixXd& H_alpha = mathist_alpha.back();
104 const Eigen::MatrixXd& H_beta = mathist_beta.back();
106 Eigen::VectorXd DiF = Eigen::VectorXd::Zero(size);
107 Eigen::MatrixXd DiFj = Eigen::MatrixXd::Zero(size, size);
109 for (
Index i = 0; i < size; ++i) {
110 DiF(i) = (dmathist_alpha[i] - dmat_alpha).cwiseProduct(H_alpha).sum() +
111 (dmathist_beta[i] - dmat_beta).cwiseProduct(H_beta).sum();
114 for (
Index i = 0; i < size; ++i) {
115 for (
Index j = 0; j < size; ++j) {
116 DiFj(i, j) = (dmathist_alpha[i] - dmat_alpha)
117 .cwiseProduct(mathist_alpha[j] - H_alpha)
119 (dmathist_beta[i] - dmat_beta)
120 .cwiseProduct(mathist_beta[j] - H_beta)
132 Eigen::VectorXd coeffs = Eigen::VectorXd::Constant(size, 1.0 /
double(size));
137 double xnorm = coeffs.sum();
140 if (std::abs(coeffs.tail(1).value()) < 0.001) {