Alexandria
2.16
Please provide a description of the project.
|
This module provides an interface for accessing two dimensional datasets (pairs of (X,Y) values) stored in some storage (file system, database, etc) More...
#include <XYDataset.h>
Public Types | |
typedef std::vector< std::pair < double, double > >::const_iterator | const_iterator |
Public Member Functions | |
XYDataset (std::vector< std::pair< double, double >> values) | |
Constructor XYDataset interface represents an immutable data set. More... | |
XYDataset (const XYDataset &)=default | |
Copy constructor. More... | |
XYDataset (XYDataset &&)=default | |
Move constructor. More... | |
virtual | ~XYDataset ()=default |
Destructor. More... | |
const_iterator | begin () const |
Returns a const iterator to the first pair of the dataset. More... | |
const_iterator | end () const |
Returns a const iterator to the one after last pair dataset. More... | |
const std::pair< double, double > & | front () const |
Returns a reference to the first pair of the dataset. More... | |
const std::pair< double, double > & | back () const |
Returns a reference to the last pair of the dataset. More... | |
size_t | size () const |
Get the size of the vector container. More... | |
Static Public Member Functions | |
static XYDataset | factory (std::vector< std::pair< double, double >> vector_pair) |
Make a XYDataset object from a vector of pair of doubles. More... | |
static XYDataset | factory (const std::vector< double > &x, const std::vector< double > &y) |
Make a XYDataset object from two vectors of doubles. More... | |
Private Attributes | |
std::vector< std::pair< double, double > > | m_values { } |
This module provides an interface for accessing two dimensional datasets (pairs of (X,Y) values) stored in some storage (file system, database, etc)
Interface class
The datasets are organized in groups (nested groups are allowed, which create a tree) and they can be uniquely identified by their qualified name, which consists of the group names and the dataset name, separated by slashes "/" for example "groupA/groupB/name". Note that datasets might not belong to any group (or alternatively that they might belong to the root group), in which case they are accessed by just using their name (no leading slash). The module abstracts the nature of the storage and the only assumption is that the datasets can be accessed using their qualified names.
ElementException | : Vectors must have the same size! |
Definition at line 59 of file XYDataset.h.
typedef std::vector<std::pair<double, double> >::const_iterator Euclid::XYDataset::XYDataset::const_iterator |
Definition at line 64 of file XYDataset.h.
|
inline |
Constructor XYDataset interface represents an immutable data set.
XYDataset interface represents an immutable data set, where both X and Y axes contain double values. It provides iterators both for the (X,Y) pairs and for the axes values independently.
values | A vector of pair of doubles |
Definition at line 78 of file XYDataset.h.
|
default |
Copy constructor.
|
default |
Move constructor.
|
virtualdefault |
Destructor.
const std::pair< double, double > & Euclid::XYDataset::XYDataset::back | ( | ) | const |
Returns a reference to the last pair of the dataset.
Definition at line 50 of file XYDataset.cpp.
XYDataset::const_iterator Euclid::XYDataset::XYDataset::begin | ( | ) | const |
Returns a const iterator to the first pair of the dataset.
Definition at line 38 of file XYDataset.cpp.
Referenced by Euclid::MathUtils::Cumulative::fromPdf(), and Euclid::MathUtils::getXYs().
XYDataset::const_iterator Euclid::XYDataset::XYDataset::end | ( | ) | const |
Returns a const iterator to the one after last pair dataset.
Definition at line 42 of file XYDataset.cpp.
Referenced by Euclid::MathUtils::Cumulative::fromPdf(), and Euclid::MathUtils::getXYs().
|
static |
Make a XYDataset object from a vector of pair of doubles.
vector_pair | A vector of pair of doubles |
Definition at line 54 of file XYDataset.cpp.
References std::move().
|
static |
Make a XYDataset object from two vectors of doubles.
x | A vector of double values |
y | A vector of double values |
Definition at line 58 of file XYDataset.cpp.
References std::back_inserter(), std::vector< T >::begin(), std::vector< T >::end(), std::make_pair(), std::move(), std::vector< T >::reserve(), std::vector< T >::size(), and std::transform().
const std::pair< double, double > & Euclid::XYDataset::XYDataset::front | ( | ) | const |
Returns a reference to the first pair of the dataset.
Definition at line 46 of file XYDataset.cpp.
|
inline |
Get the size of the vector container.
Definition at line 152 of file XYDataset.h.
Referenced by Euclid::MathUtils::interpolate().
|
private |
Definition at line 156 of file XYDataset.h.