Index of /tcl/ftparchive/sorted/packages-8.0/math/narray/0.81
Name Last modified Size Description
Parent Directory 29-Jan-99 12:22 -
README 01-Sep-98 16:07 2k
narray-0.8.tar.gz 21-Aug-98 14:56 38k
narray-0.8.tgz 21-Aug-98 14:25 38k
narray-0.81.tar.gz 01-Sep-98 16:04 62k
The NArray Extension, version 0.81
(Multi-Dimensional Numeric Arrays in Tcl)
Nick Maliszewskyj <nickm@nist.gov>
Przemek Klosowski <przemek@nist.gov>
Sam Shen <slshen@lbl.gov>
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.)
An Example
----------
Here's a example:
% package require narray ;# load narray package
0.81
% 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
ftp://ftp.neosoft.com or ftp://rrdjazz.nist/gov/pub/nickm
$Id: README,v 1.1 1998/08/21 13:09:35 nickm Exp nickm $