Edgewise subdivision of tetrahedron

This is the implementation of the algorithm by Edelsbrunner and Grayson [1] for subdividing the tetrahedron in R^4 with vertices (1,0,0,0), (0,1,0,0), (0,0,1,0), (0,0,0,1).
The C code is available here.

Syntax: subd n, where n is a positive integer.

[1] H. Edelsbrunner and D. R. Grayson, Edgewise subdivision of a simplex. DCG, 24:707--719, 2000.