Loading...
Searching...
No Matches
q3::ConvergenceWindow Class Reference

#include <convergence_window.hpp>

Public Member Functions

 ConvergenceWindow (Real relative_tolerance, int window)
 
bool has_converged () const
 
const std::vector< Real > & history () const
 
int number_of_steps () const
 
std::vector< Real > recent_history (int count=5) const
 The last count values, oldest first.
 
std::string recent_history_text (int count=5) const
 The last count values, oldest first, as "a, b, c" with six decimals each.
 
void record (Real value)
 The objective at the end of one more step.
 

Static Public Member Functions

static std::string history_text (const std::vector< Real > &values)
 

Detailed Description

Definition at line 28 of file convergence_window.hpp.

Constructor & Destructor Documentation

◆ ConvergenceWindow()

q3::ConvergenceWindow::ConvergenceWindow ( Real  relative_tolerance,
int  window 
)
inline

Definition at line 30 of file convergence_window.hpp.

Member Function Documentation

◆ has_converged()

bool q3::ConvergenceWindow::has_converged ( ) const
inline

Whether the last window differences are all within the tolerance of the current value. Needs window + 1 values, so the first steps never count as converged.

Definition at line 54 of file convergence_window.hpp.

References q3::math::tolerances::relative_change_scale_floor.

Referenced by q3::SpreadMinimizer::run(), and q3::SubspaceDisentangler::run().

◆ history()

const std::vector< Real > & q3::ConvergenceWindow::history ( ) const
inline

Definition at line 70 of file convergence_window.hpp.

◆ history_text()

static std::string q3::ConvergenceWindow::history_text ( const std::vector< Real > &  values)
inlinestatic

values as "a, b, c" with six decimals each: the one form in which an error names the spreads it reached, in its prose and on its own line.

Definition at line 96 of file convergence_window.hpp.

Referenced by recent_history_text(), and q3::WannierDiagnosticError::spreads_text().

◆ number_of_steps()

int q3::ConvergenceWindow::number_of_steps ( ) const
inline

Definition at line 74 of file convergence_window.hpp.

◆ recent_history()

std::vector< Real > q3::ConvergenceWindow::recent_history ( int  count = 5) const
inline

The last count values, oldest first.

Definition at line 79 of file convergence_window.hpp.

Referenced by recent_history_text(), and q3::SubspaceDisentangler::run().

◆ recent_history_text()

std::string q3::ConvergenceWindow::recent_history_text ( int  count = 5) const
inline

The last count values, oldest first, as "a, b, c" with six decimals each.

Definition at line 88 of file convergence_window.hpp.

References history_text(), and recent_history().

Referenced by q3::SubspaceDisentangler::run().

◆ record()

void q3::ConvergenceWindow::record ( Real  value)
inline

The objective at the end of one more step.

Definition at line 45 of file convergence_window.hpp.

Referenced by q3::SpreadMinimizer::run(), and q3::SubspaceDisentangler::run().


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