home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
nrpas
/
elmhes.dem
< prev
next >
Wrap
Text File
|
1994-04-11
|
1KB
|
52 lines
PROGRAM d11r6(input,output);
(* driver for routine ELMHES *)
CONST
np=5;
TYPE
glnp = ARRAY [1..np] OF real;
glnpnp = ARRAY [1..np,1..np] OF real;
VAR
i,j : integer;
a : glnpnp;
c,r : glnp;
(*$I MODFILE.PAS *)
(*$I BALANC.PAS *)
(*$I ELMHES.PAS *)
BEGIN
a[1,1] := 1.0; a[1,2] := 2.0; a[1,3] := 300.0;
a[1,4] := 4.0; a[1,5] := 5.0;
a[2,1] := 2.0; a[2,2] := 3.0; a[2,3] := 400.0;
a[2,4] := 5.0; a[2,5] := 6.0;
a[3,1] := 3.0; a[3,2] := 4.0; a[3,3] := 5.0;
a[3,4] := 6.0; a[3,5] := 7.0;
a[4,1] := 4.0; a[4,2] := 5.0; a[4,3] := 600.0;
a[4,4] := 7.0; a[4,5] := 8.0;
a[5,1] := 5.0; a[5,2] := 6.0; a[5,3] := 700.0;
a[5,4] := 8.0; a[5,5] := 9.0;
writeln('***** original matrix *****');
FOR i := 1 to np DO BEGIN
FOR j := 1 to np DO write(a[i,j]:12:2);
writeln
END;
writeln('***** balance matrix *****');
balanc(a,np);
FOR i := 1 to np DO BEGIN
FOR j := 1 to np DO write(a[i,j]:12:2);
writeln
END;
writeln('***** reduce to hessenberg form *****');
elmhes(a,np);
FOR j := 1 to np-2 DO BEGIN
FOR i := j+2 to np DO BEGIN
a[i,j] := 0.0
END
END;
FOR i := 1 to np DO BEGIN
FOR j := 1 to np DO write(' ',a[i,j]:11);
writeln
END
END.