R4LIB
A Single Precision Real Arithmetic Utility Library
R4LIB
is a FORTRAN77 library which
contains a number of utility routines for "R4" or "single precision real"
arithmetic.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
R4LIB is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
C4LIB,
a FORTRAN77 library which
implements certain elementary functions for "C4" or
single precision complex variables;
C8LIB,
a FORTRAN77 library which
implements certain elementary functions for "C8" or
double precision complex variables;
I4LIB,
a FORTRAN77 library which
contains many utility routines, using "I4" or "single precision integer"
arithmetic.
I8LIB,
a FORTRAN77 library which
contains many utility routines, using "I8" or "double precision integer"
arithmetic.
R8LIB,
a FORTRAN77 library which
contains many utility routines, using "R8" or
"double precision real" arithmetic.
SUBPAK,
a FORTRAN77 library which
contains many utility routines;
Source Code:
Examples and Tests:
List of Routines:
-
GET_UNIT returns a free FORTRAN unit number.
-
I4_LOG_10 returns the integer part of the logarithm base 10 of ABS(X).
-
I4_MODP returns the nonnegative remainder of integer division.
-
I4_UNIFORM returns a scaled pseudorandom I4.
-
I4_WRAP forces an I4 to lie between given limits by wrapping.
-
I4INT_TO_R4INT maps an I4INT to an R4INT.
-
I4VEC_INDICATOR sets an I4VEC to the indicator vector.
-
I4VEC_PERMUTE permutes an I4VEC in place.
-
I4VEC_PRINT prints an I4VEC.
-
LEGENDRE_ZEROS computes the zeros of the Legendre polynomial of degree N.
-
PERM_CHECK checks that a vector represents a permutation.
-
PERM_UNIFORM selects a random permutation of N objects.
-
R4_ABS returns the absolute value of an R4.
-
R4_ADD adds two R4's.
-
R4_AINT truncates an R4 argument to an integer.
-
R4_ATAN computes the inverse tangent of the ratio Y / X.
-
R4_CAS returns the "casine" of an R4 value.
-
R4_CEILING rounds an R4 "up" to the nearest integer.
-
R4_CHOOSE computes the binomial coefficient C(N,K) as an R4.
-
R4_CHOP chops an R4 to a given number of binary places.
-
R4_CSQRT returns the complex square root of an R4.
-
R4_CUBE_ROOT returns the cube root of an R4.
-
R4_DIFF computes the difference of two R4's to a specified accuracy.
-
R4_DIGIT returns a particular decimal digit of an R4.
-
R4_EPSILON returns the R4 roundoff unit.
-
R4_EPSILON_COMPUTE returns the R4 roundoff unit.
-
R4_EXP computes the exponential function, avoiding overflow and underflow.
-
R4_FACTORIAL computes the factorial of N.
-
R4_FACTORIAL2 computes the double factorial function.
-
R4_FLOOR rounds an R4 "down" (towards -infinity) to the next integer.
-
R4_FRACTION uses real arithmetic on an integer ratio.
-
R4_FRACTIONAL returns the fraction part of an R4.
-
R4_HUGE returns a "huge" R4.
-
R4_IN_01 is TRUE if an R4 is in the range [0,1].
-
R4_IS_INT determines if an R4 represents an integer value.
-
R4_LOG_2 returns the logarithm base 2 of an R4.
-
R4_LOG_10 returns the logarithm base 10 of an R4.
-
R4_LOG_B returns the logarithm base B of an R4.
-
R4_MANT computes the "mantissa" or "fraction part" of an R4.
-
R4_MOD returns the remainder of R4 division.
-
R4_MODP returns the nonnegative remainder of R4 division.
-
R4_MOP returns the I-th power of -1 as an R4.
-
R4_NINT returns the nearest integer to an R4.
-
R4_NORMAL returns a scaled pseudonormal R4.
-
R4_NORMAL_01 returns a unit pseudonormal real R4.
-
R4_PI returns the value of pi as an R4.
-
R4_POWER computes the P-th power of an R4.
-
R4_POWER_FAST computes an integer power of an R4.
-
R4_PYTHAG computes sqrt ( A * A + B * B ), avoiding overflow and underflow.
-
R4_ROUND_I4 sets an R4 to the nearest integral value, returning an I4
-
R4_ROUND2 rounds an R4 to a specified number of binary digits.
-
R4_ROUNDB rounds an R4 to a given number of digits in a given base.
-
R4_ROUNDX rounds an R4.
-
R4_SIGN returns the sign of an R4.
-
R4_SIGN_OPPOSITE is TRUE if two R4's are not of the same sign.
-
R4_SIGN_OPPOSITE_STRICT is TRUE if two R4's are strictly of opposite sign.
-
R4_SWAP swaps two R4's.
-
R4_SWAP3 swaps three R4's.
-
R4_TINY returns the smallest positive R4.
-
R4_TO_R4_DISCRETE maps R to RD in [RMIN, RMAX] with NR possible values.
-
R4_TO_DHMS converts decimal days into days, hours, minutes, seconds.
-
R4_TO_I4 maps X in [XMIN, XMAX] to integer IX in [IXMIN, IXMAX].
-
R4_UNIFORM returns a scaled pseudorandom R4.
-
R4_UNIFORM_01 returns a unit pseudorandom R4.
-
R4_UNSWAP3 unswaps three R4's.
-
R4_WALSH_1D evaluates the Walsh function.
-
R4_WRAP forces an R4 to lie between given limits by wrapping.
-
R42_CHEBY sets up the Chebyshev abscissas in an R4 interval.
-
R42_DIST_L2 returns the L2 distance between a pair of R42's.
-
R4BLOCK_ZERO zeroes an R4BLOCK.
-
R4COL_COMPARE compares columns in an R4COL.
-
R4COL_DUPLICATES generates an R4COL with some duplicate columns.
-
R4COL_FIND seeks a column value in an R4COL.
-
R4COL_FIRST_INDEX indexes the first occurrence of values in an R4COL.
-
R4COL_INSERT inserts a column into an R4COL.
-
R4COL_MAX returns the maximums in an R4COL.
-
R4COL_MAX_INDEX returns the indices of column maximums in an R4COL.
-
R4COL_MAX_ONE rescales an R4COL so each column maximum is 1.
-
R4COL_MEAN returns the column means of an R4COL.
-
R4COL_MIN returns the minimums in an R4COL.
-
R4COL_MIN_INDEX returns the indices of column minimums in an R4COL.
-
R4COL_NORMALIZE_LI normalizes an R4COL with the column infinity norm.
-
R4COL_PART_QUICK_A reorders the columns of an array as part of a quick sort.
-
R4COL_PERMUTE permutes an R4COL in place.
-
R4COL_SORT_HEAP_A ascending heapsorts an R4COL.
-
R4COL_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R4COL.
-
R4COL_SORT_QUICK_A ascending sorts the columns of a table using quick sort.
-
R4COL_SORTED_TOL_UNDEX: tolerably unique indexes for a sorted R4COL.
-
R4COL_SORTED_TOL_UNIQUE keeps tolerably unique elements in a sorted R4COL.
-
R4COL_SORTED_TOL_UNIQUE_COUNT counts tolerably unique elements in a sorted R4COL.
-
R4COL_SORTED_UNDEX returns unique sorted indexes for a sorted R4COL.
-
R4COL_SORTED_UNIQUE keeps unique elements in a sorted R4COL.
-
R4COL_SORTED_UNIQUE_COUNT counts unique elements in a sorted R4COL.
-
R4COL_SORTR_A ascending sorts one column of an R4COL, adjusting all columns.
-
R4COL_SUM sums the columns of an R4COL.
-
R4COL_SWAP swaps columns I and J of an R4COL.
-
R4COL_TO_R4VEC converts an R4COL to an R4VEC.
-
R4COL_TOL_UNDEX indexes tolerably unique entries of an R4COL.
-
R4COL_TOL_UNIQUE_COUNT counts tolerably unique entries in an R4COL.
-
R4COL_TOL_UNIQUE_INDEX indexes tolerably unique entries in an R4COL.
-
R4COL_UNDEX indexes unique entries of an R4COL.
-
R4COL_UNIFORM_ABVEC fills an R4COL with pseudorandom values.
-
R4COL_UNIQUE_COUNT counts the unique columns in an unsorted R4COL.
-
R4COL_UNIQUE_INDEX indexes the first occurrence of values in an R4COL.
-
R4COL_VARIANCE returns the variances of an R4COL.
-
R4MAT_BORDER_ADD adds a "border" to an R4MAT.
-
R4MAT_COPY copies an R4MAT.
-
R4MAT_IDENTITY stores the identity matrix in an R4MAT.
-
R4MAT_INDICATOR sets up an "indicator" R4MAT.
-
R4MAT_MAX returns the maximum entry of an R4MAT.
-
R4MAT_MIN returns the minimum entry of an R4MAT.
-
R4MAT_MM multiplies two R4MAT's.
-
R4MAT_NORM_L1 returns the matrix L1 norm of an R4MAT.
-
R4MAT_PRINT prints an R4MAT.
-
R4MAT_PRINT_SOME prints some of an R4MAT.
-
R4VEC_COPY copies an R4VEC.
-
R4VEC_DOT_PRODUCT finds the dot product of a pair of R4VEC's.
-
R4VEC_HEAP_A reorders an R4VEC into an ascending heap.
-
R4VEC_HEAP_D reorders an R4VEC into an descending heap.
-
R4VEC_MAX returns the maximum value in an R4VEC.
-
R4VEC_MEAN returns the mean of an R4VEC.
-
R4VEC_MIN returns the minimum value in an R4VEC.
-
R4VEC_NORM returns the L2 norm of an R4VEC.
-
R4VEC_NORM_L1 returns the L1 norm of an R4VEC.
-
R4VEC_NORM_L2 returns the L2 norm of an R4VEC.
-
R4VEC_NORMAL_01 returns a unit pseudonormal R4VEC.
-
R4VEC_PERMUTE_CYCLIC performs a cyclic permutation of an R4VEC.
-
R4VEC_PRINT prints an R4VEC.
-
R4VEC_PRINT_PART prints "part" of an R4VEC.
-
R4VEC_PRINT_SOME prints "some" of an R4VEC.
-
R4VEC_SORT_BUBBLE_A ascending sorts an R4VEC using bubble sort.
-
R4VEC_UNIFORM returns a scaled pseudorandom R4VEC.
-
R4VEC_UNIFORM_01 returns a unit pseudorandom R4VEC.
-
R4VEC_VARIANCE returns the variance of an R4VEC.
-
TIMESTAMP prints out the current YMDHMS date as a timestamp.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 13 April 2013.