login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

fricas
(1) -> <spad>
fricas
)abbrev package JACDIAG JacobiDiagonalisation
++ Author: Kurt Pagani
++ Date Created: Sat Jun 16 23:37:27 CEST 2018
++ License: BSD
++ References: 
++  Jacobi, C.G.J. (1846). "Über ein leichtes Verfahren, die in der Theorie 
++    der Säkularstörungen vorkommenden Gleichungen numerisch aufzulösen". 
++  Crelle's Journal 30, pages 51–94.
++  https://en.wikipedia.org/wiki/Jacobi_eigenvalue_algorithm
++ Description:
++ The Jacobi eigenvalue algorithm is an iterative method for the calculation 
++ of the eigenvalues and eigenvectors of a real symmetric matrix. It is named 
++ after Carl Gustav Jacob Jacobi, who first proposed the method in 1846, but 
++ only became widely used in the 1950s with the advent of computers.
++ Notes
++  * The tolerance and maximum number of iterations may be changed by the
++    function 'setParams'. Defaults are set in the implementation part.
++  * For the case in which one dimension is an independent subspace, the
++    maximum number of iterations may be reached. If 'checkResult' gives
++    a value smaller than 'eps' then 'jacobi' regularly terminates, otherwise
++    an error message is issued.
++ Usage and Example(s)
++  * See test_jacdiag.input 
++  * M:=matrix [[1,1],[1,1]], R:=jacobi(M)
++    R.ev .... eigenvalues
++    R.EV .... eigenvectors as columns of matrix R.EV
++    checkResult(R,M) .... Sum(norm(M*v-l*v))
++    p:=showParams() ..... [maxit= 10000,tol= 0.1 E -8]
++    p.maxit:=20000    
++    setParams(p) ........ [maxit= 20000,tol= 0.1 E -8]
++ IDEA: [jedit]return eps, iter in RES ?
++
JacobiDiagonalisation() : Exports == Implementation where
R ==> Float PI ==> PositiveInteger NN ==> NonNegativeInteger IF ==> R VIF ==> Vector R MIF ==> Matrix R RES ==> Record(ev:VIF,EV:MIF) PAR ==> Record(maxit:PI,tol:R)
Exports == with
jacobi : MIF -> RES checkResult : (RES,MIF) -> R showParams : () -> PAR setParams : PAR -> PAR
Implementation == add
eps:R:=0.000000001 maxIter:PI:=10000
showParams():PAR == [maxIter,eps] setParams(p:PAR):PAR == maxIter:=p.maxit eps:=p.tol showParams()
maxInd(k:PI,n:NN,S:MIF):PI == m:PI:=k+1 for i in k+2..n repeat if abs(S(k,i)) > abs(S(k,m)) then m:=i::PI return m
jacobi(M:MIF):RES == not square? M => error "not square" not symmetric? M => error "not symmetric" S:MIF:=copy M n:NN:=nrows S i:PI; k:PI; l:PI; m:PI state:Integer s:IF;c:IF;t:IF;p:IF;y:IF;d:IF;r:IF ind:List(PI):=[1 for i in 1..n] changed:List Boolean:=[false for i in 1..n] e:VIF:=new(n,0$IF)$VIF E:MIF:=new(n,n,0$IF)$MIF E:=diagonalMatrix [1$IF for i in 1..n] A:IF; B:IF count:Integer:=0 state:=n for k in 1..n repeat ind.k:=maxInd(k::PI,n,S) e.k:=S(k,k) changed.k:=true while (state ~= 0) and (count <= maxIter) repeat m:=1 for k in 2..n-1 repeat if abs(S(k,ind.k)) > abs(S(m,ind.m)) then m:=k::PI -- k:=m l:=ind.m p:=S(k,l) -- y:=(e.l - e.k)/2 d:R:=abs(y)+sqrt(p^2+y^2) r:R:=sqrt(p^2+d^2) c:R:=d/r s:R:=p/r t:R:=p^2/d if y < 0$R then s:=-s t:=-t S(k,l):=0$IF -- y:IF:=e.k e.k:=y-t if changed.k and abs(t)<= eps then changed.k:=false state:=state-1 else if (not changed.k) and abs(t)> eps then changed.k:=true state:=state+1 -- y:IF:=e.l e.l:=y+t if changed.l and abs(t)<= eps then changed.l:=false state:=state-1 else if (not changed.l) and abs(t)> eps then changed.l:=true state:=state+1 -- for i in 1..k-1 repeat A:=S(i,k); B:=S(i,l) S(i,k):=c*A-s*B S(i,l):=s*A+c*B for i in k+1..l-1 repeat A:=S(k,i); B:=S(i,l) S(k,i):=c*A-s*B S(i,l):=s*A+c*B for i in l+1..n repeat A:=S(k,i); B:=S(l,i) S(k,i):=c*A-s*B S(l,i):=s*A+c*B -- for i in 1..n repeat A:=E(i,k); B:=E(i,l) E(i,k):=c*A-s*B E(i,l):=s*A+c*B -- ind.k := maxInd(k,n,S) ind.l := maxInd(l,n,S) -- count:=count+1 --output([count,state]) -- if count > maxIter then if checkResult([e,E]$RES,M) > eps then error("Maximum iteration count reached") return [e,E]$RES
checkResult(r:RES,M:MIF):R == n:=nrows M s:R:=0$R for i in 1..n repeat v:VIF:=column(r.EV,i) d:VIF:=M*v - r.ev.i * v s:=s+sqrt(dot(d,d)) return s</spad>
fricas
Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/6878434841567212350-25px001.spad
      using old system compiler.
   JACDIAG abbreviates package JacobiDiagonalisation 
------------------------------------------------------------------------
   initializing NRLIB JACDIAG for JacobiDiagonalisation 
   compiling into NRLIB JACDIAG 
   compiling exported showParams : () -> Record(maxit: PositiveInteger,tol: Float)
