On Wed, 1 Oct 2014, Allin Cottrell wrote:
> I had a look at the source and it occurred to me that we may try
to
> intercept expressions like x'x and apply a specialised algorithm (which
> should be somewhat faster) for those: Allin, correct me if I'm wrong, but
> we could check for "l" and "r" for being the same guy in the
B_TRMUL branch
> of the big "switch" inside eval (line 10501 of geneval.c) and then, if so,
> simply call matrix_multiply_self_transpose(). No?
gretl_matrix_multiply_mod() already checks for a identical to b and
calls matrix_multiply_self_transpose() if it's appropriate.
Yes, I saw that, but the check is based on the equality between the two
pointers a and b; my suggestion was based on the impression that l->v.m
and r->v.m may be distinct as a result of the parsing process even though
the original parsed string contained an expression like
"<something>'<something>".
In general, doing tricksy things to try to speed up matrix operations
in
gretl is likely to slow them down. We've spent a lot of time trying to get
things working optimally when coded "naturally".
That's true. And besides, applyimng a specialised algorithm would probably
make a noticeable difference only with HUGE matrices. For example,
applying the specialised algorithm to x'x when x is a column vector may
even slow things down.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------