Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS Namespace Reference

Auxiliary classes and methods for multi-dimensional interpolations and histograms. More...

Classes

class  JAbstractAutoPointer
 Abstract class of an automatic pointer. More...
 
struct  JAbstractCollection
 Abstract interface for abscissa values of a collection of elements. More...
 
struct  JAbstractHistogram
 Simple data structure for histogram binning. More...
 
struct  JAbstractMultiMap
 Abstract interface for abscissa values of a multidimensional map. More...
 
struct  JAbstractMultiMap< 0, JAbscissa_t >
 Terminator class of recursive class JAbstractMultiMap. More...
 
class  JArray
 One dimensional array of template objects with fixed length. More...
 
class  JArray< 1, const T >
 One dimensional read-only array of template objects with fixed length. More...
 
class  JArray< 1, T >
 One dimensional array of template objects with fixed length. More...
 
class  JArray< N, const T >
 One dimensional read-only array of template objects with fixed length. More...
 
struct  JArrayIterator
 ND array iterator. More...
 
struct  JArrayIterator< 1, T >
 1D array iterator. More...
 
struct  JAssembler
 Auxiliary class to check whether given template is a collection, i.e. has a defined type collection_type. More...
 
struct  JAssembler< T, typename JVoid< typename T::collection_type >::type >
 Template specialisation of class JAssembler for classes with a defined type collection_type. More...
 
class  JAutoElement
 Handler class for automatic pointer. More...
 
class  JAutoMap
 Wrapper class around std::map for automatic insertion of elements based on data types. More...
 
struct  JAutomate
 Auxiliary class for automatic element creation. More...
 
struct  JAutomate< JAutoMap< JKey_t, JValue_t > >
 Specialisation of class JAutomate for class JAutoMap. More...
 
class  JAutoPointer
 Template class for loading and storing of objects. More...
 
struct  JBin2D
 2D Binned element. More...
 
class  JBitangent
 Numerical integrator for $ W(x) = \left|x\right| / \sqrt{1 - x^{2}} $ for $ x > 0 $ and $ W(x) = 1 $ for $ x \le 0 $. More...
 
class  JCollection
 General purpose class for collection of elements, see: Collection of elements. . More...
 
struct  JCollectionElementTransformer
 Interface for transformation of collection of elements. More...
 
class  JCombinatorics
 Auxiliary class to convert pair of indices to unique index and back. More...
 
struct  JCompiler
 Functional object compiler. More...
 
class  JConstantFunction1D
 Template implementation of function object in one dimension returning a constant value. More...
 
struct  JContent
 Auxiliary class for merging of consecutive bins until minimal content is reached. More...
 
class  JCotangent
 Numerical integrator for $ W(x) = \left|x\right| / \sqrt{1 - x^{2}} $. More...
 
struct  JCumulator
 Functional histogram cumulator. More...
 
struct  JDistance
 Template class for distance evaluation. More...
 
class  JDriver
 Auxiliary class to load and store objects. More...
 
struct  JElement
 Auxiliary class to convert value to element. More...
 
struct  JElement2D
 2D Element. More...
 
struct  JElement3D
 3D Element. More...
 
class  JExternalFunction1D
 Template implementation of function object in one dimension using an external function. More...
 
struct  JFunction
 Template definition of function object interface in multidimensions. More...
 
struct  JFunction1D
 Template definition of function object interface in one dimension. More...
 
class  JFunctional
 Template definition of function object interface. More...
 
class  JFunctional< JNullType, JNullType >
 Template specialisation of compilable function object. More...
 
struct  JFunctionalMap
 Auxiliary class to define corresponding one-dimensional function interpolator function_type. More...
 
struct  JFunctionalMap< JPolint0FunctionalGridMap >
 Specialisation of JFunctionalMap for JPolint0FunctionalGridMap. More...
 
struct  JFunctionalMap< JPolint0FunctionalMap >
 Specialisation of JFunctionalMap for JPolint0FunctionalMap. More...
 
struct  JFunctionalMap< JPolint1FunctionalGridMap >
 Specialisation of JFunctionalMap for JPolint1FunctionalGridMap. More...
 
struct  JFunctionalMap< JPolint1FunctionalMap >
 Specialisation of JFunctionalMap for JPolint1FunctionalMap. More...
 
struct  JFunctionalMap< JPolint2FunctionalGridMap >
 Specialisation of JFunctionalMap for JPolint2FunctionalGridMap. More...
 
struct  JFunctionalMap< JPolint2FunctionalMap >
 Specialisation of JFunctionalMap for JPolint2FunctionalMap. More...
 
struct  JFunctionalMap< JPolint3FunctionalGridMap >
 Specialisation of JFunctionalMap for JPolint3FunctionalGridMap. More...
 
struct  JFunctionalMap< JPolint3FunctionalMap >
 Specialisation of JFunctionalMap for JPolint3FunctionalMap. More...
 
struct  JFunctionalMap< JSplineFunctionalGridMap >
 Specialisation of JFunctionalMap for JSplineFunctionalGridMap. More...
 
struct  JFunctionalMap< JSplineFunctionalMap >
 Specialisation of JFunctionalMap for JSplineFunctionalMap. More...
 
class  JFunctionObject1D
 Template implementation of function object in one dimension. More...
 
class  JGarbageCollection
 Garbage collection. More...
 
class  JGaussHermite
 Numerical integrator for $ W(x) = e^{-x^{2}} $. More...
 
class  JGaussLaguerre
 Numerical integrator for $ W(x) = x^{a} \, e^{-x} $. More...
 
class  JGaussLegendre
 Numerical integrator for $ W(x) = 1 $. More...
 
struct  JGrid
 Simple data structure for an abstract collection of equidistant abscissa values. More...
 
class  JGridCollection
 General purpose class for collection of equidistant elements. More...
 
struct  JGridHermiteSplineFunction1D
 Type definition of a spline interpolation based on a JGridCollection. More...
 
struct  JGridHermiteSplineFunction1D_t
 Type definition of a spline interpolation based on a JGridCollection with result type double. More...
 
struct  JGridHermiteSplineFunction1H_t
 Type definition of a spline interpolation based on a JGridCollection with JResultDerivative result type. More...
 
class  JGridMap
 Map of equidistant pair-wise elements. More...
 
struct  JGridPolint0Function1D_t
 Type definition of a zero degree polynomial interpolation based on a JGridCollection with result type double. More...
 
struct  JGridPolint1Function1D_t
 Type definition of a 1st degree polynomial interpolation based on a JGridCollection with result type double. More...
 
struct  JGridPolint1Function1H_t
 Type definition of a 1st degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JGridPolint1Function1S_t
 Type definition of a 1st degree polynomial interpolation with result type JResulPDF. More...
 
struct  JGridPolint2Function1D_t
 Type definition of a 2nd degree polynomial interpolation based on a JGridCollection with result type double. More...
 
struct  JGridPolint2Function1H_t
 Type definition of a 2nd degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JGridPolint2Function1S_t
 Type definition of a 2nd degree polynomial interpolation with result type JResulPDF. More...
 
struct  JGridPolint3Function1D_t
 Type definition of a 3rd degree polynomial interpolation based on a JGridCollection with result type double. More...
 
struct  JGridPolint3Function1H_t
 Type definition of a 3rd degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JGridPolint3Function1S_t
 Type definition of a 3rd degree polynomial interpolation with result type JResulPDF. More...
 
struct  JGridPolintFunction1D_t
 Polynomial interpolation method based on a JGridCollection with result type double. More...
 
struct  JGridPolintFunction1H_t
 Polynomial interpolation method based on a JGridCollection with result type JResultDerivative. More...
 
struct  JGridPolintFunction1S_t
 Polynomial interpolation method with result type JResultPDF. More...
 
struct  JGridSplineFunction1D
 Type definition of a spline interpolation based on a JGridCollection. More...
 
struct  JGridSplineFunction1D_t
 Type definition of a spline interpolation based on a JGridCollection with result type double. More...
 
struct  JGridSplineFunction1H_t
 Type definition of a spline interpolation based on a JGridCollection with JResultDerivative result type. More...
 
struct  JGridSplineFunction1S_t
 Type definition of a spline interpolation based on a JGridCollection with JResultPDF result type. More...
 
class  JHashCollection
 General purpose class for hash collection of unique elements. More...
 
struct  JHashEvaluator
 Auxiliary class for default hash key evaluation. More...
 
struct  JHashMap
 General purpose class for hash map of unique keys. More...
 
class  JHashMap< JTypeList< JHead_t, JNullType >, JValue_t, JEvaluator_t >
 Terminator class of recursive class JHashMap. More...
 
class  JHashMap< JTypeList< JHead_t, JTail_t >, JValue_t, JEvaluator_t >
 Multi-dimensional hash map. More...
 
struct  JHashMapEvaluator
 Auxiliary class for hash evaluation of map keys and elements. More...
 
class  JHashSet
 General purpose class for hash set of elements. More...
 
class  JHenyeyGreenstein
 Numerical integrator for $ W(x) = (1 + g^{2} - 2gx)^{a} $, where $ g > 0 $. More...
 
class  JHermiteSplineCollection
 Template base class spline interpolations. More...
 
class  JHermiteSplineFunction
 Template definition for functional collection with spline interpolation. More...
 
class  JHermiteSplineFunction1D
 Template class for spline interpolation in 1D. More...
 
struct  JHermiteSplineFunction1D_t
 Type definition of a spline interpolation method based on a JCollection with double result type. More...
 
struct  JHermiteSplineFunction1H_t
 Type definition of a spline interpolation method based on a JCollection with JResultDerivative result type. More...
 
struct  JHermiteSplineFunction1S_t
 Type definition of a spline interpolation method based on a JCollection with JResultPDF result type. More...
 
class  JHermiteSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for spline interpolation method with returning JResultDerivative data structure. More...
 
class  JHermiteSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for spline interpolation method with returning JResultPDF data structure. More...
 
