GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMSMathAlgorithms.hh File Reference

Definitions of miscellaneous mathematical functions. More...

Include dependency graph for GGEMSMathAlgorithms.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GGint BinarySearchLeft (GGfloat const key, GGfloat const *array, GGint const size, GGint const offset, GGint min)
 Find the index of the key value in the p_array buffer. More...
 
GGfloat LinearInterpolation (GGfloat const xa, GGfloat const ya, GGfloat const xb, GGfloat const yb, GGfloat const x)
 interpolate the x value between point A and B More...
 
GGfloat LogLogInterpolation (GGfloat x, GGfloat x0, GGfloat y0, GGfloat x1, GGfloat y1)
 log log interpolation of the x value between point (x0,y0) and (x1,y1) More...
 

Detailed Description

Definitions of miscellaneous mathematical functions.

Author
Julien BERT julie.nosp@m.n.be.nosp@m.rt@un.nosp@m.iv-b.nosp@m.rest..nosp@m.fr
Didier BENOIT didie.nosp@m.r.be.nosp@m.noit@.nosp@m.inse.nosp@m.rm.fr
LaTIM, INSERM - U1101, Brest, FRANCE
Version
1.0
Date
Thrusday December 18, 2019

Definition in file GGEMSMathAlgorithms.hh.

Function Documentation

◆ BinarySearchLeft()

GGint BinarySearchLeft ( GGfloat const  key,
GGfloat const *  array,
GGint const  size,
GGint const  offset,
GGint  min 
)
inline

Find the index of the key value in the p_array buffer.

Parameters
key- value in p_array to find
array- p_array where is the key value
size- size of p_array, number of elements
offset- apply offset when searching index (optionnal)
min- apply a min index (optionnal)
Returns
index of key value in p_array buffer

Definition at line 49 of file GGEMSMathAlgorithms.hh.

◆ LinearInterpolation()

GGfloat LinearInterpolation ( GGfloat const  xa,
GGfloat const  ya,
GGfloat const  xb,
GGfloat const  yb,
GGfloat const  x 
)
inline

interpolate the x value between point A and B

Parameters
xa- Coordinate x of point A
ya- Coordinate y of point A
xb- Coordinate x of point B
yb- Coordinate y of point B
x- value to interpolate
Returns
the interpolated value

Definition at line 86 of file GGEMSMathAlgorithms.hh.

◆ LogLogInterpolation()

GGfloat LogLogInterpolation ( GGfloat  x,
GGfloat  x0,
GGfloat  y0,
GGfloat  x1,
GGfloat  y1 
)
inline

log log interpolation of the x value between point (x0,y0) and (x1,y1)

Parameters
x0- Coordinate x0 of point A
y0- Coordinate y0 of point A
x1- Coordinate x1 of point B
y1- Coordinate y1 of point B
x- value to interpolate
Returns
the loglog interpolated value

Definition at line 108 of file GGEMSMathAlgorithms.hh.