home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!network.ucsd.edu!lyapunov.ucsd.edu!mbk
- From: mbk@lyapunov.ucsd.edu (Matt Kennel)
- Newsgroups: comp.lang.misc
- Subject: Re: Scientists as Programmers (was Re: Small Language Wanted)
- Message-ID: <17peeqINNkg8@network.ucsd.edu>
- Date: 30 Aug 92 03:14:34 GMT
- Article-I.D.: network.17peeqINNkg8
- References: <BEVAN.92Aug29191507@tiger.cs.man.ac.uk>
- Organization: Institute For Nonlinear Science, UCSD
- Lines: 78
- NNTP-Posting-Host: lyapunov.ucsd.edu
- X-Newsreader: Tin 1.1 PL3
-
- bevan@cs.man.ac.uk (Stephen J Bevan) writes:
- : In article <17n6fjINNhvt@network.ucsd.edu> mbk@lyapunov.ucsd.edu (Matt Kennel) writes:
- : I have no idea what Mr Rubin really wants but here are a couple of
- : easy ones of the top of my head:
- :
- : P, D, Q <- singular_value_decomposition(A);
- :
- : How about :-
- :
- : (p,d,q) = singular_value_decomposition A
-
- This is perfectly sensible.
-
- : Array index notation:
- :
- : for all i <= j: a(i,j) <- sum over (k) ( b(i,k)*c(j,N,k) )
- :
- : I'm not _exactly_ sure what the above does (e.g. is N constant?), so
- : the following may be wrong (but it is better than my previous attempt
- : which I hopefully cancelled correctly :-)
-
- What I mean is that the upper triangular part of "a" is equal to B *
- transpose("C"), but where the matrix "C" is "spread" out through different
- parts of a 3tensor arrays.
-
- :
- : foo b c = array bds vs
- : where
- : vs = [ (i,j) := f i j | (i,j) <- range bds, i <= j ]
- : f i j = sum [ b!(i,k)*c!(j,n,k) | k <- range (klb,kub) ]
- : bds = ((ilb,jlb),(iub,jub))
- : ((ilb,klb),(iub,kub)) = bounds b
- : ((jlb,_,_),(jub,n,_)) = bounds c
-
- This is perfectly ridiculous! I have no clue what that means.
- I don't think one should have to write a subroutine to implement each simple
- array statement.
-
- : An alternative (and possibly more efficient) version of _vs_ is :-
- :
- : vs = [ (i,j) := f i j | i <- range (ilb,iub), j <- range (i,jub) ]
- :
- : Note this is untested as I currently don't have a compiler installed.
- : As to the notation, I'll do you a deal: you explain the one you're
- : using and I'll explain the one I'm using :-)
-
- What's called "implied summation convention" means "sum over repeated
- indices"on the right hand side of the assignment
- and iterate over covarying indices on both sides. (No I didn't invent
- this...heard it's also called "Einstein summation convention" as it's
- very useful in relativity calculations).
-
- So if C(i,j,k) is a 3-tensor, then
-
- T(i) = C(i,j,j)
-
- means for each matrix C(i,*,*) compute its trace and assign to T(i).
- (Yes the indices should automatically figure out their bounds).
-
- I think it wouldn't be so bad to allow you to explicitly say these things:
-
- for all i T(i) = sum_over(j) C(i,j,j)
-
- sum_over or sum or whatever is the of course just the traditional capital
- sigma symbol used in math, and of course all it means is add everything
- up.
-
- : I won't bore you with the obvious complex numbers, exponentiation, etc.
- :
- : Why not, you may be pleasantly suprised.
- :
- : bevan
-
- --
- -Matt Kennel mbk@inls1.ucsd.edu
- -Institute for Nonlinear Science, University of California, San Diego
- -*** AD: Archive for nonlinear dynamics papers & programs: FTP to
- -*** lyapunov.ucsd.edu, username "anonymous".
-