Close
Close window
RTableAppendAttribute - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

RTableSetAttribute

assign to the attribute RTableSettings field in external code

RTableAppendAttribute

append to the attribute RTableSettings field in external code

RTableSetIndFn

assign to the index_functions RTableSettings field in external code

RTableAppendIndFn

append to the index_functions RTableSettings field in external code

RTableSetType

assign to the data_type and maple_type RTableSettings field in external code

Calling Sequence

RTableSetAttribute(kv, rts, name)

RTableAppendAttribute(kv, rts, name)

RTableSetIndFn(kv, rts, indfn)

RTableAppendIndFn(kv, rts, indfn)

RTableSetType(kv, rts, id, name)

Parameters

kv

-

kernel handle returned by StartMaple

rts

-

RTableSettings structure

name

-

name of an attribute or type

indfn

-

Maple indexing function object

id

-

data_type identifier

Description

These functions are part of the OpenMaple interface to Microsoft Visual Basic.

These functions update an RTableSettings structure. They are provided for convenience. The RTableSettings structure can be modified directly. Some extra argument checking is done.

RTableSetAttribute(kv,rts,name) is equivalent to

rts.attributes = (kv,1)

MapleExpseqAssign kv,1,(kv,name,TRUE)

Attributes can be retrieved using the attributes command in Maple.

RTableAppendAttribute(kv,rts,name) is equivalent to the following.

dim attrib, i, n as long

n = MapleNumArgs(kv,rts.attributes)

attrib = NewMapleExpressionSequence(kv,n+1)

For i=1 to n

MapleExpseqAssign kv, attrib, i, MapleExpseqSelect(kv,attrib,i)

Next i

MapleExpseqAssign kv, attrib, i, MapleToName(kv,name,True)

rts.attributes = attrib

RTableSetIndFn and RTableAppendIndFn are the same as RTableSetAttribute and RTableAppendAttribute except they modify rts.index_functions instead of rts.attributes to set the indexing function property.

RTableSetType sets the data_type and maple_type fields of the RTableSettings structure. This command is equivalent to the following code.

rts.data_type = id

If id = RTABLE_DAG then

rts.maple_type = ToMapleName(kv,name,True)

EndIf

Examples

Public Sub TestSetAttribute(ByVal kv As Long)

Dim rt As Long

Dim rts As RTableSettings

' input (rtable and rows to swap)

rt = EvalMapleStatement(kv, "rtable(1..6,1..6,(i,j)->i);")

' set new properties

RTableGetSettings kv, rts, rt

RTableSetIndFn kv, rts, RTABLE_INDEX_SYMMETRIC

rts.p1 = 2 'band parameters

rts.p2 = 2

RTableAppendIndFn kv, rts, RTABLE_INDEX_BAND

RTableSetType kv, rts, RTABLE_DAG, "integer"

RTableSetAttribute kv, rts, "red"

RTableAppendAttribute kv, rts, "square"

' make a copy with the new properties

rt = RTableCopy(kv, rts, rt)

MapleALGEB_Printf1 kv, "new rtable = %a", rt

End Sub


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /