#include <LoggingFunction.h>
Public Member Functions | |
LoggingFunction (FunctionType f) | |
~LoggingFunction () | |
ScalarType | operator() (ScalarType x) |
void | reset () |
void | enable_plot (std::string filename) |
ScalarType | get_y_min () const |
ScalarType | get_y_max () const |
int | get_num_eval () const |
Private Attributes | |
ScalarType | y_min_ |
ScalarType | y_max_ |
int | num_eval_ |
FunctionType | function_ |
bool | plot_enabled_ |
std::ofstream | of_ |
Definition at line 22 of file LoggingFunction.h.
LoggingFunction< FunctionType, ScalarType >::LoggingFunction | ( | FunctionType | f | ) | [inline] |
Create a LoggingFunction from an existing function object f.
f | function object, implementing ScalarType operator()(ScalarType) |
Definition at line 28 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::reset().
Here is the call graph for this function:
LoggingFunction< FunctionType, ScalarType >::~LoggingFunction | ( | ) | [inline] |
Destructor
Definition at line 38 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::reset().
Here is the call graph for this function:
void LoggingFunction< FunctionType, ScalarType >::enable_plot | ( | std::string | filename | ) | [inline] |
Enable logging of function evaluations to a text file.
filename | Name of log file to write to. |
Definition at line 73 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::of_, and LoggingFunction< FunctionType, ScalarType >::plot_enabled_.
Referenced by eval_gap_voltage().
int LoggingFunction< FunctionType, ScalarType >::get_num_eval | ( | ) | const [inline] |
Return number of function evaluations.
Definition at line 97 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::num_eval_.
Referenced by eval_gap_voltage().
ScalarType LoggingFunction< FunctionType, ScalarType >::get_y_max | ( | ) | const [inline] |
Return maximum of evaluated function values.
Definition at line 90 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::y_max_.
Referenced by eval_gap_voltage().
ScalarType LoggingFunction< FunctionType, ScalarType >::get_y_min | ( | ) | const [inline] |
Return minimum of evaluated function values.
Definition at line 83 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::y_min_.
Referenced by eval_gap_voltage().
ScalarType LoggingFunction< FunctionType, ScalarType >::operator() | ( | ScalarType | x | ) | [inline] |
Call f(x) and update statistics.
x |
Definition at line 47 of file LoggingFunction.h.
References LoggingFunction< FunctionType, ScalarType >::function_, LoggingFunction< FunctionType, ScalarType >::num_eval_, LoggingFunction< FunctionType, ScalarType >::of_, LoggingFunction< FunctionType, ScalarType >::plot_enabled_, y, LoggingFunction< FunctionType, ScalarType >::y_max_, and LoggingFunction< FunctionType, ScalarType >::y_min_.
void LoggingFunction< FunctionType, ScalarType >::reset | ( | ) | [inline] |
Reset statistics and close log file, if one was created.
Definition at line 61 of file LoggingFunction.h.
References max, LoggingFunction< FunctionType, ScalarType >::num_eval_, LoggingFunction< FunctionType, ScalarType >::of_, LoggingFunction< FunctionType, ScalarType >::plot_enabled_, LoggingFunction< FunctionType, ScalarType >::y_max_, and LoggingFunction< FunctionType, ScalarType >::y_min_.
Referenced by eval_gap_voltage(), LoggingFunction< FunctionType, ScalarType >::LoggingFunction(), and LoggingFunction< FunctionType, ScalarType >::~LoggingFunction().
FunctionType LoggingFunction< FunctionType, ScalarType >::function_ [private] |
Definition at line 104 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::operator()().
int LoggingFunction< FunctionType, ScalarType >::num_eval_ [private] |
Definition at line 103 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::get_num_eval(), LoggingFunction< FunctionType, ScalarType >::operator()(), and LoggingFunction< FunctionType, ScalarType >::reset().
std::ofstream LoggingFunction< FunctionType, ScalarType >::of_ [private] |
Definition at line 106 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::enable_plot(), LoggingFunction< FunctionType, ScalarType >::operator()(), and LoggingFunction< FunctionType, ScalarType >::reset().
bool LoggingFunction< FunctionType, ScalarType >::plot_enabled_ [private] |
Definition at line 105 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::enable_plot(), LoggingFunction< FunctionType, ScalarType >::operator()(), and LoggingFunction< FunctionType, ScalarType >::reset().
ScalarType LoggingFunction< FunctionType, ScalarType >::y_max_ [private] |
Definition at line 102 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::get_y_max(), LoggingFunction< FunctionType, ScalarType >::operator()(), and LoggingFunction< FunctionType, ScalarType >::reset().
ScalarType LoggingFunction< FunctionType, ScalarType >::y_min_ [private] |
Definition at line 101 of file LoggingFunction.h.
Referenced by LoggingFunction< FunctionType, ScalarType >::get_y_min(), LoggingFunction< FunctionType, ScalarType >::operator()(), and LoggingFunction< FunctionType, ScalarType >::reset().