Sample programs for Stat 243
The following sample programs illustrate various features of the C
language or provide functionality which is useful for working on
class assignments. (The code can also be found in the directory
~s243/samples.)
-
mat.c allocation of 2-dimensional matrices
-
prob1.des description of data for non-linear
regression
-
prob1.dat sample data for non-linear regression
-
prob2.des description of data for non-linear
regression
-
prob2.dat sample data for non-linear regression
-
readmat.c function to open a file, and read a matrix
of unknown size by using a binary write while it counts the values
-
sq.c example of a UNIX-style command; a filter to
remove multiple blank lines from a file
-
simpson.c command to perform numerical
integration - demonstrates arrays of function pointers
-
sort.c quick sort with indexes
-
timer.h macros for timing execution of code