Jpp  master_rocky
the software that should make you happy
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t > Class Template Reference

Multidimensional histogram. More...

#include <JMultiHistogram.hh>

Inheritance diagram for JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >:
JTOOLS::JMultiMap< JHistogram_t::abscissa_type, JHistogram_t, JMaplist_t, JDistance< typename JHistogram_t::abscissa_type > >

Public Types

enum  { NUMBER_OF_DIMENSIONS = JMapLength<JMaplist_t>::value + JHistogram_t::NUMBER_OF_DIMENSIONS }
 
typedef JMultiMap< typename JHistogram_t::abscissa_type, JHistogram_t, JMaplist_t, JDistance_t > multimap_type
 
typedef multimap_type::abscissa_type abscissa_type
 
typedef multimap_type::ordinate_type ordinate_type
 
typedef multimap_type::const_iterator const_iterator
 
typedef multimap_type::const_reverse_iterator const_reverse_iterator
 
typedef multimap_type::iterator iterator
 
typedef multimap_type::reverse_iterator reverse_iterator
 
typedef multimap_type::super_iterator super_iterator
 
typedef multimap_type::super_const_iterator super_const_iterator
 
typedef JHistogram_t::contents_type contents_type
 

Public Member Functions

 JMultiHistogram ()
 Default constructor. More...
 
const JMultiHistogramgetMultiHistogram () const
 Get multidimensional histogram. More...
 
JMultiHistogramgetMultiHistogram ()
 Get multidimensional histogram. More...
 
template<class ... Args>
void fill (const Args &...args)
 Multi-dimensional fill method call. More...
 

Protected Member Functions

template<class ... Args>
void __fill__ (const int i, const abscissa_type x0, const abscissa_type x1, const Args &...args)
 Recursive method for filling histogram. More...
 
virtual void __fill__ (const int i, const abscissa_type x, const contents_type w)
 Termination method for filling histogram. More...
 

Protected Attributes

JArray< NUMBER_OF_DIMENSIONS, abscissa_typebuffer
 

Detailed Description

template<class JHistogram_t, class JMaplist_t, class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
class JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >

Multidimensional histogram.

The template parameters respectively refer to:

  1. histogram object used for the lowest dimension(s);
  2. list of histogram maps used for the higher dimension(s); and
  3. distance operator.

The number of dimensions of this histogram object is equal to the length of the given map list plus the extra dimensions of the first histogram object.

Definition at line 33 of file JMultiHistogram.hh.

Member Typedef Documentation

◆ multimap_type

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef JMultiMap<typename JHistogram_t::abscissa_type, JHistogram_t, JMaplist_t, JDistance_t> JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::multimap_type

Definition at line 41 of file JMultiHistogram.hh.

◆ abscissa_type

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::abscissa_type JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::abscissa_type

Definition at line 45 of file JMultiHistogram.hh.

◆ ordinate_type

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::ordinate_type JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::ordinate_type

Definition at line 46 of file JMultiHistogram.hh.

◆ const_iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::const_iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::const_iterator

Definition at line 48 of file JMultiHistogram.hh.

◆ const_reverse_iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::const_reverse_iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::const_reverse_iterator

Definition at line 49 of file JMultiHistogram.hh.

◆ iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::iterator

Definition at line 50 of file JMultiHistogram.hh.

◆ reverse_iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::reverse_iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::reverse_iterator

Definition at line 51 of file JMultiHistogram.hh.

◆ super_iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::super_iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::super_iterator

Definition at line 53 of file JMultiHistogram.hh.

◆ super_const_iterator

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef multimap_type::super_const_iterator JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::super_const_iterator

Definition at line 54 of file JMultiHistogram.hh.

◆ contents_type

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
typedef JHistogram_t::contents_type JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::contents_type

Definition at line 56 of file JMultiHistogram.hh.

Member Enumeration Documentation

◆ anonymous enum

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
anonymous enum
Enumerator
NUMBER_OF_DIMENSIONS 

Definition at line 43 of file JMultiHistogram.hh.

43 { NUMBER_OF_DIMENSIONS = JMapLength<JMaplist_t>::value + JHistogram_t::NUMBER_OF_DIMENSIONS };
Length of map list.
Definition: JMapList.hh:45

Constructor & Destructor Documentation

◆ JMultiHistogram()

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::JMultiHistogram ( )
inline

Default constructor.

Definition at line 62 of file JMultiHistogram.hh.

63  {}

Member Function Documentation

◆ getMultiHistogram() [1/2]

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
const JMultiHistogram& JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::getMultiHistogram ( ) const
inline

Get multidimensional histogram.

Returns
this multidimensional histogram

Definition at line 71 of file JMultiHistogram.hh.

72  {
73  return static_cast<const JMultiHistogram&>(*this);
74  }
Multidimensional histogram.

◆ getMultiHistogram() [2/2]

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
JMultiHistogram& JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::getMultiHistogram ( )
inline

Get multidimensional histogram.

Returns
this multidimensional histogram

Definition at line 82 of file JMultiHistogram.hh.

83  {
84  return static_cast<JMultiHistogram&>(*this);
85  }

◆ fill()

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
template<class ... Args>
void JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::fill ( const Args &...  args)
inline

Multi-dimensional fill method call.

Parameters
argscomma seperated list of abscissa values and weight

Definition at line 94 of file JMultiHistogram.hh.

95  {
96  __fill__(0, args...);
97  }
void __fill__(const int i, const abscissa_type x0, const abscissa_type x1, const Args &...args)
Recursive method for filling histogram.

◆ __fill__() [1/2]

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
template<class ... Args>
void JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::__fill__ ( const int  i,
const abscissa_type  x0,
const abscissa_type  x1,
const Args &...  args 
)
inlineprotected

Recursive method for filling histogram.

Parameters
iindex
x0value at given index
x1value at following index
argsremaining values and weight

Definition at line 110 of file JMultiHistogram.hh.

111  {
112  this->buffer[i] = x0;
113 
114  __fill__(i + 1, x1, args...);
115  }
JArray< NUMBER_OF_DIMENSIONS, abscissa_type > buffer

◆ __fill__() [2/2]

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
virtual void JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::__fill__ ( const int  i,
const abscissa_type  x,
const contents_type  w 
)
inlineprotectedvirtual

Termination method for filling histogram.

Parameters
iindex
xvalue at given index
wweight

Definition at line 124 of file JMultiHistogram.hh.

125  {
126  this->buffer[i] = x;
127 
128  this->evaluate(this->buffer.data(), w);
129  }
const_pointer data() const
Get pointer to data.
Definition: JArray.hh:284
data_type w[N+1][M+1]
Definition: JPolint.hh:867

Member Data Documentation

◆ buffer

template<class JHistogram_t , class JMaplist_t , class JDistance_t = JDistance<typename JHistogram_t::abscissa_type>>
JArray<NUMBER_OF_DIMENSIONS, abscissa_type> JTOOLS::JMultiHistogram< JHistogram_t, JMaplist_t, JDistance_t >::buffer
mutableprotected

Definition at line 131 of file JMultiHistogram.hh.


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