Raul Miller wrote:
> On 7/28/07, Alfonso Salazar <[EMAIL PROTECTED]> wrote:
>> I need verb(s) in order to calculate EIGENVALs
>> ¡S A L U D!
>
> lpack has some.
>


Since the documentation is not completely transparent, here is a
cookbook way to get started.

require '~addons/math/lapack/lapack.ijs'
require '~addons/math/lapack/dgeev.ijs'

NB. get eigenvalues of y
ev=:[: clean_jlapack_ 1 >@{ dgeev_jlapack_

NB. utilities
det=:-/ .*     NB. determinant
id=:[EMAIL PROTECTED]@#
NB. is y an eigenvalue of x?
evq=:4 : '0=clean_jlapack_ det x-y*id x'

NB. test matrices
a=: >2 1 1; 0 3 1; 3 4 3
b=:>0 _1;2 0

   ev a
0.354249 2 5.64575
   *./a&evq"0 ev a
1
   ev b
0j1.41421 0j_1.41421
   *./b&evq"0 ev b
1

Best wishes,

John


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to