invgenex.pas 685 B

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