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
RTableCreate - create an rtable in external code
Calling Sequence
RTableCreate(kv, rts, pdata, bounds)
Parameters
kv
-
kernel handle of type MKernelVector
rts
pointer to an RTableSettings structure
pdata
pointer to array data (optional)
bounds
array of lower and upper bounds
Description
This function can be used in external code with OpenMaple or define_external.
RTableCreate creates a new rtable with the settings specified in rts.
If pdata is NULL, then a data block is allocated and initialized to rts->fill. When specifying a previously created block of data (that is, when pdata is not NULL), it is important that rts->foreign is set to TRUE. Size, storage, data_type, order, and indexing functions must all be considered when managing your data block. It is recommended that you let Maple create the data block, then use RTableDataBlock to create a pointer to it.
The array, bounds is a list of the lower and upper bounds for each dimension of the rtable. For example, a MxN Matrix has bounds[0] = 1; bounds[1] = M; bounds[2] = 1; bounds[3] = N.
Note: Matrix and Vector lower bounds must start at 1, not 0.
Examples
#include "maplec.h"
ALGEB M_DECL MyIdentity( MKernelVector kv, ALGEB *args )
{
M_INT argc, n, i;
RTableSettings rts;
M_INT bounds[4];
ALGEB rt;
INTEGER32 *data;
argc = MapleNumArgs(kv,(ALGEB)args);
if( argc != 1 ) {
MapleRaiseError(kv,"one argument expected");
return( NULL );
}
n = MapleToM_INT(kv,args[1]);
RTableGetDefaults(kv,&rts);
rts.num_dimensions = 2;
rts.subtype = RTABLE_MATRIX;
rts.data_type = RTABLE_INTEGER32;
bounds[0] = 1;
bounds[1] = n;
bounds[2] = 1;
bounds[3] = n;
rt = RTableCreate(kv,&rts,NULL,bounds);
data = (INTEGER32*)RTableDataBlock(kv,rt);
for( i=1; i<=n; ++i ) {
data[MATRIX_OFFSET_FORTRAN_RECT(i,i,n,n)] = 1;
return( rt );
Execute the external function from Maple.
See Also
CustomWrapper, define_external, OpenMaple, OpenMaple/C/API, OpenMaple/C/Examples, rtable
Download Help Document