10#define HISTORYLIST_HPP
21 Eigen::VectorXd oldElem;
25 Eigen::MatrixXd hlist;
26 Eigen::MatrixXd difflist;
27 Eigen::MatrixXd normalized_difflist;
34 hlist.resize(ndim, nhistx);
35 difflist.resize(ndim, nhistx);
36 normalized_difflist.resize(ndim, nhistx);
40 int add(Eigen::VectorXd &x_in)
42 if (i_count < nhistx){
43 hlist.col(i_count) = x_in;
45 for (
int i = 1; i < i_count; i++){
46 difflist.col(i-1) = hlist.col(i) - hlist.col(i - 1);
47 normalized_difflist.col(i-1) = difflist.col(i-1) / difflist.col(i-1).norm();
51 oldElem = hlist.col(0);
52 for (
int i = 0; i < nhistx - 1; i++){
53 hlist.col(i) = hlist.col(i+1);
55 hlist.col(nhistx - 1) = x_in;
57 difflist.col(0) = hlist.col(0) - oldElem;
58 normalized_difflist.col(0) = difflist.col(0) / difflist.col(0).norm();
59 for (
int i = 1; i < nhistx; i++){
60 difflist.col(i) = hlist.col(i) - hlist.col(i - 1);
61 normalized_difflist.col(i) = difflist.col(i) / difflist.col(i).norm();
Variable cell stable quasi-Newton lattice optimizer.