11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

370 • Appendix A: Internal Representation and Manipulationthe lexical scanner or by name concatenation. It is also used by functionsthat perform operations on all global names. These operations include:1. Marking for garbage collection2. Saving a Maple session environment in a file3. Maple functions anames and unames which return all assigned andunassigned global names, respectivelyRemember TablesA remember table is a hash table in which the argument(s) to a procedurecall are stored as the table index, and the result of the procedure call isstored as the table value. Because a simplified expression in Maple has aunique instance in memory, the address of the arguments can be used asthe hash function. Hence, searching a remember table is very fast.There are several kernel functions which use remember tables including,evalf, series, divide, normal, expand, diff, readlib, andfrontend. The functions evalf, series, and divide are handled internallyin a special way for the following reasons:• evalf and series need to store some additional environment information(’Digits’ for evalf and ’Order’ for series). Consequently,the entries for these are extended with the precision information. If aresult is requested with the same or less precision than what is storedin the table, it is retrieved and rounded. If a result is produced withmore precision than what is stored, it is replaced in the table.• evalf only remembers function calls (this includes named constants);it does not remember the results of arithmetic operations.• If the division succeeded and the divisor was a nontrivial polynomial,the divide function stores the quotient in its remember table. Otherwisenothing is stored in the remember table.If option remember is specified together with option system, atgarbage collection time the remember table entries which refer to expressionsno longer in use elsewhere in the system are removed. Thisprovides a relatively efficient use of remembering that does not wastestorage for expressions that have disappeared from the expression space.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!