MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problem with very slow matrix function

  • To: mathgroup at
  • Subject: [mg50940] Re: problem with very slow matrix function
  • From: Paul Abbott <paul at>
  • Date: Tue, 28 Sep 2004 00:59:19 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <cj86j8$782$>
  • Sender: owner-wri-mathgroup at

In article <cj86j8$782$1 at>,
 Roger Bagula <tftn at> wrote:

> Mathematica will do this function, but only very slowly...
> Thsat limits the number of values and how big I can make my critical point.
> I'd like a better , faster expression to do this kind of matrix 
> switching function.
> I'm also looking for a way to make the switch depend on a random
> level as well (&& / And).  
> I tried a version and it ignorred the second "and" implicit
> and did it on only the first implicit expression.
> As I want to do this on higher matrix level Bonacci/ Pisot
> systems, I would appreciate any help.
> (*  2by2 Markov sequence Critical Eigenvalue collapse of   golden mean*)
> digits=19
> M={{0,1},{1,1}}
> Det[M]
> A[n_]:=If[(Max[Eigenvalues[A[n-1]]])<12, M.A[n-1],A[Floor[(n-1)/2]]];

Use dynamic programming! That is, change this definition to

A[n_]:=A[n]=If[(Max[Eigenvalues[A[n-1]]])<12, M.A[n-1],A[Floor[(n-1)/2]]]


Paul Abbott                                   Phone: +61 8 6488 2734
School of Physics, M013                         Fax: +61 8 6488 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at 

  • Prev by Date: Re: Export to file
  • Next by Date: Re: A list element replacement.
  • Previous by thread: GUIKit and GraphEdit
  • Next by thread: Re: problem with very slow matrix function