Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields | Static Protected Member Functions
c2_transformation< float_type > Class Template Reference

a transformation of a coordinate, including an inverse More...

#include <c2_function.hh>

Inheritance diagram for c2_transformation< float_type >:
c2_transformation_linear< float_type > c2_transformation_log< float_type > c2_transformation_recip< float_type >

Public Member Functions

 c2_transformation (bool transformed, float_type(*xin)(float_type), float_type(*xinp)(float_type), float_type(*xinpp)(float_type), float_type(*xout)(float_type))
 initialize all our function pointers More...
 
 c2_transformation (bool transformed)
 initialize all our function pointers so that only the (overridden) virtual functions can be called without an error More...
 
virtual ~c2_transformation ()
 the destructor More...
 
virtual float_type fIn (float_type x) const
 virtual input X transform More...
 
virtual float_type fInPrime (float_type x) const
 virtual input X transform derivative More...
 
virtual float_type fInDPrime (float_type x) const
 virtual input X transform second derivative More...
 
virtual float_type fOut (float_type x) const
 virtual output X transform More...
 

Data Fields

const bool fTransformed
 flag to indicate if this transform is not the identity More...
 
const bool fHasStaticTransforms
 flag to indicate if the static function pointers can be used for efficiency More...
 
float_type(*const pIn )(float_type)
 non-virtual pointer to input X transform More...
 
float_type(*const pInPrime )(float_type)
 non-virtual pointer to input X transform derivative More...
 
float_type(*const pInDPrime )(float_type)
 non-virtual pointer to input X transform second derivative More...
 
float_type(*const pOut )(float_type)
 non-virtual pointer to output X transform More...
 

Static Protected Member Functions

static float_type report_error (float_type x)
 utility function for unimplemented conversion More...
 
static float_type ident (float_type x)
 utility function f(x)=x useful in axis transforms More...
 
static float_type one (float_type)
 utility function f(x)=1 useful in axis transforms More...
 
static float_type zero (float_type)
 utility function f(x)=0 useful in axis transforms More...
 
static float_type recip (float_type x)
 utility function f(x)=1/x useful in axis transforms More...
 
static float_type recip_prime (float_type x)
 utility function f(x)=-1/x**2 useful in axis transforms More...
 
static float_type recip_prime2 (float_type x)
 utility function f(x)=2/x**3 useful in axis transforms More...
 

Detailed Description

template<typename float_type>
class c2_transformation< float_type >

a transformation of a coordinate, including an inverse

Definition at line 1149 of file c2_function.hh.

Constructor & Destructor Documentation

template<typename float_type>
c2_transformation< float_type >::c2_transformation ( bool  transformed,
float_type(*)(float_type)  xin,
float_type(*)(float_type)  xinp,
float_type(*)(float_type)  xinpp,
float_type(*)(float_type)  xout 
)
inline

initialize all our function pointers

Parameters
transformedtrue if this function is not the identity
xininput X transform
xinpinput X transform derivative
xinppinput X transform second derivative
xoutoutput X transform, which MUST be the inverse of xin

Definition at line 1157 of file c2_function.hh.

1159  :
1160  fTransformed(transformed), fHasStaticTransforms(true),
1161  pIn(xin), pInPrime(xinp), pInDPrime(xinpp), pOut(xout) { }
const bool fTransformed
flag to indicate if this transform is not the identity
float_type(*const pOut)(float_type)
non-virtual pointer to output X transform
float_type(*const pInDPrime)(float_type)
non-virtual pointer to input X transform second derivative
float_type(*const pIn)(float_type)
non-virtual pointer to input X transform
float_type(*const pInPrime)(float_type)
non-virtual pointer to input X transform derivative
const bool fHasStaticTransforms
flag to indicate if the static function pointers can be used for efficiency
template<typename float_type>
c2_transformation< float_type >::c2_transformation ( bool  transformed)
inline

initialize all our function pointers so that only the (overridden) virtual functions can be called without an error

Parameters
transformedtrue if this function is nonlinear

Definition at line 1165 of file c2_function.hh.

1165  :
1166  fTransformed(transformed), fHasStaticTransforms(false),
const bool fTransformed
flag to indicate if this transform is not the identity
float_type(*const pOut)(float_type)
non-virtual pointer to output X transform
float_type(*const pInDPrime)(float_type)
non-virtual pointer to input X transform second derivative
float_type(*const pIn)(float_type)
non-virtual pointer to input X transform
float_type(*const pInPrime)(float_type)
non-virtual pointer to input X transform derivative
static float_type report_error(float_type x)
utility function for unimplemented conversion
const bool fHasStaticTransforms
flag to indicate if the static function pointers can be used for efficiency
template<typename float_type>
virtual c2_transformation< float_type >::~c2_transformation ( )
inlinevirtual

the destructor

Definition at line 1169 of file c2_function.hh.

1169 { }

Member Function Documentation

template<typename float_type>
virtual float_type c2_transformation< float_type >::fIn ( float_type  x) const
inlinevirtual

virtual input X transform

Definition at line 1187 of file c2_function.hh.

References c2_transformation< float_type >::pIn.

