No, I didn't know about that. I was just looking at the old code and
suddenly understood how the "old-school" looping worked and was able to
update it. This uncovered a problem with a matrix update and, once I'd
updated that, I got the same result as shown in the article. It's very
satisfying to be able to be certain you've got it right so easily -
contrary to many other attempts I've made to implement algorithms or get
code working in other languages.
At a glance, the two versions look somewhat similar. The results of the
two are similar but shifted:
NB. Updated McIntyre version from article:
1e_5 clean 1e_6 jacobi m
0 0 0
0 3 0
0 0 2
0.57735 _0.408248 _0.707107
0.57735 0.816497 0
0.57735 _0.408248 0.707107
NB. Current "addons" version:
1e_5 clean&.>1e_6 jacobi m
+-----+----------------------------------+
|3 2 0|_0.40824829 _0.70710678 0.57735027|
| | 0.81649658 0 0.57735027|
| |_0.40824829 0.70710678 0.57735027|
+-----+----------------------------------+
On Thu, Feb 16, 2012 at 5:45 PM, Ric Sherlock <[email protected]> wrote:
> Hi Devon,
> Just wondering if you'd compared it to the code in
> ~addons/math/misc/jacobi.ijs
>
> On Fri, Feb 17, 2012 at 11:13 AM, Devon McCormick <[email protected]>
> wrote:
> > I finally figured out how to interpret and modernize some of the old J in
> > Donald McIntyre's article on using Jacobi's method for finding
> > eigenvalues. The modernized code is available from the article here:
> > http://www.jsoftware.com/jwiki/DevonMcCormick/JacobiByMcIntyre .
> >
> > --
> > Devon McCormick, CFA
> > ^me^ at acm.
> > org is my
> > preferred e-mail
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm