Basic HTML version of Foils prepared Sept 20 97

Foil 20 Implementation Issues - I

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


1 All multi-dimensional data structures are implemented as arrays of references
2 for $i (1..10) {
3 @list = somefunc($i); # grab a list labelled by $i
4 # Compute the number of elements in @list:
5 $LoL[$i] = scalar @list;
6 # Create a fresh 2D array for each $i:
7 $LoL2D[$i] = [ @list ]; # use array constructor [ ]
8 } # End for loop
9 my(@list) = somefunc($i); # my() creates a fresh instance each time
10 $LoL2D[$i] = \@list; # also works but is perhaps less clear

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 5 1998