Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!rpi!think.com!wupost!darwin.sura.net!gatech!gsusgi1.gsu.edu!gsusgi1.gsu.edu!qmdbms
From: qmdbms@gsusgi2.gsu.edu (Brian Schott)
Subject: Eigen in J?
Message-ID: <qmdbms.699543236@gsusgi1.gsu.edu>
Summary: Is there an existing verb for eigenstructure?
Keywords: eigenstructure, J, c.
Organization: Georgia State University
Date: Mon, 2 Mar 1992 13:33:56 GMT
Lines: 40


I am currently looking for a J function to compute the eigenstructure of a
symmetric matrix.  I understand that the verb c. is not yet implemented in J. 
Below is a listing of suite of APL functions which have worked for me in the
past.  I do not remember their origin, or I would give due credit.  Does
anyone have an equivalent suite of verbs in J to determine eigenvalues and
eigenvectors? Or does anyone want to take on a translation?

(B=)

    $ z #is eigen a
 [1]   z #is eigvect a
 [2]   z #is z,[1]a eigval z     $  

    $ l #is a eigval q
 [1]   l #is 1 1 #transpose(#transpose q)+#inner #x a+#inner #x q     $  

    $ y #is eigvect a;n;q;r;i;z;p;eps
 [1]   y #is ident n #is #rho a[1;]
 [2]   eps #is n #x n #x 1E"12 #x+/#magnitude 1 1 #transpose a
 [3]  qr:q #is ident i #is n
 [4]   r #is a
 [5]  again:z #is ident n
 [6]   z[p;p #is(-i)#take #iota n]#is house i #rho r[((n-i)+#iota i);1+n-i]
 [7]   q #is q+#inner #x z
 [8]   r #is z+#inner #x r
 [9]   #goto again #x #iota 1<i #is i-1
 [10]  a #is r+#inner #x q
 [11]  y #is y+#inner #x q
 [12]  #goto qr #x #iota eps<(+/,a*2)-+/(1 1 #transpose a)*2
 [13]  y #is y[;p #is #downgrade 1 1 #transpose a]     $  

    $ z #is house v;i
 [1]   i #is #rho v
 [2]   v #is v-(((+/v*2)*0.5),(i-1)#rho 0)
 [3]   z #is(ident i)-2 #x v #outer #x v%+/v*2     $  

    $ z #is ident n
 [1]   z #is(n,n)#rho(1,n #rho 0)     $  