class  JHermiteSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >
 Template specialisation for functional collection with spline interpolation. More...
 
class  JHermiteSplineMap
 Functional map with spline interpolation. More...
 
struct  JHesseMatrix
 Hessian matrix. More...
 
class  JHistogram
 Template definition of histogram object interface. More...
 
class  JHistogram1D
 Histogram in 1D. More...
 
class  JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >
 Template specialisation if JHistogram1D class with bin centering. More...
 
struct  JHistogramGridMap_t
 Type definition of a JHistogramMap based on JGridMap implementation. More...
 
class  JHistogramMap
 Histogram map. More...
 
struct  JHistogramMap_t
 Type definition of a JHistogramMap based on JMap implementation. More...
 
class  JList
 Recursive template class. More...
 
class  JList< 0, T, JClass_t >
 Template specialisation of obsolete JList<unsigned int, ...> class. More...
 
class  JList< 1, T, JClass_t >
 Terminator class of recursive template class. More...
 
class  JMap
 Map of pair-wise elements. More...
 
struct  JMapCollection
 Template class to define the corresponding JCollection for a given template JMap. More...
 
struct  JMapCollection< JGridMap >
 Specialisation of JMapCollection for JGridMap. More...
 
struct  JMapCollection< JMap >
 Specialisation of JMapCollection for JMap. More...
 
struct  JMapLength
 Length of map list. More...
 
struct  JMapLength< JMapList< JHead_t, JNullType > >
 Terminator class of length of map list. More...
 
struct  JMapLength< JMapList< JHead_t, JTail_t > >
 Recursive length of map list. More...
 
struct  JMAPLIST
 Auxiliary class for recursive map list generation. More...
 
struct  JMapList
 Map list. More...
 
struct  JMAPLIST< A, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap, JNullMap >
 Template specialisation to terminate recursive map list generation. More...
 
struct  JMapList< JHead_t, JNullType >
 Terminator class of map list. More...
 
struct  JMappable
 Auxiliary class to define JMappableCollection for given template. More...
 
struct  JMappableCollection
 Template interface definition for associative collection of elements. More...
 
class  JMergeSort
 This class implements a merge and sort algorithm based on the divide-and-conquer concept. More...
 
class  JMultiFunction
 Multidimensional interpolation method. More...
 
class  JMultiFunction< JConstantFunction1D< JArgument_t, JResult_t >, JMapList< JMap_t >, JDistance_t >
 Template specialisation of JMultiFunction for a JConstantFunction. More...
 
class  JMultiFunction< JConstantFunction1D< JArgument_t, JResult_t >, JMaplist_t, JDistance_t >
 Template specialisation of JMultiFunction for a JConstantFunction. More...
 
class  JMultiGrid
 Simple data structure for an abstract multidimensional map of equidistant elements. More...
 
class  JMultiGrid< 0, JAbscissa_t >
 Terminator class of recursive class JMultiGrid. More...
 
class  JMultiHistogram
 Multidimensional histogram. More...
 
class  JMultiKey
 Multidimensional key. More...
 
class  JMultiKey< 0, JKey_t >
 Empty key. More...
 
class  JMultiKey< 1, JKey_t >
 One-dimensional key. More...
 
class  JMultiKey< 2, JKey_t >
 Two-dimensional key. More...
 
class  JMultiMap
 Multidimensional map. More...
 
class  JMultiMap< JAbscissa_t, JOrdinate_t, JMapList< JHead_t, JLANG::JNullType >, JDistance_t >
 Terminator class of recursive JMultiMap class. More...
 
class  JMultiMap< JAbscissa_t, JOrdinate_t, JMapList< JHead_t, JTail_t >, JDistance_t >
 Template specialisation of JMultiMap for map list with at least one map. More...
 
class  JMultiMapGetTransformer
 Auxiliary class to convert JMultiMapTransformer to JCollectionElementTransformer. More...
 
class  JMultiMapPutTransformer
 Auxiliary class to convert JMultiMapTransformer to JCollectionElementTransformer. More...
 
class  JMultiMapTransformer
 Interface for weight application and coordinate transformation of function. More...
 
class  JMultiPair
 Multidimensional pair. More...
 
class  JMultiPair< 0, JKey_t, JValue_t >
 Empty pair. More...
 
class  JMultiPair< 1, JKey_t, JValue_t >
 One-dimensional pair. More...
 
class  JMultiPair< 2, JKey_t, JValue_t >
 Two-dimensional pair. More...
 
class  JMultiPDF
 General purpose class for multi-dimensional probability density function (PDF). More...
 
struct  JMultipleMap
 List of identical maps. More...
 
struct  JMultipleMap< 1, JMap_t >
 Terminator class of list of identical maps. More...
 
struct  JMultiSet
 Simple data structure for an abstract multidimensional map of equidistant elements. More...
 
struct  JMultiSet< 0, JAbscissa_t >
 Terminator class of recursive class JMultiSet. More...
 
struct  JNullMap
 Auxiliary class for no map definition. More...
 
class  JPair
 Template specialisation for a pair of values. More...
 
class  JPair< const JKey_t &, const JValue_t & >
 Template specialisation for a pair of const references. More...
 
class  JPair< const JKey_t &, JValue_t & >
 Template specialisation for a mixed pair of const and non-const references. More...
 
class  JPair< JKey_t &, JValue_t & >
 Template specialisation for a pair of references. More...
 
class  JPolfitFunction
 Functional collection with Legendre polynomial interpolation. More...
 
class  JPolfitFunction1D
 Template class for polynomial interpolation in 1D. More...
 
struct  JPolint0Function1D
 Type definition of a zero degree polynomial interpolation. More...
 
struct  JPolint0Function1D_t
 Type definition of a zero degree polynomial interpolation with result type double. More...
 
struct  JPolint0FunctionalGridMap
 Type definition of a zero degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint0FunctionalGridMapH
 Type definition of a zero degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint0FunctionalMap
 Type definition of a zero degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint0FunctionalMapH
 Type definition of a zero degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint1Function1D
 Type definition of a 1st degree polynomial interpolation. More...
 
struct  JPolint1Function1D_t
 Type definition of a 1st degree polynomial interpolation with result type double. More...
 
struct  JPolint1Function1H_t
 Type definition of a 1st degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JPolint1Function1S_t
 Type definition of a 1st degree polynomial interpolation with result type JResultPDF. More...
 
struct  JPolint1FunctionalGridMap
 Type definition of a 1st degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint1FunctionalGridMapH
 Type definition of a 1st degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint1FunctionalMap
 Type definition of a 1st degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint1FunctionalMapH
 Type definition of a 1st degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint2Function1D
 Type definition of a 2nd degree polynomial interpolation. More...
 
struct  JPolint2Function1D_t
 Type definition of a 2nd degree polynomial interpolation with result type double. More...
 
struct  JPolint2Function1H_t
 Type definition of a 2nd degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JPolint2Function1S_t
 Type definition of a 2nd degree polynomial interpolation with result type JResultPDF. More...
 
struct  JPolint2FunctionalGridMap
 Type definition of a 2nd degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint2FunctionalGridMapH
 Type definition of a 2nd degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint2FunctionalMap
 Type definition of a 2nd degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint2FunctionalMapH
 Type definition of a 2nd degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint3Function1D
 Type definition of a 3rd degree polynomial interpolation. More...
 
struct  JPolint3Function1D_t
 Type definition of a 3rd degree polynomial interpolation with result type double. More...
 
struct  JPolint3Function1H_t
 Type definition of a 3rd degree polynomial interpolation with result type JResultDerivative. More...
 
struct  JPolint3Function1S_t
 Type definition of a 3rd degree polynomial interpolation with result type JResultPDF. More...
 
struct  JPolint3FunctionalGridMap
 Type definition of a 3rd degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint3FunctionalGridMapH
 Type definition of a 3rd degree polynomial interpolation based on a JGridMap implementation. More...
 
struct  JPolint3FunctionalMap
 Type definition of a 3rd degree polynomial interpolation based on a JMap implementation. More...
 
struct  JPolint3FunctionalMapH
 Type definition of a 3rd degree polynomial interpolation based on a JMap implementation. More...
 
class  JPolintCollection
 Template definition of base class for polynomial interpolations with polynomial result. More...
 
struct  JPolintElement2S
 2D Element for polynomial interpolations. More...
 
class  JPolintFunction
 Template definition for functional collection with polynomial interpolation. More...
 
class  JPolintFunction1D
 Template class for polynomial interpolation in 1D. More...
 
struct  JPolintFunction1D_t
 Polynomial interpolation method with result type double. More...
 
struct  JPolintFunction1H_t
 Polynomial interpolation method with result type JResultDerivative. More...
 
struct  JPolintFunction1S_t
 Polynomial interpolation method with result type JResultPDF. More...
 
class  JPolintFunction< 0, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >
 Template specialisation for zero-degree polynomial interpolation method. More...
 
class  JPolintFunction< 1, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >
 Template specialisation for first-degree polynomial interpolation method. More...
 
class  JPolintFunction< N, JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for polynomial interpolation method with returning JResultDerivative data structure. More...
 
class  JPolintFunction< N, JElement_t, JCollection_t, JResultHesse< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for polynomial interpolation method with returning JResultHesse data structure. More...
 
class  JPolintFunction< N, JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for polynomial interpolation method with returning JResultPDF data structure. More...
 
class  JPolintFunction< N, JElement_t, JCollection_t, JResultPolynome< M, typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for polynomial interpolation method with returning JResultPolynome data structure. More...
 
class  JPolintFunction< N, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >
 Template specialisation for functional collection with polynomial interpolation. More...
 
class  JPolintMap
 Functional map with polynomial interpolation. More...
 
class  JQuadrature
 Type definition for numerical integration. More...
 
struct  JQuantile
 Auxiliary data structure for running average, standard deviation and quantiles. More...
 
