C4LIB
A Single Precision Complex Arithmetic Utility Library
C4LIB
is a FORTRAN77 library which
implements certain
elementary functions for single precision complex variables.
The symbol "C4" is used to suggest a single precision complex
variable. Here the 4 indicates that the underlying pair of
real numbers each use 4 bytes of storage.
C4LIB contains routines that operate on scalars, vectors or
doubly dimensioned arrays of C4's. A vector of C4's is denoted
a C4VEC, and a doubly dimensioned array is a C4MAT.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
C4LIB 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:
BLAS1_C,
a FORTRAN77 library which
contains basic linear algebra routines for vector-vector operations,
using single precision complex arithmetic.
C8LIB,
a FORTRAN77 library which
implements certain elementary functions for "C8" or double precision complex variables.
COMPLEX_NUMBERS,
a FORTRAN77 program which
demonstrates some simple features involved in the use of
complex numbers in FORTRAN77 programming.
FN,
a FORTRAN77 library which
contains routines by Wayne Fullerton for evaluating elementary
and special functions.
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.
LINPACK_C,
a FORTRAN77 library which
solves linear systems using single precision complex arithmetic;
R4LIB,
a FORTRAN77 library which
contains many utility routines, using "R4" or "single precision real" arithmetic.
R8LIB,
a FORTRAN77 library which
contains many utility routines, using "R8" or
"double precision real" arithmetic.
Source Code:
Examples and Tests:
List of Routines:
-
C4_ABS evaluates the absolute value of a C4.
-
C4_ACOS evaluates the inverse cosine of a C4.
-
C4_ACOSH evaluates the inverse hyperbolic cosine of a C4.
-
C4_ADD adds two C4's.
-
C4_ARG returns the argument of a C4.
-
C4_ASIN evaluates the inverse sine of a C4.
-
C4_ASINH evaluates the inverse hyperbolic sine of a C4.
-
C4_ATAN evaluates the inverse tangent of a C4.
-
C4_ATANH evaluates the inverse hyperbolic tangent of a C4.
-
C4_CONJ evaluates the conjugate of a C4.
-
C4_COPY copies a C4.
-
C4_COS evaluates the cosine of a C4.
-
C4_COSH evaluates the hyperbolic cosine of a C4.
-
C4_CUBE_ROOT returns the principal cube root of a C4.
-
C4_DIV divides two C4's.
-
C4_DIV_R4 divides a C4 by an R4.
-
C4_EXP evaluates the exponential of a C4.
-
C4_I returns the the imaginary unit, i as a C4.
-
C4_IMAG evaluates the imaginary part of a C4.
-
C4_INV evaluates the inverse of a C4.
-
C4_LE_L1 := X <= Y for C4 values, and the L1 norm.
-
C4_LE_L2 := X <= Y for complex values, and the L2 norm.
-
C4_LE_LI := X <= Y for C4 values, and the L Infinity norm.
-
C4_LOG evaluates the logarithm of a C4.
-
C4_MAG returns the magnitude of a C4.
-
C4_MUL multiplies two C4's.
-
C4_NEG returns the negative of a C4.
-
C4_NINT returns the nearest complex integer of a C4.
-
C4_NORM_L1 evaluates the L1 norm of a C4.
-
C4_NORM_L2 evaluates the L2 norm of a C4.
-
C4_NORM_LI evaluates the L-infinity norm of a C4.
-
C4_NORMAL_01 returns a unit pseudonormal C4.
-
C4_ONE returns the value of 1 as a C4.
-
C4_PRINT prints a C4.
-
C4_REAL evaluates the real part of a C4.
-
C4_SIN evaluates the sine of a C4.
-
C4_SINH evaluates the hyperbolic sine of a C4.
-
C4_SQRT returns the principal square root of a C4.
-
C4_SUB subtracts two C4's.
-
C4_SWAP swaps two C4's.
-
C4_TAN evaluates the tangent of a C4.
-
C4_TANH evaluates the hyperbolic tangent of a C4.
-
C4_TO_CARTESIAN converts a C4 to Cartesian form.
-
C4_TO_POLAR converts a C4 to polar form.
-
C4_UNIFORM_01 returns a unit pseudorandom C4.
-
C4_ZERO returns the value of 0 as a C4.
-
C4MAT_ADD combines two C4MAT's with complex scalar factors.
-
C4MAT_ADD_R4 combines two C4MAT's with real scalar factors.
-
C4MAT_COPY copies a C4MAT.
-
C4MAT_FSS factors and solves a system with multiple right hand sides.
-
C4MAT_IDENTITY sets a C4MAT to the identity.
-
C4MAT_INDICATOR returns the C4MAT indicator matrix.
-
C4MAT_MINVM computes inverse(A) * B for C4MAT's.
-
C4MAT_MM multiplies two C4MAT's.
-
C4MAT_NINT rounds the entries of a C4MAT.
-
C4MAT_NORM_FRO returns the Frobenius norm of a C4MAT.
-
C4MAT_NORM_L1 returns the matrix L1 norm of a C4MAT.
-
C4MAT_NORM_LI returns the matrix L-oo norm of a C4MAT.
-
C4MAT_PRINT prints a C4MAT.
-
C4MAT_PRINT_SOME prints some of a C4MAT.
-
C4MAT_SCALE scales a C4MAT by a complex scalar.
-
C4MAT_SCALE_R4 scales a C4MAT by a real scalar.
-
C4MAT_UNIFORM_01 returns a unit pseudorandom C4MAT.
-
C4MAT_ZERO zeroes a C4MAT.
-
C4VEC_COPY copies a C4VEC.
-
C4VEC_INDICATOR sets a C4VEC to the indicator vector.
-
C4VEC_NINT rounds the entries of a C4VEC.
-
C4VEC_NORM_L2 returns the L2 norm of a C4VEC.
-
C4VEC_NORM_SQUARED returns the square of the L2 norm of a C4VEC.
-
C4VEC_PRINT prints a C4VEC, with an optional title.
-
C4VEC_PRINT_PART prints "part" of a C4VEC.
-
C4VEC_PRINT_SOME prints some of a C4VEC.
-
C4VEC_SORT_A_L1 ascending sorts a C4VEC by L1 norm.
-
C4VEC_SORT_A_L2 ascending sorts a C4VEC by L2 norm.
-
C4VEC_SORT_A_LI ascending sorts a C4VEC by L-infinity norm.
-
C4VEC_SPIRAL returns N points on a spiral between C1 and C2.
-
C4VEC_UNIFORM_01 returns a unit pseudorandom C4VEC.
-
C4VEC_UNITY returns the N roots of unity.
-
CARTESIAN_TO_C4 converts a Cartesian form to a C4.
-
POLAR_TO_C4 converts a polar form to a C4.
-
R4_CSQRT returns the complex square root of an R4.
-
R4_FLOOR rounds an R4 "down" (towards -infinity) to the nearest integral R4.
-
R4_HUGE returns a "huge" R4.
-
R4_LOG_2 returns the logarithm base 2 of an R4.
-
R4_UNIFORM_01 returns a unit pseudorandom R4.
-
R4POLY2_ROOT returns the two roots of a quadratic polynomial.
-
R4POLY3_ROOT returns the three roots of a cubic polynomial.
-
R4POLY4_ROOT returns the four roots of a quartic polynomial.
-
SORT_HEAP_EXTERNAL externally sorts a list of items into ascending order.
-
TIMESTAMP prints out the current YMDHMS date as a timestamp.
You can go up one level to
the FORTRAN77 source codes.
Last revised on 10 March 2014.