Re: Functions in the relational context
Date: Sat, 8 Mar 2008 12:10:20 +0100
On Fri, 7 Mar 2008 17:00:32 -0800 (PST), Tegiri Nenashi wrote:
> Perhaps you can suggest some other example where nested loops are
> substituted by elegant combination of fold/map/whatever?
I wouldn't even ask you to express this sort of products in general terms independent on concrete objects (m1, m2), their types (matrices), the algebraic operators used for folding (+, *). Because SQL simply lacks any means for such abstractions, which any decent FP or OO language has. So let's pretend we are in early 70s:
Do matrix inversion. (I'd suggest an iterative method. Ah, the accuracy of the result shall be bounded and the bounds known, to the program, I mean.)
In order to continue fun, make a table of all square matrices and then do inverse as you "did" with sine...
-- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.deReceived on Sat Mar 08 2008 - 12:10:20 CET