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
Indexing Functions (for tables and arrays)
Calling Sequence
table(indexfcn, indexfcn...)
array(indexfcn, indexfcn...)
Description
The indexfcn arguments to table or array are a sequence of named indexing methods used when assigning to or evaluating entries in the table or array. If no indexing methods are specified, then Maple's ordinary indexing is used.
All indexing is done through the first indexing method specified for the table or array. The procedure index/method is invoked with two or three parameters. If simply evaluating the table entry, then only two parameters are passed. The first is a list containing the indices to be used and the second is a named table using the remaining indexing methods. In this way, later indexing methods modify the behavior of earlier methods. If the entry is being assigned to, a third argument, a list of the values being assigned, is passed to the indexing function.
The following names are known as built-in or library-defined indexing functions: symmetric, antisymmetric, sparse, diagonal, identity, and exception.
If indexfcn is not a built-in indexing function, cat(index,"/",indexfcn) is used as the name of the procedure that defines the indexing function.
The example below constructs an indexing function that returns infinity for all unassigned entries in the table (similar to the sparse indexing function which returns zero). The second example demonstrates the chaining of multiple indexing functions to get the desired effect.
Note: The command array has been superseded by Array. Information on indexing functions for Arrays can be found at rtable_indexfcn.
Examples
`index/infinity` := proc(Idx::list,Tbl::table,Entry::list) if (nargs = 2) then if assigned(Tbl[op(Idx)]) then Tbl[op(Idx)]; else infinity; end if; elif Entry = [infinity] then infinity; else Tbl[op(Idx)] := op(Entry); end if; end proc:
See Also
antisymmetric, diagonal, exception, identity, Indexing Functions for Arrays, Matrices, and Vectors (rtable Objects), sparse, symmetric, table
Download Help Document