Thibault Barnouin Optimization Method Algorithm
data.h
Go to the documentation of this file.
1 #ifndef DATA_H
2 #define DATA_H
3 
4 #include<vector>
5 #include<string>
6 
7 /*
8  * Arbitrary data set
9  */
10 
11 
12 class Data{
13  public:
14  //Constructor & Destructor for the arbitrary data set
15  Data();
16  Data(const Data&);
17  Data(std::string);
18  Data(std::vector<std::vector<double>>,std::string);
19  ~Data(){};
20  //Random data_set generators
21  void randSet(int N); //N points in ([0;1],[0;1])
22  void randSet(int N, double xa, double xb, double ya, double yb); //N points in ([xa;xb],[ya;yb])
23  void randSet(int N, int d, double mu); //N points around random d degree polynom with mean distance to polynom mu
24  //Methods to add arbitrary values, set and get a data set
25  void add_value(std::vector<double>);
26  void fromFile(std::string); //Allow to get data from external file given a filepath
27  void setData(std::vector<std::vector<double>>);
28  std::vector<std::vector<double>> getData() const;
29  void setName(std::string);
30  std::string getName() const;
31  //Display methods
32  void displayData();
33  void exportData();
34  //Get the cardinality of the data set
35  int getCard() const;
36  void print() const;
37  private:
38  std::vector<std::vector<double>> data_set;
39  std::string name_set;
40 };
41 
42 #endif
Data::Data
Data()
Definition: data.cpp:16
Data::setName
void setName(std::string)
Definition: data.cpp:106
Data::getData
std::vector< std::vector< double > > getData() const
Definition: data.cpp:102
Data::getName
std::string getName() const
Definition: data.cpp:110
Data
Definition: data.h:12
Data::getCard
int getCard() const
Definition: data.cpp:137
Data::exportData
void exportData()
Definition: data.cpp:128
Data::print
void print() const
Definition: data.cpp:141
Data::fromFile
void fromFile(std::string)
Definition: data.cpp:92
Data::setData
void setData(std::vector< std::vector< double >>)
Definition: data.cpp:88
Data::randSet
void randSet(int N)
Definition: data.cpp:34
Data::add_value
void add_value(std::vector< double >)
Definition: data.cpp:84
Data::~Data
~Data()
Definition: data.h:19
Data::displayData
void displayData()
Definition: data.cpp:116