KASKADE 7 development version
Public Member Functions | List of all members
Kaskade::LoggedQuantity< T > Class Template Reference

Class that represents a quantity that can be logged during the course of an algortihm. More...

#include <algorithm_base.hh>

Detailed Description

template<typename T>
class Kaskade::LoggedQuantity< T >

Class that represents a quantity that can be logged during the course of an algortihm.

Useful as a member of IterationParameters or a derived class Supports a vaildity check and an assertion which returns the name of the quantity Examples of use: e.g. GuardedCovariantNewtonParameters

Definition at line 29 of file algorithm_base.hh.

Public Member Functions

void doAction (LQAction::ToDo td, std::string const &name_="noName")
 
void reset (std::string const &name_)
 Delete any information contained in this class, on exit: state like freshly constructed. More...
 
 LoggedQuantity (std::string const &name_)
 
 LoggedQuantity ()
 
void logValue ()
 Insert current value into log buffer. More...
 
void logValue (int i)
 Insert current value into log buffer at a certain number i (used seldomly) More...
 
LoggedQuantity< T > & operator= (T const &rvalue)
 Set current value. More...
 
int size ()
 Get size of log buffer. More...
 
bool isValid ()
 Returns true, iff there is a valid current value. More...
 
void devalidate ()
 devalidate current value More...
 
bool isLogged ()
 returns true, iff current value is already logged More...
 
T const & operator[] (int i)
 Return value from log buffer (used seldomly) More...
 
 operator T& ()
 Directly access current value (may fail in special cases due to type non-uniqueness issues) More...
 
T & value_nonconst ()
 
T const & value () const
 
void print (std::ostream &s)
 print log-buffer into a stream, to be used for analysis of an algorithm More...
 

Constructor & Destructor Documentation

◆ LoggedQuantity() [1/2]

template<typename T >
Kaskade::LoggedQuantity< T >::LoggedQuantity ( std::string const &  name_)
inline

Definition at line 54 of file algorithm_base.hh.

◆ LoggedQuantity() [2/2]

template<typename T >
Kaskade::LoggedQuantity< T >::LoggedQuantity ( )
inline

Definition at line 55 of file algorithm_base.hh.

Member Function Documentation

◆ devalidate()

template<typename T >
void Kaskade::LoggedQuantity< T >::devalidate ( )
inline

devalidate current value

Definition at line 77 of file algorithm_base.hh.

Referenced by Kaskade::LoggedQuantity< T >::doAction().

◆ doAction()

template<typename T >
void Kaskade::LoggedQuantity< T >::doAction ( LQAction::ToDo  td,
std::string const &  name_ = "noName" 
)
inline

◆ isLogged()

template<typename T >
bool Kaskade::LoggedQuantity< T >::isLogged ( )
inline

returns true, iff current value is already logged

Definition at line 80 of file algorithm_base.hh.

◆ isValid()

template<typename T >
bool Kaskade::LoggedQuantity< T >::isValid ( )
inline

◆ logValue() [1/2]

template<typename T >
void Kaskade::LoggedQuantity< T >::logValue ( )
inline

Insert current value into log buffer.

Definition at line 58 of file algorithm_base.hh.

Referenced by Kaskade::LoggedQuantity< T >::doAction(), Kaskade::ScalarModelFunction::fixUpdate(), and Kaskade::AdaptiveParameters::logStep().

◆ logValue() [2/2]

template<typename T >
void Kaskade::LoggedQuantity< T >::logValue ( int  i)
inline

Insert current value into log buffer at a certain number i (used seldomly)

Definition at line 65 of file algorithm_base.hh.

◆ operator T&()

template<typename T >
Kaskade::LoggedQuantity< T >::operator T& ( )
inline

Directly access current value (may fail in special cases due to type non-uniqueness issues)

Definition at line 92 of file algorithm_base.hh.

◆ operator=()

template<typename T >
LoggedQuantity< T > & Kaskade::LoggedQuantity< T >::operator= ( T const &  rvalue)
inline

Set current value.

Definition at line 68 of file algorithm_base.hh.

◆ operator[]()

template<typename T >
T const & Kaskade::LoggedQuantity< T >::operator[] ( int  i)
inline

Return value from log buffer (used seldomly)

Definition at line 83 of file algorithm_base.hh.

◆ print()

template<typename T >
void Kaskade::LoggedQuantity< T >::print ( std::ostream &  s)
inline

print log-buffer into a stream, to be used for analysis of an algorithm

Definition at line 102 of file algorithm_base.hh.

◆ reset()

template<typename T >
void Kaskade::LoggedQuantity< T >::reset ( std::string const &  name_)
inline

Delete any information contained in this class, on exit: state like freshly constructed.

Definition at line 44 of file algorithm_base.hh.

Referenced by Kaskade::LoggedQuantity< T >::doAction(), and Kaskade::LoggedQuantity< T >::LoggedQuantity().

◆ size()

template<typename T >
int Kaskade::LoggedQuantity< T >::size ( )
inline

◆ value()

template<typename T >
T const & Kaskade::LoggedQuantity< T >::value ( ) const
inline

◆ value_nonconst()

template<typename T >
T & Kaskade::LoggedQuantity< T >::value_nonconst ( )
inline

access current value via a function member: Use this if operator T&() fails

Definition at line 97 of file algorithm_base.hh.

Referenced by Kaskade::DampedCovariantNewtonMethod::dampingFactor().


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