MapleKernelOptions - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : OpenMaple : C Application Programming Interface : System and Maple Properties : OpenMaple/C/MapleKernelOptions

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&equals;0

0

(1)

delay20000

0.

(2)

kerneloptsassertlevel

2

(3)

delay226

0.0566660000000000

(4)

See Also

CustomWrapper

define_external

kernelopts

OpenMaple

OpenMaple/C/API

OpenMaple/C/Examples

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam