For Programmers: Free Programming Magazines  


Home > Archive > Fortran > July 2004 > add nonuniform RNG and special functions to Fortran?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author add nonuniform RNG and special functions to Fortran?
beliavsky@aol.com

2004-07-21, 3:58 pm

There are several proposals in the C++0x standard that are aimed at
programmers doing numerical work, in the areas of

(1) random number generation -- see
http://www.open-std.org/jtc1/sc22/w.../2004/n1588.pdf

(2) mathematical special functions -- see
http://www.open-std.org/jtc1/sc22/w.../2003/n1542.pdf

(3) statistical special functions (cannot find a working link at
present)

Since there exist C libraries to do all these things, I doubt that
adding them to the C and C++ standards is a good idea. I wonder what
response, if any, there should be from the Fortran community. I do NOT
think that more RNG's or special functions should be MANDATED, but
perhaps the standards committee could specify module and procedure
names and make it optional for compiler vendors to implement the
procedures.

For example, a module random_number_mod could be defined with
subroutines such as random_normal, and the compiler could check during
compilation whether the subroutine had been implemented.

I am not enthusiastic about this suggestion -- I would rather grab
some public domain code from Netlib than get too dependent on a
compiler vendor -- but maybe it should be considered as a defensive
measure to avoid the perception that Fortran has "fallen behind" C++
in its core domain of numerical work. One advantage a Fortran language
implementation of special functions and RNG's could have over the C++
version is that the special functions could be made ELEMENTAL, and the
RNG's could work for both scalars and arrays of any dimension.

In more detail, the proposed C++ RNG's are

integer
uniform
normal
geometric
floating-point uniform
binomial
Poisson
exponential
gamma
Bernoulli

The proposed math special functions are (C++ function names)

assoc_laguerre
assoc_legendre
beta
comp_ellint_1
comp_ellint_2
comp_ellint_3
conf_hyperg
cyl_bessel_i
cyl_bessel_j
cyl_bessel_k
cyl_neumann
ellint_1
ellint_2
ellint_e
erfc
erf
expint
hermite
hyperg
laguerre
legendre
riemann_zeta
sph_bessel
sph_legendre
sph_neumann
tgamma

An incomplete list of the cumulative and inverse cumulative
distribution
functions to be added are

normal
Student t
chi-squared
beta
gamma
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com