class  JQuantiles
 Quantile calculator for a given function. More...
 
class  JRange
 Range of values. More...
 
class  JRayleigh
 Numerical integrator for $ W(x) = 1 + g \, x^{2} $, where $ g > 0 $. More...
 
struct  JRebin
 Auxiliary class for merging of fixed number of consecutive bins. More...
 
struct  JResultDerivative
 Data structure for result including value and first derivative of function. More...
 
struct  JResultEvaluator
 Auxiliary class to recursively evaluate to a result. More...
 
struct  JResultEvaluator< JResultDerivative< T > >
 Template specialisation of JResultEvaluator for JResultDerivative. More...
 
struct  JResultEvaluator< JResultHesse< T > >
 Template specialisation of JResultEvaluator for JResultHesse. More...
 
struct  JResultEvaluator< JResultPDF< T > >
 Template specialisation of JResultEvaluator for JResultPDF. More...
 
struct  JResultEvaluator< JResultPolynome< 0, T > >
 Template specialisation of JResultEvaluator for JResultPolynome. More...
 
struct  JResultEvaluator< JResultPolynome< N, T > >
 Template specialisation of JResultEvaluator for JResultPolynome. More...
 
struct  JResultHesse
 Data structure for result including value and first derivative of function. More...
 
struct  JResultPDF
 Data structure for result including value, first derivative and integrals of function. More...
 
struct  JResultPolynome
 Data structure for result including value and N derivatives of function. More...
 
struct  JResultTransformer
 Auxiliary class to handle multidimensional map transformations for given result type. More...
 
struct  JResultTransformer< JResultHesse< JResult_t > >
 Auxiliary class to handle multidimensional map transformations for given result type. More...
 
struct  JResultTransformer< JResultPDF< JResult_t > >
 Auxiliary class to handle multidimensional map transformations for given result type. More...
 
struct  JResultType
 Auxiliary class to evaluate result type. More...
 
struct  JResultType< JClass_t, typename JVoid< typename JClass_t::result_type >::type >
 Auxiliary class to evaluate result type. More...
 
class  JRouter
 Direct addressing of elements with unique identifiers. More...
 
class  JRouter< JAddress_t, false >
 Template specialisation of JRouter without default address comparison. More...
 
class  JRouter< JAddress_t, true >
 Template specialisation of JRouter with default address comparison. More...
 
class  JSelector
 Template selector class. More...
 
struct  JSet
 Simple data structure for an abstract collection of non-equidistant abscissa values. More...
 
class  JSplineBounds
 Auxiliary class to define first derivates of the spline function at the two extrema. More...
 
class  JSplineCollection
 Template base class for spline interpolations. More...
 
struct  JSplineElement2D
 2D Element for spline interpolations. More...
 
struct  JSplineElement2S
 2D Element for spline interpolations. More...
 
class  JSplineFunction
 Template definition for functional collection with spline interpolation. More...
 
class  JSplineFunction1D
 Template class for spline interpolation in 1D. More...
 
struct  JSplineFunction1D_t
 Type definition of a spline interpolation method based on a JCollection with double result type. More...
 
struct  JSplineFunction1H_t
 Type definition of a spline interpolation method based on a JCollection with JResultDerivative result type. More...
 
struct  JSplineFunction1S_t
 Type definition of a spline interpolation method based on a JCollection with JResultPDF result type. More...
 
class  JSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for spline interpolation method with returning JResultDerivative data structure. More...
 
class  JSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >
 Template specialisation for spline interpolation method with returning JResultPDF data structure. More...
 
class  JSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >
 Template specialisation for functional collection with spline interpolation. More...
 
struct  JSplineFunctionalGridMap
 Type definition of a spline interpolation based on a JGridMap implementation. More...
 
struct  JSplineFunctionalGridMapH
 Type definition of a spline interpolation based on a JGridMap implementation. More...
 
struct  JSplineFunctionalMap
 Type definition of a spline interpolation based on a JMap implementation. More...
 
struct  JSplineFunctionalMapH
 Type definition of a spline interpolation based on a JMap implementation. More...
 
class  JSplineMap
 Functional map with spline interpolation. More...
 
struct  JTable2D
 2D table with arithmetic capabilities. More...
 
struct  JTransformable
 Abstract interface for transformable multidimensional map. More...
 
class  JTransformableMultiFunction
 Transformable multidimensional function. More...
 
class  JTransformableMultiHistogram
 Transformable multidimensional histogram. More...
 
struct  JTuple
 Template data structure. More...
 
struct  JTuple< JTypeList< JHead_t, JNullType > >
 Terminator class of recursive JTuple class. More...
 
struct  JTuple< JTypeList< JHead_t, JTail_t > >
 Template specialisation of JTuple for multiple data types. More...
 
struct  JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >
 Template specialisation of JTuple for two data types. More...
 
class  JWeight
 Weight calculator. More...
 

Typedefs

typedef JRange< double > JAngleRange
 Type definition for angle range.
 
typedef JHistogram1D< JElement2D< double, double >, JCollectionJHistogram1D_t
 Type definition of a 1 dimensional histogram based on a JCollection.
 
typedef JHistogram1D< JElement2D< double, double >, JGridCollectionJGridHistogram1D_t
 Type definition of a 1 dimensional histogram based on a JGridCollection.
 
typedef JHistogram1D< JBin2D< double, double >, JCollectionJHistogram1B_t
 Type definition of a 1 dimensional histogram with bin centering based on a JCollection.
 
typedef JHistogram1D< JBin2D< double, double >, JGridCollectionJGridHistogram1B_t
 Type definition of a 1 dimensional histogram with bin centering based on a JGridCollection.
 
typedef JElement2D< double, double > JElement2D_t
 Type definition of basic element for quadratures.
 

Functions

template<class JAbscissa_t >
JAbstractHistogram< JAbscissa_t > make_histogram (const int nx, const JAbscissa_t xmin, const JAbscissa_t xmax)
 Helper method for JAbstractHistogram.
 
template<class JElement_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JCollection< JElement_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JAbscissa_t >
JGrid< JAbscissa_t > make_grid (const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax)
 Helper method for JGrid.
 
template<class JAbscissa_t >
JGrid< JAbscissa_t > make_grid (const JAbscissa_t value)
 Helper method to create a grid with a single value.
 
template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JHermiteSplineFunction1D< JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
JElement_t::ordinate_type integrate (const JHermiteSplineFunction1D< JElement_t, JCollection_t, JResultPDF< typename JElement_t::ordinate_type >, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JElement_t , template< class, class > class JContainer_t, class JDistance_t >
void makePDF (const JHistogram1D< JElement_t, JContainer_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of histogram to probability density function (PDF).
 
template<class JAbscissa_t , class JContents_t , template< class, class > class JContainer_t, class JDistance_t >
void makePDF (const JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t > &input, JMappableCollection< JAbscissa_t, JContents_t > &output)
 Conversion of histogram to probability density function (PDF).
 
template<class JElement_t , template< class, class > class JContainer_t, class JDistance_t >
JElement_t::ordinate_type integrate (const JHistogram1D< JElement_t, JContainer_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void makePDF (const JMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > &input, JMultiFunction< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > &output)
 Conversion of multidimensional histogram to multidimensional function.
 
template<unsigned int N, class JAbscissa_t >
JMultiGrid< N, JAbscissa_t > make_multigrid (const JGrid< JAbscissa_t > &bounds)
 Helper method for JMultiGrid.
 
template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void makePDF (const JMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > &input, JMultiPDF< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > &output)
 Conversion of multi-dimensional histogram to multi-dimensional PDF.
 
template<unsigned int N, class JAbscissa_t >
JMultiSet< N, JAbscissa_t > make_multiset (const JSet< JAbscissa_t > &bounds)
 Helper method for JMultiSet.
 
template<class T , class JComparator_t >
bool next_permutation (T __begin, T __last, T __end, JComparator_t compare, std::bidirectional_iterator_tag)
 Implementation of method next_permutation for bidirectional iterators.
 
template<class T , class JComparator_t >
bool next_permutation (T __begin, T __last, T __end, JComparator_t compare)
 Permutations of sub-set of data.
 
template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JDistance_t , unsigned int M>
 if ((p==this->begin() &&this->getDistance(x,(p++) ->getX()) > distance_type::precision)||(p==this->end() &&this->getDistance((--p) ->getX(), x) > distance_type::precision))
 Template base class for polynomial interpolations with polynomial result.
 
 for (int i=n/2;i !=0 &&p !=this->end();--i,++p)
 
 for (int i=n ;i !=0 &&p !=this->begin();--i, --p)
 
 for (unsigned int k=0;k !=M+1;++k)
 
 for (int m=1;m !=n;++m)
 
virtual void do_compile () override
 Function compilation.
 
template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output, const JLANG::JBool< false > &option)
 Conversion of data points to integral values.
 
template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JPolintFunction1D< 0, JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output, const JLANG::JBool< true > &option)
 Conversion of data points to integral values.
 
template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JPolintFunction1D< 1, JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output, const JLANG::JBool< true > &option)
 Conversion of data points to integral values.
 
template<class JFunction1D_t >
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.
 
