Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

math_util.cpp File Reference

contains implentations of math utilities. More...

Include dependency graph for math_util.cpp:

Include dependency graph

Go to the source code of this file.

Defines

#define EULER   0.5772156649
#define MAXIT   100
#define FPMIN   1.0e-30
#define EPS   6.0e-8

Functions

double Lin_Lin (double x_mid, double x_0, double y_0, double x_1, double y_1)
 Interpolates between two points as lin-lin.

double Log_Lin (double x_mid, double x_0, double y_0, double x_1, double y_1)
 Interpolates between two points as log-lin.

double Lin_Log (double x_mid, double x_0, double y_0, double x_1, double y_1)
 Interpolates between two points as lin-log.

double Log_Log (double x_mid, double x_0, double y_0, double x_1, double y_1)
 Interpolates between two points as log-log.

double maxE_loglog (double xi, double alpha)
 Determine maximum error in lin-lin interpolation of log-log data.

double c_d1mach (int I)
double c_d9gmit (double a, double x, double algap1, double sgngam, double alx)
double c_d9lgic (double a, double x, double alx)
double c_d9lgit (double a, double x, double algap1)
double c_d9lgmc (double x)
double c_dcsevl (double x, double *cs, int n)
void c_dgamlm (double *xmin, double *xmax)
double c_dgamr (double x)
void c_dlgams (double x, double *dlgam, double *sgngam)
double c_dlngam (double x)
int c_initds (double *os, int nos, double eta)
void c_xermsg (char *Lib, char *Routine, char *Msg, int nError, int level)
void c_xsetf (int k)
int c_xgetf (void)
void c_xerrPrint (char *Lib, char *Routine, char *Msg, int nError, int level)
double c_dgamit (double a, double x)
 Incomplete gamma function.

double c_dgamma (double x)
 Gamma function.

double expint (int n, double x)
 Exponential integral function.


Variables

ENDLClass ENDL
int KONTRL = 2
char StrLevel [4][32]


Detailed Description

Definition in file math_util.cpp.


Define Documentation

#define EPS   6.0e-8
 

Definition at line 894 of file math_util.cpp.

Referenced by add_them_up::check_total_wt(), MF12_list::ENDL_order(), expint(), MF14_list::extra_contin(), MF12_list::find_crossings(), MF12_raw::insert_cross(), two_d_Madland::make_list(), two_d_Watt::make_list(), two_d_Maxwell::make_list(), two_d_evap::make_list(), MF14_list::one_line(), two_d_Watt::set_b(), and dd_list::zeroin().

#define EULER   0.5772156649
 

Definition at line 891 of file math_util.cpp.

Referenced by expint().

#define FPMIN   1.0e-30
 

Definition at line 893 of file math_util.cpp.

Referenced by expint().

#define MAXIT   100
 

Definition at line 892 of file math_util.cpp.

Referenced by expint().


Function Documentation

double c_d1mach int  I  ) 
 

Definition at line 260 of file math_util.cpp.

References c_xermsg().

Referenced by c_d9gmit(), c_d9lgit(), c_d9lgmc(), c_dcsevl(), c_dgamit(), c_dgamlm(), c_dgamma(), and c_dlngam().

double c_d9gmit double  a,
double  x,
double  algap1,
double  sgngam,
double  alx
 

Definition at line 276 of file math_util.cpp.

References c_d1mach(), c_dlngam(), and c_xermsg().

Referenced by c_dgamit().

double c_d9lgic double  a,
double  x,
double  alx
 

Definition at line 344 of file math_util.cpp.

References c_xermsg().

Referenced by c_dgamit().

double c_d9lgit double  a,
double  x,
double  algap1
 

Definition at line 375 of file math_util.cpp.

References c_d1mach(), and c_xermsg().

Referenced by c_dgamit().

double c_d9lgmc double  x  ) 
 

Definition at line 419 of file math_util.cpp.

References c_d1mach(), c_dcsevl(), c_initds(), and c_xermsg().

Referenced by c_dgamma(), and c_dlngam().

