 evalhf/array - Maple Programming Help

Home : Support : Online Help : Programming : Resource Management : evalhf : evalhf/array

evalhf/array

handling of arrays

Description

 • evalhf handles only two special structures: arrays and rtables. This help page describes arrays, and rtables with their datatype option set to something other than float and complex. The rtable structure, which is a supertype of Array, Matrix, Vector, and hfarray are described in evalhf/hfarray.
 • Arrays passed as parameters to evalhf should have all their entries evaluating to floats or unassigned.
 • Unassigned array entries are treated as 0 by evalhf.
 • In general, evalhf can pass arrays downwards (to its called routines). These arrays can be modified and returned as function values, but cannot be returned as function values at the top level.
 • We distinguish two levels of interaction for arrays: (a) top-level, first call to evalhf and (b) function-to-function within an evalhf call. Thus

(a) $A≔array\left(1..2,3..10,\left[\left(1,3\right)={?}_{1,3},\left(1,4\right)={?}_{1,4},\left(1,5\right)={?}_{1,5},\left(1,6\right)={?}_{1,6},\left(1,7\right)={?}_{1,7},\left(1,8\right)={?}_{1,8},\left(1,9\right)={?}_{1,9},\left(1,10\right)={?}_{1,10},\left(2,3\right)={?}_{2,3},\left(2,4\right)={?}_{2,4},\left(2,5\right)={?}_{2,5},\left(2,6\right)={?}_{2,6},\left(2,7\right)={?}_{2,7},\left(2,8\right)={?}_{2,8},\left(2,9\right)={?}_{2,9},\left(2,10\right)={?}_{2,10}\right]\right)$; $B≔\mathrm{array}\mathrm{\left(...\right)}$; $\mathrm{evalhf}\left(f\left(A\right)+g\left(\mathrm{var}\left(B\right)\right)\right)$;

(b) $f≔$ proc $\mathrm{\left(...\right)}\mathrm{...},$ $A≔\mathrm{array}\mathrm{\left(...\right)}$;  $g\left(\mathrm{...}A,\mathrm{...}\right)\mathrm{...}$; end proc; $\mathrm{evalhf}\left(f\left(\mathrm{...}\right)\right)$;

 • This distinction has to be made because at the top level, arrays are converted to hardware floats, something which is not necessary in between internal evalhf calls. This conversion is expensive and should be used judiciously.
 • Arrays within evalhf are passed by reference, and hence can be modified by any sub-function which uses them.
 • Arrays at the top level (a) are normally passed by value. By using the var(array) construct, arrays are passed by value and result, being converted into hardware floats and after evaluation, converted back.
 • The function array(...) is valid inside evalhf calls and accepts dimension information only. The result is an array of the given dimensions initialized to all zeros. No indexing or initializing information can be given to the function array.
 • Indexing functions are not handled by evalhf.
 • There is no mechanism, within evalhf, to find the dimension of an array from the object itself.
 • Global arrays or global array references are not permitted within evalhf.