Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS::JHistogramMap_t< JKey_t, JHistogram_t, JDistance_t > Struct Template Referenceabstract

Type definition of a JHistogramMap based on JMap implementation. More...

#include <JHistogramMap_t.hh>

Inheritance diagram for JTOOLS::JHistogramMap_t< JKey_t, JHistogram_t, JDistance_t >:
JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t > JTOOLS::JHistogram< JAbscissa_t, JContents_t::contents_type >

Public Types

typedef JMap_t< JAbscissa_t, JContents_t, JDistance_t > collection_type
 
typedef JHistogram< JAbscissa_t, typename JContents_t::contents_type > histogram_type
 
typedef collection_type::abscissa_type abscissa_type
 
typedef collection_type::ordinate_type ordinate_type
 
typedef collection_type::value_type value_type
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef histogram_type::contents_type contents_type
 

Public Member Functions

virtual void evaluate (const abscissa_type *pX, typename JLANG::JClass< contents_type >::argument_type w)
 Fill histogram.
 
virtual void evaluate (const abscissa_type *pX, typename JLANG::JClass< contents_type >::argument_type w)=0
 Histogram filling.
 
JHistogramMapmul (typename JLANG::JClass< contents_type >::argument_type factor)
 Scale contents.
 
JHistogrammul (const double value)
 Scale histogram.
 
JHistogramMapdiv (typename JLANG::JClass< contents_type >::argument_type factor)
 Scale contents.
 
JHistogramdiv (double value)
 Scale histogram.
 
void reset ()
 Reset.
 
JHistogramadd (const JHistogram &histogram)
 Add histogram.
 
JHistogramsub (const JHistogram &histogram)
 Subtract histogram.
 
const contents_typegetUnderflow () const
 Get contents below lower limit.
 
const contents_typegetOverflow () const
 Get contents above upper limit.
 
const contents_typegetIntegral () const
 Get contents above upper limit.
 

Protected Attributes

contents_type underflow
 
contents_type overflow
 
contents_type integral
 

Detailed Description

template<class JKey_t, class JHistogram_t, class JDistance_t = JDistance<JKey_t>>
struct JTOOLS::JHistogramMap_t< JKey_t, JHistogram_t, JDistance_t >

Type definition of a JHistogramMap based on JMap implementation.

Definition at line 25 of file JHistogramMap_t.hh.

Member Typedef Documentation

◆ collection_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
JMap_t<JAbscissa_t, JContents_t, JDistance_t> JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::collection_type
inherited

Definition at line 34 of file JHistogramMap.hh.

◆ histogram_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
JHistogram<JAbscissa_t, typename JContents_t::contents_type> JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::histogram_type
inherited

Definition at line 35 of file JHistogramMap.hh.

◆ abscissa_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::abscissa_type JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::abscissa_type
inherited

Definition at line 37 of file JHistogramMap.hh.

◆ ordinate_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::ordinate_type JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::ordinate_type
inherited

Definition at line 38 of file JHistogramMap.hh.

◆ value_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::value_type JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::value_type
inherited

Definition at line 39 of file JHistogramMap.hh.

◆ const_iterator

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::const_iterator JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::const_iterator
inherited

Definition at line 41 of file JHistogramMap.hh.

◆ const_reverse_iterator

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::const_reverse_iterator JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::const_reverse_iterator
inherited

Definition at line 42 of file JHistogramMap.hh.

◆ iterator

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::iterator JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::iterator
inherited

Definition at line 43 of file JHistogramMap.hh.

◆ reverse_iterator

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
collection_type::reverse_iterator JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::reverse_iterator
inherited

Definition at line 44 of file JHistogramMap.hh.

◆ contents_type

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
histogram_type::contents_type JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::contents_type
inherited

Definition at line 47 of file JHistogramMap.hh.

Member Function Documentation

◆ evaluate() [1/2]

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
virtual void JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::evaluate ( const abscissa_type * pX,
typename JLANG::JClass< contents_type >::argument_type w )
inlinevirtualinherited

Fill histogram.

Parameters
pXpointer to abscissa values
wweight

Definition at line 63 of file JHistogramMap.hh.

65 {
66 const abscissa_type x = *pX;
67
68 iterator p = this->lower_bound(x);
69
70 this->integral += w;
71
72 if (p == this->begin())
73 this->underflow += w;
74 else if (p == this->end())
75 this->overflow += w;
76 else
77 (--p)->getY().evaluate(++pX, w);
78 }
collection_type::iterator iterator
collection_type::abscissa_type abscissa_type

