60 std::vector<double>
m_x;
63 std::vector<double>
m_y;
122 Data2D (
const std::string input_file,
const int skip_nlines=0,
const std::vector<int> column={1, 2},
const std::vector<int> column_data={},
const std::vector<int> column_errors={},
const std::vector<int> column_edges={})
124 {
read(input_file, skip_nlines, column, column_data, column_errors, column_edges); }
139 Data2D (
const std::vector<double> x,
const std::vector<double> y,
const std::vector<std::vector<double>>
data,
const std::vector<double> bin_edges_x={},
const std::vector<double> bin_edges_y={});
157 Data2D (
const std::vector<double> x,
const std::vector<double> y,
const std::vector<std::vector<double>>
data,
const std::vector<std::vector<double>>
error,
const std::vector<double> bin_edges_x={},
const std::vector<double> bin_edges_y={});
175 Data2D (
const std::vector<double> x,
const std::vector<double> y,
const std::vector<double>
data,
const std::vector<double>
error,
const std::vector<double> bin_edges_x={},
const std::vector<double> bin_edges_y={});
193 Data2D (
const std::vector<double> x,
const std::vector<double> y,
const std::vector<double>
data,
const std::vector<std::vector<double>>
covariance,
const std::vector<double> bin_edges_x={},
const std::vector<double> bin_edges_y={});
234 double xx (
const int i)
const override
241 std::vector<double>
xx ()
const override {
return m_x; }
248 double yy (
const int i)
const override
255 std::vector<double>
yy ()
const override
271 { (void)i; (void)j;
return {
m_x,
m_y}; }
279 double data (
const int i,
const int j)
const override
286 void get_data (std::vector<std::vector<double>> &
data)
const override;
294 double error (
const int i,
const int j)
const override
301 void get_error (std::vector<std::vector<double>> &
error)
const override;
379 virtual void read (
const std::string input_file,
const int skip_nlines=0,
const std::vector<int> column={1, 2},
const std::vector<int> column_data={},
const std::vector<int> column_errors={},
const std::vector<int> column_edges={})
override;
386 virtual void Print (
const int precision=4)
const override;
408 void write (
const std::string dir,
const std::string file,
const std::string header,
const bool full,
const int prec=4,
const int ww=8,
const int rank=0)
const;
419 void write_covariance (
const std::string dir,
const std::string file,
const int precision=10)
const override;
437 std::shared_ptr<Data>
cut (
const double xmin,
const double xmax,
const double ymin,
const double ymax)
const;
void set_edges_xx(const std::vector< double > edges) override
set interval variable m_edges_xx
int m_xsize
number of points along x
double data(const int i, const int j) const override
get data at index i,j
double yy(const int i) const override
get the value of y at index i
void write_covariance(const std::string dir, const std::string file, const int precision=10) const override
write the covariance
std::vector< double > m_y
ordered y axis points
int xsize() const override
get the number of points along x
void write(const std::string dir, const std::string file, const std::string header, const bool full, const int prec=4, const int ww=8, const int rank=0) const
write the data
void set_yy(const std::vector< double > y) override
set interval variable m_y
std::vector< double > xx() const override
get the x vector
std::vector< double > yy() const override
get the y vector
int ysize() const override
get the number of points along y
std::vector< double > m_x
ordered x axis points
Data2D()
default constructor
std::shared_ptr< Data > cut(const double xmin, const double xmax, const double ymin, const double ymax) const
cut the data
virtual void Print(const int precision=4) const override
print the data on screen
Data2D(const std::string input_file, const int skip_nlines=0, const std::vector< int > column={1, 2}, const std::vector< int > column_data={}, const std::vector< int > column_errors={}, const std::vector< int > column_edges={})
constructor which reads the data from file
std::vector< std::vector< double > > IndipendentVariable(const int i=-1, const int j=-1) const override
get the independet variable, to be used in model computation
void get_error(std::vector< std::vector< double >> &error) const override
get error
int m_ysize
number of points along y
virtual void read(const std::string input_file, const int skip_nlines=0, const std::vector< int > column={1, 2}, const std::vector< int > column_data={}, const std::vector< int > column_errors={}, const std::vector< int > column_edges={}) override
read the data
double error(const int i, const int j) const override
get error at index i,j
double xx(const int i) const override
get the value of x at index i
std::shared_ptr< Data > as_factory()
static factory used to construct objects of class Data2D
void set_xx(const std::vector< double > x) override
set interval variable m_x
void get_data(std::vector< std::vector< double >> &data) const override
get data
~Data2D()=default
default destructor
void set_edges_yy(const std::vector< double > edges) override
set interval variable m_edges_yy
std::vector< double > m_edges_yy
bin edges for the y variable
virtual std::vector< double > data() const
get data
std::vector< double > m_error
standard deviations
std::vector< double > m_data
data values
Data()=default
default constructor
std::vector< double > m_edges_xx
bin edges for the x variable
virtual std::vector< double > error() const
get standard deviation
virtual std::vector< std::vector< double > > covariance() const
get the m_covariance vector
The global namespace of the CosmoBolognaLib