Conformant Arrays in C
Eddie Wyatt
edw at IUS1.CS.CMU.EDU
Tue Feb 23 03:03:40 AEST 1988
> >So why is this solution insufficient?
>
> Because it's a pain in the lower part of the anatomy!
> Or, in other words, just because it is theoretically sufficient
> does not mean that it is convenient.
> This is one of the limitations of C that Fortran programmers
> have difficulty with; they're used to being able to write
> reasonable array manipulation routines.
How about matrix assignment (a = b). If you have matrices
contiguously in memory you can do a "single" bcopy to move the data.
The optional representation doesn't allow this.
Matrix addition (a = b + c). while (--size >= 0) *a++ = *b++ + *c++;
Questionable whether this is actually faster than a[i][j] method
on the non-contiguous matrix.
A pain that I'm faced with is transferring data between machines.
If the machines are of the same type, I do some heavy optimizations
on data transfer. In the case of the matrices, I write the whole
matrix at once into a message. If I where to use the optional
representation I couldn't perform this optimization.
--
Eddie Wyatt e-mail: edw at ius1.cs.cmu.edu
More information about the Comp.lang.c
mailing list