File: seqopt.usg

package info (click to toggle)
maxima 5.6-17
  • links: PTS
  • area: main
  • in suites: woody
  • size: 30,572 kB
  • ctags: 47,715
  • sloc: ansic: 154,079; lisp: 147,553; asm: 45,843; tcl: 16,744; sh: 11,057; makefile: 7,198; perl: 1,842; sed: 334; fortran: 24; awk: 5
file content (39 lines) | stat: -rw-r--r-- 2,120 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
   SEQUENCE_OPTIMIZE(exp or eqns) is a function that optimizes a code sequence
(list of equations at MACSYMA level) much the same way OPTIMIZE handles
a single expression.  However, only lists are treated specially.  All other
input will return MACSYMA BLOCK forms, just as OPTIMIZE does.  Besides
allowing the user to deal with code sequences, SEQUENCE_OPTIMIZE differs
from OPTIMIZE in principally two ways:

      1) It performs "exponent gathering" of terms in a product.  Exponents
         which are not integers are processed first.  After differences are
         collapsed, a search is done for any remaining non-unity GCDs of
         the exponents, and the appropriate power within power structure
         generated.  The strategy is then repeated for integer exponents.
         It is important to note that the gathering of these terms within
         a new power occurs only if it reduces the operations count in a
         CRAY FORTRAN environment(For detailed usage in other environments,
         send mail to GCOOK@MIT-MC).

      2) It allows the user to save the list of optimized temporaries found
         by SEQUENCE_OPTIMIZE in the list OPTIM_EQUIVS.  This is accomplished
         by setting SAVE_OPTIM_INFO[FALSE] to TRUE.
	WARNING : do not allow the value of OPTIM_EQUIVS to be resimplified
	by doing an EV or similar operation on it.  This could render it
	useless to SEQUENCE_OPTIMIZE.

   Globals besides OPTIM_EQUIVS and SAVE_OPTIM_INFO which affect the
operation of SEQUENCE_OPTIMIZE are:

      SEQUENCE_OPTIM_PREFIX['opt] is the character string used to prefix
all symbols generated by SEQUENCE_OPTIMIZE to represent common subexpressions.

      SEQUENCE_OPTIM_COUNTER[1] is the integer index used to identify by
unique symbols the common subexpressions found by SEQUENCE_OPTIMIZE.

      SEQUENCE_OPTIM_SUFFIX[?'s] is the string used to suffix all optimized
temporaries arising from a call to SEQUENCE_OPTIMIZE(The "?" removes the
internal "$").

   SEQUENCE_OPTIMIZE is accessed by doing LOAD(SEQOPT)$ .  A demonstration
is available in SHARE1;SEQOPT DEMO .  Bugs to GCOOK@MIT-MC .