Joe Riel

7742 Reputation

22 Badges

14 years, 184 days

MaplePrimes Activity

These are Posts that have been published by Joe Riel

Consider the task of sorting a list of complex floating-point numbers by magnitude. First Attempt The usual method to do this in Maple is with the sort procedure. By passing a boolean-valued function that computes then compares the magnitudes of two complex numbers, we can sort the list. The following procedure shows how this is accomplished.
sort1 := proc(L)
    return sort(L, proc(z1,z2) abs(z1) <= abs(z2) end proc);
end proc:
A disadvantage of this approach is that the absolute-value procedure is called twice every time a pair of numbers is compared. For a long list, the time spent in the absolute value routine dominates the computation time.
The map function is a particularly useful Maple function. I use it frequently and thought I understood how it worked. However, I recently discovered an interesting feature of mapping over vectors, matrices, Vectors, and Matrices. That is, the order of application of the mapped function depends on the data type and may be indeterminate (for table based structures).
It would be nice if there were a second preview button, this one near the Body: block (maybe aligned with its top right corner. That way it isn't necessary to scroll down to the bottom of the page to preview a complicated input. Leaving the submit button at the bottom is okay, that forces one to see the license section and choose something appropriate.
Try to typeset the word "style" in a pre tag, it doesn't work. For example, upon entering
<pre>plot(pts, style=point);</pre> I get

plot(pts, >

Note: this particular post doesn't exhibit the problem, it merely mimics it. It is posted using the plain text format; HTML tags have no effect.
Though I am able to edit my responses in other forums, I don't appear to have that ability in the Maple Commons forum. I noted a few errors in my recent response but am not able to edit it. That is, there is no "edit" field available.
First 11 12 13 14 15 16 Page 13 of 16