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
Cache Command - create a new cache table
Calling Sequence
Cache( opts )
Cache( n, opts )
Cache( cache, opts )
Parameters
n
-
integer; size of cache table to create
cache
cache table; cache table to copy
opts
(optional) equations of the form option=value, where option is one of procedure, temporary or permanent
Description
The Cache command is a top-level command that creates a new cache table. If n is given, the returned table will be capable of storing at least n distinct temporary entries. Increasing n may also make accessing permanent elements faster.
For example:
c1 := Cache( 100, permanent=[ a=2, b=3 ], temporary=[ c=4, d=5] );
If cache is given, a cache table with the same size as cache is created. As well, the entries of cache, both temporary and permanent, are inserted into the new cache table. Any additional entries specified by optional parameters are also added.
There are three optional arguments: procedure, temporary, and permanent.
procedure = p
The procedure optional argument accepts a procedure, p as an argument. The newly created cache table is installed as p's remember table. If p has option remember or it already has a remember table, an error is raised.
temporary = list
The temporary optional argument accepts a list of equations that are used to initialize the temporary entries of the cache table. The lhs of each equation is used as the key and the rhs is used as the value. As a cache table is only capable of storing a fixed number of temporary entries, there is no guarantee that all the entries in the list will be in the returned table.
permanent = list
The permanent optional argument accepts a list of equations that are used to initialize the permanent entries of the cache table. The lhs of each equation is used as the key and the rhs is used as the value.
For more information on cache tables, see Cache Package.
Examples
The Cache command is always called using the Cache(arguments) calling sequence. You do not need to use with(Cache).
p := proc(x) return 1; end proc;
See Also
Cache Package, Cache[AddPermanent], Cache[AddTemporary], Cache[RemovePermanent], Cache[RemoveTemporary], Cache[Resize]
Download Help Document