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
evalhf/var - passing arrays by value/result; var(name)
Description
The var construct is a place holder for Maple array arguments passed as parameters to functions evaluated by evalhf.
For example,
The var array arguments are converted to hardware floating point. Then evalhf evaluates the function with this float array and on return, the arguments are converted back into the Maple array. This achieves an effect similar to var arguments in Pascal function calls, but in reality it does call by value/result.
The var mechanism is the only mechanism available that will obtain an array result from a computation done by evalhf other than individual calls to compute each array entry.
If desired, an evalhf call can be passed an hfarray or rtable with datatype=float[8] or datatype=complex[8] instead of an array. These are truly passed by reference, and result in negligible overhead on entry to and exit from the evalhf environment.
This conversion process is only necessary when passing an array from Maple to an evalhf function call. Calls within functions already under evalhf evaluation do not need the var(..) feature.
Examples
f := proc(A,B) B[1]:= A[2] end proc:
det := proc(A::array) A[1,1]*A[2,2] - A[1,2]*A[2,1]; end proc:
See Also
evalhf[array]
Download Help Document