Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
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