home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PASCAL
/
NRPAS13.ZIP
/
HQR.DEM
< prev
next >
Wrap
Text File
|
1991-04-29
|
1KB
|
45 lines
PROGRAM d11r7(input,output);
(* driver for routine HQR *)
CONST
np=5;
TYPE
glnpnp = ARRAY [1..np,1..np] OF real;
glnp = ARRAY [1..np] OF real;
VAR
i,j : integer;
a : glnpnp;
wi,wr : glnp;
(*$I MODFILE.PAS *)
(*$I BALANC.PAS *)
(*$I ELMHES.PAS *)
(*$I HQR.PAS *)
BEGIN
a[1,1] := 1.0; a[1,2] := 2.0; a[1,3] := 0.0;
a[1,4] := 0.0; a[1,5] := 0.0;
a[2,1] := -2.0; a[2,2] := 3.0; a[2,3] := 0.0;
a[2,4] := 0.0; a[2,5] := 0.0;
a[3,1] := 3.0; a[3,2] := 4.0; a[3,3] := 50.0;
a[3,4] := 0.0; a[3,5] := 0.0;
a[4,1] := -4.0; a[4,2] := 5.0; a[4,3] := -60.0;
a[4,4] := 7.0; a[4,5] := 0.0;
a[5,1] := -5.0; a[5,2] := 6.0; a[5,3] := -70.0;
a[5,4] := 8.0; a[5,5] := -9.0;
writeln('matrix:');
FOR i := 1 to np DO BEGIN
FOR j := 1 to np DO write(a[i,j]:12:2);
writeln
END;
balanc(a,np);
elmhes(a,np);
hqr(a,np,wr,wi);
writeln('eigenvalues:');
writeln('real':11,'imag.':16);
FOR i := 1 to np DO BEGIN
writeln(' ',wr[i]:13,' ',wi[i]:13)
END
END.