Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI::Functions::Function1d_d2 Class Reference

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::Function1d_d2:

Public Member Functions

LUPI_HOST_DEVICE Function1d_d2 ()
LUPI_HOST_DEVICE Function1d_d2 (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE double evaluate (double a_x1) const
Public Member Functions inherited from MCGIDI::Functions::Function1d_d1
LUPI_HOST_DEVICE Function1d_d1 ()
LUPI_HOST_DEVICE Function1d_d1 (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE double evaluate (double a_x1) const
Public Member Functions inherited from MCGIDI::Functions::Function1d
LUPI_HOST_DEVICE Function1d ()
LUPI_HOST_DEVICE Function1d (double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
LUPI_HOST_DEVICE ~Function1d ()
LUPI_HOST_DEVICE Function1dType type () const
LUPI_HOST_DEVICE String typeString () const
template<typename RNG>
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
LUPI_HOST_DEVICE MCGIDI_VIRTUAL_FUNCTION double evaluate (double a_x1) const MCGIDI_TRUE_VIRTUAL
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)
template<typename RNG>
LUPI_HOST_DEVICE int sampleBoundingInteger (double a_x1, RNG &&a_rng) const
Public Member Functions inherited from MCGIDI::Functions::FunctionBase
LUPI_HOST_DEVICE FunctionBase ()
LUPI_HOST FunctionBase (GIDI::Functions::FunctionForm const &a_function)
LUPI_HOST_DEVICE FunctionBase (int a_dimension, double a_domainMin, double a_domainMax, Interpolation a_interpolation, double a_outerDomainValue=0)
virtual LUPI_HOST_DEVICE ~FunctionBase ()=0
LUPI_HOST_DEVICE Interpolation interpolation () const
LUPI_HOST_DEVICE double domainMin () const
LUPI_HOST_DEVICE double domainMax () const
LUPI_HOST_DEVICE double outerDomainValue () const
LUPI_HOST_DEVICE void serialize (LUPI::DataBuffer &a_buffer, LUPI::DataBuffer::Mode a_mode)

Additional Inherited Members

Protected Attributes inherited from MCGIDI::Functions::Function1d
Function1dType m_type

Detailed Description

Definition at line 102 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ Function1d_d2() [1/2]

◆ Function1d_d2() [2/2]

LUPI_HOST_DEVICE MCGIDI::Functions::Function1d_d2::Function1d_d2 ( double a_domainMin,
double a_domainMax,
Interpolation a_interpolation,
double a_outerDomainValue = 0 )
inline

Definition at line 107 of file MCGIDI_functions.hpp.

107 :
108 Function1d_d1( a_domainMin, a_domainMax, a_interpolation, a_outerDomainValue ) { }

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Functions::Function1d_d2::evaluate ( double a_x1) const

Returns the value of the function at a_x1.

Parameters
a_x1[in] The x-value to evaluate the function at.
Returns
The value of the function at a_x1.

Definition at line 350 of file MCGIDI_functions.cc.

350 {
351
352 double value = 0.0;
353
354 switch( type( ) ) {
356 break;
358 value = static_cast<Constant1d const *>( this )->evaluate( a_x1 );
359 break;
361 value = static_cast<XYs1d const *>( this )->evaluate( a_x1 );
362 break;
364 value = static_cast<Polynomial1d const *>( this )->evaluate( a_x1 );
365 break;
367 value = static_cast<Gridded1d const *>( this )->evaluate( a_x1 );
368 break;
370 value = static_cast<Branching1d const *>( this )->evaluate( a_x1 );
371 break;
372 default: // This should never happend.
373 String message( "Function1d_d2::evaluate: Unsupported Function1d_d2 " + typeString( ) );
374 LUPI_THROW( message.c_str( ) );
375 }
376
377 return( value );
378}
#define LUPI_THROW(arg)
LUPI_HOST_DEVICE double evaluate(double a_x1) const
LUPI_HOST_DEVICE String typeString() const
LUPI_HOST_DEVICE Function1dType type() const

Referenced by evaluate().


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