detgpdte.pas 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. program detgpdte;
  2. uses
  3. typ,
  4. iom,
  5. det;
  6. const
  7. n1 = -5;
  8. n2 = 10;
  9. rwa = n2 - n1 + 1;
  10. var
  11. e, t, aantal, i, j, k, l, n, term: ArbInt;
  12. d: ArbFloat;
  13. a: array[n1..n2, n1..n2] of ArbFloat;
  14. begin
  15. iom.npos := 1000; {max. width of output to 1000, since this is piped}
  16. Write(' program results detgpdte');
  17. case sizeof(ArbFloat) of
  18. 4: writeln('(single)');
  19. 6: writeln('(real)');
  20. 8: writeln('(double)');
  21. 10: writeln('(Extended)');
  22. end;
  23. Read(aantal);
  24. writeln;
  25. writeln(' number of examples : ', aantal: 3);
  26. for t := 1 to aantal do
  27. begin
  28. writeln;
  29. writeln(' example nr ', t: 3);
  30. Read(k, l, n);
  31. for i := 1 to n do
  32. for j := 1 to i do
  33. Read(a[k + i - 1, l + j - 1]);
  34. detgpd(n, rwa, a[k, l], d, e, term);
  35. writeln;
  36. writeln(' A =');
  37. for i := 1 to n do
  38. for j := 1 to i - 1 do
  39. a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
  40. iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
  41. writeln;
  42. writeln('term=', term: 2);
  43. writeln;
  44. if term = 3 then
  45. writeln(' wrong input')
  46. else
  47. if term = 2 then
  48. writeln(' matrix not pos-def')
  49. else
  50. begin
  51. Write(' det =', d: numdig);
  52. if e <> 0 then
  53. Write(' * 8**', e: 3);
  54. writeln;
  55. end; {term=1}
  56. writeln('------------------------------------------------------');
  57. end; {t}
  58. Close(input);
  59. Close(output);
  60. end.