detgpdte.pas 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.
  61. program detgpdte;
  62. uses
  63. typ,
  64. iom,
  65. det;
  66. const
  67. n1 = -5;
  68. n2 = 10;
  69. rwa = n2 - n1 + 1;
  70. var
  71. e, t, aantal, i, j, k, l, n, term: ArbInt;
  72. d: ArbFloat;
  73. a: array[n1..n2, n1..n2] of ArbFloat;
  74. begin
  75. iom.npos := 1000; {max. width of output to 1000, since this is piped}
  76. Write(' program results detgpdte');
  77. case sizeof(ArbFloat) of
  78. 4: writeln('(single)');
  79. 6: writeln('(real)');
  80. 8: writeln('(double)');
  81. 10: writeln('(Extended)');
  82. end;
  83. Read(aantal);
  84. writeln;
  85. writeln(' number of examples : ', aantal: 3);
  86. for t := 1 to aantal do
  87. begin
  88. writeln;
  89. writeln(' example nr ', t: 3);
  90. Read(k, l, n);
  91. for i := 1 to n do
  92. for j := 1 to i do
  93. Read(a[k + i - 1, l + j - 1]);
  94. detgpd(n, rwa, a[k, l], d, e, term);
  95. writeln;
  96. writeln(' A =');
  97. for i := 1 to n do
  98. for j := 1 to i - 1 do
  99. a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
  100. iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
  101. writeln;
  102. writeln('term=', term: 2);
  103. writeln;
  104. if term = 3 then
  105. writeln(' wrong input')
  106. else
  107. if term = 2 then
  108. writeln(' matrix not pos-def')
  109. else
  110. begin
  111. Write(' det =', d: numdig);
  112. if e <> 0 then
  113. Write(' * 8**', e: 3);
  114. writeln;
  115. end; {term=1}
  116. writeln('------------------------------------------------------');
  117. end; {t}
  118. Close(input);
  119. Close(output);
  120. end.
  121.