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
RTableGetSettings(kv, rts, rt)
RTableGetDefaults(kv, rts)
kv
-
kernel handle returned by StartMaple
rts
RTableSettings structure
rt
Maple rtable object
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
RTABLE_ARRAY
type of rtable,
Array, Matrix, or Vector.
storage
RTABLE_RECT
storage layout.
p1,p2
0
optional parameters used
by some storage layouts.
order
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
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
-1
a 5x5 rtable has 2 dimensions.
index_functions
MapleNULL
list of array indexing functions.
attributes
attributes given to this rtable.
transpose
when true, transpose
the rtable at creation.
fill
the default value for
unspecified elements.
The data_type field can have any of the following values.
Maple objects
RTABLE_CXDAG
ComplexDAG
complex Maple software floats
RTABLE_INTEGER8
Byte
8-bit integers
RTABLE_INTEGER16
Integer
16-bit integers
RTABLE_INTEGER32
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.
Array
RTABLE_MATRIX
Matrix
RTABLE_COLUMN
column Vector
RTABLE_ROW
row Vector
The storage field can have any of the following values.
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.
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
plus the one subdiagonal is stored.
RTABLE_LOWTRI
only the lower triangle
RTABLE_LOWTRIMINUS
the lower triangle
RTABLE_LOWTRIPLUS
plus the one superdiagonal is stored.
RTABLE_SCALAR
a single entry is stored.
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.
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.
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