Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Euclid::XYDataset::XYDataset Class Reference

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>

Collaboration diagram for Euclid::XYDataset::XYDataset:
Collaboration graph
[legend]

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.
 
 XYDataset (const XYDataset &)=default
 Copy constructor.
 
 XYDataset (XYDataset &&)=default
 Move constructor.
 
virtual ~XYDataset ()=default
 Destructor.
 
const_iterator begin () const
 Returns a const iterator to the first pair of the dataset.
 
const_iterator end () const
 Returns a const iterator to the one after last pair dataset.
 
const std::pair< double, double > & front () const
 Returns a reference to the first pair of the dataset.
 
const std::pair< double, double > & back () const
 Returns a reference to the last pair of the dataset.
 
size_t size () const
 Get the size of the vector container.
 

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.
 
static XYDataset factory (const std::vector< double > &x, const std::vector< double > &y)
 Make a XYDataset object from two vectors of doubles.
 

Private Attributes

std::vector< std::pair< double, double > > m_values {}
 

Detailed Description

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.

Exceptions
ElementException: Vectors must have the same size!
Examples
/builddir/build/BUILD/Alexandria-2.31.0/MathUtils/MathUtils/interpolation/interpolation.h.

Definition at line 59 of file XYDataset.h.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<std::pair<double,double>>::const_iterator Euclid::XYDataset::XYDataset::const_iterator

Definition at line 62 of file XYDataset.h.

Constructor & Destructor Documentation

◆ XYDataset() [1/3]

Euclid::XYDataset::XYDataset::XYDataset ( std::vector< std::pair< double, double > >  values)
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.

Parameters
valuesA vector of pair of doubles

Definition at line 76 of file XYDataset.h.

◆ XYDataset() [2/3]

Euclid::XYDataset::XYDataset::XYDataset ( const XYDataset )
default

Copy constructor.

◆ XYDataset() [3/3]

Euclid::XYDataset::XYDataset::XYDataset ( XYDataset &&  )
default

Move constructor.

◆ ~XYDataset()

virtual Euclid::XYDataset::XYDataset::~XYDataset ( )
virtualdefault

Destructor.

Member Function Documentation

◆ back()

const std::pair< double, double > & Euclid::XYDataset::XYDataset::back ( ) const

Returns a reference to the last pair of the dataset.

Returns
A reference to the last pair of the dataset

Definition at line 48 of file XYDataset.cpp.

References std::vector< T >::back(), and m_values.

Here is the call graph for this function:

◆ begin()

XYDataset::const_iterator Euclid::XYDataset::XYDataset::begin ( ) const

Returns a const iterator to the first pair of the dataset.

Returns
An iterator to the first pair

Definition at line 36 of file XYDataset.cpp.

References std::vector< T >::cbegin(), and m_values.

Here is the call graph for this function:

◆ end()

XYDataset::const_iterator Euclid::XYDataset::XYDataset::end ( ) const

Returns a const iterator to the one after last pair dataset.

Returns
An iterator to the last pair dataset

Definition at line 40 of file XYDataset.cpp.

References std::vector< T >::cend(), and m_values.

Here is the call graph for this function:

◆ factory() [1/2]

XYDataset Euclid::XYDataset::XYDataset::factory ( const std::vector< double > &  x,
const std::vector< double > &  y 
)
static

Make a XYDataset object from two vectors of doubles.

Parameters
xA vector of double values
yA vector of double values
Returns
A unique pointer of XYDataset type

Definition at line 56 of file XYDataset.cpp.

References std::vector< T >::begin(), std::vector< T >::end(), std::make_pair(), std::vector< T >::reserve(), and std::vector< T >::size().

Here is the call graph for this function:

◆ factory() [2/2]

XYDataset Euclid::XYDataset::XYDataset::factory ( std::vector< std::pair< double, double > >  vector_pair)
static

Make a XYDataset object from a vector of pair of doubles.

Parameters
vector_pairA vector of pair of doubles
Returns
A unique pointer of XYDataset type

Definition at line 52 of file XYDataset.cpp.

References std::move().

Here is the call graph for this function:

◆ front()

const std::pair< double, double > & Euclid::XYDataset::XYDataset::front ( ) const

Returns a reference to the first pair of the dataset.

Returns
A reference to the first pair of the dataset

Definition at line 44 of file XYDataset.cpp.

References std::vector< T >::front(), and m_values.

Here is the call graph for this function:

◆ size()

size_t Euclid::XYDataset::XYDataset::size ( ) const
inline

Get the size of the vector container.

Returns
The size of the container which is the number of Source objects

Definition at line 150 of file XYDataset.h.

Member Data Documentation

◆ m_values

std::vector<std::pair<double, double> > Euclid::XYDataset::XYDataset::m_values {}
private

Definition at line 155 of file XYDataset.h.

Referenced by back(), begin(), end(), and front().


The documentation for this class was generated from the following files: