dos_compilers/Digital Research PLI-86 v1/INVERT.PLI
2024-06-30 12:01:25 -07:00

30 lines
896 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******************************************************/
/* This is an external procedure called by MAININVT. */
/******************************************************/
invert:
procedure (a,r,c);
%include 'matsize.lib';
declare
(d, a(maxrow,maxcol)) float binary(24),
(i,j,k,l,r,c) fixed binary(6);
do i = 1 to r;
d = a(i,1);
do j = 1 to c - 1;
a(i,j) = a(i,j+1)/d;
end;
a(i,c) = 1/d;
do k = 1 to r;
if k ^= i then
do;
d = a(k,1);
do l = 1 to c - 1;
a(k,l) = a(k,l+1) - a(i,l) * d;
end;
a(k,c) = - a(i,c) * d;
end;
end;
end;
end invert;