restart - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Engine.restart

restart the kernel

 

Calling Sequence

Description

Examples

Calling Sequence

void restart() throws MapleException

Description

• 

The restart method causes the Maple session represented by the Engine object to clear its internal memory so that Maple acts (almost) as if just started.

• 

Any Algebraic objects will have their dispose method called.  These objects can no longer be used to reference the values they represented before restart was called.

• 

The restart method of Engine performs the same function as the restart function in Maple.

• 

In the event of an error, restart raises a MapleException.

Examples

import com.maplesoft.openmaple.*;

import com.maplesoft.externalcall.MapleException;

class Example

{

    public static void main( String notused[] ) throws MapleException

    {

        String[] mapleArgs = { "java" };

        Engine engine = new Engine( mapleArgs, new EngineCallBacksDefault(), null, null );

        Numeric n = engine.newNumeric( 1000 );

        List l = (List)engine.evaluate( "[1,2,3,4]:" );

        RTable r = (RTable)engine.evaluate( "Array( 1..10, 1..10 ):" );

        engine.evaluate( "a := 10;" );

        System.out.println( n.isDisposed() );

        System.out.println( l.isDisposed() );

        System.out.println( r.isDisposed() );

        engine.restart();

        engine.evaluate( "a;" );

        System.out.println( n.isDisposed() );

        System.out.println( l.isDisposed() );

        System.out.println( r.isDisposed() );

    }

}

Executing this code produces the following output.

a := 10

false

false

false

a

true

true

true

See Also

ExternalCalling/Java/MapleException

OpenMaple

OpenMaple/Java/API

OpenMaple/Java/Engine

restart