Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
helper.h
Go to the documentation of this file.
1/*
2 * helper.h
3 *
4 * This file contains functions that can be used everywhere
5 * in the simulation.
6 * They might make things more easy.
7 */
8
9#ifndef __HELPER_H_
10#define __HELPER_H_
11
12#include <algorithm>
13#include <cctype>
14#include <cmath>
15#include <list>
16#include <memory>
17#include <string>
18#include <utility>
19#include <vector>
20
21using namespace std;
22
23
24/*
25 This function computes the cartesian product (i.e. everything with everything)
26 of a vector of vectors.
27*/
28list<list<pair<string,float>>>* cartesian_product(
29 vector<pair<string,shared_ptr<vector<float>>>>& input);
30
31/*
32 * This function compares two struct tm objects directly
33 * instead of using mktime.
34 *
35 * Returns 0, if tm1 == tm2
36 * Returns -1, if tm1 < tm2
37 * Returns +1, if tm1 > tm2
38 */
39int compare_struct_tm(struct tm* a, struct tm* b);
40
44float round_float_n(float x, unsigned int decimal_places);
45
49float round_float_5(double x);
50
54float round_float_5(float x);
55
60void to_lowercase(std::string& s);
61
62
63#endif
64
float round_float_n(float x, unsigned int decimal_places)
Definition helper.cpp:107
float round_float_5(double x)
Definition helper.cpp:112
void to_lowercase(std::string &s)
Definition helper.cpp:120
list< list< pair< string, float > > > * cartesian_product(vector< pair< string, shared_ptr< vector< float > > > > &input)
Definition helper.cpp:63
int compare_struct_tm(struct tm *a, struct tm *b)
Definition helper.cpp:79