From: Rainer S. <rai...@gm...> - 2024-02-28 17:19:50
|
With the latest checkin, svd should no longer hang. A comparison of the algorithm with the version in the book "Numerical recipes" showed a misplaced closing paren, causing the algorithm to run endlessly. At the same time I added an upper limit for the number of iterations. Even if the computation doesn't converge it will now stop after a while. The sparse package shows the same error. However, trying its spsvd routine on some non-square matrices uncovered other problems. I will look into these next. Best regards, Rainer On Fri, 23 Feb 2024 at 20:17 -0000, Prof Tony Roberts via Reduce-algebra-de...: > Hi, > > have run into a problem with package lin_alg (and package sparse > also has similar issues). Can anyone fix? > > Using redcsl (rev 6339) I execute the following script > > on rounded; print_precision 4$ > load linalg; > a:=mat((-2,3),(5,7)); > svda:=svd(a); > b:=a/3; svdb:=svd(b); > c:=a/2; svdc:=svd(c); > end; > > To get the two different failures for matrices b and c. > > 1: in "tmp.txt"$ > [-2 3] > a := [ ] > [5 7] > svda := { > [0.1722 - 0.9851] > [ ] > [0.9851 0.1722 ] > , > [8.713 0 ] > [ ] > [ 0 3.328] > , > [0.5257 0.8507 ] > [ ] > [0.8507 - 0.5257] > } > [ - 0.6667 1 ] > b := [ ] > [ 1.667 2.333] > ***** svd: Non-numeric matrix element at position ( 1 , 1 ) > Cont? (Y or N) > ?y > [ - 1 1.5] > c := [ ] > [2.5 3.5] > > And then redcsl just hangs, and I have to kill the process. Could > someone advise on a work around (for larger matrices). > > The package sparse also causes similar failure. > > Tony > > -- > --------------------------------------------------------------------- > Four books and a toolbox: > > * (2020) Linear Algebra for the 21st Century > Oxford University Press. isbn: 978-0-19-885640-5, 978-0-19-885639-9 > https://global.oup.com/academic/product/linear-algebra-for-the-21st-century-9780198856399 > > * (2015) Model emergent dynamics in complex systems > SIAM, Philadelphia. isbn: 9781611973556. > https://epubs.siam.org/doi/10.1137/1.9781611973563 > > * (2009) Elementary calculus of financial mathematics > SIAM, Philadelphia. isbn: 978-0-898716-67-2. > https://epubs.siam.org/doi/10.1137/1.9780898718225 > > * (1994) A one-dimensional introduction to continuum mechanics > World Sci. isbn: 978-981-02-1913-0. > > * (2020) with John Maclean, and J. E. Bunder; Equation-Free > function toolbox for Matlab/Octave. > http://github.com/uoa1184615/EquationFreeGit > > Emeritus Professor A.J. Roberts, FAustMS > School of Mathematical Sciences, University of Adelaide > https://profajroberts.github.io/ > mailto:Pro...@pr... > http://orcid.org/0000-0001-8930-1552 > > > > > _______________________________________________ > Reduce-algebra-developers mailing list > Red...@li... > https://lists.sourceforge.net/lists/listinfo/reduce-algebra-developers > > Rainer Schöpf |