double c_dcsevl double  x,
double *  cs,
int  n
 

Definition at line 473 of file math_util.cpp.

References c_d1mach(), and c_xermsg().

Referenced by c_d9lgmc(), and c_dgamma().

c_dgamit double  a,
double  x
 

Parameters:
a 
x This code was translated from the Slatec library. Generalizing Euler's form of the gamma function with variable limit integrals is the definintion of the incomplete gamma function,

\[ \gamma (a,x) = \frac{ \int^x_0 t^{a-1} e^{-t} dt}{\Gamma (a) x^a } \,\,\, . \]

Definition at line 509 of file math_util.cpp.

References c_d1mach(), c_d9gmit(), c_d9lgic(), c_d9lgit(), c_dgamr(), c_dlgams(), c_dlngam(), and c_xermsg().

Referenced by one_d_Madland::g().

void c_dgamlm double *  xmin,
double *  xmax
 

Definition at line 569 of file math_util.cpp.

References c_d1mach(), and c_xermsg().

Referenced by c_dgamma().

c_dgamma double  x  ) 
 

Parameters:
x This is the definite integral definition of the gamma function (Euler's form),

\[ \Gamma(a) = \int_0^{\infty} t^{a-1} e^{-t} dt \,\,\,. \]

Definition at line 606 of file math_util.cpp.

References c_d1mach(), c_d9lgmc(), c_dcsevl(), c_dgamlm(), c_initds(), and c_xermsg().

Referenced by c_dgamr(), c_dlngam(), and one_d_Madland::one_d_Madland().

double c_dgamr double  x  ) 
 

Definition at line 721 of file math_util.cpp.

References c_dgamma(), c_dlgams(), c_xgetf(), and c_xsetf().

Referenced by c_dgamit().

void c_dlgams double  x,
double *  dlgam,
double *  sgngam
 

Definition at line 747 of file math_util.cpp.

References c_dlngam().

Referenced by c_dgamit(), and c_dgamr().

double c_dlngam double  x  ) 
 

Definition at line 762 of file math_util.cpp.

References c_d1mach(), c_d9lgmc(), c_dgamma(), and c_xermsg().

Referenced by c_d9gmit(), c_dgamit(), and c_dlgams().

int c_initds double *  os,
int  nos,
double  eta
 

Definition at line 802 of file math_util.cpp.

References c_xermsg().

Referenced by c_d9lgmc(), and c_dgamma().

void c_xermsg char *  Lib,
char *  Routine,
char *  Msg,
int  nError,
int  level
 

Definition at line 828 of file math_util.cpp.

References c_xerrPrint().

Referenced by c_d1mach(), c_d9gmit(), c_d9lgic(), c_d9lgit(), c_d9lgmc(), c_dcsevl(), c_dgamit(), c_dgamlm(), c_dgamma(), c_dlngam(), and c_initds().

void c_xerrPrint char *  Lib,
char *  Routine,
char *  Msg,
int  nError,
int  level
[static]
 

Definition at line 848 of file math_util.cpp.

References StrLevel.

Referenced by c_xermsg(), and c_xsetf().

int c_xgetf void   ) 
 

Definition at line 883 of file math_util.cpp.

References KONTRL.

Referenced by c_dgamr().

void c_xsetf int  k  ) 
 

Definition at line 866 of file math_util.cpp.

References c_xerrPrint(), and KONTRL.

Referenced by c_dgamr().

expint int  n,
double  x
 

Parameters:
n 
x Function to return the exponential integral function,

\[ E_n (x) = \int_1^{\infty} e^{-xt} t^{-n} dt \,\,\, ( x > 0 ) \,\,\,. \]

Definition at line 896 of file math_util.cpp.

References EPS, EULER, FPMIN, MAXIT, and SevereError().

Referenced by one_d_Madland::g().

Lin_Lin double  x_mid,
double  x_0,
double  y_0,
double  x_1,
double  y_1
 

