Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
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