template<class T , class JComparator_t >
JRange< T, JComparator_t > operator+ (const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
 Add ranges.
 
template<class T , class JComparator_t >
JRange< T, JComparator_t > operator- (const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
 Subtract ranges.
 
template<class T , class JComparator_t >
bool overlap (const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
 Test overlap between ranges.
 
template<class T , class JComparator_t >
JRange< T, JComparator_t > join (const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
 Join ranges.
 
template<class T , class JComparator_t >
JRange< T, JComparator_t > combine (const JRange< T, JComparator_t > &first, const JRange< T, JComparator_t > &second)
 Combine ranges.
 
template<class T >
JRange< T > make_range (T x, T y)
 Auxiliary method to create range of values.
 
template<class T >
double getN (const JRange< T > &range, const double R)
 Get expected number of occurrences due to given rate within specified interval.
 
template<class JResult_t >
JResultEvaluator< JResult_t >::result_type get_value (const JResult_t &value)
 Helper method to recursively evaluate a to function value.
 
template<class JResult_t >
JResultEvaluator< JResult_t >::result_type get_derivative (const JResult_t &value)
 Helper method to convert function value to derivative value.
 
template<class JResult_t >
JResultEvaluator< JResult_t >::result_type get_integral (const JResult_t &value)
 Helper method to convert function value to partial integral value.
 
template<class JResult_t >
JResultEvaluator< JResult_t >::result_type get_total_integral (const JResult_t &value)
 Helper method to convert function value to total integral value.
 
template<class T >
JSet< typename std::iterator_traits< T >::value_type > make_set (T __begin, T __end)
 Helper method for JSet.
 
template<class JAbscissa_t >
JSet< JAbscissa_t > make_set (const JAbstractCollection< JAbscissa_t > &input)
 Helper method for JSet.
 
template<class JOrdinate_t >
JSplineBounds< JOrdinate_t > make_spline_bounds (const JOrdinate_t fpAtXmin, const JOrdinate_t fpAtXmax)
 Helper method for JSplineBounds.
 
template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type integrate (const JSplineFunction1D< JElement_t, JCollection_t, JResult_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
JElement_t::ordinate_type integrate (const JSplineFunction1D< JElement_t, JCollection_t, JResultPDF< typename JElement_t::ordinate_type >, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
 Conversion of data points to integral values.
 
template<class JContainer_t , class JKey_t , class JValue_t >
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).
 
template<class JContainer_t >
JContainer_t::ordinate_type getIntegral (const JContainer_t &input)
 Get integral of input data points.
 
template<class JContainer_t >
JContainer_t::ordinate_type getIntegral (const JContainer_t &input, const JRange< typename JContainer_t::argument_type > &range)
 Get integral of input data points.
 
template<class JFunction_t , template< class, class, class > class JMap_t, class JTail_t >
JFunction_t::ordinate_type getIntegral (const JMultiMap< typename JFunction_t::abscissa_type, JFunction_t, JMapList< JMap_t, JTail_t >, typename JFunction_t::distance_type > &input)
 Auxiliary method to get integral of input data points.
 
template<class JFunction_t , template< class, class, class > class JMap_t, class JTail_t >
JFunction_t::ordinate_type getIntegral (const JMultiFunction< JFunction_t, JMapList< JMap_t, JTail_t >, typename JFunction_t::distance_type > &input)
 Get integral of input data points.
 
template<class T >
void reset (T &value)
 Reset value.
 
template<class JElement_t , class JDistance_t >
void reset (JCollection< JElement_t, JDistance_t > &collection)
 Recursive reset of collection.
 
template<class T >
void copy (const T &input, T &output)
 Copy of input to output.
 
template<class JElement_t , class JDistance_t , class JKey_t , class JValue_t >
void copy (const JCollection< JElement_t, JDistance_t > &input, JMappableCollection< JKey_t, JValue_t > &output)
 Recursive copy of input collection to output collection.
 
template<class T , class JAbscissa_t >
void configure (const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
 Configuration of value.
 
template<class JElement_t , class JDistance_t >
void configure (JCollection< JElement_t, JDistance_t > &collection, const JAbstractCollection< typename JElement_t::abscissa_type > &bounds, JBool< true > option=JBool< true >())
 Recursive configuration of collection.
 
template<class T >
void accumulate (T &value, JBool< false > option)
 Accumulation of value.
 
template<class JElement_t , class JDistance_t >
void accumulate (JCollection< JElement_t, JDistance_t > &collection, JBool< true > option=JBool< true >())
 Recursive accumulation of collection.
 
template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void makePDF (const JTransformableMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > &input, JTransformableMultiFunction< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > &output)
 Conversion of multidimensional histogram to multidimensional function.
 
template<class JObject_t , class JHead_t , class JTail_t , class T >
JObject_t & for_each (JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist, const JTuple< T > &tuple)
 For each data type method.
 
template<class JObject_t , class JTypelist_t , class T >
JObject_t & for_each (JObject_t &object, JType< JTypelist_t > type, const JTuple< T > &tuple)
 For each data type method.
 
template<class ... Args>
JTuple< typename JTYPELIST< Args... >::typelist > make_tuple (const Args &...args)
 Helper method for tuple.
 
template<class JObject_t , class T >
JObject_t & for_each (JObject_t &object, JType< JNullType > type, const JTuple< T > &tuple)
 Termination method of for each data type method.
 
template<class T >
void inplace_merge (T __begin, const size_t N, const size_t *delimiter)
 Merge multiple sorted ranges.
 

Variables

static const JCompiler compiler
 Function object for functional object compilation.
 
static const JCumulator cumulator
 Function object for functional object compilation.
 
 pX
 
const int n = std::min((int) (N + 1), (int) this->size())
 
int j = 0
 
return result
 

Detailed Description

Auxiliary classes and methods for multi-dimensional interpolations and histograms.

Author
mdejong

Typedef Documentation

◆ JAngleRange

typedef JRange<double> JTOOLS::JAngleRange

Type definition for angle range.

Definition at line 19 of file JAngleRange.hh.

◆ JHistogram1D_t

Type definition of a 1 dimensional histogram based on a JCollection.

Definition at line 22 of file JHistogram1D_t.hh.

◆ JGridHistogram1D_t

Type definition of a 1 dimensional histogram based on a JGridCollection.

Definition at line 28 of file JHistogram1D_t.hh.

◆ JHistogram1B_t

Type definition of a 1 dimensional histogram with bin centering based on a JCollection.

Definition at line 34 of file JHistogram1D_t.hh.

◆ JGridHistogram1B_t

Type definition of a 1 dimensional histogram with bin centering based on a JGridCollection.

Definition at line 40 of file JHistogram1D_t.hh.

◆ JElement2D_t

typedef JElement2D<double, double> JTOOLS::JElement2D_t

Type definition of basic element for quadratures.

Definition at line 25 of file JQuadrature.hh.

Function Documentation

◆ make_histogram()

template<class JAbscissa_t >
JAbstractHistogram< JAbscissa_t > JTOOLS::make_histogram ( const int nx,
const JAbscissa_t xmin,
const JAbscissa_t xmax )
inline

Helper method for JAbstractHistogram.

Parameters
nxnumber of bins
xminlower limit
xmaxupper limit
Returns
histogram

Definition at line 169 of file JAbstractHistogram.hh.

172 {
173 return JAbstractHistogram<JAbscissa_t>(nx, xmin, xmax);
174 }
Simple data structure for histogram binning.

◆ integrate() [1/10]

template<class JElement_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JCollection< JElement_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration is based on the trapezoidal rule applied to the input data points.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 828 of file JCollection.hh.

829 {
830 typedef typename JElement_t::ordinate_type ordinate_type;
831 typedef typename JCollection<JElement_t, JDistance_t>::const_iterator const_iterator;
832
833 ordinate_type V(JMATH::zero);
834
835 if (input.getSize() > 1) {
836
837 output.put(input.begin()->getX(), V);
838
839 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
840
841 V += 0.5 * input.getDistance(i->getX(), j->getX()) * (i->getY() + j->getY());
842
843 output.put(j->getX(), V);
844 }
845 }
846
847 return V;
848 }
JDistance_t getDistance
Function object for distance evaluation.
virtual abscissa_type getX(int index) const override
Get abscissa value.
virtual int getSize() const override
Get number of elements.
container_type::const_iterator const_iterator
static const JZero zero
Function object to assign zero value.
Definition JZero.hh:105
int j
Definition JPolint.hh:801

◆ make_grid() [1/2]

template<class JAbscissa_t >
JGrid< JAbscissa_t > JTOOLS::make_grid ( const int nx,
const JAbscissa_t Xmin,
const JAbscissa_t Xmax )
inline

Helper method for JGrid.

Parameters
nxnumber of elements
Xminlower limit
Xmaxupper limit
Returns
grid

Definition at line 209 of file JGrid.hh.

212 {
213 return JGrid<JAbscissa_t>(nx, Xmin, Xmax);
214 }
Simple data structure for an abstract collection of equidistant abscissa values.
Definition JGrid.hh:40

◆ make_grid() [2/2]

template<class JAbscissa_t >
JGrid< JAbscissa_t > JTOOLS::make_grid ( const JAbscissa_t value)
inline

Helper method to create a grid with a single value.

Parameters
valuevalue
Returns
single-valued grid

Definition at line 224 of file JGrid.hh.

225 {
226 return JGrid<JAbscissa_t>(1, value, value);
227 }

◆ integrate() [2/10]

template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JHermiteSplineFunction1D< JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration includes the use of 2nd derivatives of the data points of the input spline interpolating function.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 713 of file JHermiteSpline.hh.

715 {
716 typedef typename JElement_t::ordinate_type ordinate_type;
718
719 ordinate_type V(JMATH::zero);
720
721 if (input.getSize() > 1) {
722
723 output.put(input.begin()->getX(), V);
724
725 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
726
727 const double dx = input.getDistance(i->getX(), j->getX());
728 const ordinate_type y = i->getY() + j->getY();
729 const ordinate_type z = i->getU() - j->getU();
730
731 const ordinate_type v = dx * 0.50 * y;
732 const ordinate_type w = dx * 1.00 * z*dx/12.0;
733
734 V += v + w;
735
736 output.put(j->getX(), V);
737 }
738 }
739
740 return V;
741 }
collection_type::const_iterator const_iterator

◆ integrate() [3/10]

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JHermiteSplineFunction1D< JElement_t, JCollection_t, JResultPDF< typename JElement_t::ordinate_type >, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration directly uses the integral values of the input spline interpolating function.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 757 of file JHermiteSpline.hh.

759 {
760 typedef typename JElement_t::ordinate_type ordinate_type;
761 typedef JResultPDF<ordinate_type> result_type;
763
764 if (input.getSize() > 1) {
765
766 for (const_iterator i = input.begin(); i != input.end(); ++i) {
767 output.put(i->getX(), i->getIntegral());
768 }
769
770 return input.rbegin()->getIntegral();
771 }
772
773 return JMATH::zero;
774 }
Data structure for result including value, first derivative and integrals of function.
Definition JResult.hh:339

◆ makePDF() [1/5]

template<class JElement_t , template< class, class > class JContainer_t, class JDistance_t >
void JTOOLS::makePDF ( const JHistogram1D< JElement_t, JContainer_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of histogram to probability density function (PDF).

The PDF abscissa and contents are set to the bin center and contents divided the bin width, respectively.

Parameters
inputhistogram
outputmappable collection

Definition at line 559 of file JHistogram1D.hh.

561 {
562 typedef typename JElement_t::abscissa_type abscissa_type;
563 typedef typename JElement_t::ordinate_type ordinate_type;
565
566 if (input.getSize() > 1) {
567
568 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
569
570 const abscissa_type x = 0.5 * (i->getX() + j->getX());
571 const ordinate_type y = i->getY();
572 const double w = input.getDistance(i->getX(), j->getX());
573
574 output.put(x, y/w);
575 }
576 }
577 }
collection_type::const_iterator const_iterator

◆ makePDF() [2/5]

template<class JAbscissa_t , class JContents_t , template< class, class > class JContainer_t, class JDistance_t >
void JTOOLS::makePDF ( const JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t > & input,
JMappableCollection< JAbscissa_t, JContents_t > & output )
inline

Conversion of histogram to probability density function (PDF).

The PDF abscissa and contents are set to the bin center and contents divided the bin width, respectively.

Parameters
inputhistogram
outputmappable collection

Definition at line 592 of file JHistogram1D.hh.

594 {
595 typedef JAbscissa_t abscissa_type;
596 typedef JContents_t contents_type;
597 typedef typename JHistogram1D<JBin2D<JAbscissa_t, JContents_t>, JContainer_t, JDistance_t>::const_iterator const_iterator;
598
599 if (input.getSize() > 1) {
600
601 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
602
603 const abscissa_type x = i->getBinCenter();
604 const contents_type y = i->getY();
605 const double w = input.getDistance(i->getX(), j->getX());
606
607 output.put(x, y/w);
608 }
609 }
610 }
Histogram in 1D.
void put(typename JClass< key_type > ::argument_type key, typename JClass< mapped_type >::argument_type value)
Put pair-wise element (key,value) into collection.

◆ integrate() [4/10]

template<class JElement_t , template< class, class > class JContainer_t, class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JHistogram1D< JElement_t, JContainer_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration is based on the sum of bin contents of the input data points.

Parameters
inputhistogram
outputmappable collection
Returns
integral

Definition at line 626 of file JHistogram1D.hh.

628 {
629 typedef typename JElement_t::ordinate_type ordinate_type;
631
632 ordinate_type V(JMATH::zero);
633
634 if (input.getSize() > 1) {
635
636 output.put(input.begin()->getX(), V);
637
638 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
639
640 V += i->getY();
641
642 output.put(j->getX(), V);
643 }
644 }
645
646 return V;
647 }

◆ makePDF() [3/5]

template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void JTOOLS::makePDF ( const JMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > & input,
JMultiFunction< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > & output )
inline

Conversion of multidimensional histogram to multidimensional function.

Parameters
inputmultidimensional histogram
outputmultidimensional function

Definition at line 368 of file JMultiFunction.hh.

370 {
371 output.insert(input);
372 }
void insert(const JMultiFunction< __JFunction_t, __JMaplist_t, __JDistance_t > &input)
Insert multidimensional input.

◆ make_multigrid()

template<unsigned int N, class JAbscissa_t >
JMultiGrid< N, JAbscissa_t > JTOOLS::make_multigrid ( const JGrid< JAbscissa_t > & bounds)
inline

Helper method for JMultiGrid.

Parameters
boundsbounds
Returns
multidimensional grid

Definition at line 151 of file JMultiGrid.hh.

152 {
153 return JMultiGrid<N, JAbscissa_t>(bounds);
154 }
Simple data structure for an abstract multidimensional map of equidistant elements.
Definition JMultiGrid.hh:27

◆ makePDF() [4/5]

template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void JTOOLS::makePDF ( const JMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > & input,
JMultiPDF< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > & output )
inline

Conversion of multi-dimensional histogram to multi-dimensional PDF.

Parameters
inputmulti-dimensional histogram
outputmulti-dimensional PDF

Definition at line 185 of file JMultiPDF.hh.

187 {
188 output.insert(input);
189 }
void insert(const JMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > &input)
Insert multi-dimensional input.
Definition JMultiPDF.hh:97

◆ make_multiset()

template<unsigned int N, class JAbscissa_t >
JMultiSet< N, JAbscissa_t > JTOOLS::make_multiset ( const JSet< JAbscissa_t > & bounds)
inline

Helper method for JMultiSet.

Parameters
boundsbounds
Returns
multidimensional set

Definition at line 150 of file JMultiSet.hh.

151 {
152 return JMultiSet<N, JAbscissa_t>(bounds);
153 }
Simple data structure for an abstract multidimensional map of equidistant elements.
Definition JMultiSet.hh:27

◆ next_permutation() [1/2]

template<class T , class JComparator_t >
bool JTOOLS::next_permutation ( T __begin,
T __last,
T __end,
JComparator_t compare,
std::bidirectional_iterator_tag  )
inline

Implementation of method next_permutation for bidirectional iterators.

Definition at line 20 of file JPermutation.hh.

25 {
26 using namespace std;
27
28 T __rend = __begin;
29 --__rend;
30
31 for (T __i = __last; --__i != __rend; ) {
32
33 T __j;
34
35 for (__j = __last; __j != __end && !compare(*__i,*__j); ++__j) {}
36
37 if (__j != __end) {
38
39 iter_swap(__i,__j);
40
41 if (++__i != __last && ++__j != __end) {
42
43 reverse(__i,__last);
44 reverse(__j,__end);
45
46 T __k = __end;
47
48 while (__k != __j && __i != __last)
49 iter_swap(__i++,--__k);
50
51 reverse(__i,__last);
52 reverse(__j,__k);
53 }
54
55 return true;
56 }
57 }
58
59 reverse(__begin, __last);
60 reverse(__last, __end);
61 reverse(__begin, __end);
62
63 return false;
64 }

◆ next_permutation() [2/2]

template<class T , class JComparator_t >
bool JTOOLS::next_permutation ( T __begin,
T __last,
T __end,
JComparator_t compare )
inline

Permutations of sub-set of data.

The first template argument refers to a bidirectional iterator and the second template argument to the comparator.

Parameters
__beginbegin of input data
__lastend of output data
__endend of input data
comparecomparison operator
Returns
true if another permutation exists; else false

Definition at line 79 of file JPermutation.hh.

83 {
84 return next_permutation(__begin, __last, __end, compare, typename std::iterator_traits<T>::iterator_category());
85 }
bool next_permutation(T __begin, T __last, T __end, JComparator_t compare, std::bidirectional_iterator_tag)
Implementation of method next_permutation for bidirectional iterators.

◆ if()

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JDistance_t , unsigned int M>
JTOOLS::if ( (p==this->begin() &&this->getDistance(x,(p++) ->getX()) > distance_type::precision)||(p==this->end() &&this->getDistance((--p) ->getX(), x) > distance_type::precision) )

Template base class for polynomial interpolations with polynomial result.

This class partially implements the JFunctional interface.

Definition at line 775 of file JPolint.hh.

776 {
777
778 std::ostringstream os;
779
780 os << __FILE__ << ':' << __LINE__ << " abscissa out of range "
781 << STREAM("?") << x << " <> "
782 << STREAM("?") << this->begin() ->getX() << ' '
783 << STREAM("?") << this->rbegin()->getX();
784
785 throw JValueOutOfRange(os.str());
786 }
Exception for accessing a value in a collection that is outside of its range.
Auxiliary data structure for handling std::ostream.

◆ for() [1/4]

JTOOLS::for ( int i = n/2; i != 0 && p != this->end(); --i,
++ p )

Definition at line 793 of file JPolint.hh.

793{} // move p to begin of data

◆ for() [2/4]

JTOOLS::for ( int i = n ; i != 0 && p != this->begin(); --i,
-- p )

Definition at line 794 of file JPolint.hh.

794{}

◆ for() [3/4]

JTOOLS::for ( unsigned int k = 0; k != M+1; ++k)

Definition at line 797 of file JPolint.hh.

797 {
798 v[0][k] = JMATH::zero;
799 }

◆ for() [4/4]

JTOOLS::for ( int m = 1; m != n; ++m)

Definition at line 825 of file JPolint.hh.

825 {
826
827 for (int i = 0; i != n-m; ++i) {
828
829 const double ho = u[ i ];
830 const double hp = u[i+m];
831 const double dx = ho - hp;
832
833 for (int k = 0; k != M+1; ++k) {
834 r[k] = (v[i+1][k] - w[i][k]) / dx;
835 }
836
837 v[i][0] = ho * r[0];
838 w[i][0] = hp * r[0];
839
840 for (int k = 1; k != M+1; ++k) {
841 v[i][k] = ho * r[k] - k * r[k-1];
842 w[i][k] = hp * r[k] - k * r[k-1];
843 }
844 }
845
846 if (2*(j+1) < n - m) {
847
848 for (int k = 0; k != M+1; ++k) {
849 result.y[k] += v[j+1][k];
850 }
851
852 } else {
853
854 for (int k = 0; k != M+1; ++k) {
855 result.y[k] += w[j][k];
856 }
857
858 --j;
859 }
860 }
const int n
Definition JPolint.hh:791

◆ do_compile()

virtual void JTOOLS::do_compile ( )
overrideprotectedvirtual

Function compilation.

Definition at line 869 of file JPolint.hh.

870 {}

◆ integrate() [5/10]

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inlineprotected

Conversion of data points to integral values.

This method transfers the integration to the corresponding specialised function.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 1201 of file JPolint.hh.

1203 {
1204 return integrate(input, output, JLANG::JBool<N == 0 || N == 1>());
1205 }
JElement_t::ordinate_type integrate(const JCollection< JElement_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
Conversion of data points to integral values.
Auxiliary template class for type bool.
Definition JBool.hh:21

◆ integrate() [6/10]

template<unsigned int N, class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JPolintFunction1D< N, JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output,
const JLANG::JBool< false > & option )
inlineprotected

Conversion of data points to integral values.

The integration uses the Gauss-Legendre quadratures with the number of points set to the degree of the input polynomial interpolating function.

Parameters
inputcollection
outputmappable collection
optionfalse
Returns
integral

Definition at line 1225 of file JPolint.hh.

1228 {
1229 typedef typename JElement_t::abscissa_type abscissa_type;
1230 typedef typename JElement_t::ordinate_type ordinate_type;
1232
1233 ordinate_type V(JMATH::zero);
1234
1235 if (input.getSize() > 1) {
1236
1237 output.put(input.begin()->getX(), V);
1238
1239 const JGaussLegendre engine(N);
1240
1241 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
1242
1243 const abscissa_type xmin = i->getX();
1244 const abscissa_type xmax = j->getX();
1245
1246 for (JGaussLegendre::const_iterator m = engine.begin(); m != engine.end(); ++m) {
1247
1248 const abscissa_type x = 0.5 * (xmax + xmin + m->getX() * (xmax - xmin));
1249 const ordinate_type v = 0.5 * (xmax - xmin) * m->getY() * get_value(input(x));
1250
1251 V += v;
1252 }
1253
1254 output.put(xmax, V);
1255 }
1256 }
1257
1258 return V;
1259 }
Numerical integrator for .
collection_type::const_iterator const_iterator
Definition JPolint.hh:1105

◆ integrate() [7/10]

template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JPolintFunction1D< 0, JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output,
const JLANG::JBool< true > & option )
inlineprotected

Conversion of data points to integral values.

The integration is based on the sum of ordinates of the input data points.

Parameters
inputcollection
outputmappable collection
optiontrue
Returns
integral

Definition at line 1277 of file JPolint.hh.

1280 {
1281 typedef typename JElement_t::ordinate_type ordinate_type;
1283
1284 ordinate_type V(JMATH::zero);
1285
1286 if (input.getSize() > 1) {
1287
1288 output.put(input.begin()->getX(), V);
1289
1290 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
1291
1292 V += input.getDistance(i->getX(), j->getX()) * j->getY();
1293
1294 output.put(j->getX(), V);
1295 }
1296 }
1297
1298 return V;
1299 }

◆ integrate() [8/10]

template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JPolintFunction1D< 1, JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output,
const JLANG::JBool< true > & option )
inlineprotected

Conversion of data points to integral values.

The integration is based on the trapezoidal rule applied to the input data points.

Parameters
inputcollection
outputmappable collection
optiontrue
Returns
integral

Definition at line 1317 of file JPolint.hh.

1320 {
1321 typedef typename JElement_t::ordinate_type ordinate_type;
1323
1324 ordinate_type V(JMATH::zero);
1325
1326 if (input.getSize() > 1) {
1327
1328 output.put(input.begin()->getX(), V);
1329
1330 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
1331
1332 V += 0.5 * input.getDistance(i->getX(), j->getX()) * (i->getY() + j->getY());
1333
1334 output.put(j->getX(), V);
1335 }
1336 }
1337
1338 return V;
1339 }