Time: 0 SEC.
compiling exported setParams : Record(maxit: PositiveInteger,tol: Float) -> Record(maxit: PositiveInteger,tol: Float) Time: 0 SEC.
compiling local maxInd : (PositiveInteger,NonNegativeInteger,Matrix Float) -> PositiveInteger Time: 0.01 SEC.
compiling exported jacobi : Matrix Float -> Record(ev: Vector Float,EV: Matrix Float) Time: 0.04 SEC.
compiling exported checkResult : (Record(ev: Vector Float,EV: Matrix Float),Matrix Float) -> Float Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |JacobiDiagonalisation| REDEFINED
;;; *** |JacobiDiagonalisation| REDEFINED Time: 0 SEC.
Warnings: [1] setParams: maxit has no value [2] setParams: tol has no value [3] maxInd: m has no value [4] jacobi: m has no value [5] jacobi: t has no value [6] jacobi: state has no value [7] jacobi: s has no value [8] checkResult: EV has no value [9] checkResult: ev has no value
Cumulative Statistics for Constructor JacobiDiagonalisation Time: 0.07 seconds
finalizing NRLIB JACDIAG Processing JacobiDiagonalisation for Browser database: --------constructor--------- --->-->JacobiDiagonalisation((jacobi ((Record (: ev (Vector (Float))) (: EV (Matrix (Float)))) (Matrix (Float))))): Not documented!!!! --->-->JacobiDiagonalisation((checkResult ((Float) (Record (: ev (Vector (Float))) (: EV (Matrix (Float)))) (Matrix (Float))))): Not documented!!!! --->-->JacobiDiagonalisation((showParams ((Record (: maxit (PositiveInteger)) (: tol (Float)))))): Not documented!!!! --->-->JacobiDiagonalisation((setParams ((Record (: maxit (PositiveInteger)) (: tol (Float))) (Record (: maxit (PositiveInteger)) (: tol (Float)))))): Not documented!!!! ; compiling file "/var/aw/var/LatexWiki/JACDIAG.NRLIB/JACDIAG.lsp" (written 25 NOV 2024 06:22:00 PM):
; wrote /var/aw/var/LatexWiki/JACDIAG.NRLIB/JACDIAG.fasl ; compilation finished in 0:00:00.704 ------------------------------------------------------------------------ JacobiDiagonalisation is now explicitly exposed in frame initial JacobiDiagonalisation will be automatically loaded when needed from /var/aw/var/LatexWiki/JACDIAG.NRLIB/JACDIAG

Test flavours

fricas
-- Unittest .....: Package JacobiDiagonalisation
Author .......: Kurt Pagani -- Date .........: Sun Jun 17 02:14:10 CEST 2018 -- Expected .....: total tests: 16 -- Reference ....: Gregory R.T, Karney D.L., A collection of matrices for testing computational algorithms, -- ............... Krieger (1978), ISBN 0882756494
fricas
)set break resume
 
fricas
)expose UnittestCount UnittestAux Unittest
UnittestCount is now explicitly exposed in frame initial UnittestAux is now explicitly exposed in frame initial Unittest is now explicitly exposed in frame initial
--)co jacdiag
fricas
)expose JACDIAG
JacobiDiagonalisation is already explicitly exposed in frame initial
-- Test Suite testsuite "Package JacobiDiagonalisation"
All user variables and function definitions have been cleared. WARNING: string for testsuite should have less than 15 characters!
Type: Void
fricas
-- Cases
testcase "jacobi"
All user variables and function definitions have been cleared.
Type: Void
fricas
-- https://en.wikipedia.org/wiki/Jacobi_eigenvalue_algorithm
S:= matrix [[4,-30,60,-35], [-30,300,-675,420], 
            [60,-675,1620,-1050],[-35,420,-1050,700]]

\label{eq1}\left[ 
\begin{array}{cccc}
4 & -{30}&{60}& -{35}
\
-{30}&{300}& -{675}&{420}
\
{60}& -{675}&{1620}& -{1050}
\
-{35}&{420}& -{1050}&{700}
(1)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq2}\left[ 
\begin{array}{cccc}
{4.0}& -{30.0}&{60.0}& -{35.0}
\
-{30.0}&{300.0}& -{675.0}&{420.0}
\
{60.0}& -{675.0}&{1620.0}& -{1050.0}
\
-{35.0}&{420.0}& -{1050.0}&{700.0}
(2)
Type: Matrix(Float)
fricas
R:=jacobi(M)

\label{eq3}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.1666428611 \<u> 7189046264}, \:{37.1014913651 \</u> 27658
188}, \: \right.
\
\
\displaystyle
\left.{2585.2538109289 \<u> 223144}, \:{1.4780548447 \</u> 7813691
18}\right] 
(3)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
ev1:= vector [0.1666428611_7189046264, 37.1014913651_27658188,
             2585.2538109289_223144, 1.4780548447_781369118]

\label{eq4}\begin{array}{@{}l}
\displaystyle
\left[{0.1666428611 \<u> 7189046264}, \:{37.1014913651 \</u> 27658
188}, \: \right.
\
\
\displaystyle
\left.{2585.2538109289 \<u> 223144}, \:{1.4780548447 \</u> 7813691
18}\right] 
(4)
Type: Vector(Float)
fricas
EV1:= matrix [[0.7926082911_6404284196, -0.1791862905_3191911245, _
               0.0291933231_7921032382_1, -0.5820756994_9722239026], _
              [0.4519231209_0048280218, 0.7419177906_0266858684, _
              -0.3287120558_2291241902, 0.3705021850_6710175866], _
              [0.3224163985_8196511663, -0.1002281368_8300231266, _
               0.7914111458_4119456574, 0.5095786345_0180583406], _
              [0.2521611696_891868645, -0.6382825282_3465850686, _
              -0.5145527499_457719896, 0.5140482722_2216914813]]

