#include <alpaqa/accelerators/anderson.hpp>
Anderson Acceleration.
Algorithm for accelerating fixed-point iterations for finding fixed points of a function \( g \), i.e. \( g(x^\star) = x^\star \), or equivalently, roots of the residual \( r(x) \triangleq g(x) - x \).
Definition at line 38 of file anderson.hpp.
Public Types | |
using | Params = AndersonAccelParams< config_t > |
Public Member Functions | |
AndersonAccel ()=default | |
AndersonAccel (Params params) | |
AndersonAccel (Params params, length_t n) | |
void | resize (length_t n) |
Change the problem dimension. | |
void | initialize (crvec g_0, crvec r_0) |
Call this function on the first iteration to initialize the accelerator. | |
void | compute (crvec gₖ, crvec rₖ, rvec xₖ_aa) |
Compute the accelerated iterate \( x^k_\text{AA} \), given the function value at the current iterate \( g^k = g(x^k) \) and the corresponding residual \( r^k = g^k - x^k \). | |
void | compute (crvec gₖ, vec &&rₖ, rvec xₖ_aa) |
Compute the accelerated iterate \( x^k_\text{AA} \), given the function value at the current iterate \( g^k = g(x^k) \) and the corresponding residual \( r^k = g^k - x^k \). | |
void | reset () |
Reset the accelerator (but keep the last function value and residual, so calling initialize is not necessary). | |
length_t | n () const |
Get the problem dimension. | |
length_t | history () const |
Get the maximum number of stored columns. | |
length_t | current_history () const |
Get the number of columns currently stored in the buffer. | |
const Params & | get_params () const |
Get the parameters. | |
std::string | get_name () const |
void | scale_R (real_t scal) |
Scale the factorization. | |
Private Attributes | |
Params | params |
LimitedMemoryQR< config_t > | qr |
mat | G |
vec | rₗₐₛₜ |
vec | γ_LS |
bool | initialized = false |
using Params = AndersonAccelParams<config_t> |
Definition at line 41 of file anderson.hpp.
|
default |
|
inline |
params | Parameters. |
Definition at line 46 of file anderson.hpp.
|
inline |
params | Parameters. |
n | Problem dimension (size of the vectors). |
Definition at line 51 of file anderson.hpp.
|
inline |
Change the problem dimension.
Flushes the history.
n | Problem dimension (size of the vectors). |
Definition at line 56 of file anderson.hpp.
Call this function on the first iteration to initialize the accelerator.
Definition at line 66 of file anderson.hpp.
Compute the accelerated iterate \( x^k_\text{AA} \), given the function value at the current iterate \( g^k = g(x^k) \) and the corresponding residual \( r^k = g^k - x^k \).
Definition at line 78 of file anderson.hpp.
Compute the accelerated iterate \( x^k_\text{AA} \), given the function value at the current iterate \( g^k = g(x^k) \) and the corresponding residual \( r^k = g^k - x^k \).
Definition at line 88 of file anderson.hpp.
|
inline |
Reset the accelerator (but keep the last function value and residual, so calling initialize is not necessary).
Definition at line 100 of file anderson.hpp.
|
inline |
Get the problem dimension.
Definition at line 108 of file anderson.hpp.
|
inline |
Get the maximum number of stored columns.
Definition at line 110 of file anderson.hpp.
|
inline |
Get the number of columns currently stored in the buffer.
Definition at line 112 of file anderson.hpp.
|
inline |
Get the parameters.
Definition at line 115 of file anderson.hpp.
|
inline |
Definition at line 117 of file anderson.hpp.
|
inline |
Scale the factorization.
Definition at line 122 of file anderson.hpp.
|
private |
Definition at line 125 of file anderson.hpp.
|
private |
Definition at line 126 of file anderson.hpp.
|
private |
Definition at line 127 of file anderson.hpp.
|
private |
Definition at line 128 of file anderson.hpp.
|
private |
Definition at line 129 of file anderson.hpp.
|
private |
Definition at line 130 of file anderson.hpp.