inverse matrix by D

procedure Gnat.Io.M is
N:Integer;F:Long_Float;S:String:=" "&Ascii.Lf;A:array(0..9,0..17)of
Long_Float:=(0..9=>(0..17=>0.0));begin for I in 0..80 loop
Get(N);A(I/9,I rem 9):=Long_Float(N);A(I/9,I/9+9):=1.0;end loop;for I in 0..8
loop N:=I;while 0.0=A(N,I)loop N:=N+1;end loop;F:=A(N,I);for J in 0..17 loop
A(9,J):=A(N,J);A(N,J):=A(I,J);A(I,J):=A(9,J)/F;end loop;for J in 0..8 loop
F:=A(J,I);if J/=I and F/=0.0 then for K in 0..17 loop
A(J,k):=A(J,k)-A(I,K)*F;end Loop;end if;end loop;end loop;for I in 0..80 loop
Put(Integer(A(I/9,I Rem 9+9)));Put(S(I rem 9/8+1));end loop;end;

Note that non-ascii characters in the above source code will be escaped (such as \x9f).


return to the top page