invgenex.pas 691 B

1234567891011121314151617181920212223242526272829
  1. {
  2. }
  3. program invgenex;
  4. uses typ, iom, inv;
  5. const n = 4;
  6. var term : arbint;
  7. A : array[1..n,1..n] of arbfloat;
  8. begin
  9. assign(input, paramstr(1)); reset(input);
  10. assign(output, paramstr(2)); rewrite(output);
  11. writeln('program results invgenex');
  12. { Read matrix A}
  13. iomrem(input, A[1,1], n, n, n);
  14. { Print matrix A }
  15. writeln; writeln('A =');
  16. iomwrm(output, A[1,1], n, n, n, numdig);
  17. { Calculate inverse of A}
  18. invgen(n, n, A[1,1], term);
  19. writeln; writeln('term=', term:2);
  20. if term=1 then
  21. { Print inverse of matrix A}
  22. begin
  23. writeln; writeln('inverse of A =');
  24. iomwrm(output, A[1,1], n, n, n, numdig);
  25. end; {term=1}
  26. close(input); close(output)
  27. end.