C Source Codes


Here are a few C packages.

For each package listed below, if you click on its name, you can see an expanded explanation of its purpose, a list of its contents, and copy the entire source code file, a sample calling program, or the results of running the calling program.

Currently available software includes:

  1. 3ds_read, a program which reads a 3D Studio graphics file;
  2. args, a program which reports the command line arguments with which it was invoked;
  3. asa172 a library which simulates the generation of a set of multi-indices by nested DO-Loops; this is Applied Statistics Algorithm 172;
  4. asa183, a library which implements the Wichman-Hill pseudorandom number generator; this is Applied Statistics Algorithm 183;
  5. asa299, a library which computes the lattice points (integer coordinates) in an M-dimensional simplex; this is Applied Statistics Algorithm 299;
  6. ascii_to_mri, a program which restores MRI data to its original binary format, having been previously converted to an ASCII text file.
  7. bio, a library which manages binary I/O;
  8. blas1_c, a library of the Level 1 Basic Linear Algebra Subprograms, using single precision complex arithmetic;
  9. blas1_d, a library of the Level 1 Basic Linear Algebra Subprograms, using double precision real arithmetic;
  10. blas1_s, a library of the Level 1 Basic Linear Algebra Subprograms, using single precision real arithmetic;
  11. blas1_z, a library of the Level 1 Basic Linear Algebra Subprograms, using double precision complex arithmetic;
  12. brent a library which contains Richard Brent's routines for finding zeroes or minima of functions, without the use of derivative information.
  13. c, examples which illustrate some of the features of the C programming language.
  14. c4lib, a library which implements a basic level of single precision complex arithmetic.
  15. c8lib, a library which implements a basic level of double precision complex arithmetic.
  16. chrpak, a library which can manipulate characters and strings;
  17. csparse, a library which carries out the direct solution of sparse linear systems, by Timothy Davis.
  18. ctangle, a program which reads a CWEB file and creates the corresponding C source code file.
  19. cweave, a program which reads a CWEB file and creates the corresponding TeX documentation file.
  20. dislin, examples which illustrate the use of DISLIN, a scientific graphics package.
  21. drawcgm, a library of FORTRAN and C routines for graphics output in CGM, PostScript or X11 format;
  22. f77split, a program which splits a file containing multiple FORTRAN77 routines into separate files;
  23. f90split, a program which splits a file containing multiple FORTRAN90 routines into separate files;
  24. fd_predator_prey, a program which solves a pair of predator prey ODE's using a finite difference approximation.
  25. fd1d_bvp, a program which applies the finite difference method to a two point boundary value problem in one spatial dimension.
  26. fd1d_heat_explicit, a program which implements a finite difference solution, explicit in time, of the time dependent 1D heat equation;
  27. fd1d_heat_implicit, a program which implements a finite difference solution, implicit in time, of the time dependent 1D heat equation;
  28. fd1d_heat_steady, a program which implements a finite difference solution for the steady (time independent) 1D heat equation;
  29. fem1d, a program which applies the finite element method, using piecewise linear basis functions, to a linear two point boundary value problem in 1D;
  30. feynman_kac, a program which demonstrates the use of the Feynman-Kac algorithm for solving certain partial differential equations.
  31. fft_open_mp is a program which demonstrates the computation of a Fast Fourier Transform in parallel, using OpenMP.
  32. fft_serial is a program which computes a Fast Fourier Transform, and is intended as a starting point for implementing an OpenMP parallel version.
  33. fftw3, examples which illustrate the use of FFTW3, a library of routines for Fast Fourier Transforms;
  34. filum, a library which performs various operations with files;
  35. flood_open_gl, a program which uses OpenGL to allow the user to select regions of an image and flood them with color, by Art Wetzel.
  36. gcc_intrinsics, a program which demonstrates or tests some of the intrinsic functions made available by the GCC compiler.
  37. gnuplot_i, a library which allows an executing C or FORTRAN program to interact with the GNUPLOT graphics program.
  38. gprof, examples which illustrate the use of the GPROF program performance monitor;
  39. graphchk, a program, using the METIS library, which can check that a METIS graph file has the proper format;
  40. heat_mpi, a program which demonstrates the use of MPI, by solving the 1D time dependent heat equation.
  41. heated_plate is a program which solves the steady state heat equation in a 2D rectangular region, and is intended as a starting point for implementing an OpenMP parallel version.
  42. hello, a program which prints out "Hello, world!".
  43. hodge, a program which implements a 2D cellular automaton, that can be regarded as a model of the spread of an illness, and whose parameters can be tuned to exhibit stability, regular waves, or a variety of chaotic behavior. This is a simplified version of a program by Martin Gerhardt and Heike Schuster
  44. iris_to_pc, a program which runs on an SGI IRIS and receives data sent over a UDP socket from another machine;
  45. is_serial is a program which is a serial version of the NAS Parallel Benchmark IS (integer sort).
  46. kmetis, a program which uses the METIS library to partition the nodes of a graph in a balanced way, useful for parallel processing;
  47. legendre_rule_fast, a program which uses a fast (order N) algorithm to compute a Gauss-Legendre quadrature rule of given order.
  48. life_open_gl, a program which uses OpenGL to display the evolution of John Conway's "Game of Life", by Simon Green.
  49. linpack_bench, a program which is a version of the LINPACK benchmark program;
  50. linpack_d, a library which factors matrices in a variety of formats, and solving the associated linear systems, using double precision real arithmetic;
  51. linpack_s, a library which factors matrices in a variety of formats, and solving the associated linear systems, using single precision real arithmetic;
  52. linplus, a library which factors/solves/multiplies matrices in a variety of formats;
  53. machar, a library which dynamically computes the value of various machine characteristic constants;
  54. machine, a library which returns tabulated values of the constants associated with computer arithmetic
  55. makefiles, a directory of example programs which illustrate the use of MAKEFILES for maintaining a software project;
  56. matmul, a program which carries out a matrix multiplication benchmark;
  57. matt_message a program which simulates the behavior of a satellite warning system, by generating a set of 20 messages that report the observance of various threats.
  58. md is a program which carries out a molecular dynamics simulation, and is intended as a starting point for implementing an OpenMP parallel version.
  59. md_open_mp a program which carries out a molecular dynamics simulation using OpenMP.
  60. mddisk, a program which simulates a fluid modeled as a collection of soft disks, by Dennis Rapaport;
  61. mesh2dual, a program which used the METIS library to convert a finite element mesh to a dual graph.
  62. mesh2nodal, a program which uses the METIS library to convert a finite element mesh to a nodal graph.
  63. metis, a library which partitions the nodes of a graph or the elements of a mesh, for division among a number of parallel processes, or to reorder the variables in a sparse matrix to minimize fillin;
  64. mgmres, a library which applies the restarted GMRES algorithm to a sparse linear system;
  65. mixed, a directory of example programs which illustrate the use of mixed language programming in which the main routine is written in C;
  66. mm_io, a library which reads and writes a Matrix Market Sparse Matrix File;
  67. mpi, examples which illustrate the use of the MPI Message Passing Interface library, for parallel programming;
  68. mpi_ithaca, programs which illustrate the use of PBS scripts for submitting MPI jobs on Virginia Tech's ITHACA cluster.
  69. mpi_stubs, a library which may be used if a parallel program is to be compiled, loaded and run in a serial machine.
  70. mpi_sysx, examples which illustrate the use of PBS scripts for submitting MPI jobs to System X.
  71. mri_to_ascii, a program which converts the binary data in an MRI file to ASCII text.
  72. mxv, a program which compares the performance of (FOR I, FOR J) loops and (FOR J, FOR I ) loops for computing the product of an MxN matrix A and an N vector X.
  73. mxv_open_mp, a program which compares the performance of the matrix multiplication problem y=A*x, with and without parallelization by OpenMP.
  74. nasadig_x, a library which contains interface routines for use by the NASADIG graphics library when generating X Window graphics output.
  75. normal, a library which generates pseudorandom normal values;
  76. nsasm, a library which computes the jacobian matrix associated with a finite element approximation of the incompressible steady Navier-Stokes equations in 2D, and to store these as a sparse matrix.
  77. oa, a library which computes orthogonal arrays, by Art Owen;
  78. oa_executables, programs which create, testing, and manipulate orthogonal arrays, by Art Owen;
  79. obj_to_ply, a program which converts a 3D graphics file from OBJ format to PLY format format, by Greg Turk.
  80. ode, a library which implements the Adams-Bashforth-Moulton and Runge-Kutta methods of solving systems of ordinary differential equations, by Steven Moshier.
  81. oemetis, a program which uses the METIS library to reorder the variables in a sparse matrix.
  82. onmetis, a program, using the METIS library, which can reorder the variables in a sparse matrix.
  83. open_gl, examples which illustrate the use of the OpenGL graphics library;
  84. open_mp, examples which illustrate the use of the OpenMP interface for parallel programming shared memory system;
  85. open_mp_ithaca programs which illustrate the use of OpenMP on the Virginia Tech ITHACA cluster.
  86. open_mp_sgi, examples which illustrate the use of OpenMP with C programs on the Virginia Tech SGI systems.
  87. open_mp_stubs, a "stub" library, which is a dummy implementation of the OpenMP routines, and can be used to compile, load, and run a program using OpenMP on a system which does not have OpenMP installed.
  88. paranoia, a program which checks the accuracy of the floating point arithmetic on a computer.
  89. partdmesh, a program, using the METIS library, which can partition a finite element mesh after constructing the dual graph.
  90. partnmesh, a program, using the METIS library, which can partition a finite element mesh after constructing the nodal graph.
  91. pbmlib, a library which reads or writes graphics files in the Portable Bit Map format;
  92. pc_to_iris, a program which runs on a Windows NT machine, and sends data over a UDP socket to another machine;
  93. pcl_read, a program which reads a PCL file and extracts the numeric data;
  94. petsc, examples which illustrate the use of the Portable Extensible Toolkit for Scientific Computations;
  95. pig_latin, a program which converts its input to Pig Latin; a winner of the International Obfuscated C Code Competition in the "Most Humorous" category, by Don Dodson;
  96. plato_ply a program which writes a PLY graphics file for any Platonic solid, by Greg Turk.
  97. ply_io, a library which reads or writes a 3D graphics file in PLY format, by Greg Turk;
  98. ply_to_iv, a program which converts a 3D graphics file from PLY format to Inventor format, by Greg Turk.
  99. ply_to_obj, a program which converts a 3D graphics file from PLY format to OBJ format.
  100. pmetis, a program which uses the METIS library to partition the nodes of a graph in a balanced way, useful for parallel processing;
  101. power_method a library which carries out the power method for finding a dominant eigenvalue and its eigenvector.
  102. prime_number is a program which counts the number of primes between 1 and N.
  103. prime_number_mpi is a program which counts the number of primes between 1 and N, using MPI for parallel execution.
  104. prime_number_open_mp is a program which counts the number of primes between 1 and N, using OpenMP for parallel execution.
  105. pthreads, examples which illustrate the use of the POSIX thread library to carry out parallel program execution.
  106. quad_mpi, a program which applies a quadrature rule to estimate an integral, working in parallel by using MPI;
  107. quad_open_mp, a program which applies a quadrature rule to estimate an integral, working in parallel by using OpenMP;
  108. quadrule, a library which defines quadrature rules for approximating integrals;
  109. qvoronoi, a program which computes the Voronoi diagram of a pointset in M dimensions (part of the QHULL package);
  110. rand48, a program which demonstrates the use of the RAND48 family of random number generators available in the C/C++ standard library.
  111. random_mpi, a program which demonstrates one way to generate the same sequence of random numbers for both sequential execution and parallel execution under MPI.
  112. rbox, a program which generates random pointsets for testing computational geometry algorithms;
  113. rgb_io, a library which reads or writes an SGI RGB file.
  114. sandia_rules, a library which can produce a standard 1D Gauss quadrature rule of Chebyshev, Gegenbauer, generalized Hermite, generalized Laguerre, Hermite, Jacobi, Laguerre, and Legendre types.
  115. satisfiability is a program which demonstrates, for a particular circuit, an exhaustive search for solutions of the circuit satisfiability problem.
  116. satisfiability_mpi is a program which demonstrates, for a particular circuit, an exhaustive search for solutions of the circuit satisfiability problem, using MPI to perform the calculation in parallel.
  117. satisfiability_open_mp is a program which demonstrates, for a particular circuit, an exhaustive search for solutions of the circuit satisfiability problem, using OpenMP for parallel execution.
  118. sgefa_open_mp, a program which compares a standard linear algebra solver against a revised version which can be run in parallel with OpenMP.
  119. sgmga, a library which creates sparse grids based on a mixture of 1D quadrature rule families, allowing user specified growth rates for each family, allowing anisotropic weights for each dimension.
  120. showme, an program which displays triangulations and meshes, by Jonathan Shewchuk;
  121. smolpack, a library which estimates the integral of a function over a multidimensional hypercube using a sparse grid, by Knut Petras;
  122. subpak, a library which contains many utility routines;
  123. subset, a library which ranks, unranks, and generates random subsets, combinations, permutations, and so on;
  124. sum_million, a program which sums the integers from 1 to 1,000,000, as a demonstration of how to rate a computer's speed;
  125. super_blas, a library which implements some of the BLAS routines, for particular use by SUPER_LU;
  126. super_lu, a library which implements a very fast direct solver for sparse linear systems;
  127. sweep2, a program which computes Voronoi Diagrams or Delaunay triangulations, by Steve Fortune;
  128. table_io, a library which reads and writes a simple dataset stored as a TABLE file;
  129. test_mat, a library which implements test matrices.
  130. test_values, a library which returns a small set of values for a variety of mathematical functions, suitable for a rough test of accuracy for algorithms;
  131. tiff_io, a library which reads or writes a TIFF file (not working).
  132. timer, examples which illustrate how to estimate the CPU time taken by a portion of a program;
  133. timestamp, a library which returns the current YMDHMS date as a timestamp, and performs other chores;
  134. toms178, a library which seeks the minimizer of a function of several variables, using the Hooke-Jeeves direct search method;
    this is a C version of ACM TOMS algorithm 178.
  135. toms179 a library which calculates the incomplete Beta ratio;
    this is a C version of ACM TOMS algorithm 179.
  136. toms322, a library which evaluates the F and Student's T cumulative density functions;
    this is a C version of ACM TOMS algorithm 322.
  137. toms722, a library which supports IEEE arithmetic.
  138. triangle, a program which generates meshes, Delaunay triangulations, and Voronoi diagrams, by Jonathan Shewchuk;
  139. triangulate, a program which triangulates a polygonal region, by Joseph ORourke;
  140. uniform, a library which generates uniform pseudorandom values;
  141. uudecode, a program which recovers the original file from a UU encoded file;
  142. uuencode, a program which takes an input file, especially a binary file, and creates a UU encoded copy that is a text file, suitable for transmission through mail or other text-only systems.
  143. vitles_to_tec_2d, a program which reads a 2D flow file from the VITLES fluid flow program and writes a corresponding file for use by TECPLOT;
  144. vitles_to_tec_3d, a program which reads a 3D flow file from the VITLES fluid flow program and writes a corresponding file for use by TECPLOT;
  145. vitles_to_vtk, a program which reads a 3D flow file from the VITLES fluid flow program and writes a corresponding VTK file for use by 3D graphics programs such as PARAVIEW.
  146. wtime is a library which returns a reading of the wall clock time in seconds.
  147. xdr, a library which allows data to be transferred from one computer system to another using an external data representation;
  148. xfires, a program which models the occurrence of fires in a forest, and displays the status of the forest using X Windows.
  149. xged, a program which allows the user to display, edit and animate a mathematical graph within an X Window display.
  150. xising, a program which models the variations in ferromagnetism in a material, displaying the results using X Windows.
  151. xwaves, a program which simulates the behavior of solutions of certain forms of the wave equation, displaying the results using X Windows.
  152. ziggurat, a library which samples the uniform, normal or exponential distributions, using the ziggurat method.
  153. ziggurat_open_mp, a program which demonstrates how the ZIGGURAT library can be used to generate random numbers in an OpenMP parallel program.
  154. ziggurat_original, a library which is the original version of the ZIGGURAT library.

You can go up one level to the main web page.


Last revised on 09 December 2008.