Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
RTableNumElements - query the number of elements in an rtable in external code
Calling Sequence
RTableNumElements(kv, rt)
Parameters
kv
-
kernel handle returned by StartMaple
rt
Maple rtable object
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
End Sub
See Also
OpenMaple, OpenMaple/VB/API, OpenMaple/VB/Examples, rtable
Download Help Document