43 lines
1.2 KiB
C++
Executable File
43 lines
1.2 KiB
C++
Executable File
#ifndef DATA_H
|
|
#define DATA_H
|
|
|
|
#include<vector>
|
|
#include<string>
|
|
|
|
/*
|
|
* Arbitrary data set
|
|
*/
|
|
|
|
|
|
class Data{
|
|
public:
|
|
//Constructor & Destructor for the arbitrary data set
|
|
Data();
|
|
Data(const Data&);
|
|
Data(std::string);
|
|
Data(std::vector<std::vector<double>>,std::string);
|
|
~Data(){};
|
|
//Random data_set generators
|
|
void randSet(int N); //N points in ([0;1],[0;1])
|
|
void randSet(int N, double xa, double xb, double ya, double yb); //N points in ([xa;xb],[ya;yb])
|
|
void randSet(int N, int d, double mu); //N points around random d degree polynom with mean distance to polynom mu
|
|
//Methods to add arbitrary values, set and get a data set
|
|
void add_value(std::vector<double>);
|
|
void fromFile(std::string); //Allow to get data from external file given a filepath
|
|
void setData(std::vector<std::vector<double>>);
|
|
std::vector<std::vector<double>> getData() const;
|
|
void setName(std::string);
|
|
std::string getName() const;
|
|
//Display methods
|
|
void displayData();
|
|
void exportData();
|
|
//Get the cardinality of the data set
|
|
int getCard() const;
|
|
void print() const;
|
|
private:
|
|
std::vector<std::vector<double>> data_set;
|
|
std::string name_set;
|
|
};
|
|
|
|
#endif
|