F - 2 Parallel Processing With Lists
! Index-oriented commands. Many array commands either establish the size of an array in rows and
columns or manipulate individual elements by their row and column indices. These commands expect these
row and column indices to be real number pairs collected in lists. For example, fV!ah!KB=M will generate
a random integer matrix having 3 rows and 4 columns. Since these commands can normally use lists as
arguments, they cannot perform parallel processing, except by using DOLIST.
! Program control commands. Program control structures and commands do no perform parallel
processing and cannot be forced to do so. However, programs containing these structures can be made to
parallel process by using DOLIST. For example,
f3!H!V!a!Q!ch!3!"!67!452!V!]!:;<=!4KL2!<=4!1!4LE6D: returns fV!a!Q!ch.
Group 3: commands that sometimes work with parallel processing
! Graphics commands that can take pixel coordinates as arguments expect those coordinates to be presented as
two-element lists of binary integers. Since these commands can normally use lists as arguments, they cannot
parallel process, except by using DOLIST.
! For the two-argument graphics commands (BOX, LINE, TLINE), if either argument is not a list (a complex
number, for example), then the commands will parallel process, taking the list argument to be multiple
complex number coordinates. For example, -8F8/!f-3F3/!-VFH/h!E6=< will draw two lines —
between (0,0) and (1,1) and between (0,0) and (3,2).
Group 4: ADD and +
! On HP 48S and HP 48SX calculators, the + command has been used to append lists or to append elements to
lists. Thus f3!H!Vh!a!' returns f3!H!V!ah. With the advent of parallel processing in the hp 48g and
hp49g series, the ADD command was created to perform parallel addition instead of +.
This has several ramifications:
! To add two lists in parallel, you must do one of the following:
" Use ADD from the !´%LIST% menu.
" Create a custom menu containing the ADD command.
" Assign the ADD command to a user-defined key.
! User programs must be written using ADD instead of + if the program is to be able to perform direct parallel
processing, or written with + and applied to their arguments by using DOLIST. For example, programs such
as "!#!?!+?'H+!1 will produce list concatenation when x is a list rather than parallel addition, unless
rewritten as "!#!?!+?!B44 H+!1!
! Algebraic expressions capable of calculating with variables containing lists (including those intended to
become user-defined functions) cannot be created in RPN syntax since using ADD to add two symbolic
arguments concatenates the arguments with + rather than with ADD. For example,
+T+!452!H!W!DYB2!a!.!B44!+7-T/+!DYB2 [ produces +7-T/[TWH'a.T+ rather than
+7-T/[TWH!B44!a.T+.
Group 5: Commands that set modes / states
Commands that store values in system-specific locations so as to control certain modes and machine states can
generally be used to parallel process data. The problem is that each successive parameter in the list cancels the
setting established by the previous parameter. For example, f3!H!V!a!Qh!76T is effectively the same as
Q!76T.
Group 6: One-argument, one-result commands
These commands are the easiest to use with parallel processing. Simply provide the command with a list of
arguments instead of the expected single argument. Some examples:
f3!0H!V!0ah!BSD!returns!f3!H!V!ah!