quala main
Quasi-Newton and other accelerators
Public Types | Public Member Functions | Private Attributes | List of all members
AndersonAccel Class Reference

#include <quala/anderson-acceleration.hpp>

Detailed Description

Anderson Acceleration.

Todo:
Condition estimation of the QR factorization.

Definition at line 22 of file anderson-acceleration.hpp.

+ Collaboration diagram for AndersonAccel:

Public Types

using Params = AndersonAccelParams
 

Public Member Functions

 AndersonAccel (Params params)
 
 AndersonAccel (Params params, length_t n)
 
void resize (length_t n)
 Change the problem dimension. More...
 
void initialize (crvec g₀, vec r₀)
 Call this function on the first iteration to initialize the accelerator. More...
 
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 \). More...
 
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 \). More...
 
void reset ()
 Reset the accelerator (but keep the last function value and residual, so calling initialize is not necessary). More...
 
length_t n () const
 Get the problem dimension. More...
 
length_t history () const
 Get the maximum number of stored columns. More...
 
length_t current_history () const
 Get the number of columns currently stored in the buffer. More...
 
const Paramsget_params () const
 Get the parameters. More...
 

Private Attributes

Params params
 
LimitedMemoryQR qr
 
mat G
 
vec rₖ₋₁
 
vec γ_LS
 
bool initialized = false
 

Member Typedef Documentation

◆ Params

Definition at line 24 of file anderson-acceleration.hpp.

Constructor & Destructor Documentation

◆ AndersonAccel() [1/2]

AndersonAccel ( Params  params)
inline
Parameters
paramsParameters.

Definition at line 28 of file anderson-acceleration.hpp.

◆ AndersonAccel() [2/2]

AndersonAccel ( Params  params,
length_t  n 
)
inline
Parameters
paramsParameters.
nProblem dimension (size of the vectors).

Definition at line 33 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ resize()

void resize ( length_t  n)
inline

Change the problem dimension.

Flushes the history.

Parameters
nProblem dimension (size of the vectors).

Definition at line 38 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

void initialize ( crvec  g₀,
vec  r₀ 
)
inline

Call this function on the first iteration to initialize the accelerator.

Definition at line 48 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:

◆ compute() [1/2]

void compute ( crvec  gₖ,
crvec  rₖ,
rvec  xₖ_aa 
)
inline

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 60 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:

◆ compute() [2/2]

void compute ( crvec  gₖ,
vec &&  rₖ,
rvec  xₖ_aa 
)
inline

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 70 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:

◆ reset()

void reset ( )
inline

Reset the accelerator (but keep the last function value and residual, so calling initialize is not necessary).

Definition at line 82 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ n()

length_t n ( ) const
inline

Get the problem dimension.

Definition at line 90 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history()

length_t history ( ) const
inline

Get the maximum number of stored columns.

Definition at line 92 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:

◆ current_history()

length_t current_history ( ) const
inline

Get the number of columns currently stored in the buffer.

Definition at line 94 of file anderson-acceleration.hpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_params()

const Params & get_params ( ) const
inline

Get the parameters.

Definition at line 97 of file anderson-acceleration.hpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ params

Params params
private

Definition at line 100 of file anderson-acceleration.hpp.

◆ qr

LimitedMemoryQR qr
private

Definition at line 101 of file anderson-acceleration.hpp.

◆ G

mat G
private

Definition at line 102 of file anderson-acceleration.hpp.

◆ rₖ₋₁

vec rₖ₋₁
private

Definition at line 103 of file anderson-acceleration.hpp.

◆ γ_LS

vec γ_LS
private

Definition at line 104 of file anderson-acceleration.hpp.

◆ initialized

bool initialized = false
private

Definition at line 105 of file anderson-acceleration.hpp.


The documentation for this class was generated from the following file: