RTableGetSettings - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : OpenMaple : VB Application Programming Interface : RTable Manipulation : OpenMaple/VB/RTableSettings

RTableGetSettings

return a properties structure of an rtable in external code

RTableGetDefaults

return the default properties structure of an rtable in external code

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

RTableGetSettings(kv, rts, rt)

RTableGetDefaults(kv, rts)

Parameters

kv

-

kernel handle returned by StartMaple

rts

-

RTableSettings structure

rt

-

Maple rtable object

Description

• 

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

• 

RTableGetSettings assigns the properties of the rtable rt to the supplied RTableSettings structure.

• 

RTableGetDefaults fills the supplied RTableSettings structure with the default rtable properties, as implied by the rtable Maple command.  The num_dimensions setting has no default value, and must always be set before creating an rtable.

• 

The RTableSettings structure is defined in mpltable.h.  It contains the following settings.

SETTING

TYPE

DEFAULT

EXPLANATION

 

 

 

 

data_type

Long

RTABLE_DAG

type of data in the rtable.

 

 

 

 

maple_type

Maple Object

anything

type assertion on data

 

 

 

contained in rtables

 

 

 

with data_type=RTABLE_DAG.

 

 

 

 

subtype

Long

RTABLE_ARRAY

type of rtable,

 

 

 

Array, Matrix, or Vector.

 

 

 

 

storage

Long

RTABLE_RECT

storage layout.

 

 

 

 

p1,p2

Long

0

optional parameters used

 

 

 

by some storage layouts.

 

 

 

 

order

Long

RTABLE_FORTRAN

C or Fortran order indexing

 

 

 

(set to RTABLE_FORTRAN,

 

 

 

or RTABLE_C).

 

 

 

 

read_only

Long (boolean)

False

disallow data writes when true.

 

 

 

 

foreign

Long (boolean)

False

true if external program

 

 

 

manages data memory.  If the

 

 

 

pdata parameter to RTableCreate

 

 

 

is non-NULL, this field must be

 

 

 

set to TRUE.

 

 

 

 

num_dimensions

Long

-1

a 5x5 rtable has 2 dimensions.

 

 

 

 

index_functions

Maple Object

MapleNULL

list of array indexing functions.

 

 

 

 

attributes

Maple Object

MapleNULL

attributes given to this rtable.

 

 

 

 

transpose

Long (boolean)

False

when true, transpose

 

 

 

the rtable at creation.

 

 

 

 

fill

Maple Object

0

the default value for

 

 

 

unspecified elements.

 

 

 

 

• 

The data_type field can have any of the following values.

SETTING

TYPE

EXPLANATION

 

 

 

RTABLE_DAG

Long

Maple objects

RTABLE_CXDAG

ComplexDAG

complex Maple software floats

RTABLE_INTEGER8

Byte

8-bit integers

RTABLE_INTEGER16

Integer

16-bit integers

RTABLE_INTEGER32

Long

32-bit integers

RTABLE_INTEGER64

N/A

64-bit integers

RTABLE_FLOAT32

Single

32-bit floating-point numbers

RTABLE_FLOAT64

Double

64-bit floating-point numbers

RTABLE_COMPLEX

Complex64

64-bit complex float pair

 

 

 

• 

The subtype field can have any of the following values.

SETTING

EXPLANATION

 

 

RTABLE_ARRAY

Array

RTABLE_MATRIX

Matrix

RTABLE_COLUMN

column Vector

RTABLE_ROW

row Vector

 

 

• 

The storage field can have any of the following values.

SETTING

EXPLANATION

 

 

RTABLE_SPARSE

sparse format; a table

 

when data_type is RTABLE_DAG, otherwise

 

the index and data vector format used

 

by NAG.  p2 can be set to RTABLE_SPARSE_UPPER

 

to exclude storing entries below the diagonal

 

using this format.  Similarly, p2 can be set

 

to RTABLE_SPARSE_LOWER to exclude entries

 

above the diagonal.  By default p2 is

 

RTABLE_SPARSE_DEFAULT, which allows storage

 

of all entries.

 

 

RTABLE_EMPTY

no storage (usually used in

 

combination with an indexing

 

function like IdentityMatrix where

 

the values can be derived without

 

needing to be stored.

 

 

RTABLE_DIAG

only the diagonal entries

 

are stored.

 

 

RTABLE_BAND

banded storage;

 

where p1 and p2 refer to the

 

number of non-zero subdiagonals

 

and superdiagonals.

 

 

RTABLE_RECT

dense rectangular storage.

 

 

RTABLE_UPPTRI

only the upper triangle

 

(including the diagonal) is stored.

 

 

RTABLE_UPPTRIMINUS

the upper triangle

 

excluding the diagonal is stored.

 

 

RTABLE_UPPTRIPLUS

the upper triangle

 

plus the one subdiagonal is stored.

 

 

RTABLE_LOWTRI

only the lower triangle

 

(including the diagonal) is stored.

 

 

RTABLE_LOWTRIMINUS

the lower triangle

 

excluding the diagonal is stored.

 

 

RTABLE_LOWTRIPLUS

the lower triangle

 

plus the one superdiagonal is stored.

 

 

RTABLE_SCALAR

a single entry is stored.

 

 

• 

The subtype field can have any of the following values.

SETTING

EXPLANATION

 

 

RTABLE_ARRAY

Array

RTABLE_MATRIX

Matrix

RTABLE_COLUMN

column Vector

RTABLE_ROW

row Vector

 

 

• 

Usually the indexing function is used in conjunction with a non-dense storage.  For example, identity is commonly used with RTABLE_EMPTY storage, and symmetric is commonly used with RTABLE_UPPTRI storage. The index_functions field can have any of the following values.

SETTING

EXPLANATION

 

 

maple object

the name or expression sequence of

 

indexing functions.

 

 

RTABLE_INDEX_ZERO

zero indexing function.

 

 

RTABLE_INDEX_BAND

band indexing function.

 

p1 and p2 must be set to indicate

 

the number of subdiagonals and

 

superdiagonals.

 

 

RTABLE_INDEX_CONSTANT

constant indexing function.

 

The fill value is used to denote

 

the constant stored in every entry

 

of the rtable.  Usually used in

 

combination with RTABLE_EMPTY storage.

 

 

RTABLE_INDEX_DIAGONAL

diagonal indexing function.

 

 

RTABLE_INDEX_SCALAR

scalar indexing function.

 

Uses the fill value for the main

 

diagonal entry.  If subtype is a

 

Vector format, then p1 is additionally

 

used to indicate which entry is filled

 

(instead of the diagonal).

 

 

RTABLE_INDEX_ANTIHERMITIAN

antihermitian indexing function.

 

 

RTABLE_INDEX_HERMITIAN

hermitian indexing function.

 

 

RTABLE_INDEX_UPPHESSEN

Hessenberg[upper] indexing function.

 

 

RTABLE_INDEX_LOWHESSEN

Hessenberg[lower] indexing function.

 

 

RTABLE_INDEX_IDENTITY

identity indexing function.

 

 

RTABLE_INDEX_ANTISYMMETRIC

antisymmetric indexing function.

 

 

RTABLE_INDEX_SYMMETRIC

symmetric indexing function.

 

 

RTABLE_INDEX_LOWTRI

triangular[lower] indexing function.

 

 

RTABLE_INDEX_UPPTRI

triangular[upper] indexing function.

 

 

RTABLE_INDEX_UNIUPPTRI

triangular[upper,unit] indexing function.

 

 

RTABLE_INDEX_UNILOWTRI

triangular[lower,unit] indexing function.

 

 

RTABLE_INDEX_UNIT

unit indexing function.

 

 

Examples

Public Sub MyRandomDiagonal(ByVal kv As Long)

    Dim rt As Long

    Dim rts As RTableSettings

    Dim bounds(0 To 3) As Long

    Dim index(0 To 1) As Long

    Dim val As Long

    ' input (rtable and rows to swap)

    size = 9

    density = 0.5

    ' fill in the settings

    RTableGetDefaults kv, rts

    rts.num_dimensions = 2

    rts.subtype = RTABLE_MATRIX

    rts.data_type = RTABLE_INTEGER32

    rts.storage = RTABLE_DIAG

    rts.index_functions = RTABLE_INDEX_DIAGONAL

    rts.fill = ToMapleInteger(kv, -1)

    rts.order = RTABLE_C

    rts.read_only = False

    rts.attributes = ToMapleName(kv, "MyRand", True)

    bounds(0) = 1

    bounds(1) = size

    bounds(2) = 1

    bounds(3) = size

    ' create the rtable

    rt = RTableCreateDefault(kv, rts, 0, bounds(0))

    ' fill the diagonal with random values

    For i = 1 To size

        index(0) = i

        index(1) = i

        If Rnd <= density Then

            RTableAssignInteger32 kv, rt, index(0), Int(Rnd * 32767)

        End If

    Next i

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

End Sub

See Also

OpenMaple

OpenMaple/VB/API

OpenMaple/VB/Examples

rtable

trademark

 


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