◆ search()

template<class JFunction1D_t >
double JTOOLS::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.

Golden section search code is taken from reference: Numerical Recipes in C++, W.H. Press, S.A. Teukolsky, W.T. Vetterling and B.P. Flannery, Cambridge University Press.

        xa < xb < xc

        is = +1  ->  There is a minimum, i.e:  f(xb) < min(f(xa),f(xc))
        is = -1  ->  There is a maximum, i.e:  f(xb) > max(f(xa),f(xc))
Parameters
xa
xb
xc
ffunction
issign (+1 -> minimim, -1 -> maximum)
epsrelative precision

Definition at line 48 of file JQuantiles.hh.

54 {
55 static const double R = 0.61803399;
56 static const double C = 1.0 - R;
57
58 double x0 = xa;
59 double x3 = xc;
60 double x1, x2;
61
62 if (fabs(xc-xb) > fabs(xb-xa)) {
63 x1 = xb;
64 x2 = xb + C*(xc-xb);
65 } else {
66 x2 = xb;
67 x1 = xb - C*(xb-xa);
68 }
69
70 double f1 = is * get_value(f(x1));
71 double f2 = is * get_value(f(x2));
72
73 while (fabs(x3-x0) > eps*(fabs(x1)+fabs(x2))) {
74
75 if (f2 < f1) {
76
77 x0 = x1;
78 x1 = x2;
79 x2 = R*x2 + C*x3;
80
81 f1 = f2;
82 f2 = is * get_value(f(x2));
83
84 } else {
85
86 x3 = x2;
87 x2 = x1;
88 x1 = R*x1 + C*x0;
89
90 f2 = f1;
91 f1 = is * get_value(f(x1));
92 }
93 }
94
95 if (f1 < f2)
96 return x1;
97 else
98 return x2;
99 }
const JPolynome f1(1.0, 2.0, 3.0)
Function.

◆ operator+()

template<class T , class JComparator_t >
JRange< T, JComparator_t > JTOOLS::operator+ ( const JRange< T, JComparator_t > & first,
const JRange< T, JComparator_t > & second )
inline

Add ranges.


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
firstfirst range
secondsecond range
Returns
range

Definition at line 611 of file JRange.hh.

612 {
613 return JRange<T, JComparator_t>(first).add(second);
614 }
Range of values.
Definition JRange.hh:42
range_type & add(argument_type x)
Add offset.
Definition JRange.hh:446

◆ operator-()

template<class T , class JComparator_t >
JRange< T, JComparator_t > JTOOLS::operator- ( const JRange< T, JComparator_t > & first,
const JRange< T, JComparator_t > & second )
inline

Subtract ranges.


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
firstfirst range
secondsecond range
Returns
range

Definition at line 627 of file JRange.hh.

628 {
629 return JRange<T, JComparator_t>(first).sub(second);
630 }
range_type & sub(argument_type x)
Subtract offset.
Definition JRange.hh:460

◆ overlap()

template<class T , class JComparator_t >
bool JTOOLS::overlap ( const JRange< T, JComparator_t > & first,
const JRange< T, JComparator_t > & second )
inline

Test overlap between ranges.

Parameters
firstfirst range
secondsecond range
Returns
true if there is a non-zero overlap; else false

Definition at line 641 of file JRange.hh.

642 {
643 return first.overlap(second);
644 }
bool overlap(const range_type &range) const
Test overlap with given range.
Definition JRange.hh:382

◆ join()

template<class T , class JComparator_t >
JRange< T, JComparator_t > JTOOLS::join ( const JRange< T, JComparator_t > & first,
const JRange< T, JComparator_t > & second )
inline

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
firstfirst range
secondsecond range
Returns
range

Definition at line 659 of file JRange.hh.

660 {
661 return JRange<T, JComparator_t>(first).join(second);
662 }
range_type & join(const range_type &range)
Join ranges.
Definition JRange.hh:415

◆ combine()

template<class T , class JComparator_t >
JRange< T, JComparator_t > JTOOLS::combine ( const JRange< T, JComparator_t > & first,
const JRange< T, JComparator_t > & second )
inline

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
firstfirst range
secondsecond range
Returns
range

Definition at line 676 of file JRange.hh.

677 {
678 return JRange<T, JComparator_t>(first).combine(second);
679 }
range_type & combine(const range_type &range)
Combine ranges.
Definition JRange.hh:432

◆ make_range()

template<class T >
JRange< T > JTOOLS::make_range ( T x,
T y )
inline

Auxiliary method to create range of values.

Parameters
xlower limit
yupper limit
Returns
range

Definition at line 690 of file JRange.hh.

691 {
692 return JRange<T>(x,y);
693 }

◆ getN()

template<class T >
double JTOOLS::getN ( const JRange< T > & range,
const double R )
inline

Get expected number of occurrences due to given rate within specified interval.

Parameters
rangeinterval
Rrate
Returns
expectation value

Definition at line 704 of file JRange.hh.

705 {
706 return R * (range.getUpperLimit() - range.getLowerLimit());
707 }
T getLowerLimit() const
Get lower limit.
Definition JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition JRange.hh:213

◆ get_value()

template<class JResult_t >
JResultEvaluator< JResult_t >::result_type JTOOLS::get_value ( const JResult_t & value)
inline

Helper method to recursively evaluate a to function value.

Parameters
valueresult
Returns
function value

Definition at line 998 of file JResult.hh.

999 {
1001 }
Auxiliary class to recursively evaluate to a result.
Definition JResult.hh:696

◆ get_derivative()

template<class JResult_t >
JResultEvaluator< JResult_t >::result_type JTOOLS::get_derivative ( const JResult_t & value)
inline

Helper method to convert function value to derivative value.

Parameters
valueresult
Returns
derivative value

Definition at line 1011 of file JResult.hh.

1012 {
1014 }

◆ get_integral()

template<class JResult_t >
JResultEvaluator< JResult_t >::result_type JTOOLS::get_integral ( const JResult_t & value)
inline

Helper method to convert function value to partial integral value.

Parameters
valueresult
Returns
partial integral value

Definition at line 1024 of file JResult.hh.

1025 {
1027 }

◆ get_total_integral()

template<class JResult_t >
JResultEvaluator< JResult_t >::result_type JTOOLS::get_total_integral ( const JResult_t & value)
inline

