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 block in external code
Calling Sequence
RTableDataBlock(kv, rt)
Parameters
kv
-
kernel handle of type MKernelVector
rt
type ALGEB rtable object
Description
This function can be used in external code with OpenMaple or define_external.
RTableDataBlock returns a pointer to the data contained in the given rtable, rt. The returned pointer must be cast into the correct hardware datatype to access elements. The data type can be obtained from the data_type field of the RTableSettings structure returned by RTableGetSettings.
Before modifying data in the data block, ensure the rtable rt is not read-only. The read-only flag value can be obtained from the read_only field of the RTableSettings structure returned by RTableGetSettings.
Do not directly modify the data block of an rtable with an indexing function. The data stored in position [1,1] of an rtable with a special indexing function may not correspond to the [1,1] 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
#include "maplec.h"
ALGEB M_DECL MySumElems( MKernelVector kv, ALGEB *args )
{
M_INT argc, n, i;
ALGEB rt;
FLOAT64 val, *data;
RTableSettings rts;
argc = MapleNumArgs(kv,(ALGEB)args);
if( argc != 1 ) {
MapleRaiseError(kv,"one argument expected");
return( NULL );
}
if( !IsMapleRTable(kv,args[1]) ) {
MapleRaiseError(kv,"rtable expected for parameter 1");
rt = args[1];
RTableGetSettings(kv,&rts,rt);
if( rts.data_type != RTABLE_FLOAT64 ) {
MapleRaiseError(kv,"float[8] rtable expected for parameter 1");
data = (FLOAT64*)RTableDataBlock(kv,rt);
n = RTableNumElements(kv,rt);
for( val=0,i=0; i<n; ++i ) {
val += data[i];
return( ToMapleFloat(kv,val) );
Execute the external function from Maple.
See Also
CustomWrapper, define_external, OpenMaple, OpenMaple/C/API, OpenMaple/C/Examples, rtable
Download Help Document