Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JOSCPROB::JOscillogramAxis Struct Reference

Auxiliary class for defining an oscillogram axis. More...

#include <JOscillogram.hh>

Inheritance diagram for JOSCPROB::JOscillogramAxis:
JTOOLS::JGrid< JAbscissa_t > JTOOLS::JAbstractCollection< JAbscissa_t >

Public Types

typedef JGrid< double > JGrid_t
 
typedef JAbstractCollection< JAbscissa_t >::abscissa_type abscissa_type
 

Public Member Functions

 JOscillogramAxis (const int type, const JGrid_t binning)
 Constructor.
 
 JOscillogramAxis (const int type, const int N, const double min, const double max)
 Constructor.
 
virtual int getSize () const override
 Get number of elements.
 
virtual abscissa_type getX (int index) const override
 Get abscissa value.
 
virtual abscissa_type getXmin () const override
 Get minimal abscissa value.
 
virtual abscissa_type getXmax () const override
 Get maximal abscissa value.
 
int getIndex (typename JClass< abscissa_type >::argument_type x) const
 Get index of given abscissa value.
 
template<class JElement_t , class JDistance_t >
const JGridoperator() (JCollection< JElement_t, JDistance_t > &collection) const
 Configure collection.
 
bool is_equal (const JAbstractCollection &collection) const
 Test whether abstract collections are equal.
 

Public Attributes

int type
 axis type
 

Protected Attributes

int size
 
abscissa_type xmin
 
abscissa_type xmax
 

Detailed Description

Auxiliary class for defining an oscillogram axis.

Definition at line 37 of file JOscillogram.hh.

Member Typedef Documentation

◆ JGrid_t

Definition at line 40 of file JOscillogram.hh.

◆ abscissa_type

template<class JAbscissa_t >
JAbstractCollection<JAbscissa_t>::abscissa_type JTOOLS::JGrid< JAbscissa_t >::abscissa_type
inherited

Definition at line 41 of file JGrid.hh.

Constructor & Destructor Documentation

◆ JOscillogramAxis() [1/2]

JOSCPROB::JOscillogramAxis::JOscillogramAxis ( const int type,
const JGrid_t binning )
inline

Constructor.

Parameters
typeoscillation variable type
binningoscillation variable binning

Definition at line 49 of file JOscillogram.hh.

50 :
51 JGrid_t(binning),
52 type (type)
53 {}

◆ JOscillogramAxis() [2/2]

JOSCPROB::JOscillogramAxis::JOscillogramAxis ( const int type,
const int N,
const double min,
const double max )
inline

Constructor.

Parameters
typeoscillogram variable type
Nnumber of bins
minminimum axis value
maxmaximum axis value

Definition at line 64 of file JOscillogram.hh.

67 :
68 JGrid_t(N, min, max),
69 type (type)
70 {}

Member Function Documentation

◆ getSize()

template<class JAbscissa_t >
virtual int JTOOLS::JGrid< JAbscissa_t >::getSize ( ) const
inlineoverridevirtualinherited

Get number of elements.

Returns
number of elements

Implements JTOOLS::JAbstractCollection< JAbscissa_t >.

Definition at line 75 of file JGrid.hh.

76 {
77 return size;
78 }

◆ getX()

template<class JAbscissa_t >
virtual abscissa_type JTOOLS::JGrid< JAbscissa_t >::getX ( int index) const
inlineoverridevirtualinherited

Get abscissa value.

Parameters
indexindex
Returns
abscissa value

Implements JTOOLS::JAbstractCollection< JAbscissa_t >.

Definition at line 87 of file JGrid.hh.

88 {
89 return (index == 0 ? xmin : xmin + index * ((xmax - xmin) / (size - 1)));
90 }
abscissa_type xmax
Definition JGrid.hh:196
abscissa_type xmin
Definition JGrid.hh:195

◆ getXmin()

template<class JAbscissa_t >
virtual abscissa_type JTOOLS::JGrid< JAbscissa_t >::getXmin ( ) const
inlineoverridevirtualinherited

Get minimal abscissa value.

Returns
abscissa value

Implements JTOOLS::JAbstractCollection< JAbscissa_t >.

Definition at line 98 of file JGrid.hh.

99 {
100 return xmin;
101 }

◆ getXmax()

template<class JAbscissa_t >
virtual abscissa_type JTOOLS::JGrid< JAbscissa_t >::getXmax ( ) const
inlineoverridevirtualinherited

Get maximal abscissa value.

Returns
abscissa value

Implements JTOOLS::JAbstractCollection< JAbscissa_t >.

Definition at line 109 of file JGrid.hh.

110 {
111 return xmax;
112 }

◆ getIndex()

template<class JAbscissa_t >
int JTOOLS::JGrid< JAbscissa_t >::getIndex ( typename JClass< abscissa_type >::argument_type x) const
inlineinherited

Get index of given abscissa value.

Parameters
xabscissa value
Returns
index

Definition at line 121 of file JGrid.hh.

122 {
123 return (int) ((size - 1) * (x - xmin) / (xmax - xmin));
124 }

◆ operator()()

template<class JAbscissa_t >
template<class JElement_t , class JDistance_t >
const JGrid & JTOOLS::JGrid< JAbscissa_t >::operator() ( JCollection< JElement_t, JDistance_t > & collection) const
inlineinherited

Configure collection.

Parameters
collectioncollection
Returns
this grid

Definition at line 134 of file JGrid.hh.

135 {
136 collection.configure(*this);
137
138 return *this;
139 }

◆ is_equal()

template<class JAbscissa_t >
bool JTOOLS::JAbstractCollection< JAbscissa_t >::is_equal ( const JAbstractCollection< JAbscissa_t > & collection) const
inlineinherited

Test whether abstract collections are equal.

Parameters
collectionabstract collection
Returns
true if collections are equals; else false

Definition at line 72 of file JAbstractCollection.hh.

73 {
74 if (this->getSize() == collection.getSize()) {
75
76 for (int i = 0; i != this->getSize(); ++i) {
77
78 if (this->getX(i) != collection.getX(i)) {
79 return false;
80 }
81 }
82
83 return true;
84 }
85
86 return false;
87 }
virtual int getSize() const =0
Get number of elements.
virtual abscissa_type getX(int index) const =0
Get abscissa value.

Member Data Documentation

◆ type

int JOSCPROB::JOscillogramAxis::type

axis type

Definition at line 73 of file JOscillogram.hh.

◆ size

template<class JAbscissa_t >
int JTOOLS::JGrid< JAbscissa_t >::size
protectedinherited

Definition at line 194 of file JGrid.hh.

◆ xmin

template<class JAbscissa_t >
abscissa_type JTOOLS::JGrid< JAbscissa_t >::xmin
protectedinherited

Definition at line 195 of file JGrid.hh.

◆ xmax

template<class JAbscissa_t >
abscissa_type JTOOLS::JGrid< JAbscissa_t >::xmax
protectedinherited

Definition at line 196 of file JGrid.hh.


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