ROOT   Reference Guide
Searching...
No Matches
ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType > Class Template Reference
template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>

OneDimMultiFunctionAdapter class to wrap a multidimensional function in one dimensional one.

Given a f(x1,x2,x3,....xn) transforms in a f( x_i) given the coordinate intex i and the vector x[] of the coordinates. It provides the possibility to copy and own the data array of the coordinates or to maintain internally a pointer to an external array for being more efficient. In this last case the user must guarantee the life of the given passed pointer

Definition at line 56 of file OneDimFunctionAdapter.h.

## Public Member Functions

OneDimMultiFunctionAdapter (MultiFuncType f, const double *x, unsigned int icoord=0, const double *p=nullptr)
Constructor from the function object , pointer to an external array of x values and coordinate we want to adapt.

OneDimMultiFunctionAdapter (MultiFuncType f, unsigned int dim=1, unsigned int icoord=0, const double *p=nullptr)
Constructor from the function object , dimension of the function and and coordinate we want to adapt.

Destructor (no operations)

clone

void SetCoord (int icoord)

void SetX (const double *x)
set values

void SetX (double *x)
set pointer without copying the values

template<class Iterator >
void SetX (Iterator begin, Iterator end)
Set X values in case vector is own, iterator size must match previous set dimension. Public Member Functions inherited from ROOT::Math::IBaseFunctionOneDim
virtual ~IBaseFunctionOneDim ()=default

double operator() (const double *x) const
Evaluate the function at a point x[].

double operator() (double x) const
Evaluate the function at a point x.

## Private Member Functions

double DoEval (double x) const override
evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord.

## Private Attributes

unsigned int fCoord

unsigned int fDim

MultiFuncType fFunc

bool fOwn

const doublefParams

doublefX Public Types inherited from ROOT::Math::IBaseFunctionOneDim
typedef IBaseFunctionOneDim BaseFunc

#include <Math/OneDimFunctionAdapter.h>

Inheritance diagram for ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >:
[legend]

## Constructor & Destructor Documentation

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::OneDimMultiFunctionAdapter ( MultiFuncType f, const double * x, unsigned int icoord = 0, const double * p = nullptr )
inline

Constructor from the function object , pointer to an external array of x values and coordinate we want to adapt.

Definition at line 65 of file OneDimFunctionAdapter.h.

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::OneDimMultiFunctionAdapter ( MultiFuncType f, unsigned int dim = 1, unsigned int icoord = 0, const double * p = nullptr )
inline

Constructor from the function object , dimension of the function and and coordinate we want to adapt.

The coordinate cached vector is created inside and eventually the values must be passed later with the SetX which will copy them

Definition at line 81 of file OneDimFunctionAdapter.h.

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
inlineoverride

Destructor (no operations)

Definition at line 95 of file OneDimFunctionAdapter.h.

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
inline

Definition at line 142 of file OneDimFunctionAdapter.h.

## ◆ Clone()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
inlineoverridevirtual

clone

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 100 of file OneDimFunctionAdapter.h.

## ◆ DoEval()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 double ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::DoEval ( double x ) const
inlineoverrideprivatevirtual

evaluate function at the values x[] given in the constructor and as function of the coordinate fCoord.

Implements ROOT::Math::IBaseFunctionOneDim.

Definition at line 169 of file OneDimFunctionAdapter.h.

## ◆ operator=()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
inlineprivate

Definition at line 160 of file OneDimFunctionAdapter.h.

## ◆ SetCoord()

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetCoord ( int icoord )
inline

Definition at line 139 of file OneDimFunctionAdapter.h.

## ◆ SetX() [1/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( const double * x )
inline

set values

Definition at line 132 of file OneDimFunctionAdapter.h.

## ◆ SetX() [2/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
 void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( double * x )
inline

set pointer without copying the values

Definition at line 125 of file OneDimFunctionAdapter.h.

## ◆ SetX() [3/3]

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
template<class Iterator >
 void ROOT::Math::OneDimMultiFunctionAdapter< MultiFuncType >::SetX ( Iterator begin, Iterator end )
inline

Set X values in case vector is own, iterator size must match previous set dimension.

Definition at line 117 of file OneDimFunctionAdapter.h.

## ◆ fCoord

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
private

Definition at line 193 of file OneDimFunctionAdapter.h.

## ◆ fDim

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
private

Definition at line 194 of file OneDimFunctionAdapter.h.

## ◆ fFunc

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
private

Definition at line 190 of file OneDimFunctionAdapter.h.

## ◆ fOwn

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
private

Definition at line 195 of file OneDimFunctionAdapter.h.

## ◆ fParams

template<class MultiFuncType = const ROOT::Math::IMultiGenFunction &>
{"ft_lang_label":"__label__en","ft_lang_prob":0.5752288,"math_prob":0.8791546,"size":4211,"snap":"2023-40-2023-50","text_gpt3_token_len":1025,"char_repetition_ratio":0.22486332,"word_repetition_ratio":0.28798586,"special_character_ratio":0.20850155,"punctuation_ratio":0.13193403,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9669274,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,null,null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-30T13:12:42Z\",\"WARC-Record-ID\":\"<urn:uuid:52ba8978-cde5-41d0-828e-7a05615b82c0>\",\"Content-Length\":\"49552\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:9d4683bb-bc2c-4125-8214-33b9862d1fe1>\",\"WARC-Concurrent-To\":\"<urn:uuid:aecf4cc9-229f-4815-9314-1405acf93829>\",\"WARC-IP-Address\":\"188.184.49.144\",\"WARC-Target-URI\":\"https://root.cern.ch/doc/master/classROOT_1_1Math_1_1OneDimMultiFunctionAdapter.html\",\"WARC-Payload-Digest\":\"sha1:BL5NUEMTEOWREPPUILOZZRFWLFNPRJTQ\",\"WARC-Block-Digest\":\"sha1:RMLHBT2NNF6D2A3OYANZLKRJKKOI4XFZ\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510676.40_warc_CC-MAIN-20230930113949-20230930143949-00547.warc.gz\"}"}