Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: Conformant Arrays in C Message-ID: <929@PT.CS.CMU.EDU> Date: 22 Feb 88 17:03:40 GMT References: <42529@sun.uucp> <7297@brl-smoke.ARPA> <676@cresswell.quintus.UUCP> <7314@brl-smoke.ARPA> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 28 Keywords: ANSI C Fortran > >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@ius1.cs.cmu.edu