On Wed, 20 Feb 2013, Allin Cottrell wrote:
On Wed, 20 Feb 2013, Riccardo (Jack) Lucchetti wrote:
> Very nice. The next step, logically, would be to support user-written
> functions too. However, this would mean to complicate the code by a factor
> (I reckon) of 1 to 5 or so.
I was afraid the factor might be at the top end of that range, but I
experimented and it's more like 0.25. So user-functions are now supported.
The function must take a single series argument and return a scalar. Example:
<hansl>
function scalar my_aggregator (series x)
return sum(x^3)
end function
open credscore.gdt
matrix m = aggregate(Income, Acc, my_aggregator)
print m
</hansl>
Now, I don't want to be guilty of personality cult, but at the risk of
sounding like an old Stalinist apparatchik I have to say I am left in awe
by the skills of our beloved leader.
Studying the cvs diff has been for several years my primary method for
learning C, but this case stands out as a true gem.
Thank you.
-------------------------------------------------------
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
-------------------------------------------------------