My old simple script is thus
eval=:(>&(1&{) +/ .* >&(0&{))&(128!:0)
(<0 1)&|: eval ^:100 A
3 2 1
eval ^:100 A
3 25.9513 100.648
1.72914e_33 2 _2.35339
_4.61459e_50 2.36613e_31 1
Example
A
33 16 72
_24 _10 _57
_8 _4 _17
M.Shimura ([EMAIL PROTECTED])
Japan APL Association
Hot day in Tokyo
>
> While I still suggest using LAPACK for calculating eigenvalues, there
> appears to be some interest in an all-J solution.
>
> Here's a (not very elegant) solution using the neglected 128!:0 (QR
> reduction).
>
>
> QR=:128!:0
> mp=:+/ . *
>
> f=:mp&>~/ @: QR
>
> g=:3 : 0
> z=.f y
> while. z~:y do.
> y=.z
> z=.f y
> end.
> (<0 1)&|: z
> )
>
> A =: 33 16 72 , _24 _10 _57 ,: _8 _4 _17
>
> g A
> 3 2 1
>
>
> Best wishes,
>
> John
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm