Logging into matrices in data format in memory, optionally persisted into a file.
#include <loggers.h>
Public Member Functions | |
memlog (int maxlen0, string itf="") | |
memlog () | |
Default constructor. | |
void | init () |
Initialize storage. | |
void | step () |
Shifts storage position for another time step. | |
void | logit (int id, const vec &v) |
log this vector | |
void | logit (int id, const double &d) |
log this double | |
void | itsave (const char *fname) |
Save values into an itfile named after fname . | |
void | finalize () |
Finalize storing information. | |
void | from_setting (const Setting &set) |
UI for memlog. | |
virtual int | add (const RV &rv, string prefix="") |
returns an identifier which will be later needed for calling the logit() function For empty RV it returns -1, this entry will be ignored by logit() . | |
virtual string | to_string () |
This method returns a basic info about the current instance. | |
virtual void | to_setting (Setting &set) const |
This method save all the instance properties into the Setting structure. | |
virtual void | validate () |
This method TODO. | |
Protected Attributes | |
int | maxlen |
Maximum length of vectors stored in memory. | |
int | ind |
Currect record to be written. | |
Array< mat > | vectors |
Storage. | |
string | itfilename |
name of it file to save results | |
Array< RV > | entries |
RVs of all logged variables. | |
Array< string > | names |
Names of logged quantities, e.g. names of algorithm variants. |
void bdm::memlog::from_setting | ( | const Setting & | set | ) | [virtual] |
TODO dat tam kam patri, a to celej blok
logger = { class = "memlog"; filename = "file_name.it"; // resulting filename with results in it format maxlen = 100; // size of memory buffer }
Reimplemented from bdm::root.
Reimplemented in bdm::stdlog, bdm::dirfilelog, and bdm::mexlog.
References itfilename, and maxlen.