APFEL 4.8.0
A PDF evolution library in C++
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
apfel::Set< T > Class Template Reference

The Set template class allocates a collection of objects of type T along the ConvolutionMap and provides the methods to perform operations between different types of objects T. More...

#include <set.h>

Public Member Functions

 Set (ConvolutionMap const &Map=ConvolutionMap{"UNDEFINED"}, std::map< int, T > const &in=std::map< int, T > {})
 The Set constructor.
 
 Set (std::map< int, T > const &in)
 The Set constructor.
 
void SetMap (ConvolutionMap const &map)
 This function (re)sets the convolution map.
 
void SetObjects (std::map< int, T > const &objects)
 This function (re)sets the map of objects.
 
Combine () const
 This function sums up all the objects of the set into one.
 
Combine (std::vector< double > const &weigths) const
 This function sums up all the objects of the set into one using the components of input vector as weights.
 
void Print () const
 Print the Operator object.
 
Binary operators
template<class V >
Set< V > operator*= (Set< V > const &d) const
 operator *= product object
 
Set< T > & operator*= (double const &s)
 this *= scalar
 
Set< T > & operator*= (std::function< double(double const &)> f)
 this *= function of the integration variable (for distributions only)
 
Set< T > & operator*= (std::vector< double > const &v)
 this *= vector of scalars
 
Set< T > & operator*= (std::map< int, double > const &v)
 this *= map of scalars
 
Set< T > & operator/= (double const &s)
 this /= scalar
 
Set< T > & operator+= (Set< T > const &d)
 this += Set
 
Set< T > & operator-= (Set< T > const &d)
 this -= Set
 
Getters
T const & at (int const &id) const
 This returns object with ID "id" in the map.
 
ConvolutionMap const & GetMap () const
 This returns the convolution map.
 
std::map< int, T > const & GetObjects () const
 This returns the full map of objects.
 

Private Attributes

ConvolutionMap _map
 The shared pointer containing the convolution map.
 
std::map< int, T > _objects
 The container for the map.
 

Friends

template<class U >
std::ostream & operator<< (std::ostream &os, Set< U > const &s)
 

Detailed Description

template<class T>
class apfel::Set< T >

The Set template class allocates a collection of objects of type T along the ConvolutionMap and provides the methods to perform operations between different types of objects T.

Examples
dglap_test.cc, set_test.cc, and tmd_test.cc.

Constructor & Destructor Documentation

◆ Set() [1/2]

template<class T >
apfel::Set< T >::Set ( ConvolutionMap const & Map = ConvolutionMap{"UNDEFINED"},
std::map< int, T > const & in = std::map< int, T > {} )

The Set constructor.

Parameters
Mapthe convolution map (defualt: empty ConvolutionMap)
ina map of objects of type T (defualt: empty map of objects)

◆ Set() [2/2]

template<class T >
apfel::Set< T >::Set ( std::map< int, T > const & in)

The Set constructor.

Parameters
ina map of objects of type T (defualt: empty map of objects)
Note
When invoking this constructor a diagonal convolution map is automatically constructed.

Member Function Documentation

◆ at()

template<class T >
T const & apfel::Set< T >::at ( int const & id) const
inline

This returns object with ID "id" in the map.

Parameters
idobjects ID
Examples
set_test.cc.

◆ Combine() [1/2]

template<class T >
T apfel::Set< T >::Combine ( ) const

This function sums up all the objects of the set into one.

◆ Combine() [2/2]

template<class T >
T apfel::Set< T >::Combine ( std::vector< double > const & weigths) const

This function sums up all the objects of the set into one using the components of input vector as weights.

Parameters
weigthsset of weights

◆ GetMap()

template<class T >
ConvolutionMap const & apfel::Set< T >::GetMap ( ) const
inline

This returns the convolution map.

◆ GetObjects()

template<class T >
std::map< int, T > const & apfel::Set< T >::GetObjects ( ) const
inline

This returns the full map of objects.

◆ operator*=() [1/5]

template<class T >
Set< T > & apfel::Set< T >::operator*= ( double const & s)

this *= scalar

◆ operator*=() [2/5]

template<class T >
template<class V >
Set< V > apfel::Set< T >::operator*= ( Set< V > const & d) const

operator *= product object

Parameters
dthe left hand side object of type V
Returns
a new object of type V

◆ operator*=() [3/5]

template<class T >
Set< T > & apfel::Set< T >::operator*= ( std::function< double(double const &)> f)

this *= function of the integration variable (for distributions only)

◆ operator*=() [4/5]

template<class T >
Set< T > & apfel::Set< T >::operator*= ( std::map< int, double > const & v)

this *= map of scalars

◆ operator*=() [5/5]

template<class T >
Set< T > & apfel::Set< T >::operator*= ( std::vector< double > const & v)

this *= vector of scalars

◆ operator+=()

template<class T >
Set< T > & apfel::Set< T >::operator+= ( Set< T > const & d)

this += Set

◆ operator-=()

template<class T >
Set< T > & apfel::Set< T >::operator-= ( Set< T > const & d)

this -= Set

◆ operator/=()

template<class T >
Set< T > & apfel::Set< T >::operator/= ( double const & s)

this /= scalar

◆ Print()

template<class T >
void apfel::Set< T >::Print ( ) const
inline

Print the Operator object.

◆ SetMap()

template<class T >
void apfel::Set< T >::SetMap ( ConvolutionMap const & map)
inline

This function (re)sets the convolution map.

Examples
dglap_test.cc.

◆ SetObjects()

template<class T >
void apfel::Set< T >::SetObjects ( std::map< int, T > const & objects)
inline

This function (re)sets the map of objects.

Parameters
objectsset of objects

Friends And Related Symbol Documentation

◆ operator<<

template<class T >
template<class U >
std::ostream & operator<< ( std::ostream & os,
Set< U > const & s )
friend

Member Data Documentation

◆ _map

template<class T >
ConvolutionMap apfel::Set< T >::_map
private

The shared pointer containing the convolution map.

◆ _objects

template<class T >
std::map<int, T> apfel::Set< T >::_objects
private

The container for the map.


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