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

#include <MCGIDI_functions.hpp>

Inheritance diagram for MCGIDI::Functions::Function1d_d1:

Public Member Functions

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 86 of file MCGIDI_functions.hpp.

Constructor & Destructor Documentation

◆ Function1d_d1() [1/2]

LUPI_HOST_DEVICE MCGIDI::Functions::Function1d_d1::Function1d_d1 ( )
inline

◆ Function1d_d1() [2/2]

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

Definition at line 91 of file MCGIDI_functions.hpp.

91 :
92 Function1d( a_domainMin, a_domainMax, a_interpolation, a_outerDomainValue ) { }

Member Function Documentation

◆ evaluate()

LUPI_HOST_DEVICE double MCGIDI::Functions::Function1d_d1::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 309 of file MCGIDI_functions.cc.

309 {
310
311 double value = 0.0;
312
313 switch( type( ) ) {
315 break;
317 value = static_cast<Constant1d const *>( this )->evaluate( a_x1 );
318 break;
320 value = static_cast<XYs1d const *>( this )->evaluate( a_x1 );
321 break;
323 value = static_cast<Polynomial1d const *>( this )->evaluate( a_x1 );
324 break;
326 value = static_cast<Gridded1d const *>( this )->evaluate( a_x1 );
327 break;
329 value = static_cast<Regions1d const *>( this )->evaluate( a_x1 );
330 break;
332 value = static_cast<Branching1d const *>( this )->evaluate( a_x1 );
333 break;
334 default:
335 String message( "Function1d_d1::evaluate: Unsupported Function1d_d1 " + typeString( ) );
336 LUPI_THROW( message.c_str( ) );
337 }
338
339 return( value );
340}
#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: