lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Feb 18, 2011 at 10:59, T T <t34www@googlemail.com> wrote:
> On 18 February 2011 14:19, Leo Razoumov <slonik.az@gmail.com> wrote:
>>
>> It is a priority queue of simulation events ordered by their time.
>> Simulation event loop dispatches the events in strict temporal order.
>> The events can place new events on  the queue, etc.. We ended up doing
>> all this in C++.
>
> Unless you add new events only to the end of the queue and stick to
> plain arrays for implementation, I don't think you make this efficient
> in MATLAB, indeed.  After all, MATLAB stands for MATrix LABoratory and
> that's what it is good at.  JIT helps for an occasional loop, which
> you can't express through vectorized operations, but that's about it.
> Ask for more and you will be disappointed (at least as far as
> performance is concerned).

New events can have almost arbitrary time stamps. The only constraint
is causality -- new events cannot go into the past.
The priority queue was implemented as a heap data structure with the
earliest event on its tip.
Inside the events themselves there were quite a few matrix operations
-- SVD, matrix inversions,  root finding and even some interpolations.
Those MATLAB facilities came really handy.

>> MATLAB is somewhat relevant to this list insofar it is a golden
>> standard for numerical software, one of the likely LuaJIT-2
>> application areas.
>
> Fair enough.  Although, I wouldn't think of Lua(JIT) as an alternative
> to Python/MATLAB/IDL/R/<insert your favourite numerical package here>.
>  It would take long years to make it happen, with little benefit in
> between.
>

I agree, it will take time. But FFI is very handy to bind numeric
libraries and LuaJIT-2 is very fast. Very convenient combination.
Although it might have missed the train by couple of years, I am afraid.

--Leo--