Split followed by Transpose

Dr.John R.Vokey vokey at uleth.ca
Tue Mar 23 19:13:09 EST 2004


Back when the earth was still cooling, I produced an array package in 
hypercard compiled with CompileIt! that worked with a new hypercard 
object, a SANE array.  From within hypercard, one worked (invisibly) 
with handles to the arrays, so that the array itself was never passed 
in and out of functions, procedures or the external, just specific 
values (i.e., all arrays were passed by reference, not by value).  
Problem was, one had to be verrrrry careful messing around with handles 
behind hypercard's back (so to speak): you could bring the whole system 
to a spectacular grinding halt.  Consequently, I used it for my own 
purposes but never released it.  Now, even my original code is not 
available (loist to the vagaries of upgraded computer systems; not that 
it would be of much use these days).  However, matrix operations, such 
as matrix multiplication and inversion, were fast!  I suspect much the 
same could be done by any moderately competent C programmer these days, 
especially if code from linpack, etc. were incorporated into the 
external.  Recompiled for each OS, it could even be a universal 
external.  One feature that would be most valuable (and make RR the 
envy of most development packages) would be to have an efficient 
eigenvector-extraction or singular value decomposition routine 
included.  With that, one could do the most amazing math tricks with 
just a few lines of transcript (a la Matlab, Octave).

On 23-Mar-04, at 3:57 PM, use-revolution-request at lists.runrev.com wrote:

>> But you have given me a side project to investigate and that would be
>> seeing if an array/matrix/math external would
>>
>> 1. give any substantial performance over a transcript solution (my
>> first thoughts would be yes)
>
> Currently, only strings are passed to externals; presumably values in
> internal number form are stringafied through numberFormat.  (I haven't
> test whether numberFormat is used.)  Arrays might offer some
> possibilities.
>
> On my Mac arithmetic takes under a microsecond, but a call to an
> external takes 25 to 35 microseconds.  An 'if' or 'repeat' is expensive
> in Revolution.
>
> So, an external might do little things, but the value will be in big
> things.  For my math daydreams I have outlined an RPN calculator to
> keep values in the external and avoid passing data back and forth and
> to do multiple operations in one call.  This is mostly for variable
> precision decimal with interval arithmetic and possibly complex or
> trivial vectors.
>
>> 2. the amount of work in defining, sourcing and creating the external
>
> On thing that can help is pointing to something else.  Another approach
> is to mock up in Transcript.  That will also allow you to introduce
> some platforms on externals at different times.
>
>> If anyone has ideas of what should be put into such an external please
>> contact me off the list.
>
> This is cool!
>
> If you also do variable precision arithmetic or interval arithmetic,
> then I don't have to do those.  If you don't, then we might want to see
> what it takes to be compatible.
>
> Dar Scott
--
Dr. John R. Vokey
Department of psychology and Neuroscience
University of Lethbridge
Lethbridge, Alberta
CANADA T1K 3M4



More information about the use-livecode mailing list