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
RTableDataBlock - access the rtable data in external code
Calling Sequence
RTableDataBlock(kv, rt)
Parameters
kv
-
kernel handle returned by StartMaple
rt
Maple rtable object
Description
These functions are part of the OpenMaple interface to Microsoft Visual Basic.
The RTable*DataBlock family of functions return a 1-D copy of the data contained in rt. Modifying the returned data does not change the original rtable. The RTable*DataBlock function called must match the datatype of the rtable, which can be obtained from the data_type field of the RTableSettings structure returned by RTableGetSettings.
The specific RTableDataBlock function returns the address of the actual memory used by Maple to store the rtable data. This can be used to copy a changed data-block back and so update the rtable in Maple memory space.
The DoubleRTableDataBlock command provides a way to get the data of a datatype=float[8] rtable in a native 2-D or 3-D Visual Basic format. A 2-D array returned can then be indexed via 2-D A(i,j) indexing instead of computing the equivalent A((j-1)*m+i-1) index into a 1-D array. In this case (i,j) will match the Maple index, usually starting at (1,1), whereas RTableF64DataBlock will always be offset from (0).
The data block of an rtable with an indexing function may not exactly match the way the data looks when viewed from Maple. For example, the data stored in position [1,1] of an rtable with a special indexing function may not correspond to the (0) element accessed from the rtable.
An error is raised if an attempt is made to get the data block from a Maple-sparse rtable.
Examples
Public Sub MySumElems(ByVal kv As Long)
Dim rts As RTableSettings
Dim rt As Long
Dim val As Double
Dim i As Long
' original rtable
rt = EvalMapleStatement(kv, "Matrix([[1,2,3],[4,5,6]],datatype=float[8]);")
' ensure float[8] datatype before choosing DataBlock function
RTableGetSettings kv, rts, rt
If rts.data_type = RTABLE_FLOAT64 Then
n = RTableNumElements(kv, rt)
ReDim data(0 To n - 1) As Double
data = RTableF64DataBlock(kv, rt)
' sum all the elements in rt
val = 0
For i = 0 To n - 1
val = val + data(i)
Next i
Write #1, "sum = ", val
End If
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, rtable, trademarks
Download Help Document