\label{eq5}\left[ 
\begin{array}{cccc}
{0.7926082911 \<u> 6404284196}& -{0.1791862905 \</u> 3191911245}&{0.0
291933231 \<u> 7921032382 \</u> 1}& -{0.5820756994 \<u> 9722239026}
\
{0.4519231209 \</u> 0048280218}&{0.7419177906 \<u> 0266858684}& -{0.3
287120558 \</u> 2291241902}&{0.3705021850 \<u> 6710175866}
\
{0.3224163985 \</u> 8196511663}& -{0.1002281368 \<u> 8300231266}&{0.7
914111458 \</u> 4119456574}&{0.5095786345 \<u> 0180583406}
\
{0.2521611696 \</u> 891868645}& -{0.6382825282 \<u> 3465850686}& -{0.5145527499 \</u> 457719896}&{0.5140482722 \_ 2216914813}
(5)
Type: Matrix(Float)
fricas
eps:=0.0000000001

\label{eq6}0.1 E - 9(6)
Type: Float
fricas
floatNull(v:Vector Float):Boolean == sqrt dot(v,v) <= eps 
Function declaration floatNull : Vector(Float) -> Boolean has been added to workspace.
Type: Void
fricas
vector members(map(abs,R.EV-EV1))

\label{eq7}\begin{array}{@{}l}
\displaystyle
\left[{0.0}, \:{0.0}, \:{0.3 E - 21}, \:{0.0}, \:{0.0}, \:{0.3 E - 20}, \:{0.3 E - 20}, \:{0.5 E - 20}, \right.
\
\
\displaystyle
\left.\:{0.2 E - 20}, \:{0.3 E - 20}, \:{0.0}, \:{0.0}, \:{0.3 E - 20}, \:{0.3 E - 20}, \:{0.0}, \: \right.
\
\
\displaystyle
\left.{0.3 E - 20}\right] 
(7)
Type: Vector(Float)
fricas
testEquals("floatNull(R.ev-ev1)", "true")
fricas
Compiling function floatNull with type Vector(Float) -> Boolean
Type: Void
fricas
testEquals("floatNull(vector members(map(abs,R.EV-EV1)))", "true")
Type: Void
fricas
-- Gregory R.T, Karney D.L, A collection of matrices for testing 
-- computational algorithms, Krieger, 1978
-- CHAPTER IV, Example 4.1
S:= matrix [[5,4,1,1], [4,5,1,1], [1,1,4,2],[1,1,2,4]]

\label{eq8}\left[ 
\begin{array}{cccc}
5 & 4 & 1 & 1 
\
4 & 5 & 1 & 1 
\
1 & 1 & 4 & 2 
\
1 & 1 & 2 & 4 
(8)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq9}\left[ 
\begin{array}{cccc}
{5.0}&{4.0}&{1.0}&{1.0}
\
{4.0}&{5.0}&{1.0}&{1.0}
\
{1.0}&{1.0}&{4.0}&{2.0}
\
{1.0}&{1.0}&{2.0}&{4.0}
(9)
Type: Matrix(Float)
fricas
p:=showParams()

\label{eq10}\left[{maxit ={10000}}, \:{tol ={0.1 E - 8}}\right](10)
Type: Record(maxit: PositiveInteger?,tol: Float)
fricas
p.maxit:=20000

\label{eq11}20000(11)
Type: PositiveInteger?
fricas
p.tol:=0.00000000001

\label{eq12}0.1 E - 10(12)
Type: Float
fricas
setParams(p)

\label{eq13}\left[{maxit ={20000}}, \:{tol ={0.1 E - 10}}\right](13)
Type: Record(maxit: PositiveInteger?,tol: Float)
fricas
R1:=jacobi(M)

\label{eq14}\begin{array}{@{}l}
\displaystyle
\left[{ev ={\left[{1.0}, \:{10.0}, \:{2.0}, \:{5.0}\right]}}, \: \right.
\
\
\displaystyle
\left.{
\begin{array}{@{}l}
\displaystyle
EV = 
\
\
\displaystyle
{\left[ 
\begin{array}{cccc}
{0.7071067811 \<u> 865475244}&{0.6324555320 \</u> 336758664}&{0.0}& -{0.3162277660 \<u> 168379332}
\
-{0.7071067811 \</u> 865475244}&{0.6324555320 \<u> 336758664}&{0.0}& -{0.3162277660 \</u> 168379332}
\
{0.0}&{0.3162277660 \<u> 168379332}&{0.7071067811 \</u> 865475244}&{0.6
324555320 \<u> 336758664}
\
{0.0}&{0.3162277660 \</u> 168379332}& -{0.7071067811 \<u> 86547524
4}&{0.6324555320 \</u> 336758664}
?}}, \: \right. \ \ \displaystyle \left.{ \begin{array}{@{}l} \displaystyle EV = \ \ \displaystyle {\left[ \begin{array}{cccc} {0.7071067811 \ 865475244}&{0.6324555320 \ 336758664}&{0.0}& -{0.3162277660 \ 168379332} \ -{0.7071067811 \ 865475244}&{0.6324555320 \ 336758664}&{0.0}& -{0.3162277660 \ 168379332} \ {0.0}&{0.3162277660 \ 168379332}&{0.7071067811 \ 865475244}&{0.6 324555320 \ 336758664} \ {0.0}&{0.3162277660 \ 168379332}& -{0.7071067811 \ 86547524 4}&{0.6324555320 \ 336758664} " class="equation" src="images/3192297519243230694-16.0px.png" align="bottom" Style="vertical-align:text-bottom" width="816" height="1056"/>(14)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R1,M)<eps","true")
Type: Void
fricas
-- Example 4.2
S:= matrix [[6,4,4,1], [4,6,1,4], [4,1,6,4],[1,4,4,6]]

\label{eq15}\left[ 
\begin{array}{cccc}
6 & 4 & 4 & 1 
\
4 & 6 & 1 & 4 
\
4 & 1 & 6 & 4 
\
1 & 4 & 4 & 6 
(15)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq16}\left[ 
\begin{array}{cccc}
{6.0}&{4.0}&{4.0}&{1.0}
\
{4.0}&{6.0}&{1.0}&{4.0}
\
{4.0}&{1.0}&{6.0}&{4.0}
\
{1.0}&{4.0}&{4.0}&{6.0}
(16)
Type: Matrix(Float)
fricas
R2:=jacobi(M)

\label{eq17}\begin{array}{@{}l}
\displaystyle
\left[{ev ={\left[ -{1.0}, \:{5.0}, \:{5.0}, \:{15.0}\right]}}, \: \right.
\
\
\displaystyle
\left.{
\begin{array}{@{}l}
\displaystyle
EV = 
\
\
\displaystyle
{\left[ 
\begin{array}{cccc}
{0.5}&{0.5}&{0.5}&{0.5}
\
-{0.5}&{0.5}& -{0.5}&{0.5}
\
-{0.5}& -{0.5}&{0.5}&{0.5}
\
{0.5}& -{0.5}& -{0.5}&{0.5}
(17)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R2,M)<eps","true")
Type: Void
fricas
-- Example 4.3
S:= matrix [[2,1,3,4], [1,-3,1,5], [3,1,6,-2],[4,5,-2,-1]]

\label{eq18}\left[ 
\begin{array}{cccc}
2 & 1 & 3 & 4 
\
1 & - 3 & 1 & 5 
\
3 & 1 & 6 & - 2 
\
4 & 5 & - 2 & - 1 
(18)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq19}\left[ 
\begin{array}{cccc}
{2.0}&{1.0}&{3.0}&{4.0}
\
{1.0}& -{3.0}&{1.0}&{5.0}
\
{3.0}&{1.0}&{6.0}& -{2.0}
\
{4.0}&{5.0}& -{2.0}& -{1.0}
(19)
Type: Matrix(Float)
fricas
R3:=jacobi(M)

\label{eq20}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[ -{1.5731907383 \<u> 035074402}, \: -{8.0285783523 \</u> 965
302993}, \right.
\
\
\displaystyle
\left.\:{7.9329047178 \<u> 700173785}, \:{5.6688643728 \</u> 30020
3611}\right] 
(20)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R3,M)<eps","true")
Type: Void
fricas
-- Example 4.4
S:= matrix [[5,7,6,5], [7,10,8,7], [6,8,10,9],[5,7,9,10]]

\label{eq21}\left[ 
\begin{array}{cccc}
5 & 7 & 6 & 5 
\
7 &{10}& 8 & 7 
\
6 & 8 &{10}& 9 
\
5 & 7 & 9 &{10}
(21)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq22}\left[ 
\begin{array}{cccc}
{5.0}&{7.0}&{6.0}&{5.0}
\
{7.0}&{10.0}&{8.0}&{7.0}
\
{6.0}&{8.0}&{10.0}&{9.0}
\
{5.0}&{7.0}&{9.0}&{10.0}
(22)
Type: Matrix(Float)
fricas
R4:=jacobi(M)

\label{eq23}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.0101500483 \<u> 9789186807 \</u> 2}, \:{3.8580574559 \_ 4
49508547}, \right.
\
\
\displaystyle
\left.\:{0.8431071498 \<u> 550318408}, \:{30.2886853458 \</u> 0212
5436}\right] 
(23)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R4,M)<eps","true")
Type: Void
fricas
-- Example 4.5
eps:=0.00000001  -- eps from above too small

\label{eq24}0.1 E - 7(24)
Type: Float
fricas
M:= matrix [[0.81321,-0.00013,0.00014,0.00011,0.00021], _
            [-0.00013,0.93125,0.23567,0.41235,0.41632], _
            [0.00014,0.23567,0.18765,0.50632,0.30697],  _
            [0.00011,0.41235,0.50632,0.27605,0.46322],  _
            [0.00021,0.41632,0.30697,0.46322,0.41931]]

\label{eq25}\left[ 
\begin{array}{ccccc}
{0.81321}& -{0.00013}&{0.00014}&{0.00011}&{0.00021}
\
-{0.00013}&{0.93125}&{0.23567}&{0.41235}&{0.41632}
\
{0.00014}&{0.23567}&{0.18765}&{0.50632}&{0.30697}
\
{0.00011}&{0.41235}&{0.50632}&{0.27605}&{0.46322}
\
{0.00021}&{0.41632}&{0.30697}&{0.46322}&{0.41931}
(25)
Type: Matrix(Float)
fricas
R5:=jacobi(M)

\label{eq26}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.8132101714 \<u> 8644666656}, \:{0.4198520858 \</u> 425381
4826}, \: \right.
\
\
\displaystyle
\left.-{0.2990822128 \_ 7531886141}, \: \right.
\
\
\displaystyle
\left.{1.6782798304 \<u> 035586382}, \:{0.0152101251 \</u> 4277540
844 \_ 1}\right] 
(26)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R5,M)<eps","true")
Type: Void
fricas
-- Example 4.6
eps:=0.0000001  -- eps from above too small

\label{eq27}0.1 E - 6(27)
Type: Float
fricas
S:= matrix [[5,4,3,2,1],[4,6,0,4,3],[3,0,7,6,5],[2,4,6,8,7],[1,3,5,7,9]]

\label{eq28}\left[ 
\begin{array}{ccccc}
5 & 4 & 3 & 2 & 1 
\
4 & 6 & 0 & 4 & 3 
\
3 & 0 & 7 & 6 & 5 
\
2 & 4 & 6 & 8 & 7 
\
1 & 3 & 5 & 7 & 9 
(28)
Type: Matrix(NonNegativeInteger?)
fricas
M:=map(s+->s::Float, S)

\label{eq29}\left[ 
\begin{array}{ccccc}
{5.0}&{4.0}&{3.0}&{2.0}&{1.0}
\
{4.0}&{6.0}&{0.0}&{4.0}&{3.0}
\
{3.0}&{0.0}&{7.0}&{6.0}&{5.0}
\
{2.0}&{4.0}&{6.0}&{8.0}&{7.0}
\
{1.0}&{3.0}&{5.0}&{7.0}&{9.0}
(29)
Type: Matrix(Float)
fricas
R6:=jacobi(M)

\label{eq30}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[ -{1.0965951816 \<u> 58696809}, \:{7.5137241542 \</u> 053727
573}, \: \right.
\
\
\displaystyle
\left.{4.8489501203 \<u> 161481508}, \:{1.3270455995 \</u> 5676524
47}, \: \right.
\
\
\displaystyle
\left.{22.4068753075 \_ 80410656}\right] 
(30)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R6,M)<eps","true")
Type: Void
fricas
-- Example 4.7
S:= matrix [[10,1,2,3,4],[1,9,-1,2,-3],[2,-1,7,3,-5],[3,2,3,12,-1],_
            [4,-3,-5,-1,15]]

\label{eq31}\left[ 
\begin{array}{ccccc}
{10}& 1 & 2 & 3 & 4 
\
1 & 9 & - 1 & 2 & - 3 
\
2 & - 1 & 7 & 3 & - 5 
\
3 & 2 & 3 &{12}& - 1 
\
4 & - 3 & - 5 & - 1 &{15}
(31)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq32}\left[ 
\begin{array}{ccccc}
{10.0}&{1.0}&{2.0}&{3.0}&{4.0}
\
{1.0}&{9.0}& -{1.0}&{2.0}& -{3.0}
\
{2.0}& -{1.0}&{7.0}&{3.0}& -{5.0}
\
{3.0}&{2.0}&{3.0}&{12.0}& -{1.0}
\
{4.0}& -{3.0}& -{5.0}& -{1.0}&{15.0}
(32)
Type: Matrix(Float)
fricas
R7:=jacobi(M)

\label{eq33}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{6.9948378304 \<u> 964728165}, \:{9.3655549201 \</u> 0613240
88}, \: \right.
\
\
\displaystyle
\left.{1.6552662077 \<u> 271664822}, \:{15.8089207643 \</u> 904919
67}, \: \right.
\
\
\displaystyle
\left.{19.1754202772 \_ 79736326}\right] 
(33)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R7,M)<eps","true")
Type: Void
fricas
-- Example 4.8
S:= matrix [[5,1,-2,0,-2,5],[1,6,-3,2,0,6],[-2,-3,8,-5,-6,0],[0,2,-5,5,1,-2],_
            [-2,0,-6,1,6,-3],[5,6,0,-2,-3,8]]

\label{eq34}\left[ 
\begin{array}{cccccc}
5 & 1 & - 2 & 0 & - 2 & 5 
\
1 & 6 & - 3 & 2 & 0 & 6 
\
- 2 & - 3 & 8 & - 5 & - 6 & 0 
\
0 & 2 & - 5 & 5 & 1 & - 2 
\
- 2 & 0 & - 6 & 1 & 6 & - 3 
\
5 & 6 & 0 & - 2 & - 3 & 8 
(34)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq35}\left[ 
\begin{array}{cccccc}
{5.0}&{1.0}& -{2.0}&{0.0}& -{2.0}&{5.0}
\
{1.0}&{6.0}& -{3.0}&{2.0}&{0.0}&{6.0}
\
-{2.0}& -{3.0}&{8.0}& -{5.0}& -{6.0}&{0.0}
\
{0.0}&{2.0}& -{5.0}&{5.0}&{1.0}& -{2.0}
\
-{2.0}&{0.0}& -{6.0}&{1.0}&{6.0}& -{3.0}
\
{5.0}&{6.0}&{0.0}& -{2.0}& -{3.0}&{8.0}
(35)
Type: Matrix(Float)
fricas
R8:=jacobi(M)

\label{eq36}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{4.4559896384 \<u> 593662322}, \: -{1.5987342935 \</u> 81359
4058}, \right.
\
\
\displaystyle
\left.\:{16.1427446551 \<u> 21993174}, \:{4.4559896384 \</u> 59366
2321}, \: \right.
\
\
\displaystyle
\left.-{1.5987342935 \<u> 813594058}, \:{16.1427446551 \</u> 21993
174}\right] 
(36)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R8,M)<eps","true")
Type: Void
fricas
-- Example 4.9
S:= matrix [[1,2,3,0,1,2],[2,4,5,-1,0,3],[3,5,6,-2,-3,0],[0,-1,-2,1,2,3],_
            [1,0,-3,2,4,5],[2,3,0,3,5,6]]

\label{eq37}\left[ 
\begin{array}{cccccc}
1 & 2 & 3 & 0 & 1 & 2 
\
2 & 4 & 5 & - 1 & 0 & 3 
\
3 & 5 & 6 & - 2 & - 3 & 0 
\
0 & - 1 & - 2 & 1 & 2 & 3 
\
1 & 0 & - 3 & 2 & 4 & 5 
\
2 & 3 & 0 & 3 & 5 & 6 
(37)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq38}\left[ 
\begin{array}{cccccc}
{1.0}&{2.0}&{3.0}&{0.0}&{1.0}&{2.0}
\
{2.0}&{4.0}&{5.0}& -{1.0}&{0.0}&{3.0}
\
{3.0}&{5.0}&{6.0}& -{2.0}& -{3.0}&{0.0}
\
{0.0}& -{1.0}& -{2.0}&{1.0}&{2.0}&{3.0}
\
{1.0}&{0.0}& -{3.0}&{2.0}&{4.0}&{5.0}
\
{2.0}&{3.0}&{0.0}&{3.0}&{5.0}&{6.0}
(38)
Type: Matrix(Float)
fricas
R9:=jacobi(M)

\label{eq39}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.2849864366 \<u> 7450951293}, \: -{1.6963228483 \</u> 9591
36551}, \right.
\
\
\displaystyle
\left.\:{12.4113364117 \<u> 21404142}, \:{0.2849864366 \</u> 74509
51293}, \: \right.
\
\
\displaystyle
\left.-{1.6963228483 \<u> 959136551}, \:{12.4113364117 \</u> 21404
142}\right] 
(39)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R9,M)<eps","true")
Type: Void
fricas
-- Example 4.10
eps:=0.00001  -- eps from above too small

\label{eq40}0.00001(40)
Type: Float
fricas
S:= matrix [[611,196,-192,407,-8,-52,-49,29], _
            [196,899,113,-192,-71,-43,-8,-44], _
            [-192,113,899,196,61,49,8,52], _
            [407,-192,196,611,8,44,59,-23],_
            [-8,-71,61,8,411,-599,208,208], _
            [-52,-43,49,44,-599,411,208,208], _
            [-49,-8,8,59,208,208,99,-911], _
            [29,-44,52,-23,208,208,-911,99]]

\label{eq41}\left[ 
\begin{array}{cccccccc}
{611}&{196}& -{192}&{407}& - 8 & -{52}& -{49}&{29}
\
{196}&{899}&{113}& -{192}& -{71}& -{43}& - 8 & -{44}
\
-{192}&{113}&{899}&{196}&{61}&{49}& 8 &{52}
\
{407}& -{192}&{196}&{611}& 8 &{44}&{59}& -{23}
\
- 8 & -{71}&{61}& 8 &{411}& -{599}&{208}&{208}
\
-{52}& -{43}&{49}&{44}& -{599}&{411}&{208}&{208}
\
-{49}& - 8 & 8 &{59}&{208}&{208}&{99}& -{911}
\
{29}& -{44}&{52}& -{23}&{208}&{208}& -{911}&{99}
(41)
Type: Matrix(Integer)
fricas
M:=map(s+->s::Float, S)

\label{eq42}\left[ 
\begin{array}{cccccccc}
{611.0}&{196.0}& -{192.0}&{407.0}& -{8.0}& -{52.0}& -{49.0}&{2
9.0}
\
{196.0}&{899.0}&{113.0}& -{192.0}& -{71.0}& -{43.0}& -{8.0}& -{44.0}
\
-{192.0}&{113.0}&{899.0}&{196.0}&{61.0}&{49.0}&{8.0}&{52.0}
\
{407.0}& -{192.0}&{196.0}&{611.0}&{8.0}&{44.0}&{59.0}& -{23.0}
\
-{8.0}& -{71.0}&{61.0}&{8.0}&{411.0}& -{599.0}&{208.0}&{208.0}
\
-{52.0}& -{43.0}&{49.0}&{44.0}& -{599.0}&{411.0}&{208.0}&{208.0}
\
-{49.0}& -{8.0}&{8.0}&{59.0}&{208.0}&{208.0}&{99.0}& -{911.0}
\
{29.0}& -{44.0}&{52.0}& -{23.0}&{208.0}&{208.0}& -{911.0}&{99.0}
(42)
Type: Matrix(Float)
fricas
R10:=jacobi(M)

\label{eq43}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.0980486407 \<u> 2151706114 \</u> 7}, \:{999.9999999999 \_ 9999958}, \right.
\
\
\displaystyle
\left.\:{1000.0}, \:{1020.0490184299 \_ 968238}, \: \right.
\
\
\displaystyle
\left.{0.3776805208 \_ 266153749 E - 15}, \: \right.
\
\
\displaystyle
\left.{1019.9999999999 \<u> 989334}, \: -{1020.0490184299 \</u> 96
8238}, \right.
\
\
\displaystyle
\left.\:{1019.9019513592 \_ 795495}\right] 
(43)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R10,M)<eps","true")
Type: Void
fricas
-- Example 4.11
eps:=0.00001  -- eps from above too small

\label{eq44}0.00001(44)
Type: Float
fricas
S:= diagonalMatrix [5,6,6,6,6,6,6,6,6,6,5]

\label{eq45}\left[ 
\begin{array}{ccccccccccc}
5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
\
0 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
\
0 & 0 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
\
0 & 0 & 0 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 
\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 
\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 
\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 5 
(45)
Type: Matrix(Integer)
fricas
for i in 2..11 repeat S(i-1,i):=S(i,i-1):=3
Type: Void
fricas
for i in 3..11 repeat S(i-2,i):=S(i,i-2):=1
Type: Void
fricas
for i in 4..11 repeat S(i-3,i):=S(i,i-3):=1
Type: Void
fricas
S(1,2):=S(2,1):=S(10,11):=S(11,10):=2

\label{eq46}2(46)
Type: PositiveInteger?
fricas
M:=map(s+->s::Float, S)

\label{eq47}\left[ 
\begin{array}{ccccccccccc}
{5.0}&{2.0}&{1.0}&{1.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}
\
{2.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}
\
{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}
\
{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}&{0.0}&{0.0}&{0.0}
\
{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}&{0.0}&{0.0}
\
{0.0}&{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}&{0.0}
\
{0.0}&{0.0}&{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}&{0.0}
\
{0.0}&{0.0}&{0.0}&{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}&{1.0}
\
{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{3.0}&{1.0}
\
{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{1.0}&{1.0}&{3.0}&{6.0}&{2.0}
\
{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{0.0}&{1.0}&{1.0}&{2.0}&{5.0}
(47)
Type: Matrix(Float)
fricas
R11:=jacobi(M)

\label{eq48}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{4.1292484841 \<u> 890931323}, \:{0.5222822874 \</u> 6137264
404}, \: \right.
\
\
\displaystyle
\left.{8.8284271247 \<u> 461905061}, \:{3.9999999999 \</u> 9999999
97}, \: \right.
\
\
\displaystyle
\left.{14.9418193276 \<u> 76381949}, \:{3.1715728752 \</u> 5380770
16}, \: \right.
\
\
\displaystyle
\left.{5.9999999999 \<u> 99999446}, \:{1.8038475772 \</u> 93370916
8}, \: \right.
\
\
\displaystyle
\left.{12.1961524227 \<u> 06631475}, \:{4.4066499006 \</u> 7315222
96}, \: \right.
\
\
\displaystyle
\left.{3.9999999999 \_ 999999999}\right] 
(48)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R11,M)<eps","true")
Type: Void
fricas
-- Example 4.12
M:=matrix [[0.2500,0.06675,0.04000,0.02475,0.07050,0.06375,0.06925,0.02050,_ 0.03600, -0.01025,-0.00175,0.02750,0.02300,0.00200], _ [0.06675,0.25000,0.10400,0.07475,0.03625,0.11675,0.11050,0.06225,0.05100, _ 0.03250,0.02400,0.03600,0.06350,0.05300], _ [0.04000,0.10400,0.25000,0.14575,0.03725,0.07175,0.07800,0.12200,0.11275, _ 0.09375,0.10175,0.09600,0.14300,0.11550], _ [0.02475,0.07475,0.14575,0.25000,0.05375,0.07000,0.05225,0.12800,0.12475, _ 0.10550,0.13000,0.14575,0.13975,0.13375], _ [0.07050,0.03625,0.03725,0.05375,0.25000,0.04575,0.05750,0.05700,0.05050, _ 0.01475,0.04500,0.07150,0.05300,0.01600], _ [0.06375,0.11675,0.07175,0.07000,0.04575,0.25000,0.08625,0.08800,0.07150, _ 0.04850,0.03200,0.04475,0.03300,0.04500], _ [0.06925,0.11050,0.07800,0.05225,0.05750,0.08625,0.25000,0.08725,0.06950, _ 0.03725,0.04025,0.04300,0.04075,0.01450], _ [0.02050,0.06225,0.12200,0.12800,0.05700,0.08800,0.08725,0.25000,0.14100, _ 0.13275,0.15550,0.13050,0.11825,0.09125], _ [0.03600,0.05100,0.11275,0.12475,0.05050,0.07150,0.06950,0.14100,0.25000, _ 0.07425,0.10750,0.09175,0.10725,0.08225], _ [-0.01025,0.03250,0.09375,0.10550,0.01475,0.04850,0.03725,0.13275,0.07425, _ 0.25000,0.15500,0.09625,0.09950,0.09425], _ [-0.00175,0.02400,0.10175,0.13000,0.04500,0.03200,0.04025,0.15550,0.10750, _ 0.15500,0.25000,0.13350,0.14850,0.13050], _ [0.02750,0.03600,0.09600,0.14575,0.07150,0.04475,0.04300,0.13050,0.09175, _ 0.09625,0.13350,0.25000,0.11100,0.10075], _ [0.02300,0.06350,0.14300,0.13975,0.05300,0.03300,0.04075,0.11825,0.10725, _ 0.09950,0.14850,0.11100,0.25000,0.14325], _ [0.00200,0.05300,0.11550,0.13375,0.01600,0.04500,0.01450,0.09125,0.08225, _ 0.09425,0.13050,0.10075,0.14325,0.25000]]

\label{eq49}\left[ 
\begin{array}{cccccccccccccc}
{0.25}&{0.06675}&{0.04}&{0.02475}&{0.0705}&{0.06375}&{0.06925}&{0.0
205}&{0.036}& -{0.01025}& -{0.00175}&{0.0275}&{0.023}&{0.002}
\
{0.06675}&{0.25}&{0.104}&{0.07475}&{0.03625}&{0.11675}&{0.110
5}&{0.06225}&{0.051}&{0.0325}&{0.024}&{0.036}&{0.0635}&{0.053}
\
{0.04}&{0.104}&{0.25}&{0.14575}&{0.03725}&{0.07175}&{0.078}&{0.1
22}&{0.11275}&{0.09375}&{0.10175}&{0.096}&{0.143}&{0.1155}
\
{0.02475}&{0.07475}&{0.14575}&{0.25}&{0.05375}&{0.07}&{0.0522
5}&{0.128}&{0.12475}&{0.1055}&{0.13}&{0.14575}&{0.13975}&{0.1
3375}
\
{0.0705}&{0.03625}&{0.03725}&{0.05375}&{0.25}&{0.04575}&{0.05
75}&{0.057}&{0.0505}&{0.01475}&{0.045}&{0.0715}&{0.053}&{0.01
6}
\
{0.06375}&{0.11675}&{0.07175}&{0.07}&{0.04575}&{0.25}&{0.0862
5}&{0.088}&{0.0715}&{0.0485}&{0.032}&{0.04475}&{0.033}&{0.045}
\
{0.06925}&{0.1105}&{0.078}&{0.05225}&{0.0575}&{0.08625}&{0.25}&{0.0
8725}&{0.0695}&{0.03725}&{0.04025}&{0.043}&{0.04075}&{0.0145}
\
{0.0205}&{0.06225}&{0.122}&{0.128}&{0.057}&{0.088}&{0.08725}&{0.2
5}&{0.141}&{0.13275}&{0.1555}&{0.1305}&{0.11825}&{0.09125}
\
{0.036}&{0.051}&{0.11275}&{0.12475}&{0.0505}&{0.0715}&{0.0695}&{0.1
41}&{0.25}&{0.07425}&{0.1075}&{0.09175}&{0.10725}&{0.08225}
\
-{0.01025}&{0.0325}&{0.09375}&{0.1055}&{0.01475}&{0.0485}&{0.0
3725}&{0.13275}&{0.07425}&{0.25}&{0.155}&{0.09625}&{0.0995}&{0.0
9425}
\
-{0.00175}&{0.024}&{0.10175}&{0.13}&{0.045}&{0.032}&{0.04025}&{0.1
555}&{0.1075}&{0.155}&{0.25}&{0.1335}&{0.1485}&{0.1305}
\
{0.0275}&{0.036}&{0.096}&{0.14575}&{0.0715}&{0.04475}&{0.043}&{0.1
305}&{0.09175}&{0.09625}&{0.1335}&{0.25}&{0.111}&{0.10075}
\
{0.023}&{0.0635}&{0.143}&{0.13975}&{0.053}&{0.033}&{0.04075}&{0.1
1825}&{0.10725}&{0.0995}&{0.1485}&{0.111}&{0.25}&{0.14325}
\
{0.002}&{0.053}&{0.1155}&{0.13375}&{0.016}&{0.045}&{0.0145}&{0.0
9125}&{0.08225}&{0.09425}&{0.1305}&{0.10075}&{0.14325}&{0.25}
(49)
Type: Matrix(Float)
fricas
R12:=jacobi(M)

\label{eq50}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{0.1663246021 \<u> 0025823682}, \:{0.1713075617 \</u> 897417
1399}, \: \right.
\
\
\displaystyle
\left.{0.0972092161 \<u> 6203514813 \</u> 8}, \:{0.1227875231 \_ 8
17131926}, \right.
\
\
\displaystyle
\left.\:{0.2677332979 \<u> 5388836645}, \:{0.4627662026 \</u> 9414
64008}, \: \right.
\
\
\displaystyle
\left.{0.1032157624 \_ 3104449922}, \: \right.
\
\
\displaystyle
\left.{0.0643799133 \<u> 6741279490 \</u> 3}, \: \right.
\
\
\displaystyle
\left.{0.1773563338 \_ 2092625442}, \: \right.
\
\
\displaystyle
\left.{0.0735971188 \<u> 5341424867 \</u> 5}, \:{1.3340348369 \_ 5
64426216}, \right.
\
\
\displaystyle
\left.\:{0.1434228761 \_ 4650515836}, \: \right.
\
\
\displaystyle
\left.{0.0842252705 \<u> 6463554604 \</u> 4}, \: \right.
\
\
\displaystyle
\left.{0.2316394839 \_ 7783581793}\right] 
(50)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R12,M)<eps","true")
Type: Void
fricas
-- Example 4.13 (Hilbert Matrix)
H(n) == matrix [[1/(i+j-1) for i in 1..n] for j in 1..n]
Type: Void
fricas
M:=H(20);
fricas
Compiling function H with type PositiveInteger -> Matrix(Fraction(
      Integer))
Type: Matrix(Fraction(Integer))
fricas
R13:=jacobi(M)

\label{eq51}\begin{array}{@{}l}
\displaystyle
\left[{
\begin{array}{@{}l}
\displaystyle
ev ={
\begin{array}{@{}l}
\displaystyle
\left[{1.9071347204 \<u> 07253103}, \:{0.4870384065 \</u> 72048867
81}, \: \right.
\
\
\displaystyle
\left.{0.0008676711 \<u> 0917149782 \</u> 705}, \: \right.
\
\
\displaystyle
\left.{0.0000048305 \<u> 1004864734 \</u> 33279}, \: \right.
\
\
\displaystyle
\left.{0.0089611286 \<u> 1485648034 \</u> 98}, \: \right.
\
\
\displaystyle
\left.{0.1590216371 \_ 077614324 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.1413948074 \_ 4628595824 E - 7}, \: \right.
\
\
\displaystyle
\left.{0.3979401165 \_ 5463231616 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.0755958213 \<u> 0544095843 \</u> 9}, \: \right.
\
\
\displaystyle
\left.{0.1668930345 \_ 4225524645 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.1872845593 \_ 6715022839 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.4156604438 \_ 2412458777 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.6029936660 \_ 8059110817 E - 9}, \: \right.
\
\
\displaystyle
\left.{0.1279656833 \_ 3254260344 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.2827652010 \_ 3941708864 E - 6}, \: \right.
\
\
\displaystyle
\left.{0.1328459298 \_ 5173200512 E - 12}, \: \right.
\
\
\displaystyle
\left.{0.9892736125 \_ 7865554553 E - 12}, \: \right.
\
\
\displaystyle
\left.{0.3879726539 \_ 3557307554 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.3758601579 \_ 8175153646 E - 11}, \: \right.
\
\
\displaystyle
\left.{0.0000703343 \<u> 1473192346 \</u> 1446}\right] 
(51)
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R13,M)<eps","true")
Type: Void
fricas
-- Example 4.23
M:=matrix [[1 for i in 1..50] for j in 1..50];
Type: Matrix(Integer)
fricas
R23:=jacobi(M);
Type: Record(ev: Vector(Float),EV: Matrix(Float))
fricas
testEquals("checkResult(R23,M)<eps","true")
Type: Void
fricas
-- Results/Statistics
fricas
)set output algebra on
 
fricas
)version
"FriCAS 1.3.10 compiled at Wed 10 Jan 02:19:45 CET 2024"
fricas
)lisp (lisp-implementation-type)
Your user access level is compiler and this command is therefore not available. See the )set userlevel command for more information.
fricas
)lisp (lisp-implementation-version)
Your user access level is compiler and this command is therefore not available. See the )set userlevel command for more information.
statistics()
============================================================================= General WARNINGS: * do not use ')clear completely' before having used 'statistics()' It clears the statistics without warning! * do not forget to pass the arguments of the testXxxx functions as Strings! Otherwise, the test will fail and statistics() will not notice!
============================================================================= Testsuite: Package JacobiDiagonalisation failed (total): 0 (1)
============================================================================= testsuite | testcases: failed (total) | tests: failed (total) Package JacobiDiagonalisation 0 (1) 0 (16) ============================================================================= File summary. unexpected failures: 0 expected failures: 0 unexpected passes: 0 total tests: 16
Type: Void




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: