Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JTOOLS::JExternalFunction1D< JArgument_t, JResult_t > Class Template Reference

Template implementation of function object in one dimension using an external function. More...

#include <JFunctionObject1D.hh>

Inheritance diagram for JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >:
JTOOLS::JFunction1D< JArgument_t, JResult_t > JTOOLS::JFunction< JArgument_t, JResult_t > JTOOLS::JFunctional< JArgument_t, JResult_t >

Public Types

typedef JFunction1D< JArgument_t, JResult_t > function_type
 
typedef function_type::argument_type argument_type
 
typedef function_type::result_type result_type
 
typedef result_type(*) pointerToFunction(const argument_type)
 
enum  { NUMBER_OF_DIMENSIONS = 1 }
 
typedef JFunctional< JArgument_t, JResult_t > functional_type
 
typedef functional_type::JExceptionHandler JExceptionHandler
 
typedef JSupervisor supervisor_type
 

Public Member Functions

 JExternalFunction1D (pointerToFunction function)
 Constructor.
 
virtual result_type evaluate (const argument_type *pX) const override
 Function value evaluation.
 
result_type operator() (const argument_type x) const
 Function value evaluation.
 
const JSupervisorgetSupervisor () const
 Get supervisor.
 
const JExceptionHandlergetExceptionHandler () const override
 Get exception handler.
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions.
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation.
 
static JClass< result_type >::argument_type getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation.
 

Protected Member Functions

virtual void do_compile () override
 Function compilation.
 

Protected Attributes

pointerToFunction __f
 
JSupervisor __supervisor
 

Detailed Description

template<class JArgument_t, class JResult_t>
class JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >

Template implementation of function object in one dimension using an external function.

This class implements the JFunction1D interface.

Definition at line 31 of file JFunctionObject1D.hh.

Member Typedef Documentation

◆ function_type

template<class JArgument_t , class JResult_t >
JFunction1D<JArgument_t, JResult_t> JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::function_type

Definition at line 36 of file JFunctionObject1D.hh.

◆ argument_type

template<class JArgument_t , class JResult_t >
function_type::argument_type JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::argument_type

Definition at line 37 of file JFunctionObject1D.hh.

◆ result_type

template<class JArgument_t , class JResult_t >
function_type::result_type JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::result_type

Definition at line 38 of file JFunctionObject1D.hh.

◆ pointerToFunction

template<class JArgument_t , class JResult_t >
result_type(*) JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::pointerToFunction(const argument_type)

Definition at line 40 of file JFunctionObject1D.hh.

◆ functional_type

template<class JArgument_t , class JResult_t >
JFunctional<JArgument_t, JResult_t> JTOOLS::JFunction1D< JArgument_t, JResult_t >::functional_type
inherited

Definition at line 332 of file JFunctional.hh.

◆ JExceptionHandler

template<class JArgument_t , class JResult_t >
functional_type::JExceptionHandler JTOOLS::JFunction< JArgument_t, JResult_t >::JExceptionHandler
inherited

Definition at line 235 of file JFunctional.hh.

◆ supervisor_type

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunction< JArgument_t, JResult_t >::supervisor_type
inherited

Definition at line 237 of file JFunctional.hh.

Member Enumeration Documentation

◆ anonymous enum

template<class JArgument_t , class JResult_t >
anonymous enum
inherited
Enumerator
NUMBER_OF_DIMENSIONS 

Definition at line 330 of file JFunctional.hh.

Constructor & Destructor Documentation

◆ JExternalFunction1D()

template<class JArgument_t , class JResult_t >
JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::JExternalFunction1D ( pointerToFunction function)
inline

Constructor.

Parameters
functionpointer to function

Definition at line 48 of file JFunctionObject1D.hh.

48 :
50 __f(function)
51 {}
JFunction1D< JArgument_t, JResult_t > function_type

Member Function Documentation

◆ evaluate()

template<class JArgument_t , class JResult_t >
virtual result_type JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::evaluate ( const argument_type * pX) const
inlineoverridevirtual

Function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value

Implements JTOOLS::JFunctional< JArgument_t, JResult_t >.

Definition at line 60 of file JFunctionObject1D.hh.

61 {
62 return __f(*pX);
63 }

◆ do_compile()

template<class JArgument_t , class JResult_t >
virtual void JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::do_compile ( )
inlineoverrideprotectedvirtual

Function compilation.

Definition at line 70 of file JFunctionObject1D.hh.

71 {}

◆ operator()()

template<class JArgument_t , class JResult_t >
result_type JTOOLS::JFunction1D< JArgument_t, JResult_t >::operator() ( const argument_type x) const
inlineinherited

Function value evaluation.

Parameters
xargument value
Returns
function value

Definition at line 343 of file JFunctional.hh.

344 {
345 return this->evaluate(&x);
346 }
virtual result_type evaluate(const argument_type *pX) const =0
Recursive function value evaluation.

◆ getSupervisor()

template<class JArgument_t , class JResult_t >
const JSupervisor & JTOOLS::JFunction< JArgument_t, JResult_t >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 290 of file JFunctional.hh.

291 {
292 return __supervisor;
293 }
JSupervisor __supervisor

◆ getExceptionHandler()

template<class JArgument_t , class JResult_t >
const JExceptionHandler & JTOOLS::JFunction< JArgument_t, JResult_t >::getExceptionHandler ( ) const
inlineoverridevirtualinherited

Get exception handler.

Returns
exception handler

Implements JTOOLS::JFunctional< JArgument_t, JResult_t >.

Definition at line 301 of file JFunctional.hh.

302 {
303 return *__supervisor.handler;
304 }
std::shared_ptr< JExceptionHandler > handler

◆ setExceptionHandler()

template<class JArgument_t , class JResult_t >
void JTOOLS::JFunction< JArgument_t, JResult_t >::setExceptionHandler ( const JSupervisor & supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 312 of file JFunctional.hh.

313 {
314 this->__supervisor = supervisor;
315 }

◆ getValue() [1/2]

template<class JArgument_t , class JResult_t >
static result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( const JFunctional< JArgument_t, JResult_t > & function,
const argument_type * pX )
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 103 of file JFunctional.hh.

105 {
106 return function.evaluate(pX);
107 }

◆ getValue() [2/2]

template<class JArgument_t , class JResult_t >
static JClass< result_type >::argument_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( typename JClass< result_type >::argument_type value,
const argument_type * pX )
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 117 of file JFunctional.hh.

119 {
120 return value;
121 }

Member Data Documentation

◆ __f

template<class JArgument_t , class JResult_t >
pointerToFunction JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >::__f
protected

Definition at line 74 of file JFunctionObject1D.hh.

◆ __supervisor

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunction< JArgument_t, JResult_t >::__supervisor
protectedinherited

Definition at line 318 of file JFunctional.hh.


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