A BETTER way to do Multidimensional arrays in C

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Tue Jan 15 08:26:44 AEST 1985


Steve's suggestion of using vectored-row matrices is a good one;
indeed I think I'll include it in the matrix package in our support
library.  There need to be alloc/free routines (with alloc taking
care of setting up the vectors) but for large matrices it would
be worth it since double indirection will usually be faster than
index arithmetic.

This brings me to one of my oldest gripes:  There are not enough
standardized programming support routines in the C library.
Everyone ends up inventing his own set of routines for common
operations, such as complex arithmetic or queueing.  There have
been a few useful additions recently but there should be more.



More information about the Comp.lang.c mailing list