Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!utnut!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!csus.edu!sfsuvax1.sfsu.edu!vpcsc4
From: vpcsc4@sfsuvax1.sfsu.edu (Emmett McLean)
Subject: Re: Question: Tri-diagonal matrices in APL
Message-ID: <1993May8.024002.1533@csus.edu>
Sender: news@csus.edu
Organization: San Francisco State University
References: <1695@kepler1.rentec.com> <1993May6.030445.3577@csus.edu> <1697@kepler1.rentec.com>
Date: Sat, 8 May 1993 02:40:02 GMT
Lines: 33


   NB. Here is an (slightly edited) email message which pointed out that 
   NB. my analysis of %.  was wrong. This should set things straight:
 
 >    9!:3 (5)
 >    inv =. +/@((</~ ,: >:/~) * ((|:"2 ,: ])@(|.@(*/)~)))@>:@i. % >:
 >    tri =. ,~ $ (2 _1&,)@(,&_1)@(-&2 # 0:)
 >    time  =. 6!:2
 >    space =. 7!:2@]
 >    test  =. time,space
 >    id =. ,~ $ (1&,)@( # 0:)
 >    
 >    NB. J's inverse is NOT that bad!! What you want is something more like:
 >    
 >    tst1 =. +/@|@,@(id - ((%. +/ .* ])@tri))
 >    tst1 100
 > 8.57688e_13
 >    test 'tst1 100'
 > 11.51 861844
 >    
 >    tst2 =. +/@|@,@(id - (inv +/ .* tri))
 >    tst2 100
 > 8.57688e_13
 >    test 'tst2 100'
 > 3.24 783196
 >    
 >    NB. Much more reasonable.
 >    
 >    NB. It seems clear to me that tacit notation isn't!

  So the indigenous matrix inversion is accurate in this case.

  Emmett