Parameters:
x_mid the "x" position at which the interpolated "y" value is calculated
x_0 the "x" value of the left point used in the extrapolation
y_0 the "y" value of the left point used in the extrapolation
x_1 the "x" value of the right point used in the extrapolation
y_1 the "y" value of the right point used in the extrapolation
Returns the lin-lin interpolated "y" value corresponding to "x_mid" between the two points (x_0,y_0) and (x_1,y_1).

Definition at line 99 of file math_util.cpp.

References SevereError().

Referenced by one_d_evap::list_interp(), one_d_Maxwell::list_interp(), one_d_Watt::list_interp(), one_d_Madland::list_interp(), and one_d_Legendre::list_interp().

Lin_Log double  x_mid,
double  x_0,
double  y_0,
double  x_1,
double  y_1
 

Parameters:
x_mid the "x" position at which the interpolated "y" value is calculated
x_0 the "x" value of the left point used in the extrapolation
y_0 the "y" value of the left point used in the extrapolation
x_1 the "x" value of the right point used in the extrapolation
y_1 the "y" value of the right point used in the extrapolation
Returns the lin-log interpolated "y" value corresponding to "x_mid" between the two points (x_0,y_0) and (x_1,y_1).

Definition at line 132 of file math_util.cpp.

References pastenum(), and SevereError().

Referenced by one_d_table::list_interp(), one_d_evap::list_interp(), one_d_Maxwell::list_interp(), one_d_Watt::list_interp(), one_d_Madland::list_interp(), and one_d_Legendre::list_interp().

Log_Lin double  x_mid,
double  x_0,
double  y_0,
double  x_1,
double  y_1
 

Parameters:
x_mid the "x" position at which the interpolated "y" value is calculated
x_0 the "x" value of the left point used in the extrapolation
y_0 the "y" value of the left point used in the extrapolation
x_1 the "x" value of the right point used in the extrapolation
y_1 the "y" value of the right point used in the extrapolation
Returns the log-lin interpolated "y" value corresponding to "x_mid" between the two points (x_0,y_0) and (x_1,y_1).

Definition at line 110 of file math_util.cpp.

References pastenum(), and SevereError().

Referenced by one_d_table::list_interp(), one_d_evap::list_interp(), one_d_Maxwell::list_interp(), one_d_Watt::list_interp(), one_d_Madland::list_interp(), and one_d_Legendre::list_interp().

Log_Log double  x_mid,
double  x_0,
double  y_0,
double  x_1,
double  y_1
 

Parameters:
x_mid the "x" position at which the interpolated "y" value is calculated
x_0 the "x" value of the left point used in the extrapolation
y_0 the "y" value of the left point used in the extrapolation
x_1 the "x" value of the right point used in the extrapolation
y_1 the "y" value of the right point used in the extrapolation
Returns the log-log interpolated "y" value corresponding to "x_mid" between the two points (x_0,y_0) and (x_1,y_1).

Definition at line 162 of file math_util.cpp.

References SevereError().

Referenced by one_d_evap::list_interp(), one_d_Maxwell::list_interp(), one_d_Watt::list_interp(), one_d_Madland::list_interp(), and one_d_Legendre::list_interp().

double maxE_loglog double  xi,
double  alpha
 

This routine is used in linear interpolation of loglog data. It determines the maximum error for linear interpolation of $ x^\alpha $ on the interval $ 1 < x < x_i $.

Definition at line 188 of file math_util.cpp.

References SevereError().

Referenced by dd_list::LogLog_2_LinLin().


Variable Documentation

ENDLClass ENDL
 

Definition at line 48 of file math_util.cpp.

int KONTRL = 2 [static]
 

Definition at line 233 of file math_util.cpp.

Referenced by c_xgetf(), and c_xsetf().

char StrLevel[4][32] [static]
 

Initial value:

 { { "Informative message" },
  { "Informative message" },
  { "recoverable error" },
  { "fatal error" } }

Definition at line 234 of file math_util.cpp.

Referenced by c_xerrPrint().


Generated on Thu Sep 7 10:34:50 2006 for fete -- From ENDFB6 To ENDL by doxygen 1.3.4