Helper method to convert function value to total integral value.

Parameters
valueresult
Returns
total integral value

Definition at line 1037 of file JResult.hh.

1038 {
1040 }

◆ make_set() [1/2]

template<class T >
JSet< typename std::iterator_traits< T >::value_type > JTOOLS::make_set ( T __begin,
T __end )
inline

Helper method for JSet.

Parameters
__beginbegin of abscissa values
__endend of abscissa values
Returns
set

Definition at line 180 of file JSet.hh.

181 {
183 }
Simple data structure for an abstract collection of non-equidistant abscissa values.
Definition JSet.hh:34

◆ make_set() [2/2]

template<class JAbscissa_t >
JSet< JAbscissa_t > JTOOLS::make_set ( const JAbstractCollection< JAbscissa_t > & input)
inline

Helper method for JSet.

Parameters
inputabstract collection
Returns
set

Definition at line 193 of file JSet.hh.

194 {
195 return JSet<JAbscissa_t>(input);
196 }

◆ make_spline_bounds()

template<class JOrdinate_t >
JSplineBounds< JOrdinate_t > JTOOLS::make_spline_bounds ( const JOrdinate_t fpAtXmin,
const JOrdinate_t fpAtXmax )
inline

Helper method for JSplineBounds.

Parameters
fpAtXmin1st derivative at minimal abscissa value
fpAtXmax1st derivative at maximal abscissa value
Returns
spline bounds

Definition at line 153 of file JSpline.hh.

155 {
156 return JSplineBounds<JOrdinate_t>(fpAtXmin, fpAtXmax);
157 }
Auxiliary class to define first derivates of the spline function at the two extrema.
Definition JSpline.hh:37

◆ integrate() [9/10]

template<class JElement_t , template< class, class > class JCollection_t, class JResult_t , class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JSplineFunction1D< JElement_t, JCollection_t, JResult_t, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration includes the use of 2nd derivatives of the data points of the input spline interpolating function.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 876 of file JSpline.hh.

878 {
879 typedef typename JElement_t::ordinate_type ordinate_type;
881
882 ordinate_type V(JMATH::zero);
883
884 if (input.getSize() > 1) {
885
886 output.put(input.begin()->getX(), V);
887
888 for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
889
890 const double dx = input.getDistance(i->getX(), j->getX());
891 const ordinate_type y = i->getY() + j->getY();
892 const ordinate_type z = i->getU() + j->getU();
893 const ordinate_type v = dx * 0.50 * y;
894 const ordinate_type w = dx * 0.25 * z*dx*dx/6;
895
896 V += v - w;
897
898 output.put(j->getX(), V);
899 }
900 }
901
902 return V;
903 }
collection_type::const_iterator const_iterator
Definition JSpline.hh:744

◆ integrate() [10/10]

template<class JElement_t , template< class, class > class JCollection_t, class JDistance_t >
JElement_t::ordinate_type JTOOLS::integrate ( const JSplineFunction1D< JElement_t, JCollection_t, JResultPDF< typename JElement_t::ordinate_type >, JDistance_t > & input,
typename JMappable< JElement_t >::map_type & output )
inline

Conversion of data points to integral values.

The integration directly uses the integral values of the input spline interpolating function.

Parameters
inputcollection
outputmappable collection
Returns
integral

Definition at line 919 of file JSpline.hh.

921 {
922 typedef typename JElement_t::ordinate_type ordinate_type;
923 typedef JResultPDF<ordinate_type> result_type;
925
926 if (input.getSize() > 1) {
927
928 for (const_iterator i = input.begin(); i != input.end(); ++i) {
929 output.put(i->getX(), i->getIntegral());
930 }
931
932 return input.rbegin()->getIntegral();
933 }
934
935 return JMATH::zero;
936 }

◆ makeCDF()

template<class JContainer_t , class JKey_t , class JValue_t >
JContainer_t::ordinate_type JTOOLS::makeCDF ( const JContainer_t & input,
JMappableCollection< JKey_t, JValue_t > & output,
const typename JContainer_t::ordinate_type eps = JMATH::zero )
inline

Conversion of data points to cumulative probability distribition (CDF).

Note that the data type of the input container should be preserved so that the corresponding method integrate() is used.

Parameters
inputcollection
outputmappable collection
epsminimal step size
Returns
integral value

Definition at line 52 of file JToolsToolkit.hh.