◆ evaluate() [2/2]

virtual void JTOOLS::JHistogram< JAbscissa_t, JContents_t >::evaluate ( const abscissa_type * pX,
typename JLANG::JClass< contents_type >::argument_type w )
pure virtualinherited

Histogram filling.

Parameters
pXpointer to abscissa values
wweight

◆ mul() [1/2]

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
JHistogramMap & JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::mul ( typename JLANG::JClass< contents_type >::argument_type factor)
inlineinherited

Scale contents.

Parameters
factormultiplication factor
Returns
this histogram

Definition at line 87 of file JHistogramMap.hh.

88 {
89 collection_type::mul(factor);
90 histogram_type ::mul(factor);
91
92 return *this;
93 }

◆ mul() [2/2]

JHistogram & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::mul ( const double value)
inlineinherited

Scale histogram.

Parameters
valuemultiplication factor
Returns
this histogram

Definition at line 120 of file JHistogram.hh.

121 {
122 this->underflow *= value;
123 this->overflow *= value;
124 this->integral *= value;
125
126 return *this;
127 }

◆ div() [1/2]

template<class JAbscissa_t , class JContents_t , template< class, class, class > class JMap_t, class JDistance_t = JDistance<JAbscissa_t>>
JHistogramMap & JTOOLS::JHistogramMap< JAbscissa_t, JContents_t, JMap_t, JDistance_t >::div ( typename JLANG::JClass< contents_type >::argument_type factor)
inlineinherited

Scale contents.

Parameters
factordivision factor
Returns
this histogram

Definition at line 102 of file JHistogramMap.hh.

103 {
104 collection_type::div(factor);
105 histogram_type ::div(factor);
106
107 return *this;
108 }

◆ div() [2/2]

JHistogram & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::div ( double value)
inlineinherited

Scale histogram.

Parameters
valuedivision factor
Returns
this histogram

Definition at line 136 of file JHistogram.hh.

137 {
138 this->underflow /= value;
139 this->overflow /= value;
140 this->integral /= value;
141
142 return *this;
143 }

◆ reset()

void JTOOLS::JHistogram< JAbscissa_t, JContents_t >::reset ( )
inlineinherited

Reset.

Definition at line 64 of file JHistogram.hh.

65 {
66 this->underflow = JMATH::zero;
67 this->overflow = JMATH::zero;
68 this->integral = JMATH::zero;
69 }
static const JZero zero
Function object to assign zero value.
Definition JZero.hh:105

◆ add()

JHistogram & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::add ( const JHistogram< JAbscissa_t, JContents_t::contents_type > & histogram)
inlineinherited

Add histogram.

Parameters
histogramhistogram
Returns
this histogram

Definition at line 88 of file JHistogram.hh.

89 {
90 this->underflow += histogram.underflow;
91 this->overflow += histogram.overflow;
92 this->integral += histogram.integral;
93
94 return *this;
95 }

◆ sub()

JHistogram & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::sub ( const JHistogram< JAbscissa_t, JContents_t::contents_type > & histogram)
inlineinherited

Subtract histogram.

Parameters
histogramhistogram
Returns
this histogram

Definition at line 104 of file JHistogram.hh.

105 {
106 this->underflow -= histogram.underflow;
107 this->overflow -= histogram.overflow;
108 this->integral -= histogram.integral;
109
110 return *this;
111 }

◆ getUnderflow()

const contents_type & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getUnderflow ( ) const
inlineinherited

Get contents below lower limit.

Returns
contents

Definition at line 151 of file JHistogram.hh.

152 {
153 return underflow;
154 }

◆ getOverflow()

const contents_type & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getOverflow ( ) const
inlineinherited

Get contents above upper limit.

Returns
contents

Definition at line 162 of file JHistogram.hh.

163 {
164 return overflow;
165 }

◆ getIntegral()

const contents_type & JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getIntegral ( ) const
inlineinherited

Get contents above upper limit.

Returns
contents

Definition at line 173 of file JHistogram.hh.

174 {
175 return integral;
176 }

Member Data Documentation

◆ underflow

contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::underflow
protectedinherited

Definition at line 223 of file JHistogram.hh.

◆ overflow

contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::overflow
protectedinherited

Definition at line 224 of file JHistogram.hh.

◆ integral

contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::integral
protectedinherited

Definition at line 225 of file JHistogram.hh.


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