Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
JTOOLS::JQuantiles Class Reference

Quantile calculator for a given function. More...

#include <JQuantiles.hh>

Inheritance diagram for JTOOLS::JQuantiles:
JTOOLS::JRange< double > JTOOLS::JPair< JKey_t, JValue_t > JLANG::JEquals< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t >

Public Types

typedef JAbstractCollection
< double > 
JAbscissa_t
 
typedef JRange< double,
std::less< double > > 
range_type
 
typedef JLANG::JClass< double >
::argument_type 
argument_type
 
typedef JKey_t key_type
 
typedef JValue_t mapped_type
 

Public Member Functions

 JQuantiles ()
 Default constructor. More...
 
template<class JFunction1D_t >
 JQuantiles (const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
 Constructor. More...
 
template<class JFunction1D_t >
 JQuantiles (const JAbscissa_t &abscissa, const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
 Constructor. More...
 
template<class JFunction1D_t >
void set (const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
 Set quantiles. More...
 
template<class JFunction1D_t >
void set (const JAbscissa_t &abscissa, const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
 Set quantiles. More...
 
double getX () const
 Get position of maximum. More...
 
double getY () const
 Get value of maximum. More...
 
double getFWHM () const
 Get Full Width at Half Maximum. More...
 
double getIntegral () const
 Get integral of function. More...
 
const range_typegetRange () const
 Get range. More...
 
void setRange (const range_type &range)
 Set range. More...
 
void setRange (argument_type x, argument_type y)
 Set lower and uppper limit. More...
 
void setRange (iterator_type __begin, iterator_type __end, result_type value_type::*member)
 Set lower and uppper limit. More...
 
void setRange (iterator_type __begin, iterator_type __end, result_type(value_type::*function)() const)
 Set lower and uppper limit. More...
 
double getLowerLimit () const
 Get lower limit. More...
 
double getUpperLimit () const
 Get upper limit. More...
 
void setLowerLimit (argument_type x)
 Set lower limit. More...
 
void setUpperLimit (argument_type y)
 Set upper limit. More...
 
void fixLowerLimit (argument_type x)
 Fix lower limit. More...
 
void fixUpperLimit (argument_type y)
 Fix upper limit. More...
 
bool equals (const range_type &range) const
 Equal method. More...
 
double getLength () const
 Get length (difference between upper and lower limit). More...
 
bool is_valid () const
 Check validity of range. More...
 
bool operator() (argument_type x) const
 Test whether value is inside range. More...
 
double constrain (argument_type x) const
 Constrain value to range. More...
 
bool overlap (const range_type &range) const
 Test overlap with given range. More...
 
range_type include (argument_type x)
 Include given value to range. More...
 
range_typejoin (const range_type &range)
 Join ranges. More...
 
range_typecombine (const range_type &range)
 Combine ranges. More...
 
range_typeadd (argument_type x)
 Add offset. More...
 
range_typeadd (const range_type &range)
 Add offset. More...
 
range_typesub (argument_type x)
 Subtract offset. More...
 
range_typesub (const range_type &range)
 Subtract offset. More...
 
range_typemul (const double factor)
 Multiply range. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
range_typediv (const double factor)
 Divide range. More...
 
double getN (const double R) const
 Get expected number of occurances of given rate within this interval. More...
 
const key_typegetKey () const
 
const mapped_typegetValue () const
 
mapped_typegetValue ()
 

Static Public Member Functions

static double getMinimum ()
 Get minimum possible value. More...
 
static double getMaximum ()
 Get maximum possible value. More...
 

Public Attributes

std::less< double > compare
 Function object. More...
 
JKey_t first
 
JValue_t second
 

Static Public Attributes

static const JRange< double,
std::less< double > > 
DEFAULT_RANGE
 Default range. More...
 

Protected Attributes

double Xmax
 
double Ymax
 
double fwhm
 
double sum
 

Detailed Description

Quantile calculator for a given function.

It is assumed that the function has a single maximum.

Definition at line 106 of file JQuantiles.hh.

Member Typedef Documentation

Definition at line 111 of file JQuantiles.hh.

typedef JRange<double , std::less<double > > JTOOLS::JRange< double , std::less<double > >::range_type
inherited

Definition at line 40 of file JRange.hh.

typedef JLANG::JClass<double >::argument_type JTOOLS::JRange< double , std::less<double > >::argument_type
inherited

Definition at line 41 of file JRange.hh.

template<class JKey_t, class JValue_t>
typedef JKey_t JTOOLS::JPair< JKey_t, JValue_t >::key_type
inherited

Definition at line 32 of file JPair.hh.

template<class JKey_t, class JValue_t>
typedef JValue_t JTOOLS::JPair< JKey_t, JValue_t >::mapped_type
inherited

Definition at line 33 of file JPair.hh.

Constructor & Destructor Documentation

JTOOLS::JQuantiles::JQuantiles ( )
inline

Default constructor.

Definition at line 116 of file JQuantiles.hh.

116  :
117  Xmax(0.0),
118  Ymax(0.0),
119  fwhm(0.0),
120  sum (0.0)
121  {}
template<class JFunction1D_t >
JTOOLS::JQuantiles::JQuantiles ( const JFunction1D_t &  f1,
const double  Q = 1.0,
const double  eps = 1.0e-6 
)
inline

Constructor.

Parameters
f1functional collection
Qquantile
epsrelative precision

Definition at line 132 of file JQuantiles.hh.

134  :
135  Xmax(0.0),
136  Ymax(0.0),
137  fwhm(0.0),
138  sum (0.0)
139  {
140  set(f1, Q, eps);
141  }
void set(const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
Set quantiles.
Definition: JQuantiles.hh:174
template<class JFunction1D_t >
JTOOLS::JQuantiles::JQuantiles ( const JAbscissa_t abscissa,
const JFunction1D_t &  f1,
const double  Q = 1.0,
const double  eps = 1.0e-6 
)
inline

Constructor.

Parameters
abscissaabscissa
f1function
Qquantile
epsrelative precision

Definition at line 153 of file JQuantiles.hh.

156  :
157  Xmax(0.0),
158  Ymax(0.0),
159  fwhm(0.0),
160  sum (0.0)
161  {
162  set(abscissa, f1, Q, eps);
163  }
void set(const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
Set quantiles.
Definition: JQuantiles.hh:174

Member Function Documentation

template<class JFunction1D_t >
void JTOOLS::JQuantiles::set ( const JFunction1D_t &  f1,
const double  Q = 1.0,
const double  eps = 1.0e-6 
)
inline

Set quantiles.

Parameters
f1functional collection
Qquantile
epsrelative precision

Definition at line 174 of file JQuantiles.hh.

177  {
178  typedef typename JFunction1D_t::const_iterator const_iterator;
179 
180  if (f1.empty()) {
181  throw JEmptyCollection("JQuantiles() no data.");
182  }
183 
184 
185  // maximum
186 
187  const_iterator p = f1.begin();
188 
189  for (const_iterator i = f1.begin(); i != f1.end(); ++i) {
190  if (i->getY() > p->getY()) {
191  p = i;
192  }
193  }
194 
195 
196  // x at maximum
197 
198  Xmax = p->getX();
199 
200  if (p != f1.begin()) {
201 
202  const double xa = (--p)->getX();
203  const double xb = (++p)->getX();
204 
205  if (++p != f1.end()) {
206 
207  const double xc = p->getX();
208 
209  Xmax = search(xa, xb, xc, f1, -1, eps);
210  }
211  }
212 
213  Ymax = get_value(f1(Xmax));
214 
215 
216  // integral & quantile
217 
218  if (Q > 0.0 && Q <= 1.0) {
219 
221 
222  try {
223 
224  sum = makeCDF(f1, buffer);
225 
226  setLowerLimit(buffer(0.5 * (1.0 - Q)));
227  setUpperLimit(buffer(0.5 * (1.0 + Q)));
228  }
229  catch(const JException& error) {
230  sum = 0.0;
231  }
232 
233  } else {
234 
235  sum = JTOOLS::getIntegral(f1);
236 
237  if (Q > 1.0) {
238  setLowerLimit(f1. begin()->getX());
239  setUpperLimit(f1.rbegin()->getX());
240  } else if (Q <= 0.0) {
243  }
244  }
245 
246 
247  // FWHM
248 
249  fwhm = 0.0;
250 
251  for (double xmin = f1.begin()->getX(), xmax = Xmax, v = 0.5*Ymax; ; ) {
252 
253  const double x = 0.5 * (xmin + xmax);
254  const double y = get_value(f1(x));
255 
256  if (fabs(y - v) < eps*v || xmax - xmin < eps) {
257  fwhm -= x;
258  break;
259  }
260 
261  if (y > v)
262  xmax = x;
263  else
264  xmin = x;
265  }
266 
267  for (double xmin = Xmax, xmax = f1.rbegin()->getX(), v = 0.5*Ymax; ; ) {
268 
269  const double x = 0.5 * (xmin + xmax);
270  const double y = get_value(f1(x));
271 
272  if (fabs(y - v) < eps*v || xmax - xmin < eps) {
273  fwhm += x;
274  break;
275  }
276 
277  if (y > v)
278  xmin = x;
279  else
280  xmax = x;
281  }
282  }
General purpose class for collection of elements, see: &lt;a href=&quot;JTools.PDF&quot;;&gt;Collection of elements...
Definition: JCollection.hh:71
double getX() const
Get position of maximum.
Definition: JQuantiles.hh:313
double search(const double xa, const double xb, const double xc, const JFunction1D_t &f, const int is, const double eps=1.0e-6)
Locate maximum or minimun of function.
Definition: JQuantiles.hh:48
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:213
Template class for spline interpolation in 1D.
Definition: JSpline.hh:657
JContainer_t::ordinate_type makeCDF(const JContainer_t &input, JMappableCollection< JKey_t, JValue_t > &output, const typename JContainer_t::ordinate_type eps=JMATH::zero)
Conversion of data points to cumulative probability distribition (CDF).
JResultEvaluator< JResult_t >::result_type get_value(const JResult_t &value)
Helper method to recursively evaluate a to function value.
Definition: JResult.hh:748
JContainer_t::ordinate_type getIntegral(const JContainer_t &input)
Get integral of input data points.
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:202
template<class JFunction1D_t >
void JTOOLS::JQuantiles::set ( const JAbscissa_t abscissa,
const JFunction1D_t &  f1,
const double  Q = 1.0,
const double  eps = 1.0e-6 
)
inline

Set quantiles.

Parameters
abscissaabscissa
f1function
Qquantile
epsrelative precision

Definition at line 294 of file JQuantiles.hh.

298  {
300 
301  buffer.configure(abscissa, f1);
302  buffer.compile();
303 
304  set(buffer, Q, eps);
305  }
General purpose class for collection of elements, see: &lt;a href=&quot;JTools.PDF&quot;;&gt;Collection of elements...
Definition: JCollection.hh:71
void set(const JFunction1D_t &f1, const double Q=1.0, const double eps=1.0e-6)
Set quantiles.
Definition: JQuantiles.hh:174
Template class for spline interpolation in 1D.
Definition: JSpline.hh:657
double JTOOLS::JQuantiles::getX ( ) const
inline

Get position of maximum.

Returns
x value at maximum

Definition at line 313 of file JQuantiles.hh.

314  {
315  return Xmax;
316  }
double JTOOLS::JQuantiles::getY ( ) const
inline

Get value of maximum.

Returns
y value at maximum

Definition at line 324 of file JQuantiles.hh.

325  {
326  return Ymax;
327  }
double JTOOLS::JQuantiles::getFWHM ( ) const
inline

Get Full Width at Half Maximum.

Returns
FWHM

Definition at line 335 of file JQuantiles.hh.

336  {
337  return fwhm;
338  }
double JTOOLS::JQuantiles::getIntegral ( ) const
inline

Get integral of function.

Returns
integral

Definition at line 346 of file JQuantiles.hh.

347  {
348  return sum;
349  }
const range_type& JTOOLS::JRange< double , std::less<double > >::getRange ( ) const
inlineinherited

Get range.

Returns
range

Definition at line 109 of file JRange.hh.

110  {
111  return static_cast<const range_type&>(*this);
112  }
JRange< double, std::less< double > > range_type
Definition: JRange.hh:40
void JTOOLS::JRange< double , std::less<double > >::setRange ( const range_type range)
inlineinherited

Set range.

Parameters
rangerange

Definition at line 120 of file JRange.hh.

121  {
122  static_cast<range_type&>(*this) = range;
123  }
JRange< double, std::less< double > > range_type
Definition: JRange.hh:40
void JTOOLS::JRange< double , std::less<double > >::setRange ( argument_type  x,
argument_type  y 
)
inlineinherited

Set lower and uppper limit.

Parameters
xlower limit
yupper limit

Definition at line 132 of file JRange.hh.

133  {
134  this->first = x;
135  this->second = y;
136  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< double , std::less<double > >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type value_type::*  member 
)
inlineinherited

Set lower and uppper limit.

Parameters
__beginbegin of data
__endend of data
memberpointer to data member

Definition at line 147 of file JRange.hh.

148  {
150 
151  for (iterator_type i = __begin; i != __end; ++i) {
152  include((*i).*member);
153  }
154  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:336
static double getMinimum()
Get minimum possible value.
Definition: JRange.hh:485
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:120
static double getMaximum()
Get maximum possible value.
Definition: JRange.hh:496
void JTOOLS::JRange< double , std::less<double > >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type(value_type::*)() const  function 
)
inlineinherited

Set lower and uppper limit.

Parameters
__beginbegin of data
__endend of data
functionpointer to member method

Definition at line 165 of file JRange.hh.

166  {
168 
169  for (iterator_type i = __begin; i != __end; ++i) {
170  include(((*i).*function)());
171  }
172  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:336
static double getMinimum()
Get minimum possible value.
Definition: JRange.hh:485
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:120
static double getMaximum()
Get maximum possible value.
Definition: JRange.hh:496
double JTOOLS::JRange< double , std::less<double > >::getLowerLimit ( ) const
inlineinherited

Get lower limit.

Returns
lower limit

Definition at line 180 of file JRange.hh.

181  {
182  return this->first;
183  }
JKey_t first
Definition: JPair.hh:128
double JTOOLS::JRange< double , std::less<double > >::getUpperLimit ( ) const
inlineinherited

Get upper limit.

Returns
upper limit

Definition at line 191 of file JRange.hh.

192  {
193  return this->second;
194  }
JValue_t second
Definition: JPair.hh:129
void JTOOLS::JRange< double , std::less<double > >::setLowerLimit ( argument_type  x)
inlineinherited

Set lower limit.

Parameters
xlower limit

Definition at line 202 of file JRange.hh.

203  {
204  this->first = x;
205  }
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< double , std::less<double > >::setUpperLimit ( argument_type  y)
inlineinherited

Set upper limit.

Parameters
yupper limit

Definition at line 213 of file JRange.hh.

214  {
215  this->second = y;
216  }
JValue_t second
Definition: JPair.hh:129
void JTOOLS::JRange< double , std::less<double > >::fixLowerLimit ( argument_type  x)
inlineinherited

Fix lower limit.

The range is shifted to the given lower limit.

Parameters
xlower limit

Definition at line 226 of file JRange.hh.

227  {
228  this->second += x - this->first;
229  this->first = x;
230  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< double , std::less<double > >::fixUpperLimit ( argument_type  y)
inlineinherited

Fix upper limit.

The range is shifted to the given upper limit.

Parameters
yupper limit

Definition at line 240 of file JRange.hh.

241  {
242  this->first += y - this->second;
243  this->second = y;
244  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
bool JTOOLS::JRange< double , std::less<double > >::equals ( const range_type range) const
inlineinherited

Equal method.

Parameters
rangerange
Returns
true if this module range equal to given module range; else false

Definition at line 253 of file JRange.hh.

254  {
255  return (!this->compare(this->getLowerLimit(), range.getLowerLimit()) &&
256  !this->compare(range.getLowerLimit(), this->getLowerLimit()) &&
257  !this->compare(this->getUpperLimit(), range.getUpperLimit()) &&
258  !this->compare(range.getUpperLimit(), this->getUpperLimit()));
259  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
double JTOOLS::JRange< double , std::less<double > >::getLength ( ) const
inlineinherited

Get length (difference between upper and lower limit).

Returns
length

Definition at line 267 of file JRange.hh.

268  {
269  return getUpperLimit() - getLowerLimit();
270  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
bool JTOOLS::JRange< double , std::less<double > >::is_valid ( ) const
inlineinherited

Check validity of range.

Returns
true if lower limit less than or equal to upper limit; else false

Definition at line 278 of file JRange.hh.

279  {
280  return !compare(getUpperLimit(), getLowerLimit());
281  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
bool JTOOLS::JRange< double , std::less<double > >::operator() ( argument_type  x) const
inlineinherited

Test whether value is inside range.

Parameters
xvalue
Returns
true if lower limit <= value <= upper limit; else false

Definition at line 290 of file JRange.hh.

291  {
292  return (!compare(x, getLowerLimit()) &&
293  !compare(getUpperLimit(), x));
294  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
double JTOOLS::JRange< double , std::less<double > >::constrain ( argument_type  x) const
inlineinherited

Constrain value to range.

This method returns the original value if it is in this range, else lower limit if value < lower limit or upper limit if value > upper limit.

Parameters
xvalue
Returns
lower limit <= x <= upper limit

Definition at line 305 of file JRange.hh.

306  {
307  if (compare(x, getLowerLimit())) return getLowerLimit();
308  if (compare(getUpperLimit(), x)) return getUpperLimit();
309 
310  return x;
311  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
bool JTOOLS::JRange< double , std::less<double > >::overlap ( const range_type range) const
inlineinherited

Test overlap with given range.

The result is equivalent to join(range).is_valid().

Parameters
rangerange
Returns
true if there is a non-zero overlap; else false

Definition at line 321 of file JRange.hh.

322  {
323  return (compare(getLowerLimit(), range.getUpperLimit()) &&
324  compare(range.getLowerLimit(), getUpperLimit()));
325  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
range_type JTOOLS::JRange< double , std::less<double > >::include ( argument_type  x)
inlineinherited

Include given value to range.

The new lower limit is the minimim of the original lower limit and given value and the new upper limit is the maximum of the original upper limit and given value;

Parameters
xvalue
Returns
range

Definition at line 336 of file JRange.hh.

337  {
338  if (compare(x, getLowerLimit())) setLowerLimit(x);
339  if (compare(getUpperLimit(), x)) setUpperLimit(x);
340 
341  return *this;
342  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:213
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:202
range_type& JTOOLS::JRange< double , std::less<double > >::join ( const range_type range)
inlineinherited

Join ranges.

The new lower limit is the maximim of the two lower limits and the new upper limit is the minimum of the two upper limits. This operation results in an equal or smaller range and may result in an unphysical range (i.e. lower limit > upper limit).

Parameters
rangerange

Definition at line 354 of file JRange.hh.

355  {
356  if (compare(getLowerLimit(), range.getLowerLimit())) setLowerLimit(range.getLowerLimit());
357  if (compare(range.getUpperLimit(), getUpperLimit())) setUpperLimit(range.getUpperLimit());
358 
359  return *this;
360  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:213
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:202
range_type& JTOOLS::JRange< double , std::less<double > >::combine ( const range_type range)
inlineinherited

Combine ranges.

The new lower limit is the minimim of the two lower limits and the new upper limit is the maximum of the two upper limits. This operation results in an equal or larger range.

Parameters
rangerange

Definition at line 371 of file JRange.hh.

372  {
373  if (compare(range.getLowerLimit(), getLowerLimit())) setLowerLimit(range.getLowerLimit());
374  if (compare(getUpperLimit(), range.getUpperLimit())) setUpperLimit(range.getUpperLimit());
375 
376  return *this;
377  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
std::less< double > compare
Function object.
Definition: JRange.hh:516
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:213
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:202
range_type& JTOOLS::JRange< double , std::less<double > >::add ( argument_type  x)
inlineinherited

Add offset.

Parameters
xoffset

Definition at line 385 of file JRange.hh.

386  {
387  this->first += x;
388  this->second += x;
389 
390  return *this;
391  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< double , std::less<double > >::add ( const range_type range)
inlineinherited

Add offset.

The new lower limit is the sum of the two lower limits and the new upper limit is the sum of the two upper limits.

Parameters
rangeoffset

Definition at line 415 of file JRange.hh.

416  {
417  this->first += range.getLowerLimit();
418  this->second += range.getUpperLimit();
419 
420  return *this;
421  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< double , std::less<double > >::sub ( argument_type  x)
inlineinherited

Subtract offset.

Parameters
xoffset

Definition at line 399 of file JRange.hh.

400  {
401  this->first -= x;
402  this->second -= x;
403 
404  return *this;
405  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< double , std::less<double > >::sub ( const range_type range)
inlineinherited

Subtract offset.

The new lower limit is the difference of the two lower limits and the new upper limit is the difference of the two upper limits.

Parameters
rangeoffset

Definition at line 431 of file JRange.hh.

432  {
433  this->first -= range.getLowerLimit();
434  this->second -= range.getUpperLimit();
435 
436  return *this;
437  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< double , std::less<double > >::mul ( const double  factor)
inlineinherited

Multiply range.

Parameters
factorfactor

Definition at line 445 of file JRange.hh.

446  {
447  this->first *= factor;
448  this->second *= factor;
449 
450  return *this;
451  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for product evaluation of objects.
Definition: JCalculator.hh:18
range_type& JTOOLS::JRange< double , std::less<double > >::div ( const double  factor)
inlineinherited

Divide range.

Parameters
factorfactor

Definition at line 459 of file JRange.hh.

460  {
461  this->first /= factor;
462  this->second /= factor;
463 
464  return *this;
465  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
double JTOOLS::JRange< double , std::less<double > >::getN ( const double  R) const
inlineinherited

Get expected number of occurances of given rate within this interval.

Parameters
Rrate
Returns
expectation value

Definition at line 474 of file JRange.hh.

475  {
476  return R * (getUpperLimit() - getLowerLimit());
477  }
double getLowerLimit() const
Get lower limit.
Definition: JRange.hh:180
double getUpperLimit() const
Get upper limit.
Definition: JRange.hh:191
static double JTOOLS::JRange< double , std::less<double > >::getMinimum ( )
inlinestaticinherited

Get minimum possible value.

Returns
minimum possible value

Definition at line 485 of file JRange.hh.

486  {
487  return JMATH::JLimits<T>::min();
488  }
float min()
Definition: JLimits.hh:96
static double JTOOLS::JRange< double , std::less<double > >::getMaximum ( )
inlinestaticinherited

Get maximum possible value.

Returns
maximum possible value

Definition at line 496 of file JRange.hh.

497  {
498  return JMATH::JLimits<T>::max();
499  }
Auxiliary class for minimum and maximum values for any class.
Definition: JLimits.hh:21
template<class JKey_t, class JValue_t>
const key_type& JTOOLS::JPair< JKey_t, JValue_t >::getKey ( ) const
inlineinherited

Definition at line 123 of file JPair.hh.

123 { return this->first; }
JKey_t first
Definition: JPair.hh:128
template<class JKey_t, class JValue_t>
const mapped_type& JTOOLS::JPair< JKey_t, JValue_t >::getValue ( ) const
inlineinherited

Definition at line 124 of file JPair.hh.

124 { return this->second; }
JValue_t second
Definition: JPair.hh:129
template<class JKey_t, class JValue_t>
mapped_type& JTOOLS::JPair< JKey_t, JValue_t >::getValue ( )
inlineinherited

Definition at line 126 of file JPair.hh.

126 { return this->second; }
JValue_t second
Definition: JPair.hh:129

Member Data Documentation

double JTOOLS::JQuantiles::Xmax
protected

Definition at line 353 of file JQuantiles.hh.

double JTOOLS::JQuantiles::Ymax
protected

Definition at line 354 of file JQuantiles.hh.

double JTOOLS::JQuantiles::fwhm
protected

Definition at line 355 of file JQuantiles.hh.

double JTOOLS::JQuantiles::sum
protected

Definition at line 356 of file JQuantiles.hh.

const JRange<double , std::less<double > > JTOOLS::JRange< double , std::less<double > >::DEFAULT_RANGE
staticinherited

Default range.

This range corresponds to an unphysical range.

Definition at line 506 of file JRange.hh.

std::less<double > JTOOLS::JRange< double , std::less<double > >::compare
inherited

Function object.

Parameters
firstfirst argument
secondsecond argument
Returns
true if first < second; else false

Definition at line 516 of file JRange.hh.

template<class JKey_t, class JValue_t>
JKey_t JTOOLS::JPair< JKey_t, JValue_t >::first
inherited

Definition at line 128 of file JPair.hh.

template<class JKey_t, class JValue_t>
JValue_t JTOOLS::JPair< JKey_t, JValue_t >::second
inherited

Definition at line 129 of file JPair.hh.


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