Jpp 19.3.0-rc.3
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 112 of file JHistogram.hh.

113 {
114 this->underflow *= value;
115 this->overflow *= value;
116 this->integral *= value;
117
118 return *this;
119 }

◆ 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 128 of file JHistogram.hh.

129 {
130 this->underflow /= value;
131 this->overflow /= value;
132 this->integral /= value;
133
134 return *this;
135 }

◆ reset()

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

Reset.

Definition at line 56 of file JHistogram.hh.

57 {
58 this->underflow = JMATH::zero;
59 this->overflow = JMATH::zero;
60 this->integral = JMATH::zero;
61 }
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 80 of file JHistogram.hh.

81 {
82 this->underflow += histogram.underflow;
83 this->overflow += histogram.overflow;
84 this->integral += histogram.integral;
85
86 return *this;
87 }

◆ 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 96 of file JHistogram.hh.

97 {
98 this->underflow -= histogram.underflow;
99 this->overflow -= histogram.overflow;
100 this->integral -= histogram.integral;
101
102 return *this;
103 }

◆ getUnderflow()

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

Get contents below lower limit.

Returns
contents

Definition at line 143 of file JHistogram.hh.

144 {
145 return underflow;
146 }

◆ getOverflow()

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

Get contents above upper limit.

Returns
contents

Definition at line 154 of file JHistogram.hh.

155 {
156 return overflow;
157 }

◆ getIntegral()

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

Get contents above upper limit.

Returns
contents

Definition at line 165 of file JHistogram.hh.

166 {
167 return integral;
168 }

Member Data Documentation

◆ underflow

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

Definition at line 206 of file JHistogram.hh.

◆ overflow

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

Definition at line 207 of file JHistogram.hh.

◆ integral

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

Definition at line 208 of file JHistogram.hh.


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