Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
Overview of the Cache Package
Calling Sequence
Cache[command](arguments)
command(arguments)
Description
The Cache package exports functions for manipulating cache tables, both as option cache remember tables and as top-level objects.
The top-level Cache command creates a new cache table.
Cache tables are similar to normal tables: they associate a key with a value. However, a cache table stores two kinds of entries, permanent and temporary. Permanent entries are similar to normal remember table entries. Once added to a table they remain in the table until explicitly removed. A temporary entry may be removed when another entry is inserted because a cache table has a fixed maximum number of temporary elements it can store. Therefore inserting a temporary entry into a cache table may cause another temporary entry to be removed from the table.
Cache tables are primarily intended for use as remember tables. A caching remember table allows a procedure to permanently store return values while allowing dynamically remembered values to be collected by the system. Cache tables also have special garbage collection rules. A check is performed whenever memory is allocated from the system. If the total amount of memory allocated exceeds the current value of the cacheclearlimit option to kernelopts, all cache tables are automatically cleared of all temporary elements on the next garbage collection.
Because cache tables have two types of entries, it is possible for a single table to have two entries using the same key, one temporary and one permanent. In these cases, the temporary entry is always used.
The option cache can be specified in a procedure. This option is similar to option remember except that a cache remember table is created instead of a standard remember table. A cache remember table can also be created by using the Cache command. The entries that are automatically added to the remember table of a procedure with option cache are temporary. To create permanent entries, the Cache[AddPermanent] command can be used. The option cache is incompatible with options remember and system. An error is raised if they are used together. For more information on using option cache see option cache.
Each command in the Cache package can be accessed by using either the long form or the short form of the command name in the command calling sequence.
As the underlying implementation of the Cache package is a module, it is also possible to use the form Cache:-command to access a command from the package. For more information, see Module Members.
List of Cache Package Commands
The following is a list of available commands.
AddPermanent
AddTemporary
PermanentEntries
PermanentIndices
RemovePermanent
RemoveTemporary
Resize
TemporaryEntries
TemporaryIndices
Note: There is also a top-level Cache command that creates a new cache table.
To display the help page for a particular Cache command, see Getting Help with a Command in a Package.
See Also
Cache Command, kernelopts, option, procedure, remember, table, type[cache]
Download Help Document