1187 { return pIn(x); }
float_type(*const pIn)(float_type)
non-virtual pointer to input X transform
template<typename float_type>
virtual float_type c2_transformation< float_type >::fInDPrime ( float_type  x) const
inlinevirtual

virtual input X transform second derivative

Definition at line 1191 of file c2_function.hh.

References c2_transformation< float_type >::pInDPrime.

1191 { return pInDPrime(x); }
float_type(*const pInDPrime)(float_type)
non-virtual pointer to input X transform second derivative
template<typename float_type>
virtual float_type c2_transformation< float_type >::fInPrime ( float_type  x) const
inlinevirtual

virtual input X transform derivative

Definition at line 1189 of file c2_function.hh.

References c2_transformation< float_type >::pInPrime.

1189 { return pInPrime(x); }
float_type(*const pInPrime)(float_type)
non-virtual pointer to input X transform derivative
template<typename float_type>
virtual float_type c2_transformation< float_type >::fOut ( float_type  x) const
inlinevirtual

virtual output X transform

Definition at line 1193 of file c2_function.hh.

References c2_transformation< float_type >::pOut.

1193 { return pOut(x); }
float_type(*const pOut)(float_type)
non-virtual pointer to output X transform
template<typename float_type>
static float_type c2_transformation< float_type >::ident ( float_type  x)
inlinestaticprotected

utility function f(x)=x useful in axis transforms

Definition at line 1199 of file c2_function.hh.

References test::x.

Referenced by dcdmas(), lunpik(), phint(), phochk(), and phoene().

1199 { return x; }
template<typename float_type>
static float_type c2_transformation< float_type >::one ( float_type  )
inlinestaticprotected

utility function f(x)=1 useful in axis transforms

Definition at line 1201 of file c2_function.hh.

Referenced by absorp(), daltra(), defaux(), elhain(), ficonf(), habint(), hadri1(), hafdi1(), hafdis(), hamult(), harkin(), hax1x2(), hisout(), inucas(), kkinc(), lortrp(), ltini(), mashel(), nclpot(), prblm2(), qrblm2(), resncl(), rm48(), samppt(), scn4ba(), sigmas(), sihnab(), var(), vegas(), xcheck(), xptfl(), xptfl1(), and xsglau().

1201 { return 1; }
template<typename float_type>
static float_type c2_transformation< float_type >::recip ( float_type  x)
inlinestaticprotected

utility function f(x)=1/x useful in axis transforms

Definition at line 1205 of file c2_function.hh.

References test::x.

1205 { return 1.0/x; }
template<typename float_type>
static float_type c2_transformation< float_type >::recip_prime ( float_type  x)
inlinestaticprotected

utility function f(x)=-1/x**2 useful in axis transforms

Definition at line 1207 of file c2_function.hh.

References test::x.

1207 { return -1/(x*x); }
template<typename float_type>
static float_type c2_transformation< float_type >::recip_prime2 ( float_type  x)
inlinestaticprotected

utility function f(x)=2/x**3 useful in axis transforms

Definition at line 1209 of file c2_function.hh.

References test::x.

1209 { return 2/(x*x*x); }
template<typename float_type>
static float_type c2_transformation< float_type >::report_error ( float_type  x)
inlinestaticprotected

utility function for unimplemented conversion

Definition at line 1197 of file c2_function.hh.

References test::x.

1197 { throw c2_exception("use of improperly constructed axis transform"); return x; }
the exception class for c2_function operations.
Definition: c2_function.hh:65
template<typename float_type>
static float_type c2_transformation< float_type >::zero ( float_type  )
inlinestaticprotected

Field Documentation

template<typename float_type>
const bool c2_transformation< float_type >::fHasStaticTransforms

flag to indicate if the static function pointers can be used for efficiency

Definition at line 1173 of file c2_function.hh.

template<typename float_type>
const bool c2_transformation< float_type >::fTransformed

flag to indicate if this transform is not the identity

Definition at line 1171 of file c2_function.hh.

template<typename float_type>
float_type(* const c2_transformation< float_type >::pIn)(float_type)

non-virtual pointer to input X transform

Note
the pointers to functions allow highly optimized access when static functions are available. They are only used inside value_with_derivatives(), which is assumed to be the most critical routine.

Definition at line 1178 of file c2_function.hh.

Referenced by c2_transformation< float_type >::fIn().

template<typename float_type>
float_type(* const c2_transformation< float_type >::pInDPrime)(float_type)

non-virtual pointer to input X transform second derivative

Definition at line 1182 of file c2_function.hh.

Referenced by c2_transformation< float_type >::fInDPrime().

template<typename float_type>
float_type(* const c2_transformation< float_type >::pInPrime)(float_type)

non-virtual pointer to input X transform derivative

Definition at line 1180 of file c2_function.hh.

Referenced by c2_transformation< float_type >::fInPrime().

template<typename float_type>
float_type(* const c2_transformation< float_type >::pOut)(float_type)

non-virtual pointer to output X transform

Definition at line 1184 of file c2_function.hh.

Referenced by c2_transformation< float_type >::fOut().


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