e This is a shell for matrix reduction under pascal. I got it by deleting the mathematics from a program written by a student in Math 4270 during the fall semester of 1989. It seems to work ok, but it has the disagreeable feature that a separate lineread is required for each matrix element. Under unix it seems to work better accepting input from a file than from stdin. Don't know why. And I am not fluent enough in pascal to get a more reasonable input system. Maybe someone will contribute a better version. Anyway, this one has the virtue that it works! Be warned that, since this is a shell, its output is (intentionally) inaccurate. } program Mreduction; const MaxRow = 4 ; MaxCol = 8 ; type Matrix = array [1..MaxRow, 1..MaxCol] of real; var trix: Matrix; Det : real; procedure final(var M : Matrix); var i,j : integer; begin writeln; writeln (' The Reduced Matrix is: '); writeln; for i := 1 to MaxRow do begin for j := 1 to MaxRow do begin write (' ',M[i,j]:5:3) end; writeln end; writeln; if Det <> 0 then begin writeln (' The Inverse Matrix is: '); writeln; for i := 1 to MaxRow do begin for j := ( MaxRow + 1) to MaxCol do begin write (' ',M[i,j] :5:3) end; writeln end end else writeln('No inverse matrix.'); writeln; writeln (' The Determinant is: ',Det:5:3); writeln; writeln; writeln ('Warning:'); writeln; writeln ('These results are false; no calculation has'); writeln ('has actually taken place.'); writeln; writeln; end; procedure getit(var M: Matrix); var i: integer; j: integer; begin Det := 1; for i := 1 to MaxRow do begin writeln ('Enter the ',MaxRow:2, ' integers of row #',i:2); writeln ('Press enter after each entry.'); for j := 1 to MaxRow do readln(M[i,j]); end; for i := 1 to MaxRow do for j := (MaxRow + 1) to MaxCol do if i = (j - MaxRow) then M[i,j] := 1 else M[i,j] := 0; end; procedure reduce (var M : Matrix); begin end; begin {Main} getit(trix) ; reduce(trix); final(trix); end.