SPH
Classes | Functions
Functional.h File Reference
#include "math/rng/Rng.h"
#include "objects/geometry/Domain.h"
#include "objects/wrappers/AutoPtr.h"

Go to the source code of this file.

Classes

class  Integrator< TRng, TInternal >
 Object for integrating a generic three-dimensional scalar function. More...
 

Functions

template<typename TFunctor >
NAMESPACE_SPH_BEGIN INLINE Float integrate (const Interval range, const TFunctor &functor)
 Integrates a one-dimensional function using Simpson's rule. More...
 
template<typename TFunctor >
INLINE Optional< FloatgetRoot (const Interval &range, const Float eps, const TFunctor &functor)
 Returns a root of a R->R function on given range. More...
 
template<typename TFunctor >
INLINE bool isContinuous (const Interval &range, const Float delta, const Float eps, const TFunctor &functor)
 Checks if the given R->R function is continuous in given interval. More...
 

Detailed Description

Author
Basic routines for integrating arbitrary functions in N dimensions, finding roots, etc.
Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
Date
2016-2021

Definition in file Functional.h.

Function Documentation

◆ getRoot()

template<typename TFunctor >
INLINE Optional<Float> getRoot ( const Interval range,
const Float  eps,
const TFunctor &  functor 
)

Returns a root of a R->R function on given range.

If there is no root or the root cannot be found, returns NOTHING. For functions with multiple roots, returns one of them; the selection of such root is not specified.

Definition at line 91 of file Functional.h.

◆ integrate()

template<typename TFunctor >
NAMESPACE_SPH_BEGIN INLINE Float integrate ( const Interval  range,
const TFunctor &  functor 
)

Integrates a one-dimensional function using Simpson's rule.

The precision of the integral is currently fixed.

Definition at line 18 of file Functional.h.

◆ isContinuous()

template<typename TFunctor >
INLINE bool isContinuous ( const Interval range,
const Float  delta,
const Float  eps,
const TFunctor &  functor 
)

Checks if the given R->R function is continuous in given interval.

The eps and delta values are the same for all values and must be specified by the caller.

Definition at line 111 of file Functional.h.