55 {
56 typedef typename JContainer_t::ordinate_type ordinate_type;
57 typedef typename JContainer_t::abscissa_type abscissa_type;
59 typedef JCollection<element_type> buffer_type;
60
61
62 if (input.getSize() > 1) {
63
64 buffer_type buffer;
65
66 const ordinate_type V = integrate(input, buffer);
67
68 if (V == ordinate_type(JMATH::zero)) {
69 THROW(JDivisionByZero, "Method makeCDF(): integral equals zero.");
70 }
71
72 output.clear();
73
74 typename buffer_type::const_iterator i = buffer.begin();
75
76 for ( ; i != buffer.end() && i->getY() <= 0.5 * eps * V; ++i) {}
77
78 if (i != buffer.end()) {
79
80 // force first point at (0, ymin)
81
82 JKey_t x = 0.0;
83 JValue_t y = i->getX();
84
85 output.put(x, y);
86
87 JKey_t xmax = x;
88 JValue_t ymax = y;
89
90 for (++i; i != buffer.end(); ++i) {
91
92 x = i->getY() / V;
93 y = i->getX();
94
95 if (x > xmax) {
96
97 ymax = y;
98
99 if (x > xmax + eps) {
100
101 output.put(x, y);
102
103 xmax = x;
104 }
105 }
106 }
107
108 // force last point at (1, ymax)
109
110 x = 1.0;
111 y = ymax;
112
113 output.put(x,y);
114
115 } else {
116 THROW(JDivisionByZero, "Method makeCDF(): no remaining data.");
117 }
118
119 return V;
120
121 } else {
122 THROW(JEmptyCollection, "Method makeCDF(): not sufficient input data.");
123 }
124 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Exception for division by zero.
General purpose class for collection of elements, see: <a href="JTools.PDF";>Collection of elements....
Definition JSet.hh:22
const double xmax
2D Element.
Definition JPolint.hh:1131
virtual void clear()=0
Clear.

◆ getIntegral() [1/4]

template<class JContainer_t >
JContainer_t::ordinate_type JTOOLS::getIntegral ( const JContainer_t & input)
inline

Get integral of input data points.

Parameters
inputinput data
Returns
integral value

Definition at line 134 of file JToolsToolkit.hh.

◆ getIntegral() [2/4]

template<class JContainer_t >
JContainer_t::ordinate_type JTOOLS::getIntegral ( const JContainer_t & input,
const JRange< typename JContainer_t::argument_type > & range )
inline

Get integral of input data points.

Parameters
inputinput data
rangerange
Returns
integral value

Definition at line 150 of file JToolsToolkit.hh.

152 {
153 JContainer_t output;
154
155 integrate(input, output);
156
157 if (!output.empty())
158 return ((output.in_range(range.getUpperLimit()) ? get_value(output(range.getUpperLimit())) : output.rbegin()->getY()) -
159 (output.in_range(range.getLowerLimit()) ? get_value(output(range.getLowerLimit())) : output. begin()->getY()));
160 else
161 return 0.0;
162 }

◆ getIntegral() [3/4]

template<class JFunction_t , template< class, class, class > class JMap_t, class JTail_t >
JFunction_t::ordinate_type JTOOLS::getIntegral ( const JMultiMap< typename JFunction_t::abscissa_type, JFunction_t, JMapList< JMap_t, JTail_t >, typename JFunction_t::distance_type > & input)
inline

Auxiliary method to get integral of input data points.

Parameters
inputinput data
Returns
integral value

Definition at line 175 of file JToolsToolkit.hh.

176 {
177 typedef typename JFunction_t::abscissa_type abscissa_type;
178 typedef typename JFunction_t::ordinate_type ordinate_type;
179 typedef typename JFunction_t::distance_type distance_type;
180 typedef typename JFunctionalMap<JMap_t>::template function_type<abscissa_type,
181 ordinate_type,
182 ordinate_type,
183 distance_type> buffer_type;
184 typedef JMultiMap<abscissa_type, JFunction_t, JMapList<JMap_t, JTail_t>, distance_type> multimap_type;
185
186 static buffer_type buffer;
187
188 buffer.configure(input);
189
190 typename buffer_type::iterator out = buffer.begin();
191
192 for (typename multimap_type::const_iterator in = input.begin(); in != input.end(); ++in, ++out) {
193 out->getY() = getIntegral(in->getY());
194 }
195
196 buffer.compile();
197
198 return getIntegral(buffer);
199 }
Multidimensional map.
Definition JMultiMap.hh:52
JContainer_t::ordinate_type getIntegral(const JContainer_t &input)
Get integral of input data points.
Auxiliary class to define corresponding one-dimensional function interpolator function_type.

◆ getIntegral() [4/4]

template<class JFunction_t , template< class, class, class > class JMap_t, class JTail_t >
JFunction_t::ordinate_type JTOOLS::getIntegral ( const JMultiFunction< JFunction_t, JMapList< JMap_t, JTail_t >, typename JFunction_t::distance_type > & input)
inline

Get integral of input data points.

Parameters
inputinput data
Returns
integral value

Definition at line 212 of file JToolsToolkit.hh.

213 {
214 typedef typename JFunction_t::abscissa_type abscissa_type;
215 typedef typename JFunction_t::ordinate_type ordinate_type;
216 typedef typename JFunction_t::distance_type distance_type;
217 typedef typename JFunctionalMap<JMap_t>::template function_type<abscissa_type,
218 ordinate_type,
219 ordinate_type,
220 distance_type> buffer_type;
221 typedef JMultiFunction<JFunction_t, JMapList<JMap_t, JTail_t>, distance_type> multifunction_type;
222
223 buffer_type buffer;
224
225 for (typename multifunction_type::const_iterator i = input.begin(); i != input.end(); ++i) {
226 buffer.put(i->getX(), getIntegral(i->getY()));
227 }
228
229 buffer.compile();
230
231 return getIntegral(buffer);
232 }
Multidimensional interpolation method.

◆ reset() [1/2]

template<class T >
void JTOOLS::reset ( T & value)
inline

Reset value.

The value is set to (the equivalent of) zero, see method JMATH::getZero.

Parameters
valuevalue

Definition at line 243 of file JToolsToolkit.hh.

244 {
245 value = JMATH::getZero<T>();
246 }
T getZero()
Get zero value for a given data type.
Definition JZero.hh:26

◆ reset() [2/2]

template<class JElement_t , class JDistance_t >
void JTOOLS::reset ( JCollection< JElement_t, JDistance_t > & collection)
inline

Recursive reset of collection.

Parameters
collectioncollection

Definition at line 255 of file JToolsToolkit.hh.

256 {
257 typedef typename JCollection<JElement_t, JDistance_t>::iterator iterator;
258
259 for (iterator i = collection.begin(); i != collection.end(); ++i) {
260 reset(i->getY());
261 }
262 }
container_type::iterator iterator
void reset(T &value)
Reset value.

◆ copy() [1/2]

template<class T >
void JTOOLS::copy ( const T & input,
T & output )
inline

Copy of input to output.

The output value is set to the input value.

Parameters
inputinput
outputoutput

Definition at line 274 of file JToolsToolkit.hh.

275 {
276 output = input;
277 }

◆ copy() [2/2]

template<class JElement_t , class JDistance_t , class JKey_t , class JValue_t >
void JTOOLS::copy ( const JCollection< JElement_t, JDistance_t > & input,
JMappableCollection< JKey_t, JValue_t > & output )
inline

Recursive copy of input collection to output collection.

Parameters
inputinput
outputoutput

Definition at line 287 of file JToolsToolkit.hh.

288 {
289 typedef typename JCollection<JElement_t, JDistance_t>::const_iterator const_iterator;
290
291 output.clear();
292
293 for (const_iterator i = input.begin(); i != input.end(); ++i) {
294 copy(i->getY(), output.get(i->getX()));
295 }
296 }
virtual const mapped_type & get(typename JClass< key_type >::argument_type key) const =0
Get mapped value.

◆ configure() [1/2]

template<class T , class JAbscissa_t >
void JTOOLS::configure ( const T & value,
const JAbstractCollection< JAbscissa_t > & bounds,
JBool< false > option )
inline

Configuration of value.

This is a fall-back method; it does nothing.

Parameters
valuevalue
boundsbounds
optionfalse

Definition at line 309 of file JToolsToolkit.hh.

310 {}

◆ configure() [2/2]

template<class JElement_t , class JDistance_t >
void JTOOLS::configure ( JCollection< JElement_t, JDistance_t > & collection,
const JAbstractCollection< typename JElement_t::abscissa_type > & bounds,
JBool< true > option = JBool<true>() )
inline

Recursive configuration of collection.

Parameters
collectioncollection
boundsbounds
optiontrue

Definition at line 321 of file JToolsToolkit.hh.

324 {
325 typedef typename JCollection<JElement_t, JDistance_t>::iterator iterator;
326 typedef typename JCollection<JElement_t, JDistance_t>::ordinate_type ordinate_type;
327
328 collection.configure(bounds);
329
330 for (iterator i = collection.begin(); i != collection.end(); ++i) {
332 }
333 }
void configure(const JAbstractCollection< abscissa_type > &bounds)
Configure collection.
JElement_t::ordinate_type ordinate_type
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
Auxiliary class to check whether given template is a collection, i.e. has a defined type collection_t...
Definition JAssembler.hh:24

◆ accumulate() [1/2]

template<class T >
void JTOOLS::accumulate ( T & value,
JBool< false > option )
inline

Accumulation of value.

This is a fall-back method; it does nothing.

Parameters
valuevalue
optionfalse

Definition at line 345 of file JToolsToolkit.hh.

346 {}

◆ accumulate() [2/2]

template<class JElement_t , class JDistance_t >
void JTOOLS::accumulate ( JCollection< JElement_t, JDistance_t > & collection,
JBool< true > option = JBool<true>() )
inline

Recursive accumulation of collection.

Parameters
collectioncollection
optiontrue

Definition at line 356 of file JToolsToolkit.hh.

357 {
358 typedef typename JCollection<JElement_t, JDistance_t>::iterator iterator;
359 typedef typename JCollection<JElement_t, JDistance_t>::ordinate_type ordinate_type;
360
361 for (iterator i = collection.begin(); i != collection.end(); ++i) {
363 }
364
365 if (collection.getSize() > 1) {
366
367 for (iterator j = collection.begin(), i = j++; j != collection.end(); ++i, ++j) {
368 j->getY() += i->getY();
369 }
370
371 reset(collection.begin()->getY());
372 }
373 }
const ordinate_type & getY(int index) const
Get ordinate value.
void accumulate(T &value, JBool< false > option)
Accumulation of value.

◆ makePDF() [5/5]

template<class JHistogram_t , class JHistogramMaplist_t , class JHistogramDistance_t , class JFunction_t , class JFunctionMaplist_t , class JFunctionDistance_t >
void JTOOLS::makePDF ( const JTransformableMultiHistogram< JHistogram_t, JHistogramMaplist_t, JHistogramDistance_t > & input,
JTransformableMultiFunction< JFunction_t, JFunctionMaplist_t, JFunctionDistance_t > & output )
inline

Conversion of multidimensional histogram to multidimensional function.

Parameters
inputmultidimensional histogram
outputmultidimensional function

Definition at line 292 of file JTransformableMultiFunction.hh.

294 {
295 output.insert(input);
296 }
void insert(const JTransformableMultiFunction< __JFunction_t, __JMaplist_t, __JDistance_t > &input)
Insert multidimensional input.

◆ for_each() [1/3]

template<class JObject_t , class JHead_t , class JTail_t , class T >
JObject_t & JTOOLS::for_each ( JObject_t & object,
JType< JTypeList< JHead_t, JTail_t > > typelist,
const JTuple< T > & tuple )

For each data type method.

The given object should provide for the function object operator

   template<class T>
   void object()(JType<T> type, tuple);
Parameters
objectobject
typelisttype list
tupletuple
Returns
object

Definition at line 666 of file JTuple.hh.

667 {
668 for_each(object, JType<JHead_t>(), tuple);
669 for_each(object, JType<JTail_t>(), tuple);
670
671 return object;
672 }
Auxiliary class for a type holder.
Definition JType.hh:19

◆ for_each() [2/3]

template<class JObject_t , class JTypelist_t , class T >
JObject_t & JTOOLS::for_each ( JObject_t & object,
JType< JTypelist_t > type,
const JTuple< T > & tuple )

For each data type method.

The given object should provide for the function object operator

   template<class T>
   void object()(JType<T> type, tuple);
Parameters
objectobject
typetype
tupletuple
Returns
object

Definition at line 690 of file JTuple.hh.

691 {
692 object(type, tuple);
693
694 return object;
695 }

◆ make_tuple()

template<class ... Args>
JTuple< typename JTYPELIST< Args... >::typelist > JTOOLS::make_tuple ( const Args &... args)
inline

Helper method for tuple.

Parameters
argsvalues
Returns
tuple

Definition at line 705 of file JTuple.hh.

706 {
707 return JTuple<typename JTYPELIST<Args...>::typelist>(args...);
708 }
Auxiliary class for recursive type list generation.
Definition JTypeList.hh:351
Template data structure.
Definition JTuple.hh:47

◆ for_each() [3/3]

template<class JObject_t , class T >
JObject_t & JTOOLS::for_each ( JObject_t & object,
JType< JNullType > type,
const JTuple< T > & tuple )

Termination method of for each data type method.

Parameters
objectobject
typenull type
tupletuple
Returns
object

Definition at line 720 of file JTuple.hh.

721 {
722 return object;
723 }

◆ inplace_merge()

template<class T >
void JTOOLS::inplace_merge ( T __begin,
const size_t N,
const size_t * delimiter )

Merge multiple sorted ranges.

Parameters
__beginbegin of data
Nnumber of delimiters (equals number of ranges plus one)
delimiterincremental delimiters

Definition at line 29 of file JMergeSort.cc.

30 {
31 switch (N - 1) {
32
33 case 0:
34 case 1:
35 break;
36
37 case 2:
38
39 std::inplace_merge(__begin + delimiter[0],
40 __begin + delimiter[1],
41 __begin + delimiter[2]);
42
43 break;
44
45 default:
46
47 const size_t n = (N - 1) >> 1;
48
49 inplace_merge(__begin, n + 1, delimiter);
50 inplace_merge(__begin, N - n, delimiter + n);
51
52 std::inplace_merge(__begin + delimiter[ 0 ],
53 __begin + delimiter[ n ],
54 __begin + delimiter[N-1]);
55
56 break;
57 };
58 }
void inplace_merge(T __begin, const size_t N, const size_t *delimiter)
Merge multiple sorted ranges.
Definition JMergeSort.cc:29

Variable Documentation

◆ compiler

const JCompiler JTOOLS::compiler
static

Function object for functional object compilation.

Definition at line 379 of file JFunctional.hh.

◆ cumulator

const JCumulator JTOOLS::cumulator
static

Function object for functional object compilation.

Definition at line 242 of file JHistogram.hh.

◆ pX

JTOOLS::pX

Definition at line 788 of file JPolint.hh.

◆ n

const int JTOOLS::n = std::min((int) (N + 1), (int) this->size())

Definition at line 791 of file JPolint.hh.

◆ j

JTOOLS::j = 0

Definition at line 801 of file JPolint.hh.

◆ result

return JTOOLS::result

Definition at line 862 of file JPolint.hh.