data.h
Go to the documentation of this 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
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