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
RTableIndFn - retrieve an indexing function code in external code
RTableIndFnArgs - retrieve arguments for an indexing function code in external code
Calling Sequence
RTableIndFn(kv, rt, i)
RTableIndFnArgs(kv, rt, i)
Parameters
kv
-
kernel handle returned by StartMaple
rt
Maple rtable object
i
ith indexing function in an rtable
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
The RTableIndFn function returns the RTABLE_INDEX_* code denoting the kind of indexing function used by the rtable rt. Since rtables can have more than one indexing function, the paramenter i specifies which index function to examine. Use MapleNumArgs on the RTableSettings indexing_functions field to determine the number of indexing functions an rtable has. Typically an rtable has no indexing functions.
Some indexing functions have extra data associated with them. For example band is usually denoted band[p1,p2] where p1 and p2 are the number of diagonals above and below the main diagonal. These extra arguments can be retrieved using RTableIndFnArgs.
Examples
Public Sub MyScalarMultiply(ByVal kv As Long)
Dim rts As RTableSettings
Dim rt As Long
Dim scalar As Double
Dim i, j, m, n As Long
Dim index(0 To 1) As Long
' original rtable
rt = EvalMapleStatement(kv, _
"Matrix(4,4,(i,j)->i,datatype=float[8],shape=diagonal);")
' scalar to element-wise multiply
scalar = 2
RTableGetSettings kv, rts, rt
m = RTableUpperBound(kv, rt, 1)
n = RTableUpperBound(kv, rt, 2)
If rts.data_type = RTABLE_FLOAT64 _
And MapleNumArgs(kv, rts.index_functions) = 1 _
And RTableIndFn(kv, rt, 1) = RTABLE_INDEX_DIAGONAL _
Then
' handle diagonal shape more efficiently
If m < n Then
n = m
End If
For i = 1 To n
index(0) = i
index(1) = i
RTableAssignFloat64 kv, rt, index(0), _
RTableSelectFloat64(kv, rt, index(0)) * scalar
Next i
ElseIf rts.data_type = RTABLE_FLOAT64 Then
For i = 1 To m
For j = 1 To n
index(1) = j
Next j
MapleALGEB_Printf1 kv, "rtable = %a", rt
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, rtable, rtable_indexingfunctions, rtable_indfns, trademarks
Download Help Document