Exactly right, implemented as per Devon¹s email (ie row-wise order instead of col-wise offers efficiencies, and simplified algorithms too), then row assignments done to the pre-allocated table as per Devon¹s examples.
If this problem is big¹ and you intend to track the data into files, then you may also consider using J¹s Memory Mapped Files (JMF files) to store the large array. This may be more efficient than you managing the individual files yourself. See the Mapped Files Lab if you want to look down this track, as the file effectively becomes an array for data management. Regards Rob PS: Dan - thanks for the Dyalog APL tip on ³2-/a,0² On 30/05/08 1:51 AM, "Hahn, Harvey" <[EMAIL PROTECTED]> wrote: > ... > Rob, do I understand you correctly that I would, in such a scenario, operate > on *two* older files: the larger "master" file that I would append the new > results column to, and the file containing the actually cumulative data in the > previous column? In this way, I'd (1) take the column of previous cumulative > values and subtract them from the new column of cumulative values, (2) add > this column of results to the previous "master" file, and (3) re-use the > column of "new" cumulative values as the column of "previous" cumulative > values the next time around. Is that a correct understanding of what you > suggested? Sounds good to me! > > |If you go this direction, it might also help to transpose the > |matrix, so you're adding new timeslice differences as rows > |(for efficiency). > > That's essentially how I'm adding the new column each time. > > |Better yet, pre-allocate the matrix to hold the results and > |insert rows (in order to move the memory allocation overhead > |up front to a single operation). > > Devon and Rob, although I understand the concept of preallocating a matrix > (which you both mentioned), I'm not sure what the nuts-and-bolts code for > "filling" it with the current values would look like. Would some form of > "amend" be used, or what? Could someone demonstrate with code? Thanks! > > Harvey > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
