Geant4-11
|
Class for interpolating the of a 1-dimensional function. More...
#include <G4INCLInterpolationTable.hh>
Public Types | |
typedef G4double(*const | ManipulatorFunc) (const G4double) |
Typedef to simplify the syntax of inverseCDFTable. More... | |
Public Member Functions | |
std::vector< G4double > | getNodeAbscissae () const |
std::vector< G4double > | getNodeValues () const |
unsigned int | getNumberOfNodes () const |
virtual G4double | getXMaximum () const |
Return the maximum allowed value of the independent variable. More... | |
virtual G4double | getXMinimum () const |
Return the minimum allowed value of the independent variable. More... | |
virtual G4double | integrate (const G4double x0, const G4double x1, const G4double step=-1.) const |
Integrate the function between two values. More... | |
InterpolationTable (std::vector< G4double > const &x, std::vector< G4double > const &y) | |
InterpolationTable * | inverseCDFTable (ManipulatorFunc fWrap=0, const G4int nNodes=60) const |
Return a pointer to the inverse of the CDF of this function. More... | |
G4double | operator() (const G4double x) const |
Compute the value of the function. More... | |
IFunction1D * | primitive () const |
Return a pointer to the (numerical) primitive to this function. More... | |
std::string | print () const |
virtual | ~InterpolationTable () |
Protected Member Functions | |
void | initDerivatives () |
Initialise the values of the node derivatives. More... | |
InterpolationTable () | |
Protected Attributes | |
std::vector< InterpolationNode > | nodes |
Interpolating nodes. More... | |
G4double | xMax |
Maximum value of the independent variable. More... | |
G4double | xMin |
Minimum value of the independent variable. More... | |
Static Private Attributes | |
static const G4double | integrationCoefficients [] |
Coefficients for numerical integration. More... | |
Class for interpolating the of a 1-dimensional function.
Definition at line 106 of file G4INCLInterpolationTable.hh.
Typedef to simplify the syntax of inverseCDFTable.
Definition at line 93 of file G4INCLIFunction1D.hh.
G4INCL::InterpolationTable::InterpolationTable | ( | std::vector< G4double > const & | x, |
std::vector< G4double > const & | y | ||
) |
Definition at line 54 of file G4INCLInterpolationTable.cc.
References initDerivatives(), and nodes.
|
inlinevirtual |
Definition at line 109 of file G4INCLInterpolationTable.hh.
|
protected |
Definition at line 52 of file G4INCLInterpolationTable.cc.
std::vector< G4double > G4INCL::InterpolationTable::getNodeAbscissae | ( | ) | const |
Definition at line 67 of file G4INCLInterpolationTable.cc.
References G4INCL::InterpolationNode::getX(), nodes, and G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform().
std::vector< G4double > G4INCL::InterpolationTable::getNodeValues | ( | ) | const |
Definition at line 74 of file G4INCLInterpolationTable.cc.
References G4INCL::InterpolationNode::getY(), nodes, and G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform().
|
inline |
|
inlinevirtualinherited |
Return the maximum allowed value of the independent variable.
Definition at line 75 of file G4INCLIFunction1D.hh.
References G4INCL::IFunction1D::xMax.
Referenced by G4INCL::IFunction1D::inverseCDFTable(), G4INCL::InvFInterpolationTable::InvFInterpolationTable(), and G4INCL::IFunction1D::primitive().
|
inlinevirtualinherited |
Return the minimum allowed value of the independent variable.
Definition at line 72 of file G4INCLIFunction1D.hh.
References G4INCL::IFunction1D::xMin.
Referenced by G4INCL::IFunction1D::inverseCDFTable(), G4INCL::InvFInterpolationTable::InvFInterpolationTable(), and G4INCL::IFunction1D::primitive().
|
protected |
Initialise the values of the node derivatives.
Definition at line 81 of file G4INCLInterpolationTable.cc.
References nodes.
Referenced by InterpolationTable(), and G4INCL::InvFInterpolationTable::InvFInterpolationTable().
|
virtualinherited |
Integrate the function between two values.
x0 | lower integration bound |
x1 | upper integration bound |
step | largest integration step size; if <0, 45 steps will be used |
Definition at line 66 of file G4INCLIFunction1D.cc.
References G4INCL::IFunction1D::integrationCoefficients, G4INCL::Math::max(), G4INCL::Math::min(), G4INCL::IFunction1D::operator()(), G4INCL::Math::sign(), G4INCL::IFunction1D::xMax, and G4INCL::IFunction1D::xMin.
|
inherited |
Return a pointer to the inverse of the CDF of this function.
The function parameter fWrap is wrapped around the return value of operator(). If fWrap=NULL (default), fWrap=identity.
Definition at line 123 of file G4INCLIFunction1D.cc.
References G4INCL::IFunction1D::getXMaximum(), G4INCL::IFunction1D::getXMinimum(), G4INCL::IFunction1D::IFunction1D(), G4INCL::Math::min(), G4INCL::IFunction1D::operator()(), G4INCL::IFunction1D::xMax, and G4INCL::IFunction1D::xMin.
Referenced by G4INCL::NuclearDensityFactory::createPCDFTable(), G4INCL::NuclearDensityFactory::createRCDFTable(), and G4INCL::NuclearDensityFactory::createRPCorrelationTable().
Compute the value of the function.
Implements G4INCL::IFunction1D.
Definition at line 91 of file G4INCLInterpolationTable.cc.
References nodes.
|
inherited |
Return a pointer to the (numerical) primitive to this function.
Definition at line 105 of file G4INCLIFunction1D.cc.
References G4INCL::IFunction1D::getXMaximum(), G4INCL::IFunction1D::getXMinimum(), G4INCL::IFunction1D::IFunction1D(), G4INCL::IFunction1D::operator()(), Primitive, and G4INCL::IFunction1D::xMin.
std::string G4INCL::InterpolationTable::print | ( | ) | const |
Definition at line 108 of file G4INCLInterpolationTable.cc.
References CLHEP::detail::n, and nodes.
Referenced by G4INCL::NuclearDensityFactory::createPCDFTable(), G4INCL::NuclearDensityFactory::createRCDFTable(), and G4INCL::NuclearDensityFactory::createRPCorrelationTable().
|
staticprivateinherited |
Coefficients for numerical integration.
Definition at line 110 of file G4INCLIFunction1D.hh.
Referenced by G4INCL::IFunction1D::integrate().
|
protected |
Interpolating nodes.
Definition at line 128 of file G4INCLInterpolationTable.hh.
Referenced by getNodeAbscissae(), getNodeValues(), getNumberOfNodes(), initDerivatives(), InterpolationTable(), G4INCL::InvFInterpolationTable::InvFInterpolationTable(), operator()(), and print().
|
protectedinherited |
Maximum value of the independent variable.
Definition at line 106 of file G4INCLIFunction1D.hh.
Referenced by G4INCL::IFunction1D::getXMaximum(), G4INCL::IFunction1D::integrate(), and G4INCL::IFunction1D::inverseCDFTable().
|
protectedinherited |
Minimum value of the independent variable.
Definition at line 104 of file G4INCLIFunction1D.hh.
Referenced by G4INCL::IFunction1D::getXMinimum(), G4INCL::IFunction1D::integrate(), G4INCL::IFunction1D::inverseCDFTable(), and G4INCL::IFunction1D::primitive().