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

Online Help

All Products    Maple    MapleSim


MapleKernelOptions

set or query kernel variables and options in external code

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

MapleKernelOptions(kv, option, val)

Parameters

kv

-

kernel handle of type MKernelVector

option

-

character string

val

-

type ALGEB value

Description

• 

This function can be used in external code with OpenMaple or define_external.

• 

MapleKernelOptions sets and queries variables that affect Maple computations. For a list of option names and descriptions, see ?kernelopts,

• 

To query a value without setting it pass val = NULL. The previous assigned value is returned.

Examples

    #include "maplec.h"

    ALGEB M_DECL MyDelay( MKernelVector kv, ALGEB *args )

    {

    M_INT i, n;

    ALGEB start_time, fin_time;

        double junk;

    if( 1 != MapleNumArgs(kv,(ALGEB)args) ) {

        MapleRaiseError(kv,"one argument expected");

        return( NULL );

    }

    MapleKernelOptions(kv,"assertlevel",ToMapleInteger(kv,2));

    n = MapleToM_INT(kv,args[1]);

    start_time = MapleKernelOptions(kv,"cputime",NULL);

    for( i=1; i<=n; ++i ) {

        junk *= 2;

    }

    MapleAssign(kv,ToMapleName(kv,"myjunk",TRUE),ToMapleFloat(kv,junk));

    fin_time = MapleKernelOptions(kv,"cputime",NULL);

    return( EvalMapleProc(kv,ToMapleName(kv,"-",TRUE),

                    2,fin_time,start_time) );

    }

Execute the external function from Maple.

withExternalCalling&colon;

dllExternalLibraryNameHelpExamples&colon;

delayDefineExternalMyDelay&comma;dll&colon;

kerneloptsassertlevel=0

0

(1)

delay20000

0.0000490000000000212

(2)

kerneloptsassertlevel

2

(3)

delay226

0.0728510000000000

(4)

See Also

CustomWrapper

define_external

kernelopts

OpenMaple

OpenMaple/C/API

OpenMaple/C/Examples