home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / misc / 2807 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  1.9 KB

  1. Path: sparky!uunet!kithrup!stanford.edu!ames!haven.umd.edu!darwin.sura.net!gatech!bloom-beacon!eru.mt.luth.se!lunic!sunic!mcsun!uknet!mucs!m1!bevan
  2. From: bevan@cs.man.ac.uk (Stephen J Bevan)
  3. Newsgroups: comp.lang.misc
  4. Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
  5. Message-ID: <BEVAN.92Aug29191507@tiger.cs.man.ac.uk>
  6. Date: 29 Aug 92 18:15:07 GMT
  7. References: <BEVAN.92Aug28195448@tiger.cs.man.ac.uk> <17n6fjINNhvt@network.ucsd.edu>
  8. Sender: news@cs.man.ac.uk
  9. Organization: Department of Computer Science, University of Manchester
  10. Lines: 41
  11. In-reply-to: mbk@lyapunov.ucsd.edu's message of 29 Aug 92 06:46:11 GMT
  12.  
  13. In article <17n6fjINNhvt@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:
  14.    I have no idea what Mr Rubin really wants but here are a couple of 
  15.    easy ones of the top of my head:
  16.  
  17.     P, D, Q <- singular_value_decomposition(A);
  18.  
  19. How about :-
  20.  
  21. (p,d,q) = singular_value_decomposition A
  22.  
  23.  
  24.    Array index notation:
  25.  
  26.    for all i <= j: a(i,j) <- sum over (k) ( b(i,k)*c(j,N,k) )
  27.  
  28. I'm not _exactly_ sure what the above does (e.g. is N constant?), so
  29. the following may be wrong (but it is better than my previous attempt
  30. which I hopefully cancelled correctly :-)
  31.  
  32. foo b c = array bds vs
  33.   where
  34.     vs = [ (i,j) := f i j | (i,j) <- range bds, i <= j ]
  35.     f i j = sum [ b!(i,k)*c!(j,n,k) | k <- range (klb,kub) ]
  36.     bds = ((ilb,jlb),(iub,jub))
  37.     ((ilb,klb),(iub,kub)) = bounds b
  38.     ((jlb,_,_),(jub,n,_)) = bounds c
  39.  
  40. An alternative (and possibly more efficient) version of _vs_ is :-
  41.  
  42.   vs = [ (i,j) := f i j | i <- range (ilb,iub), j <- range (i,jub) ]
  43.  
  44. Note this is untested as I currently don't have a compiler installed.
  45. As to the notation, I'll do you a deal: you explain the one you're
  46. using and I'll explain the one I'm using :-)
  47.  
  48.  
  49.    I won't bore you with the obvious complex numbers, exponentiation, etc.
  50.  
  51. Why not, you may be pleasantly suprised.
  52.  
  53. bevan
  54.