11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7.2 Using Compiled Code in Maple • 327RtableGetDefaults fills the RtableSettings structure s with standarddefault values. These defaults are as follows.data_type = RTABLE_DAGmaple_type = ’anything’ (Maple name ’anything’)subtype = RTABLE_ARRAYstorage = RTABLE_RECTp1 = -1, p2 = -1order = RTABLE_FORTRANread_only = FALSEforeign = FALSEnum_dimensions = -1index_functions = ’NULL’ (Maple NULL)attributes = ’NULL’ (Maple NULL)transpose = FALSEfill = 0RtableGetSettings fills the RtableSettings structure s with thesettings held by the RTABLE, rt.RtableIndFn returns the i th indexing function code. The indexingcodes are defined in mpltable.h in the form RTABLE_INDEX_XXXX. If thereare no indexing functions, this gives an error for any value of i. If thereis one indexing function, then rtableIndFun(rt,1) returns the code forthe only indexing function. Use MapleNumArgs to determine the numberof indexing functions.RtableIndFnArgs returns the argument expression sequence for indexingfunction ’num’ in rtable ’rt’. If there are no arguments, Maple’NULL’ is returned. The result can be further converted to a hardware typeusing the MapleToXXX function(s). The number of arguments returned canbe determined using MapleNumArgs. Note that some knowledge aboutthe indexing functions is required to convert the return value to the appropriatehardware type. For example, RTableIndFnArgs(kv,rt,1) ofa band[b1,b2] rtable returns the b1 part of the expression sequence(b1,b2). The user must know that b1 and b2 are always integers.Conversely, c in constant[c] is always the same type as the rtable’sdatatype. Thus for float[8] rtables, to convert to a hardware type useMapleToFloat64.RtableSetAttribute sets all the attributes of the RtableSettingsstructure s to the single NAME attribute, name.RtableSetIndFn sets all the indexing functions of the RtableSettingsstructure s and resets it to the single indexing function infn.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!