-
Notifications
You must be signed in to change notification settings - Fork 1
/
LogManager.h
70 lines (56 loc) · 1.86 KB
/
LogManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//============================================================================
// Name : LogManager.h
// Author : Christian Schoppmeyer
// Version :
// Created On : 22.11.2011
// Copyright : EMBOCON Copyright
// Description :
//============================================================================
#ifndef LOGMANAGER_H_
#define LOGMANAGER_H_
#include <stdlib.h>
#include <stdint.h>
using namespace std;
/**
* Open a new log file for writing the results of the simulation/optimization run into the file.
*/
void openLogFile(char* path);
void openCPUTimeMeasLogFile(char* path);
/**
* Close the open log file.
*/
void closeLogFile();
void closeCPUTimeMeasLogFile();
/**
* Write the command line arguments used to call GEMS to the log file
*/
void writeCMDLineArgsToLog(char* argv[]);
/**
* Write a CPU time measurement of a function call to the CPU time measurement log
*/
void writeCPUTimeMeasToLog(char* msg, uint64_t timeElapsed);
/**
* Write test message in log file with comment sign (#) ahead.
*/
void writeLineToLog(char* msg);
/**
* Write text to log file.
*/
void writeTextToLog(char* msg);
/**
* Write state, output, input and parameter names to log file.
*/
void writeNameToLog(char* name);
/**
* Write step to log file
*/
void writeStepToLog(double step, double xcur[], unsigned int countState, double ycur[], unsigned int countOutput, double ucur[], unsigned int countInput, double pcur[], unsigned int countParam);
/**
* Write the general information about the optimization to the header of the log file
*/
void writeGeneralInfoToLog(unsigned int countState, unsigned int countOutput, unsigned int countInput, unsigned int countParam, unsigned int countOptParam, unsigned int countObsParam, double numberOfsteps);
/**
* Round a double to the given number of digits
*/
double round(double x, int digits);
#endif /* LOGMANAGER_H_ */