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
Engine.Engine - Engine class constructor
Calling Sequence
Engine( String args[], EngineCallBacks cb, Object user_data, Object res )
Parameters
args
-
start up command-line arguments
cb
call back methods
user_data
arbitrary data to be passed into the call backs
res
reserved for future use
Description
Engine is the constructor for the Engine class. Creating an instance of Engine starts the Maple session. Only one instance of Engine should be created during the execution of the Java program.
The args parameter is an array of Strings to be passed as command-line arguments to Maple. The String at index 0 should be set to "java".
The cb parameter is a instance of a class implementing the EngineCallBacks interface. It specifies the callbacks used by the kernel.
The user_data parameter is a data element that is passed into each callback specified in cb.
The res parameter is a data element that is reserved for future use. Programs calling Engine must always pass Java null for res.
(Windows only) If there are errors running a Java OpenMaple program with an atypical Java Virtual Machine, try passing the full path to the Java Virtual Machine executable as the zero'th string in args.
Examples
import com.maplesoft.openmaple.*;
import com.maplesoft.externalcall.MapleException;
class Example
{
public static void main( String notused[] ) throws MapleException
String mapleArgs[];
Engine engine;
mapleArgs = new String[1];
mapleArgs[0] = "java";
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
null, null );
engine.evaluate( "int(x,x);" );
engine.evaluate( "LinearAlgebra:-RandomMatrix( 3, 3 );" );
try
engine.evaluate( "syntax_error" );
}
catch ( MapleException me )
System.out.println( "Error: "+me.getMessage() );
Executing this code produces the following output.
1/2*x^2
Matrix(3,3,{(1, 1) = -21, (1, 2) = -50, (1, 3) = -79, (2, 1) = -56, (2, 2) = 30, (2, 3) = -71, (3, 1) = -8, (3, 2) = 62, (3, 3) = 28},datatype = anything,storage = rectangular,order = Fortran_order,shape = [])
Error: at offset 13, unexpected end of statement
See Also
maple, OpenMaple, OpenMaple/Java/API, OpenMaple/Java/Engine
Download Help Document