RTableNumElements - query the number of elements in an rtable in external code
|
Calling Sequence
|
|
RTableNumElements(kv, rt)
|
|
Description
|
|
•
|
This function is part of the OpenMaple interface to Microsoft Visual Basic.
|
•
|
The RTableNumElements function returns the number of elements in the rtable rt. This command is equivalent to calling rtable_num_elems with the Stored option.
|
•
|
For dense rtables, this command returns the number of elements of storage allocated. For example, a 2x2 rectangular rtable has 4 elements.
|
•
|
For NAG-sparse format rtables (all hardware datatype sparse storage rtables), this command returns the number of elements in the data vector specified, which is the same as the length of each index vector. Note that the number returned in this case is the number of data elements filled, not the number of elements allocated. For information and restrictions on this format, see ?sparse.
|
•
|
For Maple-sparse rtables, this command returns zero.
|
|
|
Examples
|
|
Public Sub TestRTableNumElements(ByVal kv As Long)
|
Dim rt As Long
|
Dim index(0 To 1) As Long
|
rt = EvalMapleStatement(kv, _
|
"Matrix(500,storage=sparse,datatype=float[8]);")
|
' writes 0 (no stored elements -- sparse format)
|
Write #1, RTableNumElements(kv, rt)
|
' assign a value in the sparse Matrix
|
index(0) = 39
|
index(1) = 271
|
RTableAssignFloat64 kv, rt, index(0), 1.1
|
' writes 1
|
Write #1, RTableNumElements(kv, rt)
|
End Sub
|
|
|
|
|
Download Help Document
Was this information helpful?