utils.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_UTILS_HPP
2 #define JULIAN_UTILS_HPP
3 
4 #include <iostream>
5 #include <vector>
6 #include <dates/date.hpp>
7 #include <map>
8 namespace julian {
9 
17  #define SHOW(x) std::cout <<"\nName: "<< #x << "\n" << x << "\n"
18 
19  bool isCloseEnough(double x1, double x2, int n);
20 
21  double roundNumber(double,int);
22 
23  void writeToCsv(std::string file_name, std::map<std::string,std::vector<double> > data);
24 
25  double convertStr2Dbl(std::string);
26 
27  std::string convertDbl2Str(double);
28 
29  std::vector<double> convertStr2Dbl(std::vector<std::string>);
30 
31  std::pair<std::string, std::string> catchDataAndSettingFileNames(int ac, char* av[]);
32 }
33 #endif
bool isCloseEnough(double x1, double x2, int n)
Function checks if difference between two numbers is small enough.
Definition: utils.cpp:23
double convertStr2Dbl(std::string input)
Function converts string to double.
Definition: utils.cpp:57
Definition: cadHoliday.cpp:3
std::string convertDbl2Str(double input)
Function converts double to string.
Definition: utils.cpp:73
File contains definition of date class.
void writeToCsv(std::string file_name, std::map< std::string, std::vector< double > > data)
Function saves data to csv file.
Definition: utils.cpp:108
double roundNumber(double x, int n)
Function rounds number to a decimal place.
Definition: utils.cpp:42
std::pair< std::string, std::string > catchDataAndSettingFileNames(int ac, char *av[])
Function uses boost::program_options to catch the name of data and setting file.
Definition: utils.cpp:146