alpaqa guanaqo
Nonconvex constrained optimization
Loading...
Searching...
No Matches
AndersonAccel< Conf > Class Template Reference

#include <alpaqa/accelerators/anderson.hpp>

Detailed Description

template<Config Conf = DefaultConfig>
class alpaqa::AndersonAccel< Conf >

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

Collaboration diagram for AndersonAccel< Conf >:

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 Paramsget_params () const
 Get the parameters.
std::string get_name () const
void scale_R (real_t scal)
 Scale the factorization.
const LimitedMemoryQR< config_t > & get_QR () const
 For testing purposes.

Private Attributes

Params params
LimitedMemoryQR< config_t > qr
mat G
vec rₗₐₛₜ
vec γ_LS
bool initialized = false

Member Typedef Documentation

◆ Params

template<Config Conf = DefaultConfig>
using Params = AndersonAccelParams<config_t>

Definition at line 42 of file anderson.hpp.

Constructor & Destructor Documentation

◆ AndersonAccel() [1/3]

template<Config Conf = DefaultConfig>
AndersonAccel ( )
default

◆ AndersonAccel() [2/3]

template<Config Conf = DefaultConfig>
AndersonAccel ( Params params)
inline
Parameters
paramsParameters.

Definition at line 47 of file anderson.hpp.

◆ AndersonAccel() [3/3]

template<Config Conf = DefaultConfig>
AndersonAccel ( Params params,
length_t n )
inline
Parameters
paramsParameters.
nProblem dimension (size of the vectors).

Definition at line 52 of file anderson.hpp.

Member Function Documentation

◆ resize()

template<Config Conf = DefaultConfig>
void resize ( length_t n)
inline

Change the problem dimension.

Flushes the history.

Parameters
nProblem dimension (size of the vectors).

Definition at line 57 of file anderson.hpp.

Here is the caller graph for this function:

◆ initialize()

template<Config Conf = DefaultConfig>
void initialize ( crvec g_0,
crvec r_0 )
inline

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

Definition at line 67 of file anderson.hpp.

◆ compute() [1/2]

template<Config Conf = DefaultConfig>
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 79 of file anderson.hpp.

◆ compute() [2/2]

template<Config Conf = DefaultConfig>
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 89 of file anderson.hpp.

◆ reset()

template<Config Conf = DefaultConfig>
void reset ( )
inline

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

Definition at line 101 of file anderson.hpp.

◆ n()

template<Config Conf = DefaultConfig>
length_t n ( ) const
inline

Get the problem dimension.

Definition at line 109 of file anderson.hpp.

◆ history()

template<Config Conf = DefaultConfig>
length_t history ( ) const
inline

Get the maximum number of stored columns.

Definition at line 111 of file anderson.hpp.

◆ current_history()

template<Config Conf = DefaultConfig>
length_t current_history ( ) const
inline

Get the number of columns currently stored in the buffer.

Definition at line 113 of file anderson.hpp.

◆ get_params()

template<Config Conf = DefaultConfig>
const Params & get_params ( ) const
inline

Get the parameters.

Definition at line 116 of file anderson.hpp.

◆ get_name()

template<Config Conf = DefaultConfig>
std::string get_name ( ) const
inline

Definition at line 118 of file anderson.hpp.

◆ scale_R()

template<Config Conf = DefaultConfig>
void scale_R ( real_t scal)
inline

Scale the factorization.

Definition at line 123 of file anderson.hpp.

◆ get_QR()

template<Config Conf = DefaultConfig>
const LimitedMemoryQR< config_t > & get_QR ( ) const
inline

For testing purposes.

Definition at line 126 of file anderson.hpp.

Member Data Documentation

◆ params

template<Config Conf = DefaultConfig>
Params params
private

Definition at line 129 of file anderson.hpp.

◆ qr

template<Config Conf = DefaultConfig>
LimitedMemoryQR<config_t> qr
private

Definition at line 130 of file anderson.hpp.

◆ G

template<Config Conf = DefaultConfig>
mat G
private

Definition at line 131 of file anderson.hpp.

◆ rₗₐₛₜ

template<Config Conf = DefaultConfig>
vec rₗₐₛₜ
private

Definition at line 132 of file anderson.hpp.

◆ γ_LS

template<Config Conf = DefaultConfig>
vec γ_LS
private

Definition at line 133 of file anderson.hpp.

◆ initialized

template<Config Conf = DefaultConfig>
bool initialized = false
private

Definition at line 134 of file anderson.hpp.


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