Previous Up Next

15.2.12  Hessenberg matrix reduction

A Hessenberg matrix is a square matrix where the coefficients below the sub-principal diagonal are all zeros. The hessenberg command finds a Hessenberg matrix equivalent to a given square matrix.

SCHUR(A) is equivalent to hessenberg(A,-1), which is compatible with HP calculators.

Example

Let

A=






32222
212−1−1
221−11
2−1−131
2−1112






.

Input:

A:=[[3,2,2,2,2],[2,1,2,-1,-1],[2,2,1,-1,1],[2,-1,-1,3,1],[2,-1,1,1,2]]; P,B:=hessenberg(A)
     









10000
01000
01100
01
1
2
1
4
1
01110









,


















385
5
2
2
21
1
2
5
4
−1
02120
002
3
2
2
000
13
8
7
2


















          

Indeed, pcar(A) and pcar(B) both return [1,−10,13,71,−50,−113] and it is easily verified that B=P−1AP.

B:=epsilon2zero(hessenberg(A,-1))

Output (to 2 digits):

     
 






0.729361953258−0.420012536934−0.509269713814−0.170245642208−0.057283416961
0.249597549360.716215130873−0.0478044979307−0.376346706145−0.529919650904
0.354791329292−0.3013459838920.7429173323750.18980875771−0.441995682565
0.3402749733260.1681491955810.427145129505−0.4628265621730.67770008281
0.4050534034940.437654888177−0.06308695717820.7610149715520.247520076117






,
         
 






6.701090383020000
0−1.86020364148000
00−1.1595680168700
0001.688360424430
00004.6303208509






         

Previous Up Next