The NArray Extension, version 0.5 (Multi-Dimensional Numeric Arrays in Tcl) Sam Shen In Brief -------- NArray is an extension to help Tcl cope with large in-memory numeric arrays. NArray's require only a few more bytes than the storage required by the array. In addition to providing array referencing and setting, narray allows functions to be mapped over each element of the array. These functions are compiled into byte code for performance about 100x faster than straight tcl and only 5-10x slower than C. (These numbers are ball-park figures, actual results depend on the situation.) If you have netCDF, then narray's can be saved to and loaded from netCDF files. An Example ---------- Here's a example: % narray create cube 64 64 64 ;# cube is an 64x64x64 float array cube % cube status ;# 64x64x64 * sizeof(float) = 1MB 1024.12KB used, debug 0 % cube aref 0 0 0 ;# return the element (0,0,0) 0 % cube aset 0 0 0 10 ;# set (0,0,0) to 10 10 % cube map { [] += 5; } ;# add 5 to each element % cube aref 0 0 0 ;# (0,0,0) is now 15 15 % cube vset sum 0 ;# set the variable sum to 0 0 % cube map { sum += $[]; } ;# sum the elements % cube vref sum ;# get the value of the variable sum 1.31073e+06 ;# the sum of the elements is 1310730 % expr 64*64*64*5+10 ;# just checking... 1310730 You can also bind other arrays to variables in the narray language, call functions, call tcl, etc. See the man page and other examples for more information. Where to Get It --------------- The current version of the software should be available on harbor.ecn.purdue.edu in the usual place, or in ftp://overload.lbl.gov/pub/narray/. Also, you may demo the software by pointing your forms-capable WWW browser at http://www.lbl.gov/~sls/narray/. $Id: README,v 1.6 1994/08/05 04:04:03 sls Exp $