38template <Config Conf = DefaultConfig>
72 assert(g_it != g_end);
79 xₖ_aa = α * G̃.col((*g_it).circular);
80 while (++g_it != g_end) {
81 auto [i, g_idx] = *g_it;
82 α = γ_LS(i) - γ_LS(i - 1);
83 xₖ_aa += α * G̃.col(g_idx);
Incremental QR factorization using modified Gram-Schmidt with reorthogonalization.
CircularRange< index_t > ring_iter() const
Get iterators in the circular buffer.
length_t num_columns() const
Get the number of columns that are currently stored.
void remove_column()
Remove the leftmost column.
void add_column(const VecV &v)
Add the given column to the right.
void solve_col(const VecB &b, VecX &x, real_t tol=0) const
Solve the least squares problem Ax = b.
index_t ring_tail() const
Get the tail index of the circular buffer (points to one past the most recent element).
real_t get_max_eig() const
Get the maximum eigenvalue of R.
typename Conf::real_t real_t
typename Conf::crvec crvec
void minimize_update_anderson(LimitedMemoryQR< Conf > &qr, rmat< Conf > G̃, crvec< Conf > rₖ, crvec< Conf > rₗₐₛₜ, crvec< Conf > gₖ, real_t< Conf > min_div_fac, rvec< Conf > γ_LS, rvec< Conf > xₖ_aa)
Solve one step of Anderson acceleration to find a fixed point of a function g(x):