Browse Source

* Darius' mega patch for numlib

git-svn-id: trunk@9188 -
marco 17 years ago
parent
commit
01f2667f0c
100 changed files with 13201 additions and 174 deletions
  1. 144 3
      .gitattributes
  2. 4 4
      packages/extra/numlib/det.pas
  3. 34 35
      packages/extra/numlib/doc/inv.tex
  4. 430 0
      packages/extra/numlib/doc/iom.tex
  5. 3 3
      packages/extra/numlib/dsl.pas
  6. 8 8
      packages/extra/numlib/eig.pas
  7. 1 1
      packages/extra/numlib/eigh1.pas
  8. 2 2
      packages/extra/numlib/eigh2.pas
  9. 2741 0
      packages/extra/numlib/examples/Makefile
  10. 40 0
      packages/extra/numlib/examples/Makefile.fpc
  11. 4 4
      packages/extra/numlib/examples/invgenex.dat
  12. 29 16
      packages/extra/numlib/examples/invgenex.pas
  13. 4 4
      packages/extra/numlib/examples/invgpdex.dat
  14. 33 20
      packages/extra/numlib/examples/invgpdex.pas
  15. 4 4
      packages/extra/numlib/examples/invgsyex.dat
  16. 33 20
      packages/extra/numlib/examples/invgsyex.pas
  17. 3 0
      packages/extra/numlib/examples/iomremex.dat
  18. 28 0
      packages/extra/numlib/examples/iomremex.pas
  19. 1 0
      packages/extra/numlib/examples/iomrevex.dat
  20. 27 0
      packages/extra/numlib/examples/iomrevex.pas
  21. 10 12
      packages/extra/numlib/examples/iomrewrsex.pas
  22. 13 0
      packages/extra/numlib/examples/iomwrmex.dat
  23. 28 0
      packages/extra/numlib/examples/iomwrmex.pas
  24. 27 0
      packages/extra/numlib/examples/iomwrvex.pas
  25. 2 2
      packages/extra/numlib/int.pas
  26. 5 5
      packages/extra/numlib/inv.pas
  27. 1 1
      packages/extra/numlib/iom.pas
  28. 12 12
      packages/extra/numlib/mdt.pas
  29. 1 1
      packages/extra/numlib/omv.pas
  30. 3 3
      packages/extra/numlib/roo.pas
  31. 12 13
      packages/extra/numlib/sle.pas
  32. 1 1
      packages/extra/numlib/spe.pas
  33. 32 0
      packages/extra/numlib/tests/detgpbte.dat
  34. 177 0
      packages/extra/numlib/tests/detgpbte.pas
  35. 62 0
      packages/extra/numlib/tests/detgpdte.dat
  36. 125 0
      packages/extra/numlib/tests/detgpdte.pas
  37. 58 0
      packages/extra/numlib/tests/detgsyte.dat
  38. 121 0
      packages/extra/numlib/tests/detgsyte.pas
  39. 54 0
      packages/extra/numlib/tests/detgtrte.dat
  40. 127 0
      packages/extra/numlib/tests/detgtrte.pas
  41. 68 0
      packages/extra/numlib/tests/eigbs1te.dat
  42. 102 0
      packages/extra/numlib/tests/eigbs1te.pas
  43. 80 0
      packages/extra/numlib/tests/eigbs2te.dat
  44. 102 0
      packages/extra/numlib/tests/eigbs2te.pas
  45. 68 0
      packages/extra/numlib/tests/eigbs3te.dat
  46. 160 0
      packages/extra/numlib/tests/eigbs3te.pas
  47. 72 0
      packages/extra/numlib/tests/eigbs4te.dat
  48. 170 0
      packages/extra/numlib/tests/eigbs4te.pas
  49. 112 0
      packages/extra/numlib/tests/eigge1te.dat
  50. 108 0
      packages/extra/numlib/tests/eigge1te.pas
  51. 148 0
      packages/extra/numlib/tests/eigge3te.dat
  52. 192 0
      packages/extra/numlib/tests/eigge3te.pas
  53. 144 0
      packages/extra/numlib/tests/eiggg1te.dat
  54. 132 0
      packages/extra/numlib/tests/eiggg1te.pas
  55. 144 0
      packages/extra/numlib/tests/eiggg2te.dat
  56. 134 0
      packages/extra/numlib/tests/eiggg2te.pas
  57. 142 0
      packages/extra/numlib/tests/eiggg3te.dat
  58. 222 0
      packages/extra/numlib/tests/eiggg3te.pas
  59. 146 0
      packages/extra/numlib/tests/eiggg4te.dat
  60. 238 0
      packages/extra/numlib/tests/eiggg4te.pas
  61. 104 0
      packages/extra/numlib/tests/eiggs1te.dat
  62. 108 0
      packages/extra/numlib/tests/eiggs1te.pas
  63. 154 0
      packages/extra/numlib/tests/eiggs2te.dat
  64. 116 0
      packages/extra/numlib/tests/eiggs2te.pas
  65. 104 0
      packages/extra/numlib/tests/eiggs3te.dat
  66. 144 0
      packages/extra/numlib/tests/eiggs3te.pas
  67. 150 0
      packages/extra/numlib/tests/eiggs4te.dat
  68. 156 0
      packages/extra/numlib/tests/eiggs4te.pas
  69. 48 0
      packages/extra/numlib/tests/eigsv1te.dat
  70. 126 0
      packages/extra/numlib/tests/eigsv1te.pas
  71. 65 0
      packages/extra/numlib/tests/eigsv3te.dat
  72. 182 0
      packages/extra/numlib/tests/eigsv3te.pas
  73. 32 0
      packages/extra/numlib/tests/eigts1te.dat
  74. 132 0
      packages/extra/numlib/tests/eigts1te.pas
  75. 32 0
      packages/extra/numlib/tests/eigts2te.dat
  76. 138 0
      packages/extra/numlib/tests/eigts2te.pas
  77. 46 0
      packages/extra/numlib/tests/eigts3te.dat
  78. 146 0
      packages/extra/numlib/tests/eigts3te.pas
  79. 50 0
      packages/extra/numlib/tests/eigts4te.dat
  80. 160 0
      packages/extra/numlib/tests/eigts4te.pas
  81. 996 0
      packages/extra/numlib/tests/intge1te.pas
  82. 852 0
      packages/extra/numlib/tests/intge2te.pas
  83. 178 0
      packages/extra/numlib/tests/intge3te.pas
  84. 33 0
      packages/extra/numlib/tests/invgente.dat
  85. 122 0
      packages/extra/numlib/tests/invgente.pas
  86. 39 0
      packages/extra/numlib/tests/invgpdte.dat
  87. 122 0
      packages/extra/numlib/tests/invgpdte.pas
  88. 31 0
      packages/extra/numlib/tests/invgsyte.dat
  89. 122 0
      packages/extra/numlib/tests/invgsyte.pas
  90. 86 0
      packages/extra/numlib/tests/iomwrmte.pas
  91. 25 0
      packages/extra/numlib/tests/odeiv1te.dat
  92. 182 0
      packages/extra/numlib/tests/odeiv1te.pas
  93. 27 0
      packages/extra/numlib/tests/odeiv2te.dat
  94. 152 0
      packages/extra/numlib/tests/odeiv2te.pas
  95. 46 0
      packages/extra/numlib/tests/roof1rte.dat
  96. 126 0
      packages/extra/numlib/tests/roof1rte.pas
  97. 460 0
      packages/extra/numlib/tests/roofnrt1.pas
  98. 46 0
      packages/extra/numlib/tests/roofnrte.dat
  99. 226 0
      packages/extra/numlib/tests/roofnrte.pas
  100. 9 0
      packages/extra/numlib/tests/roopolte.dat

+ 144 - 3
.gitattributes

@@ -2928,17 +2928,27 @@ packages/extra/numlib/Makefile.fpc svneol=native#text/plain
 packages/extra/numlib/det.pas svneol=native#text/plain
 packages/extra/numlib/det.pas svneol=native#text/plain
 packages/extra/numlib/direct.inc svneol=native#text/plain
 packages/extra/numlib/direct.inc svneol=native#text/plain
 packages/extra/numlib/doc/inv.tex -text
 packages/extra/numlib/doc/inv.tex -text
+packages/extra/numlib/doc/iom.tex svneol=native#text/plain
 packages/extra/numlib/dsl.pas svneol=native#text/plain
 packages/extra/numlib/dsl.pas svneol=native#text/plain
 packages/extra/numlib/eig.pas svneol=native#text/plain
 packages/extra/numlib/eig.pas svneol=native#text/plain
 packages/extra/numlib/eigh1.pas svneol=native#text/plain
 packages/extra/numlib/eigh1.pas svneol=native#text/plain
 packages/extra/numlib/eigh2.pas svneol=native#text/plain
 packages/extra/numlib/eigh2.pas svneol=native#text/plain
-packages/extra/numlib/examples/invgenex.dat -text
+packages/extra/numlib/examples/Makefile svneol=native#text/plain
+packages/extra/numlib/examples/Makefile.fpc svneol=native#text/plain
+packages/extra/numlib/examples/invgenex.dat svneol=native#text/plain
 packages/extra/numlib/examples/invgenex.pas svneol=native#text/plain
 packages/extra/numlib/examples/invgenex.pas svneol=native#text/plain
-packages/extra/numlib/examples/invgpdex.dat -text
+packages/extra/numlib/examples/invgpdex.dat svneol=native#text/plain
 packages/extra/numlib/examples/invgpdex.pas svneol=native#text/plain
 packages/extra/numlib/examples/invgpdex.pas svneol=native#text/plain
-packages/extra/numlib/examples/invgsyex.dat -text
+packages/extra/numlib/examples/invgsyex.dat svneol=native#text/plain
 packages/extra/numlib/examples/invgsyex.pas svneol=native#text/plain
 packages/extra/numlib/examples/invgsyex.pas svneol=native#text/plain
+packages/extra/numlib/examples/iomremex.dat svneol=native#text/plain
+packages/extra/numlib/examples/iomremex.pas svneol=native#text/plain
+packages/extra/numlib/examples/iomrevex.dat svneol=native#text/plain
+packages/extra/numlib/examples/iomrevex.pas svneol=native#text/plain
 packages/extra/numlib/examples/iomrewrsex.pas svneol=native#text/plain
 packages/extra/numlib/examples/iomrewrsex.pas svneol=native#text/plain
+packages/extra/numlib/examples/iomwrmex.dat svneol=native#text/plain
+packages/extra/numlib/examples/iomwrmex.pas svneol=native#text/plain
+packages/extra/numlib/examples/iomwrvex.pas svneol=native#text/plain
 packages/extra/numlib/fpmake.pp svneol=native#text/plain
 packages/extra/numlib/fpmake.pp svneol=native#text/plain
 packages/extra/numlib/int.pas svneol=native#text/plain
 packages/extra/numlib/int.pas svneol=native#text/plain
 packages/extra/numlib/inv.pas svneol=native#text/plain
 packages/extra/numlib/inv.pas svneol=native#text/plain
@@ -2953,6 +2963,137 @@ packages/extra/numlib/roo.pas svneol=native#text/plain
 packages/extra/numlib/sle.pas svneol=native#text/plain
 packages/extra/numlib/sle.pas svneol=native#text/plain
 packages/extra/numlib/spe.pas svneol=native#text/plain
 packages/extra/numlib/spe.pas svneol=native#text/plain
 packages/extra/numlib/spl.pas svneol=native#text/plain
 packages/extra/numlib/spl.pas svneol=native#text/plain
+packages/extra/numlib/tests/detgpbte.dat svneol=native#text/plain
+packages/extra/numlib/tests/detgpbte.pas svneol=native#text/plain
+packages/extra/numlib/tests/detgpdte.dat svneol=native#text/plain
+packages/extra/numlib/tests/detgpdte.pas svneol=native#text/plain
+packages/extra/numlib/tests/detgsyte.dat svneol=native#text/plain
+packages/extra/numlib/tests/detgsyte.pas svneol=native#text/plain
+packages/extra/numlib/tests/detgtrte.dat svneol=native#text/plain
+packages/extra/numlib/tests/detgtrte.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigbs1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigbs1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigbs2te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigbs2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigbs3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigbs3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigbs4te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigbs4te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigge1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigge1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigge3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigge3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggg1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggg1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggg2te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggg2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggg3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggg3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggg4te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggg4te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggs1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggs1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggs2te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggs2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggs3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggs3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eiggs4te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eiggs4te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigsv1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigsv1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigsv3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigsv3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigts1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigts1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigts2te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigts2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigts3te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigts3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/eigts4te.dat svneol=native#text/plain
+packages/extra/numlib/tests/eigts4te.pas svneol=native#text/plain
+packages/extra/numlib/tests/intge1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/intge2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/intge3te.pas svneol=native#text/plain
+packages/extra/numlib/tests/invgente.dat svneol=native#text/plain
+packages/extra/numlib/tests/invgente.pas svneol=native#text/plain
+packages/extra/numlib/tests/invgpdte.dat svneol=native#text/plain
+packages/extra/numlib/tests/invgpdte.pas svneol=native#text/plain
+packages/extra/numlib/tests/invgsyte.dat svneol=native#text/plain
+packages/extra/numlib/tests/invgsyte.pas svneol=native#text/plain
+packages/extra/numlib/tests/iomwrmte.pas svneol=native#text/plain
+packages/extra/numlib/tests/odeiv1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/odeiv1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/odeiv2te.dat svneol=native#text/plain
+packages/extra/numlib/tests/odeiv2te.pas svneol=native#text/plain
+packages/extra/numlib/tests/roof1rte.dat svneol=native#text/plain
+packages/extra/numlib/tests/roof1rte.pas svneol=native#text/plain
+packages/extra/numlib/tests/roofnrt1.pas svneol=native#text/plain
+packages/extra/numlib/tests/roofnrte.dat svneol=native#text/plain
+packages/extra/numlib/tests/roofnrte.pas svneol=native#text/plain
+packages/extra/numlib/tests/roopolte.dat svneol=native#text/plain
+packages/extra/numlib/tests/roopolte.pas svneol=native#text/plain
+packages/extra/numlib/tests/sledtrte.dat svneol=native#text/plain
+packages/extra/numlib/tests/sledtrte.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegbalt.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegbalt.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegbate.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegbate.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegenlt.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegenlt.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegente.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegente.pas svneol=native#text/plain
+packages/extra/numlib/tests/sleglslt.dat svneol=native#text/plain
+packages/extra/numlib/tests/sleglslt.pas svneol=native#text/plain
+packages/extra/numlib/tests/sleglste.dat svneol=native#text/plain
+packages/extra/numlib/tests/sleglste.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegpblt.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegpblt.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegpbte.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegpbte.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegpdlt.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegpdlt.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegpdte.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegpdte.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegsylt.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegsylt.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegsyte.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegsyte.pas svneol=native#text/plain
+packages/extra/numlib/tests/slegtrte.dat svneol=native#text/plain
+packages/extra/numlib/tests/slegtrte.pas svneol=native#text/plain
+packages/extra/numlib/tests/speachte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spearcte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spearste.dat svneol=native#text/plain
+packages/extra/numlib/tests/speashte.dat svneol=native#text/plain
+packages/extra/numlib/tests/speathte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebi0te.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebi1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebj0te.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebj1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebk0te.dat svneol=native#text/plain
+packages/extra/numlib/tests/spebk1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/speby0te.dat svneol=native#text/plain
+packages/extra/numlib/tests/speby1te.dat svneol=native#text/plain
+packages/extra/numlib/tests/specohte.dat svneol=native#text/plain
+packages/extra/numlib/tests/speefcte.dat svneol=native#text/plain
+packages/extra/numlib/tests/speentte.dat svneol=native#text/plain
+packages/extra/numlib/tests/speentte.pas svneol=native#text/plain
+packages/extra/numlib/tests/speerfte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spegamte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spege1te.pas svneol=native#text/plain
+packages/extra/numlib/tests/spemaxte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spemaxte.pas svneol=native#text/plain
+packages/extra/numlib/tests/spepolte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spepolte.pas svneol=native#text/plain
+packages/extra/numlib/tests/spepowte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spepowte.pas svneol=native#text/plain
+packages/extra/numlib/tests/spesgnte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spesgnte.pas svneol=native#text/plain
+packages/extra/numlib/tests/spesihte.dat svneol=native#text/plain
+packages/extra/numlib/tests/spetahte.dat svneol=native#text/plain
+packages/extra/numlib/tests/test.bat svneol=native#text/plain
+packages/extra/numlib/tests/test.pas svneol=native#text/plain
+packages/extra/numlib/tests/timer.pas svneol=native#text/plain
+packages/extra/numlib/tests/turte.pas svneol=native#text/plain
 packages/extra/numlib/timer.pas svneol=native#text/plain
 packages/extra/numlib/timer.pas svneol=native#text/plain
 packages/extra/numlib/tpnumlib.pas svneol=native#text/plain
 packages/extra/numlib/tpnumlib.pas svneol=native#text/plain
 packages/extra/numlib/typ.pas svneol=native#text/plain
 packages/extra/numlib/typ.pas svneol=native#text/plain

+ 4 - 4
packages/extra/numlib/det.pas

@@ -224,10 +224,10 @@ end; {detgpd}
 procedure detgba(n, l, r: ArbInt; var a, f: ArbFloat;
 procedure detgba(n, l, r: ArbInt; var a, f: ArbFloat;
                  var k, term:ArbInt);
                  var k, term:ArbInt);
 var
 var
-    rwidth, s, ns, kk, ii, i, j, jj, ll : ArbInt;
-    u, ca                               : ArbFloat;
-    pa, l1, acopy                       : ^arfloat1;
-    p                                   : ^arint1;
+    rwidth, s, ns, kk, ii, i, jj, ll : ArbInt;
+    u, ca                            : ArbFloat;
+    pa, l1, acopy                    : ^arfloat1;
+    p                                : ^arint1;
 begin
 begin
   if (n<1) or (l<0) or (r<0) or (l>n-1) or (r>n-1) then
   if (n<1) or (l<0) or (r<0) or (l>n-1) or (r>n-1) then
     begin
     begin

+ 34 - 35
packages/extra/numlib/doc/inv.tex

@@ -58,11 +58,11 @@ units typ an inv to use these routines.
 Integers used for parameters are of type "ArbInt" to avoid problems with
 Integers used for parameters are of type "ArbInt" to avoid problems with
 systems that define integer differently depending on mode. 
 systems that define integer differently depending on mode. 
 
 
-Floating point values are of type "ArbFloat" to allow writing code that is
-independant of the exact real type. (Contrary to directly specifying single,
-real, double or extended in library and examples). Typ.pas and the central
-includefile have some conditional code to switch between floating point
-types.
+Floating point values are of type "ArbFloat" to allow writing code
+that is independent of the exact real type. (Contrary to directly
+specifying single, real, double or extended in library and
+examples). Typ.pas and the central includefile have some conditional
+code to switch between floating point types.
 
 
 These changes were already prepared somewhat when I got the lib, but weren't
 These changes were already prepared somewhat when I got the lib, but weren't
 consequently applied. I did that while porting to FPC.
 consequently applied. I did that while porting to FPC.
@@ -78,8 +78,9 @@ Procedure to calculate the inverse of a matrix.
 
 
 \Dataorganisation
 \Dataorganisation
 
 
-The procedure assumes that the calling program has declared a two dimensional
-matrix containing the maxtrixelements in a square partial block.
+The procedure assumes that the calling program has declared a two
+dimensional matrix containing the matrix elements in a square
+partial block.
 
 
 \DeclarationandParams
 \DeclarationandParams
 
 
@@ -89,18 +90,18 @@ matrix containing the maxtrixelements in a square partial block.
  \item[n: integer] \mbox{ } \\
  \item[n: integer] \mbox{ } \\
     The parameter {\bf n} describes the size of the matrix
     The parameter {\bf n} describes the size of the matrix
  \item[rwidth: integer] \mbox{} \\
  \item[rwidth: integer] \mbox{} \\
-    The parameter {\bf rwidth} describes the declared rowlength of the twodimensional
+    The parameter {\bf rwidth} describes the declared rowlength of the two dimensional
     matrix.
     matrix.
  \item[var ai: real] \mbox{} \\
  \item[var ai: real] \mbox{} \\
-    The parameter {\bf ai} must contain to the twodimensional arrayelement
+    The parameter {\bf ai} must contain to the two dimensional array element
     that is top-left in the matrix.
     that is top-left in the matrix.
-    After the function has ended succesfully (\textbf{term=1}) then 
+    After the function has ended successfully (\textbf{term=1}) then
     the input matrix has been changed into its inverse, otherwise the contents 
     the input matrix has been changed into its inverse, otherwise the contents 
     of the input matrix are undefined.
     of the input matrix are undefined.
  \item[var term: integer]  \mbox{} \\
  \item[var term: integer]  \mbox{} \\
     After the procedure has run, this variable contains the reason for 
     After the procedure has run, this variable contains the reason for 
     the termination of the procedure:\\
     the termination of the procedure:\\
-      {\bf term}=1, succesfull termination, the inverse has been calculated
+      {\bf term}=1, successful termination, the inverse has been calculated
       {\bf term}=2, inverse matrix could not be calculated because the matrix
       {\bf term}=2, inverse matrix could not be calculated because the matrix
 		    is (very close to) being singular.
 		    is (very close to) being singular.
       {\bf term}=3, wrong input n$<$1
       {\bf term}=3, wrong input n$<$1
@@ -125,8 +126,8 @@ Calculate the inverse of
  .
  .
 \]
 \]
 
 
-Below is the source of the invgenex demo that demontrates invgenex, some
-routines of iom were used to construct matrices.
+Below is the source of the invgenex demo that demonstrates invgenex,
+some routines of iom were used to construct matrices.
 
 
 \NUMLIBexample{invgenex}
 \NUMLIBexample{invgenex}
 
 
@@ -193,14 +194,12 @@ pivoting.
 
 
 \FunctionDescription
 \FunctionDescription
 
 
-Procedure to calculate the inverse of a symmetrical, positive definite
-matrix
-
-%van een symmetrische,positief definiete matrix.
+Procedure to calculate the inverse of a symmetrical, positive
+definitive matrix
 
 
-\Dataorganisation
-The procedure assumes that the calling program has declared a two dimensional
-matrix containing the maxtrixelements in a square partial block.
+\Dataorganisation The procedure assumes that the calling program has
+declared a two dimensional matrix containing the matrix elements in
+a square partial block.
 
 
 \DeclarationandParams
 \DeclarationandParams
 
 
@@ -210,18 +209,18 @@ matrix containing the maxtrixelements in a square partial block.
  \item[n: integer] \mbox{ } \\
  \item[n: integer] \mbox{ } \\
     The parameter {\bf n} describes the size of the matrix
     The parameter {\bf n} describes the size of the matrix
  \item[rwidth: integer] \mbox{} \\
  \item[rwidth: integer] \mbox{} \\
-    The parameter {\bf rwidth} describes the declared rowlength of the twodimensional
+    The parameter {\bf rwidth} describes the declared row length of the two dimensional
     matrix.
     matrix.
  \item[var ai: real] \mbox{} \\
  \item[var ai: real] \mbox{} \\
-    The parameter {\bf ai} must contain to the twodimensional arrayelement
+    The parameter {\bf ai} must contain to the two dimensional array element
     that is top-left in the matrix.
     that is top-left in the matrix.
-    After the function has ended succesfully (\textbf{term=1}) then 
+    After the function has ended successfully (\textbf{term=1}) then
     the input matrix has been changed into its inverse, otherwise the contents 
     the input matrix has been changed into its inverse, otherwise the contents 
     of the input matrix are undefined.
     of the input matrix are undefined.
  \item[var term: integer]  \mbox{} \\
  \item[var term: integer]  \mbox{} \\
     After the procedure has run, this variable contains the reason for 
     After the procedure has run, this variable contains the reason for 
     the termination of the procedure:\\
     the termination of the procedure:\\
-      {\bf term}=1, succesfull termination, the inverse has been calculated
+      {\bf term}=1, successful termination, the inverse has been calculated
       {\bf term}=2, inverse matrix could not be calculated because the matrix
       {\bf term}=2, inverse matrix could not be calculated because the matrix
 		    is (very close to) being singular.
 		    is (very close to) being singular.
       {\bf term}=3, wrong input n$<$1
       {\bf term}=3, wrong input n$<$1
@@ -229,7 +228,7 @@ matrix containing the maxtrixelements in a square partial block.
 \Remarks
 \Remarks
 
 
 \begin{itemize}
 \begin{itemize}
-\item Only the bottomleft part of the matrix $A$ needs to be passed.
+\item Only the bottom left part of the matrix $A$ needs to be passed.
 \item \textbf{Warning} This procedure does not do array range checks. When called with invalid
 \item \textbf{Warning} This procedure does not do array range checks. When called with invalid
 parameters, invalid/nonsense responses or even crashes may be the result.
 parameters, invalid/nonsense responses or even crashes may be the result.
 \end{itemize}
 \end{itemize}
@@ -298,8 +297,8 @@ operation after termination.
 
 
 \Method
 \Method
 
 
-The calculation of the inverse is based on Cholesky decomposition for a
-symmetrical positive definitie matrix. 
+The calculation of the inverse is based on Cholesky decomposition
+for a symmetrical positive definitive matrix.
 
 
 \References
 \References
 
 
@@ -317,8 +316,8 @@ Procedure to calculate the inverse of a symmetrical matrix.
 \Dataorganisation
 \Dataorganisation
 
 
 The procedure assumes that the calling program has declared a two
 The procedure assumes that the calling program has declared a two
-dimensional matrix containing the maxtrixelements in (the bottomleft part
-of) a square partial block.
+dimensional matrix containing the matrix elements in (the bottom
+left part of) a square partial block.
 
 
 \DeclarationandParams
 \DeclarationandParams
 
 
@@ -328,18 +327,18 @@ of) a square partial block.
  \item[n: integer] \mbox{ } \\
  \item[n: integer] \mbox{ } \\
     The parameter {\bf n} describes the size of the matrix
     The parameter {\bf n} describes the size of the matrix
  \item[rwidth: integer] \mbox{} \\
  \item[rwidth: integer] \mbox{} \\
-    The parameter {\bf rwidth} describes the declared rowlength of the twodimensional
+    The parameter {\bf rwidth} describes the declared row length of the two dimensional
     matrix.
     matrix.
  \item[var ai: real] \mbox{} \\
  \item[var ai: real] \mbox{} \\
-    The parameter {\bf ai} must contain to the twodimensional arrayelement
+    The parameter {\bf ai} must contain to the two dimensional array element
     that is top-left in the matrix.
     that is top-left in the matrix.
-    After the function has ended succesfully (\textbf{term=1}) then
+    After the function has ended successfully (\textbf{term=1}) then
     the input matrix has been changed into its inverse, otherwise the contents
     the input matrix has been changed into its inverse, otherwise the contents
     of the input matrix are undefined.
     of the input matrix are undefined.
  \item[var term: integer]  \mbox{} \\
  \item[var term: integer]  \mbox{} \\
     After the procedure has run, this variable contains the reason for
     After the procedure has run, this variable contains the reason for
     the termination of the procedure:\\
     the termination of the procedure:\\
-      {\bf term}=1, succesfull termination, the inverse has been calculated
+      {\bf term}=1, successful termination, the inverse has been calculated
       {\bf term}=2, inverse matrix could not be calculated because the matrix
       {\bf term}=2, inverse matrix could not be calculated because the matrix
                     is (very close to) being singular.
                     is (very close to) being singular.
       {\bf term}=3, wrong input n$<$1
       {\bf term}=3, wrong input n$<$1
@@ -348,14 +347,14 @@ of) a square partial block.
 
 
 \Remarks
 \Remarks
 \begin{itemize}
 \begin{itemize}
-\item Only the bottomleft part of the matrix $A$ needs to be passed.
+\item Only the bottom left part of the matrix $A$ needs to be passed.
 \item \textbf{Warning} This procedure does not do array range checks. When called with invalid
 \item \textbf{Warning} This procedure does not do array range checks. When called with invalid
 parameters, invalid/nonsense responses or even crashes may be the result.
 parameters, invalid/nonsense responses or even crashes may be the result.
 \end{itemize}
 \end{itemize}
 
 
 \Example
 \Example
 
 
-  Het berekenen van de inverse van
+  Calculating the inverse of
 \[
 \[
  A=
  A=
  \left(
  \left(

+ 430 - 0
packages/extra/numlib/doc/iom.tex

@@ -0,0 +1,430 @@
+%
+% part of numlib docs. In time this won't be a standalone pdf anymore, but part of a larger part.
+% for now I keep it directly compliable. Uses fpc.sty from fpc-docs pkg.
+%
+
+\documentclass{report}
+
+\usepackage{fpc}
+\lstset{%
+  basicstyle=\small,
+  language=delphi,
+  commentstyle=\itshape,
+  keywordstyle=\bfseries,
+  showstringspaces=false,
+  frame=
+}
+
+\makeindex
+
+\newcommand{\FunctionDescription}{\item[Description]\rmfamily}
+\newcommand{\Dataorganisation}{\item[Data Struct]\rmfamily}
+\newcommand{\DeclarationandParams}{\item[Declaration]\rmfamily}
+\newcommand{\References}{\item[References]\rmfamily}
+\newcommand{\Method}{\item[Method]\rmfamily}
+\newcommand{\Precision}{\item[Precision]\rmfamily}
+\newcommand{\Remarks}{\item[Remarks]\rmfamily}
+\newcommand{\Example}{\item[Example]\rmfamily}
+\newcommand{\ProgramData}{\item[Example Data]\rmfamily}
+\newcommand{\ProgramResults}{\item[Example Result]\rmfamily}
+
+\makeatletter
+\@ifpackageloaded{tex4ht}{%
+\newcommand{\NUMLIBexample}[1]{
+\par \file{\textbf{Listing:} \exampledir/#1.pas}%
+\HCode{<HR/>}%
+\listinginput[9999]{5000}{\exampledir/#1.pas}%
+\HCode{<HR/>}%
+}%
+}{% else ifpackageloaded
+\newcommand{\NUMLIBexample}[1]{%
+\par \file{\textbf{Listing:} \exampledir/#1.pas}%
+\lstinputlisting{\exampledir/#1.pas}%
+}% End of FPCExample
+}% End of ifpackageloaded.
+\makeatother
+%
+
+\begin{document}
+\FPCexampledir{../examples}
+\section{general comments}
+
+\textbf{Original comments:} \\
+The used floating point type \textbf{real} depends on the used
+version, see the general introduction for more information. You'll
+need to USE units typ and iom to use these routines.
+
+\textbf{MvdV notes:} \\
+Integers used for parameters are of type "ArbInt" to avoid problems
+with systems that define integer differently depending on mode.
+
+Floating point values are of type "ArbFloat" to allow writing code
+that is independent of the exact real type. (Contrary to directly
+specifying single, real, double or extended in library and
+examples). Typ.pas and the central includefile have some conditional
+code to switch between floating point types.
+
+These changes were already prepared somewhat when I got the lib, but
+weren't consequently applied. I did that while porting to FPC.
+
+\section{Unit iom}
+
+
+\begin{procedure}{iomrev}
+
+\FunctionDescription Procedure to read a vector from file.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a one dimensional vector where the data will
+be stored in.
+
+\DeclarationandParams
+
+\lstinline|procedure iomrev(var inp: text; var v: ArbFloat; n:|
+\lstinline|ArbInt);|
+
+\begin{description}
+ \item[var inp: text] \mbox{} \\
+   The parameter {\bf inp} contains the file where the components of the vector are stored in.
+ \item[var v: ArbFloat] \mbox{} \\
+   Parameter {\bf v} must contain the top array element.
+ \item[n: ArbInt] \mbox{} \\
+   The parameter {\bf n} contains the length of the resulting vector.
+\end{description}
+
+\Remarks
+  This procedure does not do array range checks. When called with invalid
+  parameters, invalid/nonsense responses or even crashes may be the result.
+
+\Example Reading and printing the vector \[(1,\; 2,\; 3,\; 4,\;
+5)^{T}\].
+
+\NUMLIBexample{iomrevex}
+
+\ProgramData Below is the data from the inputfile shown.
+\begin{verbatim}
+ 1  2  3  4  5
+\end{verbatim}
+
+\ProgramResults Running the example program {\bf iomrevex} when
+using the real type single gives the following results.
+
+\begin{verbatim}
+v =
+  1.000E+0000   2.000E+0000   3.000E+0000   4.000E+0000   5.000E+0000
+\end{verbatim}
+
+%\Precision
+
+%\Method
+
+%\References
+
+\end{procedure}
+%===========================================================================
+\begin{procedure}{iomwrv}
+
+\FunctionDescription Procedure to write a vector to file.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a one dimensional vector where the data is
+stored in.
+
+\DeclarationandParams \lstinline|procedure iomwrv(var out: text;|
+\lstinline|var v: ArbFloat; n, form: ArbInt);|
+
+\begin{description}
+  \item[var out: text] \mbox{} \\
+   The parameter {\bf out} contains the file where the components of the vector are stored in.
+  \item[var v: ArbFloat] \mbox{} \\
+   Parameter {\bf v} must contain the top array element.
+  \item[n: ArbInt] \mbox{} \\
+   The parameter {\bf n} contains the length of the vector.
+  \item[form: ArbInt] \mbox{} \\
+   The parameter {\bf form} controls the number of decimals of the floating point representation.
+\end{description}
+
+\Remarks If the number of elements of the vector is so big that the
+vector does not fit one line, then the vector is split up over
+several lines.
+
+One line is typically 78 character positions. (It is possible though
+to change the global unit variable {\bf npos} that controls the
+number of characters).
+
+{\bf NOTE} \\
+  This procedure does not do array range checks. When called with invalid
+  parameters, invalid/nonsense responses or even crashes may be the result.
+
+\Example A random generated 5-vector $v$, with components between
+ $-1$ and $+1$, is written to file in two ways with {\bf form}=15 and {\bf form}=12.
+
+\ProgramData
+
+\NUMLIBexample{iomwrvex}
+
+\ProgramResults Running the example program {\bf iomwrvex} when
+using the real type single will give a similar result.
+
+\begin{verbatim}
+-9.193040E-0001  -2.695178E-0001  -1.123863E-0001  -8.804156E-0001
+-4.882166E-0001
+
+-9.193E-0001  -2.695E-0001  -1.124E-0001  -8.804E-0001  -4.882E-0001
+\end{verbatim}
+
+%\Precision
+%
+%\Method
+%
+%\References
+
+\end{procedure}
+%===========================================================================
+
+\begin{procedure}{iomrem}
+
+\FunctionDescription Procedure for reading a rectangular matrix.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a two dimensional matrix where the data will
+be stored in.
+
+\DeclarationandParams
+
+\lstinline|procedure iomrem(var inp: text; var a: ArbFloat; m, n,|
+\lstinline|rwidth: ArbInt);|
+
+\begin{description}
+  \item[var inp: text] \mbox{} \\
+   The parameter {\bf inp} contains the file where the components of the matrix are stored in.
+ \item[var a: ArbFloat] \mbox{} \\
+   Parameter {\bf a} must contain the left top array element.
+ \item[m: ArbInt] \mbox{} \\
+   Parameter {\bf m} contains the column length of the matrix to be read.
+ \item[n: ArbInt] \mbox{} \\
+   Parameter {\bf n} contains the row length of the matrix to be read.
+ \item[rwidth: ArbInt] \mbox{} \\
+   Parameter {\bf rwidth} contains the declared rowlength of the two
+   dimensional array where the matrix will be stored in.
+\end{description}
+
+\Remarks This procedure does not do array range checks. When called
+with invalid parameters, invalid/nonsense responses or even crashes
+may be the result.
+
+\Example reading and printing if the  $3 \times 2$-matrix
+
+\[ \left( \begin{array}{cc}
+                 1 & 2 \\
+                 3 & 4 \\
+                 5 & 6
+          \end{array}
+   \right).
+\]
+
+\ProgramData
+
+\NUMLIBexample{iomremex}
+
+\ProgramResults Running the example program {\bf iomremex} when
+using the real type single gives the following results.
+
+\begin{verbatim}
+A=
+
+ 1.000E+0000   2.000E+0000
+ 3.000E+0000   4.000E+0000
+ 5.000E+0000   6.000E+0000
+\end{verbatim}
+
+%\Precision
+%
+%\Method
+%
+%\References
+
+\end{procedure}
+%===========================================================================
+\begin{procedure}{iomwrm}
+
+\FunctionDescription Procedure for writing a rectangular matrix to
+file.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a two dimensional matrix where the data will
+be stored in.
+
+\DeclarationandParams \lstinline|procedure iomwrm(var out: text;|
+\lstinline|var a: real; m, n, rwidth, form: integer);|
+
+\begin{description}
+ \item[var out: text] \mbox{} \\
+   The parameter {\bf out} contains the file where the components of the matrix are stored.
+ \item[var a: real] \mbox{} \\
+   Parameter {\bf a} must contain the left top array element.
+ \item[m: integer] \mbox{} \\
+   Parameter {\bf m} contains the column length of the matrix.
+ \item[n: integer] \mbox{} \\
+   Parameter {\bf n} contains the row length of the matrix.
+ \item[rwidth: integer] \mbox{} \\
+   Parameter {\bf rwidth} contains the true column count of the declared matrix.
+ \item[form: integer] \mbox{} \\
+   The parameter {\bf form} controls the number of decimals of the floating point representation.
+\end{description}
+
+\Remarks If the number of columns of the matrix is so big that the
+row does not fit one line, then the matrix columns are split up over
+several lines separated by an empty line.
+
+One line is typically 78 character positions. (It is possible though
+to change the global unit variable {\bf npos} that controls the
+number of characters).
+
+{\bf NOTE} \\
+  This procedure does not do array range checks. When called with invalid
+  parameters, invalid/nonsense responses or even crashes may be the result.
+
+\Example Of a $5 \times 13$-matrix $A$ with elements
+$A_{ij}=-(i+j/10), 1 \leq i \leq 5,\ 1 \leq j \leq 13$, is the $3
+\times 6$ block matrix $(A_{ij}), \ 2 \leq i \leq 4, \ 3 \leq j \leq
+8$ written to file with {\bf form}=14 and {\bf form}=10.
+
+\ProgramData
+
+\NUMLIBexample{iomwrmex}
+
+\ProgramResults Running the example program {\bf iomwrmex} when
+using the real type single gives the following results.
+
+\begin{verbatim}
+-2.30000E+0000  -2.40000E+0000  -2.50000E+0000  -2.60000E+0000
+-3.30000E+0000  -3.40000E+0000  -3.50000E+0000  -3.60000E+0000
+-4.30000E+0000  -4.40000E+0000  -4.50000E+0000  -4.60000E+0000
+
+-2.70000E+0000  -2.80000E+0000 -3.70000E+0000  -3.80000E+0000
+-4.70000E+0000  -4.80000E+0000
+
+-2.3E+0000  -2.4E+0000  -2.5E+0000  -2.6E+0000  -2.7E+0000
+-2.8E+0000 -3.3E+0000  -3.4E+0000  -3.5E+0000  -3.6E+0000
+-3.7E+0000  -3.8E+0000 -4.3E+0000  -4.4E+0000  -4.5E+0000
+-4.6E+0000  -4.7E+0000  -4.8E+0000
+\end{verbatim}
+
+%\Precision
+%
+%\Method
+%
+%\References
+
+\end{procedure}
+
+%===========================================================================
+\begin{procedure}{iomwrms}
+
+\FunctionDescription Procedure for writing a rectangular matrix to a
+string.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a two dimensional matrix where the data will
+be stored in.
+
+\DeclarationandParams \lstinline|procedure iomwrms(var out:|
+\lstinline|ArbString; var a: ArbFloat; m, n, form, c: ArbInt);|
+
+\begin{description}
+ \item[var out: ArbString] \mbox{} \\
+   The parameter {\bf out} contains the string where the components of the matrix are stored.
+ \item[var a: ArbFloat] \mbox{} \\
+   Parameter {\bf a} must contain the left top array element.
+ \item[m: ArbInt] \mbox{} \\
+   Parameter {\bf m} contains the column length of the matrix.
+ \item[n: ArbInt] \mbox{} \\
+   Parameter {\bf n} contains the row length of the matrix.
+ \item[form: ArbInt] \mbox{} \\
+   The parameter {\bf form} controls the number of decimals of the floating point representation.
+ \item[c: ArbInt] \mbox{} \\
+   The parameter {\bf c} contains the true column count of the declared matrix.
+\end{description}
+
+\Remarks This procedure does not do array range checks. When called
+with invalid parameters, invalid/nonsense responses or even crashes
+may be the result.
+
+\Example
+
+\NUMLIBexample{iomrewrsex}
+
+\ProgramData
+\begin{verbatim}
+{1 2}{3 4}{5 6}
+\end{verbatim}
+
+\ProgramResults
+\begin{verbatim}
+A = { 1.0E+0000  2.0E+0000 }{ 3.0E+0000  4.0E+0000 }{ 5.0E+0000
+6.0E+0000 }
+\end{verbatim}
+
+%\Precision
+%
+%\Method
+%
+%\References
+
+\end{procedure}
+%===========================================================================
+
+\begin{procedure}{iomrems}
+
+\FunctionDescription Procedure for reading a rectangular matrix from
+string.
+
+\Dataorganisation The procedure assumes that the program that is
+calling it has declared a two dimensional matrix where the data will
+be stored in.
+
+\DeclarationandParams \lstinline|procedure iomrems(inp: ArbString;|
+\lstinline|var a: ArbFloat; var m, n: ArbInt; c: ArbInt);|
+
+\begin{description}
+  \item[inp: ArbString] \mbox{} \\
+    De parameter {\bf inp} contains the string where all components of the new matrix are stored in.
+  \item[var a: ArbFloat] \mbox{} \\
+   Parameter {\bf a} must contain the left top array element.
+  \item[var m: ArbInt] \mbox{} \\
+   Parameter {\bf m} contains the column length of the matrix.
+  \item[var n: ArbInt] \mbox{} \\
+   Parameter {\bf n} contains the row length of the matrix.
+  \item[c: ArbInt] \mbox{} \\
+   Parameter {\bf c} contains the true column count of the declared matrix.
+\end{description}
+
+\Remarks This procedure does not do array range checks. When called
+with invalid parameters, invalid/nonsense responses or even crashes
+may be the result.
+
+\Example
+
+\NUMLIBexample{iomrewrsex}
+
+\ProgramData
+\begin{verbatim}
+{1 2}{3 4}{5 6}
+\end{verbatim}
+
+\ProgramResults
+\begin{verbatim}
+A = { 1.0E+0000  2.0E+0000 }{ 3.0E+0000  4.0E+0000 }{ 5.0E+0000
+6.0E+0000 }
+\end{verbatim}
+
+%\Precision
+%
+%\Method
+%
+%\References
+
+\end{procedure}
+
+\end{document}

+ 3 - 3
packages/extra/numlib/dsl.pas

@@ -191,8 +191,8 @@ Procedure dslgsy(n, rwidth: ArbInt; Var alt: ArbFloat; Var p: ArbInt;
 
 
 Var
 Var
     i, indexpivot, imin1, j, jmin1, iplus1, imin2, ns, ii  : ArbInt;
     i, indexpivot, imin1, j, jmin1, iplus1, imin2, ns, ii  : ArbInt;
-                                          success, regular : boolean;
-                                                 h, ct, di : ArbFloat;
+                                                   success : boolean;
+                                                     h, di : ArbFloat;
                                palt, pb, px, y, l, d, u, v : ^arfloat1;
                                palt, pb, px, y, l, d, u, v : ^arfloat1;
                                                         pp : ^arint1;
                                                         pp : ^arint1;
                                                         pq : ^arbool1;
                                                         pq : ^arbool1;
@@ -424,7 +424,7 @@ Procedure dslgpb(n, lb, rwidth: ArbInt; Var al, b, x: ArbFloat;
 
 
 Var
 Var
    ll, ii, llmin1, p, i, q, k : ArbInt;
    ll, ii, llmin1, p, i, q, k : ArbInt;
-            h, hh, alim       : ArbFloat;
+                      h, alim : ArbFloat;
                   pal, pb, px : ^arfloat1;
                   pal, pb, px : ^arfloat1;
 Begin
 Begin
   If (lb<0) Or (lb>n-1) Or (n<1) Or (rwidth<1) Then
   If (lb<0) Or (lb>n-1) Or (n<1) Or (rwidth<1) Then

+ 8 - 8
packages/extra/numlib/eig.pas

@@ -245,7 +245,7 @@ end; {eigts4}
 procedure eigbs1(var a: ArbFloat; n, l: ArbInt; var lam: ArbFloat;
 procedure eigbs1(var a: ArbFloat; n, l: ArbInt; var lam: ArbFloat;
                  var term: ArbInt);
                  var term: ArbInt);
 var             u, d, cd : ^arfloat1;
 var             u, d, cd : ^arfloat1;
-      uwidth, i, sr, nsr : ArbInt;
+      uwidth, sr, nsr : ArbInt;
 begin
 begin
   if (n<1) or (l<0) or (l>n-1) then
   if (n<1) or (l<0) or (l>n-1) then
     begin
     begin
@@ -262,7 +262,7 @@ end; {eigbs1}
 procedure eigbs2(var a: ArbFloat; n, l, k1, k2: ArbInt; var lam: ArbFloat;
 procedure eigbs2(var a: ArbFloat; n, l, k1, k2: ArbInt; var lam: ArbFloat;
                  var term: ArbInt);
                  var term: ArbInt);
 var                  u, d, cd : ^arfloat1;
 var                  u, d, cd : ^arfloat1;
-           i, sr, nsr, uwidth : ArbInt;
+            sr, nsr, uwidth : ArbInt;
 begin
 begin
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) or (l<0) or (l>n-1) then
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) or (l<0) or (l>n-1) then
     begin
     begin
@@ -279,7 +279,7 @@ end; {eigbs2}
 procedure eigbs3(var a: ArbFloat; n, l: ArbInt; var lam, x: ArbFloat;
 procedure eigbs3(var a: ArbFloat; n, l: ArbInt; var lam, x: ArbFloat;
                  rwidthx: ArbInt; var term: ArbInt);
                  rwidthx: ArbInt; var term: ArbInt);
 var                  u, d, cd : ^arfloat1;
 var                  u, d, cd : ^arfloat1;
-           i, sr, nsr, uwidth : ArbInt;
+           sr, nsr, uwidth : ArbInt;
 begin
 begin
   if (n<1) or (l<0) or (l>n-1) then
   if (n<1) or (l<0) or (l>n-1) then
     begin
     begin
@@ -361,7 +361,7 @@ end;  {eigge1}
 procedure eigge3(var a: ArbFloat; n, rwidtha: ArbInt; var lam, x: complex;
 procedure eigge3(var a: ArbFloat; n, rwidtha: ArbInt; var lam, x: complex;
                  rwidthx: ArbInt; var term: ArbInt);
                  rwidthx: ArbInt; var term: ArbInt);
 var     pa, pd, u, v: ^arfloat1;
 var     pa, pd, u, v: ^arfloat1;
-    m1, m2, i, j, ns: ArbInt;
+    m1, m2, i, ns: ArbInt;
 begin
 begin
   if n<1 then
   if n<1 then
     begin
     begin
@@ -384,7 +384,7 @@ end;  {eigge3}
 procedure eiggg1(var a: ArbFloat; n, rwidtha: ArbInt; var b: ArbFloat;
 procedure eiggg1(var a: ArbFloat; n, rwidtha: ArbInt; var b: ArbFloat;
                  rwidthb: ArbInt; var lam: ArbFloat; var term: ArbInt);
                  rwidthb: ArbInt; var lam: ArbFloat; var term: ArbInt);
 var u, v, pa, pb : ^arfloat1;
 var u, v, pa, pb : ^arfloat1;
-        i, j, ns : ArbInt;
+        i, ns : ArbInt;
 begin
 begin
   if n<1 then
   if n<1 then
     begin
     begin
@@ -401,7 +401,7 @@ end; {eiggg1}
 procedure eiggg2(var a: ArbFloat; n, rwidtha, k1, k2: ArbInt; var b: ArbFloat;
 procedure eiggg2(var a: ArbFloat; n, rwidtha, k1, k2: ArbInt; var b: ArbFloat;
                  rwidthb: ArbInt; var lam: ArbFloat; var term: ArbInt);
                  rwidthb: ArbInt; var lam: ArbFloat; var term: ArbInt);
 var u, v, pa, pb : ^arfloat1;
 var u, v, pa, pb : ^arfloat1;
-        i, j, ns : ArbInt;
+        i, ns : ArbInt;
 begin
 begin
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) then
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) then
     begin
     begin
@@ -419,7 +419,7 @@ procedure eiggg3(var a: ArbFloat; n, rwidtha: ArbInt; var b: ArbFloat;
                  rwidthb: ArbInt; var lam, x: ArbFloat; rwidthx: ArbInt;
                  rwidthb: ArbInt; var lam, x: ArbFloat; rwidthx: ArbInt;
                  var term: ArbInt);
                  var term: ArbInt);
 var u, v, pa, pb : ^arfloat1;
 var u, v, pa, pb : ^arfloat1;
-        i, j, ns : ArbInt;
+        i, ns : ArbInt;
 begin
 begin
   if n<1 then
   if n<1 then
     begin
     begin
@@ -444,7 +444,7 @@ procedure eiggg4(var a: ArbFloat; n, rwidtha, k1, k2: ArbInt; var b: ArbFloat;
                  var m2, term: ArbInt);
                  var m2, term: ArbInt);
 
 
 var u, v, pa, pb : ^arfloat1;
 var u, v, pa, pb : ^arfloat1;
-     i, j, ns, t : ArbInt;
+     i, ns, t : ArbInt;
 begin
 begin
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) then
   if (n<1) or (k1<1) or (k2<k1) or (k2>n) then
     begin
     begin

+ 1 - 1
packages/extra/numlib/eigh1.pas

@@ -837,7 +837,7 @@ procedure bandev(var a: ArbFloat; n, m, rwidth: ArbInt; lambda: ArbFloat;
 var                              pa, pv, au, l, u : ^arfloat1;
 var                              pa, pv, au, l, u : ^arfloat1;
                                                 p : ^arint1;
                                                 p : ^arint1;
           ind, ii, i, k, t, j, its, w, sr, ns, ll : ArbInt;
           ind, ii, i, k, t, j, its, w, sr, ns, ll : ArbInt;
-    meps, eps, s, norm, lambdak, x, y, r1, d1, ca : ArbFloat;
+                 meps, eps, s, norm, x, y, r1, d1 : ArbFloat;
 begin
 begin
   pa:=@a; pv:=@v;
   pa:=@a; pv:=@v;
   sr:=sizeof(ArbFloat); ns:=n*sr; ll:=2*m+1;
   sr:=sizeof(ArbFloat); ns:=n*sr; ll:=2*m+1;

+ 2 - 2
packages/extra/numlib/eigh2.pas

@@ -50,7 +50,7 @@ implementation
 
 
 procedure orthes(var a: ArbFloat; n, rwidth: ArbInt; var u: ArbFloat);
 procedure orthes(var a: ArbFloat; n, rwidth: ArbInt; var u: ArbFloat);
 var               pa, pu, d : ^arfloat1;
 var               pa, pu, d : ^arfloat1;
-    sig, sig2, h, f, g, tol : ArbFloat;
+    sig, sig2, h, f, tol : ArbFloat;
                     k, i, j : ArbInt;
                     k, i, j : ArbInt;
 begin
 begin
   pa:=@a; pu:=@u; tol:=midget/macheps;
   pa:=@a; pu:=@u; tol:=midget/macheps;
@@ -309,7 +309,7 @@ procedure orttrans(var a: ArbFloat; n, rwidtha: ArbInt; var q: ArbFloat;
                    rwidthq: ArbInt);
                    rwidthq: ArbInt);
 
 
 var                 i, j, k : ArbInt;
 var                 i, j, k : ArbInt;
-    sig, sig2, f, g, h, tol : ArbFloat;
+    sig, sig2, f, h, tol : ArbFloat;
                   pa, pq, d : ^arfloat1;
                   pa, pq, d : ^arfloat1;
 
 
 begin
 begin

+ 2741 - 0
packages/extra/numlib/examples/Makefile

@@ -0,0 +1,2741 @@
+#
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/10]
+#
+default: all
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
+BSDs = freebsd netbsd openbsd darwin
+UNIXs = linux $(BSDs) solaris qnx
+LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
+FORCE:
+.PHONY: FORCE
+override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
+ifneq ($(findstring darwin,$(OSTYPE)),)
+inUnix=1 #darwin
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+ifeq ($(findstring ;,$(PATH)),)
+inUnix=1
+SEARCHPATH:=$(filter-out .,$(subst :, ,$(PATH)))
+else
+SEARCHPATH:=$(subst ;, ,$(PATH))
+endif
+endif
+SEARCHPATH+=$(patsubst %/,%,$(subst \,/,$(dir $(MAKE))))
+PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
+ifeq ($(PWD),)
+PWD:=$(strip $(wildcard $(addsuffix /pwd,$(SEARCHPATH))))
+ifeq ($(PWD),)
+$(error You need the GNU utils package to use this Makefile)
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=
+endif
+else
+PWD:=$(firstword $(PWD))
+SRCEXEEXT=.exe
+endif
+ifndef inUnix
+ifeq ($(OS),Windows_NT)
+inWinNT=1
+else
+ifdef OS2_SHELL
+inOS2=1
+endif
+endif
+else
+ifneq ($(findstring cygdrive,$(PATH)),)
+inCygWin=1
+endif
+endif
+ifdef inUnix
+SRCBATCHEXT=.sh
+else
+ifdef inOS2
+SRCBATCHEXT=.cmd
+else
+SRCBATCHEXT=.bat
+endif
+endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
+ifdef inUnix
+PATHSEP=/
+else
+PATHSEP:=$(subst /,\,/)
+ifdef inCygWin
+PATHSEP=/
+endif
+endif
+ifdef PWD
+BASEDIR:=$(subst \,/,$(shell $(PWD)))
+ifdef inCygWin
+ifneq ($(findstring /cygdrive/,$(BASEDIR)),)
+BASENODIR:=$(patsubst /cygdrive%,%,$(BASEDIR))
+BASEDRIVE:=$(firstword $(subst /, ,$(BASENODIR)))
+BASEDIR:=$(subst /cygdrive/$(BASEDRIVE)/,$(BASEDRIVE):/,$(BASEDIR))
+endif
+endif
+else
+BASEDIR=.
+endif
+ifdef inOS2
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO=echo
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+endif
+override DEFAULT_FPCDIR=../../../..
+ifndef FPC
+ifdef PP
+FPC=$(PP)
+endif
+endif
+ifndef FPC
+FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
+ifneq ($(FPCPROG),)
+FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
+FPC:=$(shell $(FPCPROG) -PB)
+endif
+ifneq ($(findstring Error,$(FPC)),)
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+else
+override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
+endif
+endif
+override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
+override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
+FOUNDFPC:=$(strip $(wildcard $(FPC)))
+ifeq ($(FOUNDFPC),)
+FOUNDFPC=$(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))
+ifeq ($(FOUNDFPC),)
+$(error Compiler $(FPC) not found)
+endif
+endif
+ifndef FPC_COMPILERINFO
+FPC_COMPILERINFO:=$(shell $(FPC) -iVSPTPSOTO)
+endif
+ifndef FPC_VERSION
+FPC_VERSION:=$(word 1,$(FPC_COMPILERINFO))
+endif
+export FPC FPC_VERSION FPC_COMPILERINFO
+unexport CHECKDEPEND ALLDEPENDENCIES
+ifndef CPU_TARGET
+ifdef CPU_TARGET_DEFAULT
+CPU_TARGET=$(CPU_TARGET_DEFAULT)
+endif
+endif
+ifndef OS_TARGET
+ifdef OS_TARGET_DEFAULT
+OS_TARGET=$(OS_TARGET_DEFAULT)
+endif
+endif
+ifneq ($(words $(FPC_COMPILERINFO)),5)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTP)
+FPC_COMPILERINFO+=$(shell $(FPC) -iSO)
+FPC_COMPILERINFO+=$(shell $(FPC) -iTO)
+endif
+ifndef CPU_SOURCE
+CPU_SOURCE:=$(word 2,$(FPC_COMPILERINFO))
+endif
+ifndef CPU_TARGET
+CPU_TARGET:=$(word 3,$(FPC_COMPILERINFO))
+endif
+ifndef OS_SOURCE
+OS_SOURCE:=$(word 4,$(FPC_COMPILERINFO))
+endif
+ifndef OS_TARGET
+OS_TARGET:=$(word 5,$(FPC_COMPILERINFO))
+endif
+FULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+FULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+TARGETSUFFIX=$(OS_TARGET)
+SOURCESUFFIX=$(OS_SOURCE)
+else
+TARGETSUFFIX=$(FULL_TARGET)
+SOURCESUFFIX=$(FULL_SOURCE)
+endif
+ifneq ($(FULL_TARGET),$(FULL_SOURCE))
+CROSSCOMPILE=1
+endif
+ifeq ($(findstring makefile,$(MAKECMDGOALS)),)
+ifeq ($(findstring $(FULL_TARGET),$(MAKEFILETARGETS)),)
+$(error The Makefile doesn't support target $(FULL_TARGET), please run fpcmake first)
+endif
+endif
+ifneq ($(findstring $(OS_TARGET),$(BSDs)),)
+BSDhier=1
+endif
+ifeq ($(OS_TARGET),linux)
+linuxHier=1
+endif
+export OS_TARGET OS_SOURCE CPU_TARGET CPU_SOURCE FULL_TARGET FULL_SOURCE TARGETSUFFIX SOURCESUFFIX CROSSCOMPILE
+ifdef FPCDIR
+override FPCDIR:=$(subst \,/,$(FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+else
+override FPCDIR=wrong
+endif
+ifdef DEFAULT_FPCDIR
+ifeq ($(FPCDIR),wrong)
+override FPCDIR:=$(subst \,/,$(DEFAULT_FPCDIR))
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=wrong
+endif
+endif
+endif
+ifeq ($(FPCDIR),wrong)
+ifdef inUnix
+override FPCDIR=/usr/local/lib/fpc/$(FPC_VERSION)
+ifeq ($(wildcard $(FPCDIR)/units),)
+override FPCDIR=/usr/lib/fpc/$(FPC_VERSION)
+endif
+else
+override FPCDIR:=$(subst /$(FPC),,$(firstword $(strip $(wildcard $(addsuffix /$(FPC),$(SEARCHPATH))))))
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(FPCDIR)/..
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR:=$(BASEDIR)
+ifeq ($(wildcard $(addprefix $(FPCDIR)/,rtl units)),)
+override FPCDIR=c:/pp
+endif
+endif
+endif
+endif
+endif
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(FPCDIR)/bin/$(TARGETSUFFIX))
+endif
+ifndef BINUTILSPREFIX
+ifndef CROSSBINDIR
+ifdef CROSSCOMPILE
+BINUTILSPREFIX=$(CPU_TARGET)-$(OS_TARGET)-
+endif
+endif
+endif
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(TARGETSUFFIX))
+ifeq ($(UNITSDIR),)
+UNITSDIR:=$(wildcard $(FPCDIR)/units/$(OS_TARGET))
+endif
+PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra)
+override PACKAGE_NAME=iom
+override PACKAGE_VERSION=0
+ifeq ($(FULL_TARGET),i386-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override TARGET_PROGRAMS+=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override CLEAN_FILES+=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_OPTIONS+=-gl
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_UNITDIR+=..
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_TARGETDIR+=.
+endif
+ifeq ($(FULL_TARGET),i386-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+override COMPILER_UNITTARGETDIR+=../units/$(CPU_TARGET)-$(OS_TARGET)
+endif
+ifdef REQUIRE_UNITSDIR
+override UNITSDIR+=$(REQUIRE_UNITSDIR)
+endif
+ifdef REQUIRE_PACKAGESDIR
+override PACKAGESDIR+=$(REQUIRE_PACKAGESDIR)
+endif
+ifdef ZIPINSTALL
+ifneq ($(findstring $(OS_TARGET),$(UNIXs)),)
+UNIXHier=1
+endif
+else
+ifneq ($(findstring $(OS_SOURCE),$(UNIXs)),)
+UNIXHier=1
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef PREFIX
+INSTALL_PREFIX=$(PREFIX)
+endif
+endif
+ifndef INSTALL_PREFIX
+ifdef UNIXHier
+INSTALL_PREFIX=/usr/local
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=/pp
+else
+INSTALL_BASEDIR:=/$(PACKAGE_NAME)
+endif
+endif
+endif
+export INSTALL_PREFIX
+ifdef INSTALL_FPCSUBDIR
+export INSTALL_FPCSUBDIR
+endif
+ifndef DIST_DESTDIR
+DIST_DESTDIR:=$(BASEDIR)
+endif
+export DIST_DESTDIR
+ifndef COMPILER_UNITTARGETDIR
+ifdef PACKAGEDIR_MAIN
+COMPILER_UNITTARGETDIR=$(PACKAGEDIR_MAIN)/units/$(TARGETSUFFIX)
+else
+COMPILER_UNITTARGETDIR=units/$(TARGETSUFFIX)
+endif
+endif
+ifndef COMPILER_TARGETDIR
+COMPILER_TARGETDIR=.
+endif
+ifndef INSTALL_BASEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/fpc/$(FPC_VERSION)
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)/lib/$(PACKAGE_NAME)
+endif
+else
+INSTALL_BASEDIR:=$(INSTALL_PREFIX)
+endif
+endif
+ifndef INSTALL_BINDIR
+ifdef UNIXHier
+INSTALL_BINDIR:=$(INSTALL_PREFIX)/bin
+else
+INSTALL_BINDIR:=$(INSTALL_BASEDIR)/bin
+ifdef INSTALL_FPCPACKAGE
+ifdef CROSSCOMPILE
+ifdef CROSSINSTALL
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(SOURCESUFFIX)
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+else
+INSTALL_BINDIR:=$(INSTALL_BINDIR)/$(TARGETSUFFIX)
+endif
+endif
+endif
+endif
+ifndef INSTALL_UNITDIR
+INSTALL_UNITDIR:=$(INSTALL_BASEDIR)/units/$(TARGETSUFFIX)
+ifdef INSTALL_FPCPACKAGE
+ifdef PACKAGE_NAME
+INSTALL_UNITDIR:=$(INSTALL_UNITDIR)/$(PACKAGE_NAME)
+endif
+endif
+endif
+ifndef INSTALL_LIBDIR
+ifdef UNIXHier
+INSTALL_LIBDIR:=$(INSTALL_PREFIX)/lib
+else
+INSTALL_LIBDIR:=$(INSTALL_UNITDIR)
+endif
+endif
+ifndef INSTALL_SOURCEDIR
+ifdef UNIXHier
+ifdef BSDhier
+SRCPREFIXDIR=share/src
+else
+ifdef linuxHier
+SRCPREFIXDIR=share/src
+else
+SRCPREFIXDIR=src
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_PREFIX)/$(SRCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+ifdef INSTALL_FPCSUBDIR
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(INSTALL_FPCSUBDIR)/$(PACKAGE_NAME)
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source/$(PACKAGE_NAME)
+endif
+else
+INSTALL_SOURCEDIR:=$(INSTALL_BASEDIR)/source
+endif
+endif
+endif
+ifndef INSTALL_DOCDIR
+ifdef UNIXHier
+ifdef BSDhier
+DOCPREFIXDIR=share/doc
+else
+ifdef linuxHier
+DOCPREFIXDIR=share/doc
+else
+DOCPREFIXDIR=doc
+endif
+endif
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_PREFIX)/$(DOCPREFIXDIR)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc/$(PACKAGE_NAME)
+else
+INSTALL_DOCDIR:=$(INSTALL_BASEDIR)/doc
+endif
+endif
+endif
+ifndef INSTALL_EXAMPLEDIR
+ifdef UNIXHier
+ifdef INSTALL_FPCPACKAGE
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/fpc-$(FPC_VERSION)/$(PACKAGE_NAME)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/fpc-$(FPC_VERSION)/examples/$(PACKAGE_NAME)
+endif
+endif
+else
+ifdef BSDhier
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/share/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+ifdef linuxHier
+INSTALL_EXAMPLEDIR:=$(INSTALL_DOCDIR)/examples/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_PREFIX)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
+endif
+endif
+endif
+else
+ifdef INSTALL_FPCPACKAGE
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples/$(PACKAGE_NAME)
+else
+INSTALL_EXAMPLEDIR:=$(INSTALL_BASEDIR)/examples
+endif
+endif
+endif
+ifndef INSTALL_DATADIR
+INSTALL_DATADIR=$(INSTALL_BASEDIR)
+endif
+ifndef INSTALL_SHAREDDIR
+INSTALL_SHAREDDIR=$(INSTALL_PREFIX)/lib
+endif
+ifdef CROSSCOMPILE
+ifndef CROSSBINDIR
+CROSSBINDIR:=$(wildcard $(CROSSTARGETDIR)/bin/$(SOURCESUFFIX))
+ifeq ($(CROSSBINDIR),)
+CROSSBINDIR:=$(wildcard $(INSTALL_BASEDIR)/cross/$(TARGETSUFFIX)/bin/$(FULL_SOURCE))
+endif
+endif
+else
+CROSSBINDIR=
+endif
+BATCHEXT=.bat
+LOADEREXT=.as
+EXEEXT=.exe
+PPLEXT=.ppl
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.so
+SHAREDLIBPREFIX=libfp
+STATICLIBPREFIX=libp
+IMPORTLIBPREFIX=libimp
+RSTEXT=.rst
+ifeq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),go32v1)
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+OEXT=.obj
+ASMEXT=.asm
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=wat
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),emx)
+BATCHEXT=.cmd
+AOUTEXT=.out
+STATICLIBPREFIX=
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=emx
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),morphos)
+EXEEXT=
+SHAREDLIBEXT=.library
+SHORTSUFFIX=mos
+endif
+ifeq ($(OS_TARGET),atari)
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nw
+endif
+ifeq ($(OS_TARGET),netwlibc)
+EXEEXT=.nlm
+STATICLIBPREFIX=
+SHORTSUFFIX=nwl
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+endif
+ifeq ($(OS_TARGET),darwin)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=dwn
+endif
+ifeq ($(OS_TARGET),gba)
+EXEEXT=.gba
+SHAREDLIBEXT=.so
+SHORTSUFFIX=gba
+endif
+ifeq ($(OS_TARGET),symbian)
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=symbian
+endif
+else
+ifeq ($(OS_TARGET),go32v1)
+PPUEXT=.pp1
+OEXT=.o1
+ASMEXT=.s1
+SMARTEXT=.sl1
+STATICLIBEXT=.a1
+SHAREDLIBEXT=.so1
+STATICLIBPREFIX=
+SHORTSUFFIX=v1
+endif
+ifeq ($(OS_TARGET),go32v2)
+STATICLIBPREFIX=
+SHORTSUFFIX=dos
+endif
+ifeq ($(OS_TARGET),watcom)
+STATICLIBPREFIX=
+SHORTSUFFIX=wat
+endif
+ifeq ($(OS_TARGET),linux)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=lnx
+endif
+ifeq ($(OS_TARGET),freebsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=fbs
+endif
+ifeq ($(OS_TARGET),netbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=nbs
+endif
+ifeq ($(OS_TARGET),openbsd)
+BATCHEXT=.sh
+EXEEXT=
+HASSHAREDLIB=1
+SHORTSUFFIX=obs
+endif
+ifeq ($(OS_TARGET),win32)
+PPUEXT=.ppw
+OEXT=.ow
+ASMEXT=.sw
+SMARTEXT=.slw
+STATICLIBEXT=.aw
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=w32
+endif
+ifeq ($(OS_TARGET),os2)
+BATCHEXT=.cmd
+PPUEXT=.ppo
+ASMEXT=.so2
+OEXT=.oo2
+AOUTEXT=.out
+SMARTEXT=.sl2
+STATICLIBPREFIX=
+STATICLIBEXT=.ao2
+SHAREDLIBEXT=.dll
+SHORTSUFFIX=os2
+ECHO=echo
+endif
+ifeq ($(OS_TARGET),amiga)
+EXEEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.library
+SHORTSUFFIX=amg
+endif
+ifeq ($(OS_TARGET),atari)
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=.ttp
+SHORTSUFFIX=ata
+endif
+ifeq ($(OS_TARGET),beos)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=be
+endif
+ifeq ($(OS_TARGET),solaris)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=sun
+endif
+ifeq ($(OS_TARGET),qnx)
+BATCHEXT=.sh
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+SHORTSUFFIX=qnx
+endif
+ifeq ($(OS_TARGET),netware)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nw
+endif
+ifeq ($(OS_TARGET),netwlibc)
+STATICLIBPREFIX=
+PPUEXT=.ppu
+OEXT=.o
+ASMEXT=.s
+SMARTEXT=.sl
+STATICLIBEXT=.a
+SHAREDLIBEXT=.nlm
+EXEEXT=.nlm
+SHORTSUFFIX=nwl
+endif
+ifeq ($(OS_TARGET),macos)
+BATCHEXT=
+PPUEXT=.ppu
+ASMEXT=.s
+OEXT=.o
+SMARTEXT=.sl
+STATICLIBEXT=.a
+EXEEXT=
+DEBUGSYMEXT=.xcoff
+SHORTSUFFIX=mac
+endif
+endif
+ifneq ($(findstring $(OS_SOURCE),$(LIMIT83fs)),)
+FPCMADE=fpcmade.$(SHORTSUFFIX)
+ZIPSUFFIX=$(SHORTSUFFIX)
+ZIPCROSSPREFIX=
+ZIPSOURCESUFFIX=src
+ZIPEXAMPLESUFFIX=exm
+else
+FPCMADE=fpcmade.$(TARGETSUFFIX)
+ZIPSOURCESUFFIX=.source
+ZIPEXAMPLESUFFIX=.examples
+ifdef CROSSCOMPILE
+ZIPSUFFIX=.$(SOURCESUFFIX)
+ZIPCROSSPREFIX=$(TARGETSUFFIX)-
+else
+ZIPSUFFIX=.$(TARGETSUFFIX)
+ZIPCROSSPREFIX=
+endif
+endif
+ifndef ECHO
+ECHO:=$(strip $(wildcard $(addsuffix /gecho$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO:=$(strip $(wildcard $(addsuffix /echo$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ECHO),)
+ECHO= __missing_command_ECHO
+else
+ECHO:=$(firstword $(ECHO))
+endif
+else
+ECHO:=$(firstword $(ECHO))
+endif
+endif
+export ECHO
+ifndef DATE
+DATE:=$(strip $(wildcard $(addsuffix /gdate$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE:=$(strip $(wildcard $(addsuffix /date$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(DATE),)
+DATE= __missing_command_DATE
+else
+DATE:=$(firstword $(DATE))
+endif
+else
+DATE:=$(firstword $(DATE))
+endif
+endif
+export DATE
+ifndef GINSTALL
+GINSTALL:=$(strip $(wildcard $(addsuffix /ginstall$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL:=$(strip $(wildcard $(addsuffix /install$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(GINSTALL),)
+GINSTALL= __missing_command_GINSTALL
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+else
+GINSTALL:=$(firstword $(GINSTALL))
+endif
+endif
+export GINSTALL
+ifndef CPPROG
+CPPROG:=$(strip $(wildcard $(addsuffix /cp$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(CPPROG),)
+CPPROG= __missing_command_CPPROG
+else
+CPPROG:=$(firstword $(CPPROG))
+endif
+endif
+export CPPROG
+ifndef RMPROG
+RMPROG:=$(strip $(wildcard $(addsuffix /rm$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(RMPROG),)
+RMPROG= __missing_command_RMPROG
+else
+RMPROG:=$(firstword $(RMPROG))
+endif
+endif
+export RMPROG
+ifndef MVPROG
+MVPROG:=$(strip $(wildcard $(addsuffix /mv$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MVPROG),)
+MVPROG= __missing_command_MVPROG
+else
+MVPROG:=$(firstword $(MVPROG))
+endif
+endif
+export MVPROG
+ifndef MKDIRPROG
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /gmkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG:=$(strip $(wildcard $(addsuffix /mkdir$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(MKDIRPROG),)
+MKDIRPROG= __missing_command_MKDIRPROG
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+else
+MKDIRPROG:=$(firstword $(MKDIRPROG))
+endif
+endif
+export MKDIRPROG
+ifndef ECHOREDIR
+ifndef inUnix
+ECHOREDIR=echo
+else
+ECHOREDIR=$(ECHO)
+endif
+endif
+ifndef COPY
+COPY:=$(CPPROG) -fp
+endif
+ifndef COPYTREE
+COPYTREE:=$(CPPROG) -Rfp
+endif
+ifndef MKDIRTREE
+MKDIRTREE:=$(MKDIRPROG) -p
+endif
+ifndef MOVE
+MOVE:=$(MVPROG) -f
+endif
+ifndef DEL
+DEL:=$(RMPROG) -f
+endif
+ifndef DELTREE
+DELTREE:=$(RMPROG) -rf
+endif
+ifndef INSTALL
+ifdef inUnix
+INSTALL:=$(GINSTALL) -c -m 644
+else
+INSTALL:=$(COPY)
+endif
+endif
+ifndef INSTALLEXE
+ifdef inUnix
+INSTALLEXE:=$(GINSTALL) -c -m 755
+else
+INSTALLEXE:=$(COPY)
+endif
+endif
+ifndef MKDIR
+MKDIR:=$(GINSTALL) -m 755 -d
+endif
+export ECHOREDIR COPY COPYTREE MOVE DEL DELTREE INSTALL INSTALLEXE MKDIR
+ifndef PPUMOVE
+PPUMOVE:=$(strip $(wildcard $(addsuffix /ppumove$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(PPUMOVE),)
+PPUMOVE= __missing_command_PPUMOVE
+else
+PPUMOVE:=$(firstword $(PPUMOVE))
+endif
+endif
+export PPUMOVE
+ifndef FPCMAKE
+FPCMAKE:=$(strip $(wildcard $(addsuffix /fpcmake$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(FPCMAKE),)
+FPCMAKE= __missing_command_FPCMAKE
+else
+FPCMAKE:=$(firstword $(FPCMAKE))
+endif
+endif
+export FPCMAKE
+ifndef ZIPPROG
+ZIPPROG:=$(strip $(wildcard $(addsuffix /zip$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(ZIPPROG),)
+ZIPPROG= __missing_command_ZIPPROG
+else
+ZIPPROG:=$(firstword $(ZIPPROG))
+endif
+endif
+export ZIPPROG
+ifndef TARPROG
+TARPROG:=$(strip $(wildcard $(addsuffix /gtar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG:=$(strip $(wildcard $(addsuffix /tar$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(TARPROG),)
+TARPROG= __missing_command_TARPROG
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+else
+TARPROG:=$(firstword $(TARPROG))
+endif
+endif
+export TARPROG
+ASNAME=$(BINUTILSPREFIX)as
+LDNAME=$(BINUTILSPREFIX)ld
+ARNAME=$(BINUTILSPREFIX)ar
+RCNAME=$(BINUTILSPREFIX)rc
+ifneq ($(findstring 1.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),win32)
+ifeq ($(CROSSBINDIR),)
+ASNAME=asw
+LDNAME=ldw
+ARNAME=arw
+endif
+endif
+endif
+ifndef ASPROG
+ifdef CROSSBINDIR
+ASPROG=$(CROSSBINDIR)/$(ASNAME)$(SRCEXEEXT)
+else
+ASPROG=$(ASNAME)
+endif
+endif
+ifndef LDPROG
+ifdef CROSSBINDIR
+LDPROG=$(CROSSBINDIR)/$(LDNAME)$(SRCEXEEXT)
+else
+LDPROG=$(LDNAME)
+endif
+endif
+ifndef RCPROG
+ifdef CROSSBINDIR
+RCPROG=$(CROSSBINDIR)/$(RCNAME)$(SRCEXEEXT)
+else
+RCPROG=$(RCNAME)
+endif
+endif
+ifndef ARPROG
+ifdef CROSSBINDIR
+ARPROG=$(CROSSBINDIR)/$(ARNAME)$(SRCEXEEXT)
+else
+ARPROG=$(ARNAME)
+endif
+endif
+AS=$(ASPROG)
+LD=$(LDPROG)
+RC=$(RCPROG)
+AR=$(ARPROG)
+PPAS=ppas$(SRCBATCHEXT)
+ifdef inUnix
+LDCONFIG=ldconfig
+else
+LDCONFIG=
+endif
+ifdef DATE
+DATESTR:=$(shell $(DATE) +%Y%m%d)
+else
+DATESTR=
+endif
+ifndef UPXPROG
+ifeq ($(OS_TARGET),go32v2)
+UPXPROG:=1
+endif
+ifeq ($(OS_TARGET),win32)
+UPXPROG:=1
+endif
+ifdef UPXPROG
+UPXPROG:=$(strip $(wildcard $(addsuffix /upx$(SRCEXEEXT),$(SEARCHPATH))))
+ifeq ($(UPXPROG),)
+UPXPROG=
+else
+UPXPROG:=$(firstword $(UPXPROG))
+endif
+else
+UPXPROG=
+endif
+endif
+export UPXPROG
+ZIPOPT=-9
+ZIPEXT=.zip
+ifeq ($(USETAR),bz2)
+TAROPT=vj
+TAREXT=.tar.bz2
+else
+TAROPT=vz
+TAREXT=.tar.gz
+endif
+override REQUIRE_PACKAGES=rtl 
+ifeq ($(FULL_TARGET),i386-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-go32v2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-win32)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-os2)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-beos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-qnx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netware)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wdosx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-emx)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-watcom)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-netwlibc)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),i386-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-atari)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-openbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),m68k-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-amiga)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-macos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-morphos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-solaris)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),sparc-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-freebsd)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-win64)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),x86_64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-palmos)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-wince)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-gba)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-nds)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),arm-symbian)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-linux)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifeq ($(FULL_TARGET),powerpc64-embedded)
+REQUIRE_PACKAGES_RTL=1
+endif
+ifdef REQUIRE_PACKAGES_RTL
+PACKAGEDIR_RTL:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /rtl/Makefile.fpc,$(PACKAGESDIR))))))
+ifneq ($(PACKAGEDIR_RTL),)
+ifneq ($(wildcard $(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)),)
+UNITDIR_RTL=$(PACKAGEDIR_RTL)/units/$(TARGETSUFFIX)
+else
+UNITDIR_RTL=$(PACKAGEDIR_RTL)
+endif
+ifdef CHECKDEPEND
+$(PACKAGEDIR_RTL)/$(FPCMADE):
+	$(MAKE) -C $(PACKAGEDIR_RTL) $(FPCMADE)
+override ALLDEPENDENCIES+=$(PACKAGEDIR_RTL)/$(FPCMADE)
+endif
+else
+PACKAGEDIR_RTL=
+UNITDIR_RTL:=$(subst /Package.fpc,,$(strip $(wildcard $(addsuffix /rtl/Package.fpc,$(UNITSDIR)))))
+ifneq ($(UNITDIR_RTL),)
+UNITDIR_RTL:=$(firstword $(UNITDIR_RTL))
+else
+UNITDIR_RTL=
+endif
+endif
+ifdef UNITDIR_RTL
+override COMPILER_UNITDIR+=$(UNITDIR_RTL)
+endif
+endif
+ifndef NOCPUDEF
+override FPCOPTDEF=$(CPU_TARGET)
+endif
+ifneq ($(OS_TARGET),$(OS_SOURCE))
+override FPCOPT+=-T$(OS_TARGET)
+endif
+ifneq ($(CPU_TARGET),$(CPU_SOURCE))
+override FPCOPT+=-P$(CPU_TARGET)
+endif
+ifeq ($(OS_SOURCE),openbsd)
+override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
+endif
+ifndef CROSSBOOTSTRAP
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-XP$(BINUTILSPREFIX)
+endif
+ifneq ($(BINUTILSPREFIX),)
+override FPCOPT+=-Xr$(RLINKPATH)
+endif
+endif
+ifdef UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(UNITDIR))
+endif
+ifdef LIBDIR
+override FPCOPT+=$(addprefix -Fl,$(LIBDIR))
+endif
+ifdef OBJDIR
+override FPCOPT+=$(addprefix -Fo,$(OBJDIR))
+endif
+ifdef INCDIR
+override FPCOPT+=$(addprefix -Fi,$(INCDIR))
+endif
+ifdef LINKSMART
+override FPCOPT+=-XX
+endif
+ifdef CREATESMART
+override FPCOPT+=-CX
+endif
+ifdef DEBUG
+override FPCOPT+=-gl
+override FPCOPTDEF+=DEBUG
+endif
+ifdef RELEASE
+ifneq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(CPU_TARGET),i386)
+FPCCPUOPT:=-OG2p3
+endif
+ifeq ($(CPU_TARGET),powerpc)
+FPCCPUOPT:=-O1r
+endif
+else
+FPCCPUOPT:=-O2
+endif
+override FPCOPT+=-Ur -Xs $(FPCCPUOPT) -n
+override FPCOPTDEF+=RELEASE
+endif
+ifdef STRIP
+override FPCOPT+=-Xs
+endif
+ifdef OPTIMIZE
+override FPCOPT+=-O2
+endif
+ifdef VERBOSE
+override FPCOPT+=-vwni
+endif
+ifdef COMPILER_OPTIONS
+override FPCOPT+=$(COMPILER_OPTIONS)
+endif
+ifdef COMPILER_UNITDIR
+override FPCOPT+=$(addprefix -Fu,$(COMPILER_UNITDIR))
+endif
+ifdef COMPILER_LIBRARYDIR
+override FPCOPT+=$(addprefix -Fl,$(COMPILER_LIBRARYDIR))
+endif
+ifdef COMPILER_OBJECTDIR
+override FPCOPT+=$(addprefix -Fo,$(COMPILER_OBJECTDIR))
+endif
+ifdef COMPILER_INCLUDEDIR
+override FPCOPT+=$(addprefix -Fi,$(COMPILER_INCLUDEDIR))
+endif
+ifdef CROSSBINDIR
+override FPCOPT+=-FD$(CROSSBINDIR)
+endif
+ifdef COMPILER_TARGETDIR
+override FPCOPT+=-FE$(COMPILER_TARGETDIR)
+ifeq ($(COMPILER_TARGETDIR),.)
+override TARGETDIRPREFIX=
+else
+override TARGETDIRPREFIX=$(COMPILER_TARGETDIR)/
+endif
+endif
+ifdef COMPILER_UNITTARGETDIR
+override FPCOPT+=-FU$(COMPILER_UNITTARGETDIR)
+ifeq ($(COMPILER_UNITTARGETDIR),.)
+override UNITTARGETDIRPREFIX=
+else
+override UNITTARGETDIRPREFIX=$(COMPILER_UNITTARGETDIR)/
+endif
+else
+ifdef COMPILER_TARGETDIR
+override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR)
+override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX)
+endif
+endif
+ifdef CREATESHARED
+override FPCOPT+=-Cg
+ifeq ($(CPU_TARGET),i386)
+override FPCOPT+=-Aas
+endif
+endif
+ifeq ($(findstring 2.0.,$(FPC_VERSION)),)
+ifeq ($(OS_TARGET),linux)
+ifeq ($(CPU_TARGET),x86_64)
+override FPCOPT+=-Cg
+endif
+endif
+endif
+ifdef LINKSHARED
+endif
+ifdef OPT
+override FPCOPT+=$(OPT)
+endif
+ifdef FPCOPTDEF
+override FPCOPT+=$(addprefix -d,$(FPCOPTDEF))
+endif
+ifdef CFGFILE
+override FPCOPT+=@$(CFGFILE)
+endif
+ifdef USEENV
+override FPCEXTCMD:=$(FPCOPT)
+override FPCOPT:=!FPCEXTCMD
+export FPCEXTCMD
+endif
+override AFULL_TARGET=$(CPU_TARGET)-$(OS_TARGET)
+override AFULL_SOURCE=$(CPU_SOURCE)-$(OS_SOURCE)
+ifneq ($(AFULL_TARGET),$(AFULL_SOURCE))
+override ACROSSCOMPILE=1
+endif
+ifdef ACROSSCOMPILE
+override FPCOPT+=$(CROSSOPT)
+endif
+override COMPILER:=$(FPC) $(FPCOPT)
+ifeq (,$(findstring -s ,$(COMPILER)))
+EXECPPAS=
+else
+ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
+EXECPPAS:=@$(PPAS)
+endif
+endif
+endif
+.PHONY: fpc_exes
+ifndef CROSSINSTALL
+ifneq ($(TARGET_PROGRAMS),)
+override EXEFILES=$(addsuffix $(EXEEXT),$(TARGET_PROGRAMS))
+override EXEOFILES:=$(addsuffix $(OEXT),$(TARGET_PROGRAMS)) $(addprefix $(STATICLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS))) $(addprefix $(IMPORTLIBPREFIX),$(addsuffix $(STATICLIBEXT),$(TARGET_PROGRAMS)))
+override ALLTARGET+=fpc_exes
+override INSTALLEXEFILES+=$(EXEFILES)
+override CLEANEXEFILES+=$(EXEFILES) $(EXEOFILES)
+ifeq ($(OS_TARGET),os2)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+ifeq ($(OS_TARGET),emx)
+override CLEANEXEFILES+=$(addsuffix $(AOUTEXT),$(TARGET_PROGRAMS))
+endif
+endif
+endif
+fpc_exes: $(COMPILER_TARGETDIR) $(COMPILER_UNITTARGETDIR) $(EXEFILES)
+ifdef TARGET_RSTS
+override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
+override CLEANRSTFILES+=$(RSTFILES)
+endif
+.PHONY: fpc_all fpc_smart fpc_debug fpc_release fpc_shared
+$(FPCMADE): $(ALLDEPENDENCIES) $(ALLTARGET)
+	@$(ECHOREDIR) Compiled > $(FPCMADE)
+fpc_all: $(FPCMADE)
+fpc_smart:
+	$(MAKE) all LINKSMART=1 CREATESMART=1
+fpc_debug:
+	$(MAKE) all DEBUG=1
+fpc_release:
+	$(MAKE) all RELEASE=1
+.SUFFIXES: $(EXEEXT) $(PPUEXT) $(OEXT) .pas .lpr .dpr .pp .rc .res
+$(COMPILER_UNITTARGETDIR):
+	$(MKDIRTREE) $(COMPILER_UNITTARGETDIR)
+$(COMPILER_TARGETDIR):
+	$(MKDIRTREE) $(COMPILER_TARGETDIR)
+%$(PPUEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(PPUEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pp
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.pas
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.lpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%$(EXEEXT): %.dpr
+	$(COMPILER) $<
+	$(EXECPPAS)
+%.res: %.rc
+	windres -i $< -o $@
+vpath %.pp $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.pas $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.lpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.dpr $(COMPILER_SOURCEDIR) $(COMPILER_INCLUDEDIR)
+vpath %.inc $(COMPILER_INCLUDEDIR)
+vpath %$(OEXT) $(COMPILER_UNITTARGETDIR)
+vpath %$(PPUEXT) $(COMPILER_UNITTARGETDIR)
+.PHONY: fpc_shared
+override INSTALLTARGET+=fpc_shared_install
+ifndef SHARED_LIBVERSION
+SHARED_LIBVERSION=$(FPC_VERSION)
+endif
+ifndef SHARED_LIBNAME
+SHARED_LIBNAME=$(PACKAGE_NAME)
+endif
+ifndef SHARED_FULLNAME
+SHARED_FULLNAME=$(SHAREDLIBPREFIX)$(SHARED_LIBNAME)-$(SHARED_LIBVERSION)$(SHAREDLIBEXT)
+endif
+ifndef SHARED_LIBUNITS
+SHARED_LIBUNITS:=$(TARGET_UNITS) $(TARGET_IMPLICITUNITS)
+override SHARED_LIBUNITS:=$(filter-out $(INSTALL_BUILDUNIT),$(SHARED_LIBUNITS))
+endif
+fpc_shared:
+ifdef HASSHAREDLIB
+	$(MAKE) all CREATESHARED=1 LINKSHARED=1 CREATESMART=1
+ifneq ($(SHARED_BUILD),n)
+	$(PPUMOVE) -q $(SHARED_LIBUNITS) -i$(COMPILER_UNITTARGETDIR) -o$(SHARED_FULLNAME) -d$(COMPILER_UNITTARGETDIR)
+endif
+else
+	@$(ECHO) Shared Libraries not supported
+endif
+fpc_shared_install:
+ifneq ($(SHARED_BUILD),n)
+ifneq ($(SHARED_LIBUNITS),)
+ifneq ($(wildcard $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME)),)
+	$(INSTALL) $(COMPILER_UNITTARGETDIR)/$(SHARED_FULLNAME) $(INSTALL_SHAREDDIR)
+endif
+endif
+endif
+.PHONY: fpc_install fpc_sourceinstall fpc_exampleinstall
+ifdef INSTALL_UNITS
+override INSTALLPPUFILES+=$(addsuffix $(PPUEXT),$(INSTALL_UNITS))
+endif
+ifdef INSTALL_BUILDUNIT
+override INSTALLPPUFILES:=$(filter-out $(INSTALL_BUILDUNIT)$(PPUEXT),$(INSTALLPPUFILES))
+endif
+ifdef INSTALLPPUFILES
+override INSTALLPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(INSTALLPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(INSTALLPPUFILES)))
+ifneq ($(UNITTARGETDIRPREFIX),)
+override INSTALLPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPUFILES)))
+override INSTALLPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(notdir $(INSTALLPPULINKFILES))))
+endif
+override INSTALL_CREATEPACKAGEFPC=1
+endif
+ifdef INSTALLEXEFILES
+ifneq ($(TARGETDIRPREFIX),)
+override INSTALLEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(notdir $(INSTALLEXEFILES)))
+endif
+endif
+fpc_install: all $(INSTALLTARGET)
+ifdef INSTALLEXEFILES
+	$(MKDIR) $(INSTALL_BINDIR)
+ifdef UPXPROG
+	-$(UPXPROG) $(INSTALLEXEFILES)
+endif
+	$(INSTALLEXE) $(INSTALLEXEFILES) $(INSTALL_BINDIR)
+endif
+ifdef INSTALL_CREATEPACKAGEFPC
+ifdef FPCMAKE
+ifdef PACKAGE_VERSION
+ifneq ($(wildcard Makefile.fpc),)
+	$(FPCMAKE) -p -T$(CPU_TARGET)-$(OS_TARGET) Makefile.fpc
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) Package.fpc $(INSTALL_UNITDIR)
+endif
+endif
+endif
+endif
+ifdef INSTALLPPUFILES
+	$(MKDIR) $(INSTALL_UNITDIR)
+	$(INSTALL) $(INSTALLPPUFILES) $(INSTALL_UNITDIR)
+ifneq ($(INSTALLPPULINKFILES),)
+	$(INSTALL) $(INSTALLPPULINKFILES) $(INSTALL_UNITDIR)
+endif
+ifneq ($(wildcard $(LIB_FULLNAME)),)
+	$(MKDIR) $(INSTALL_LIBDIR)
+	$(INSTALL) $(LIB_FULLNAME) $(INSTALL_LIBDIR)
+ifdef inUnix
+	ln -sf $(LIB_FULLNAME) $(INSTALL_LIBDIR)/$(LIB_NAME)
+endif
+endif
+endif
+ifdef INSTALL_FILES
+	$(MKDIR) $(INSTALL_DATADIR)
+	$(INSTALL) $(INSTALL_FILES) $(INSTALL_DATADIR)
+endif
+fpc_sourceinstall: distclean
+	$(MKDIR) $(INSTALL_SOURCEDIR)
+	$(COPYTREE) $(BASEDIR)/* $(INSTALL_SOURCEDIR)
+fpc_exampleinstall: $(addsuffix _distclean,$(TARGET_EXAMPLEDIRS))
+ifdef HASEXAMPLES
+	$(MKDIR) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef EXAMPLESOURCEFILES
+	$(COPY) $(EXAMPLESOURCEFILES) $(INSTALL_EXAMPLEDIR)
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(COPYTREE) $(addsuffix /*,$(TARGET_EXAMPLEDIRS)) $(INSTALL_EXAMPLEDIR)
+endif
+.PHONY: fpc_distinstall
+fpc_distinstall: install exampleinstall
+.PHONY: fpc_zipinstall fpc_zipsourceinstall fpc_zipexampleinstall
+ifndef PACKDIR
+ifndef inUnix
+PACKDIR=$(BASEDIR)/../fpc-pack
+else
+PACKDIR=/tmp/fpc-pack
+endif
+endif
+ifndef ZIPNAME
+ifdef DIST_ZIPNAME
+ZIPNAME=$(DIST_ZIPNAME)
+else
+ZIPNAME=$(PACKAGE_NAME)
+endif
+endif
+ifndef FULLZIPNAME
+FULLZIPNAME=$(ZIPCROSSPREFIX)$(ZIPPREFIX)$(ZIPNAME)$(ZIPSUFFIX)
+endif
+ifndef ZIPTARGET
+ifdef DIST_ZIPTARGET
+ZIPTARGET=DIST_ZIPTARGET
+else
+ZIPTARGET=install
+endif
+endif
+ifndef USEZIP
+ifdef inUnix
+USETAR=1
+endif
+endif
+ifndef inUnix
+USEZIPWRAPPER=1
+endif
+ifdef USEZIPWRAPPER
+ZIPPATHSEP=$(PATHSEP)
+ZIPWRAPPER=$(subst /,$(PATHSEP),$(DIST_DESTDIR)/fpczip$(SRCBATCHEXT))
+else
+ZIPPATHSEP=/
+endif
+ZIPCMD_CDPACK:=cd $(subst /,$(ZIPPATHSEP),$(PACKDIR))
+ZIPCMD_CDBASE:=cd $(subst /,$(ZIPPATHSEP),$(BASEDIR))
+ifdef USETAR
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(TAREXT)
+ZIPCMD_ZIP:=$(TARPROG) cf$(TAROPT) $(ZIPDESTFILE) *
+else
+ZIPDESTFILE:=$(DIST_DESTDIR)/$(FULLZIPNAME)$(ZIPEXT)
+ZIPCMD_ZIP:=$(subst /,$(ZIPPATHSEP),$(ZIPPROG)) -Dr $(ZIPOPT) $(ZIPDESTFILE) *
+endif
+fpc_zipinstall:
+	$(MAKE) $(ZIPTARGET) INSTALL_PREFIX=$(PACKDIR) ZIPINSTALL=1
+	$(MKDIR) $(DIST_DESTDIR)
+	$(DEL) $(ZIPDESTFILE)
+ifdef USEZIPWRAPPER
+ifneq ($(ECHOREDIR),echo)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDPACK))" > $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_ZIP))" >> $(ZIPWRAPPER)
+	$(ECHOREDIR) -e "$(subst \,\\,$(ZIPCMD_CDBASE))" >> $(ZIPWRAPPER)
+else
+	echo $(ZIPCMD_CDPACK) > $(ZIPWRAPPER)
+	echo $(ZIPCMD_ZIP) >> $(ZIPWRAPPER)
+	echo $(ZIPCMD_CDBASE) >> $(ZIPWRAPPER)
+endif
+ifdef inUnix
+	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) (ZIPWRAPPER)
+else
+	$(ZIPWRAPPER)
+endif
+endif
+	$(DEL) $(ZIPWRAPPER)
+else
+	$(ZIPCMD_CDPACK) ; $(ZIPCMD_ZIP) ; $(ZIPCMD_CDBASE)
+endif
+	$(DELTREE) $(PACKDIR)
+fpc_zipsourceinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=sourceinstall ZIPSUFFIX=$(ZIPSOURCESUFFIX)
+fpc_zipexampleinstall:
+ifdef HASEXAMPLES
+	$(MAKE) fpc_zipinstall ZIPTARGET=exampleinstall ZIPSUFFIX=$(ZIPEXAMPLESUFFIX)
+endif
+fpc_zipdistinstall:
+	$(MAKE) fpc_zipinstall ZIPTARGET=distinstall
+.PHONY: fpc_clean fpc_cleanall fpc_distclean
+ifdef EXEFILES
+override CLEANEXEFILES:=$(addprefix $(TARGETDIRPREFIX),$(CLEANEXEFILES))
+endif
+ifdef CLEAN_UNITS
+override CLEANPPUFILES+=$(addsuffix $(PPUEXT),$(CLEAN_UNITS))
+endif
+ifdef CLEANPPUFILES
+override CLEANPPULINKFILES:=$(subst $(PPUEXT),$(OEXT),$(CLEANPPUFILES)) $(addprefix $(STATICLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES))) $(addprefix $(IMPORTLIBPREFIX),$(subst $(PPUEXT),$(STATICLIBEXT),$(CLEANPPUFILES)))
+ifdef DEBUGSYMEXT
+override CLEANPPULINKFILES+=$(subst $(PPUEXT),$(DEBUGSYMEXT),$(CLEANPPUFILES))
+endif
+override CLEANPPUFILES:=$(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPUFILES))
+override CLEANPPULINKFILES:=$(wildcard $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANPPULINKFILES)))
+endif
+fpc_clean: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+ifdef CLEAN_FILES
+	-$(DEL) $(CLEAN_FILES)
+endif
+ifdef LIB_NAME
+	-$(DEL) $(LIB_NAME) $(LIB_FULLNAME)
+endif
+	-$(DEL) $(FPCMADE) Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *$(ASMEXT) *_ppas$(BATCHEXT)
+fpc_cleanall: $(CLEANTARGET)
+ifdef CLEANEXEFILES
+	-$(DEL) $(CLEANEXEFILES)
+endif
+ifdef COMPILER_UNITTARGETDIR
+ifdef CLEANPPUFILES
+	-$(DEL) $(CLEANPPUFILES)
+endif
+ifneq ($(CLEANPPULINKFILES),)
+	-$(DEL) $(CLEANPPULINKFILES)
+endif
+ifdef CLEANRSTFILES
+	-$(DEL) $(addprefix $(UNITTARGETDIRPREFIX),$(CLEANRSTFILES))
+endif
+endif
+	-$(DELTREE) units
+	-$(DEL) *$(OEXT) *$(PPUEXT) *$(RSTEXT) *$(ASMEXT) *$(STATICLIBEXT) *$(SHAREDLIBEXT) *$(PPLEXT)
+ifneq ($(PPUEXT),.ppu)
+	-$(DEL) *.o *.ppu *.a
+endif
+	-$(DELTREE) *$(SMARTEXT)
+	-$(DEL) fpcmade.* Package.fpc $(PPAS) script.res link.res $(FPCEXTFILE) $(REDIRFILE)
+	-$(DEL) *_ppas$(BATCHEXT)
+ifdef AOUTEXT
+	-$(DEL) *$(AOUTEXT)
+endif
+ifdef DEBUGSYMEXT
+	-$(DEL) *$(DEBUGSYMEXT)
+endif
+fpc_distclean: cleanall
+.PHONY: fpc_baseinfo
+override INFORULES+=fpc_baseinfo
+fpc_baseinfo:
+	@$(ECHO)
+	@$(ECHO)  == Package info ==
+	@$(ECHO)  Package Name..... $(PACKAGE_NAME)
+	@$(ECHO)  Package Version.. $(PACKAGE_VERSION)
+	@$(ECHO)
+	@$(ECHO)  == Configuration info ==
+	@$(ECHO)
+	@$(ECHO)  FPC.......... $(FPC)
+	@$(ECHO)  FPC Version.. $(FPC_VERSION)
+	@$(ECHO)  Source CPU... $(CPU_SOURCE)
+	@$(ECHO)  Target CPU... $(CPU_TARGET)
+	@$(ECHO)  Source OS.... $(OS_SOURCE)
+	@$(ECHO)  Target OS.... $(OS_TARGET)
+	@$(ECHO)  Full Source.. $(FULL_SOURCE)
+	@$(ECHO)  Full Target.. $(FULL_TARGET)
+	@$(ECHO)  SourceSuffix. $(SOURCESUFFIX)
+	@$(ECHO)  TargetSuffix. $(TARGETSUFFIX)
+	@$(ECHO)
+	@$(ECHO)  == Directory info ==
+	@$(ECHO)
+	@$(ECHO)  Required pkgs... $(REQUIRE_PACKAGES)
+	@$(ECHO)
+	@$(ECHO)  Basedir......... $(BASEDIR)
+	@$(ECHO)  FPCDir.......... $(FPCDIR)
+	@$(ECHO)  CrossBinDir..... $(CROSSBINDIR)
+	@$(ECHO)  UnitsDir........ $(UNITSDIR)
+	@$(ECHO)  PackagesDir..... $(PACKAGESDIR)
+	@$(ECHO)
+	@$(ECHO)  GCC library..... $(GCCLIBDIR)
+	@$(ECHO)  Other library... $(OTHERLIBDIR)
+	@$(ECHO)
+	@$(ECHO)  == Tools info ==
+	@$(ECHO)
+	@$(ECHO)  As........ $(AS)
+	@$(ECHO)  Ld........ $(LD)
+	@$(ECHO)  Ar........ $(AR)
+	@$(ECHO)  Rc........ $(RC)
+	@$(ECHO)
+	@$(ECHO)  Mv........ $(MVPROG)
+	@$(ECHO)  Cp........ $(CPPROG)
+	@$(ECHO)  Rm........ $(RMPROG)
+	@$(ECHO)  GInstall.. $(GINSTALL)
+	@$(ECHO)  Echo...... $(ECHO)
+	@$(ECHO)  Shell..... $(SHELL)
+	@$(ECHO)  Date...... $(DATE)
+	@$(ECHO)  FPCMake... $(FPCMAKE)
+	@$(ECHO)  PPUMove... $(PPUMOVE)
+	@$(ECHO)  Upx....... $(UPXPROG)
+	@$(ECHO)  Zip....... $(ZIPPROG)
+	@$(ECHO)
+	@$(ECHO)  == Object info ==
+	@$(ECHO)
+	@$(ECHO)  Target Loaders........ $(TARGET_LOADERS)
+	@$(ECHO)  Target Units.......... $(TARGET_UNITS)
+	@$(ECHO)  Target Implicit Units. $(TARGET_IMPLICITUNITS)
+	@$(ECHO)  Target Programs....... $(TARGET_PROGRAMS)
+	@$(ECHO)  Target Dirs........... $(TARGET_DIRS)
+	@$(ECHO)  Target Examples....... $(TARGET_EXAMPLES)
+	@$(ECHO)  Target ExampleDirs.... $(TARGET_EXAMPLEDIRS)
+	@$(ECHO)
+	@$(ECHO)  Clean Units......... $(CLEAN_UNITS)
+	@$(ECHO)  Clean Files......... $(CLEAN_FILES)
+	@$(ECHO)
+	@$(ECHO)  Install Units....... $(INSTALL_UNITS)
+	@$(ECHO)  Install Files....... $(INSTALL_FILES)
+	@$(ECHO)
+	@$(ECHO)  == Install info ==
+	@$(ECHO)
+	@$(ECHO)  DateStr.............. $(DATESTR)
+	@$(ECHO)  ZipName.............. $(ZIPNAME)
+	@$(ECHO)  ZipPrefix............ $(ZIPPREFIX)
+	@$(ECHO)  ZipCrossPrefix....... $(ZIPCROSSPREFIX)
+	@$(ECHO)  ZipSuffix............ $(ZIPSUFFIX)
+	@$(ECHO)  FullZipName.......... $(FULLZIPNAME)
+	@$(ECHO)  Install FPC Package.. $(INSTALL_FPCPACKAGE)
+	@$(ECHO)
+	@$(ECHO)  Install base dir..... $(INSTALL_BASEDIR)
+	@$(ECHO)  Install binary dir... $(INSTALL_BINDIR)
+	@$(ECHO)  Install library dir.. $(INSTALL_LIBDIR)
+	@$(ECHO)  Install units dir.... $(INSTALL_UNITDIR)
+	@$(ECHO)  Install source dir... $(INSTALL_SOURCEDIR)
+	@$(ECHO)  Install doc dir...... $(INSTALL_DOCDIR)
+	@$(ECHO)  Install example dir.. $(INSTALL_EXAMPLEDIR)
+	@$(ECHO)  Install data dir..... $(INSTALL_DATADIR)
+	@$(ECHO)
+	@$(ECHO)  Dist destination dir. $(DIST_DESTDIR)
+	@$(ECHO)  Dist zip name........ $(DIST_ZIPNAME)
+	@$(ECHO)
+.PHONY: fpc_info
+fpc_info: $(INFORULES)
+.PHONY: fpc_makefile fpc_makefiles fpc_makefile_sub1 fpc_makefile_sub2 \
+	fpc_makefile_dirs
+fpc_makefile:
+	$(FPCMAKE) -w -T$(OS_TARGET) Makefile.fpc
+fpc_makefile_sub1:
+ifdef TARGET_DIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_DIRS))
+endif
+ifdef TARGET_EXAMPLEDIRS
+	$(FPCMAKE) -w -T$(OS_TARGET) $(addsuffix /Makefile.fpc,$(TARGET_EXAMPLEDIRS))
+endif
+fpc_makefile_sub2: $(addsuffix _makefile_dirs,$(TARGET_DIRS) $(TARGET_EXAMPLEDIRS))
+fpc_makefile_dirs: fpc_makefile_sub1 fpc_makefile_sub2
+fpc_makefiles: fpc_makefile fpc_makefile_dirs
+debug: fpc_debug
+smart: fpc_smart
+release: fpc_release
+units: fpc_units
+examples:
+shared: fpc_shared
+install: fpc_install
+sourceinstall: fpc_sourceinstall
+exampleinstall: fpc_exampleinstall
+distinstall: fpc_distinstall
+zipinstall: fpc_zipinstall
+zipsourceinstall: fpc_zipsourceinstall
+zipexampleinstall: fpc_zipexampleinstall
+zipdistinstall: fpc_zipdistinstall
+clean: fpc_clean
+distclean: fpc_distclean
+cleanall: fpc_cleanall
+info: fpc_info
+makefiles: fpc_makefiles
+.PHONY: debug smart release units examples shared install sourceinstall exampleinstall distinstall zipinstall zipsourceinstall zipexampleinstall zipdistinstall clean distclean cleanall info makefiles
+ifneq ($(wildcard fpcmake.loc),)
+include fpcmake.loc
+endif
+.PHONY: all
+all: 
+	$(MAKE) --assume-new=invgenex.pas invgenex$(EXEEXT)
+	$(MAKE) --assume-new=invgpdex.pas invgpdex$(EXEEXT)
+	$(MAKE) --assume-new=invgsyex.pas invgsyex$(EXEEXT)
+	$(MAKE) --assume-new=iomremex.pas iomremex$(EXEEXT)
+	$(MAKE) --assume-new=iomrevex.pas iomrevex$(EXEEXT)
+	$(MAKE) --assume-new=iomrewrsex.pas iomrewrsex$(EXEEXT)
+	$(MAKE) --assume-new=iomwrmex.pas iomwrmex$(EXEEXT)
+	$(MAKE) --assume-new=iomwrvex.pas iomwrvex$(EXEEXT)

+ 40 - 0
packages/extra/numlib/examples/Makefile.fpc

@@ -0,0 +1,40 @@
+#
+#   Makefile.fpc for numlib
+#
+
+[package]
+name=iom
+version=0
+ 
+[target]
+programs=invgenex invgpdex invgsyex iomremex iomrevex iomrewrsex iomwrmex iomwrvex
+
+[compiler]
+options= -gl
+unittargetdir=../units/$(CPU_TARGET)-$(OS_TARGET)
+unitdir=..
+targetdir=.
+ 
+[clean]
+files=$(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(OEXT)) \
+      $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(PPUEXT)) \
+      $(wildcard ../units/$(CPU_TARGET)-$(OS_TARGET)/*$(RSTEXT))
+
+[default]
+fpcdir=../../../..
+
+
+[rules]
+.PHONY: all
+
+all: 
+	$(MAKE) --assume-new=invgenex.pas invgenex$(EXEEXT)
+	$(MAKE) --assume-new=invgpdex.pas invgpdex$(EXEEXT)
+	$(MAKE) --assume-new=invgsyex.pas invgsyex$(EXEEXT)
+	$(MAKE) --assume-new=iomremex.pas iomremex$(EXEEXT)
+	$(MAKE) --assume-new=iomrevex.pas iomrevex$(EXEEXT)
+	$(MAKE) --assume-new=iomrewrsex.pas iomrewrsex$(EXEEXT)
+	$(MAKE) --assume-new=iomwrmex.pas iomwrmex$(EXEEXT)
+	$(MAKE) --assume-new=iomwrvex.pas iomwrvex$(EXEEXT)
+#-----------------------------------------------------------------------------
+# end.

+ 4 - 4
packages/extra/numlib/examples/invgenex.dat

@@ -1,4 +1,4 @@
- 4  2  4  1
-30 20 45 12
-20 15 36 10
-35 28 70 20
+ 4  2  4  1
+30 20 45 12
+20 15 36 10
+35 28 70 20

+ 29 - 16
packages/extra/numlib/examples/invgenex.pas

@@ -1,25 +1,38 @@
 program invgenex;
 program invgenex;
-uses typ, iom, inv;
-const n = 4;
-var  term : arbint;
-        A : array[1..n,1..n] of arbfloat;
+
+uses
+  typ, iom, inv;
+
+const
+  n = 4;
+  
+var
+  term: arbint;
+  A:    array[1..n, 1..n] of arbfloat;
+  
 begin
 begin
-  assign(input, paramstr(1)); reset(input);
-  assign(output, paramstr(2)); rewrite(output);
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
   writeln('program results invgenex');
   writeln('program results invgenex');
   { Read matrix A}
   { Read matrix A}
-  iomrem(input, A[1,1], n, n, n);
+  iomrem(input, A[1, 1], n, n, n);
   { Print matrix A }
   { Print matrix A }
-  writeln; writeln('A =');
-  iomwrm(output, A[1,1], n, n, n, numdig);
+  writeln;
+  writeln('A =');
+  iomwrm(output, A[1, 1], n, n, n, numdig);
   { Calculate inverse of A}
   { Calculate inverse of A}
-  invgen(n, n, A[1,1], term);
-  writeln; writeln('term=', term:2);
-  if term=1 then
-  { Print inverse of matrix A}
+  invgen(n, n, A[1, 1], term);
+  writeln;
+  writeln('term=', term: 2);
+  if term = 1 then
+    { Print inverse of matrix A}
   begin
   begin
-      writeln; writeln('inverse of A =');
-      iomwrm(output, A[1,1], n, n, n, numdig);
+    writeln;
+    writeln('inverse of A =');
+    iomwrm(output, A[1, 1], n, n, n, numdig);
   end; {term=1}
   end; {term=1}
-  close(input); close(output)
+  Close(input);
+  Close(output);
 end.
 end.

+ 4 - 4
packages/extra/numlib/examples/invgpdex.dat

@@ -1,4 +1,4 @@
-5
-7 10
-6 8 10
-5 7 9 10
+5
+7 10
+6 8 10
+5 7 9 10

+ 33 - 20
packages/extra/numlib/examples/invgpdex.pas

@@ -1,29 +1,42 @@
-{
-}
-
 program invgpdex;
 program invgpdex;
-uses typ, iom, inv;
-const n = 4;
-var i, j,  term : ArbInt;
-              A : array[1..n,1..n] of ArbFloat;
+
+uses
+  typ, iom, inv;
+
+const
+  n = 4;
+  
+var
+  i, j, term: ArbInt;
+  A: array[1..n, 1..n] of ArbFloat;
+  
 begin
 begin
-  assign(input, paramstr(1)); reset(input);
-  assign(output, paramstr(2)); rewrite(output);
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
   writeln('program results invgpdex');
   writeln('program results invgpdex');
   { read bottomleft part of matrix A}
   { read bottomleft part of matrix A}
-  for i:=1 to n do iomrev(input, A[i,1], i);
+  for i := 1 to n do
+    iomrev(input, A[i, 1], i);
   { Print matrix A}
   { Print matrix A}
-  writeln; writeln('A =');
-  for i:=1 to n do for j:=1 to i-1 do A[j,i]:=A[i,j];
-  iomwrm(output, A[1,1], n, n, n, numdig);
+  writeln;
+  writeln('A =');
+  for i := 1 to n do
+    for j := 1 to i - 1 do
+      A[j, i] := A[i, j];
+  iomwrm(output, A[1, 1], n, n, n, numdig);
   { Calculate inverse of matrix A}
   { Calculate inverse of matrix A}
-  invgpd(n, n, A[1,1], term);
-  writeln; writeln('term=', term:2);
-  if term=1 then
-  { Print inverse of matrix A}
+  invgpd(n, n, A[1, 1], term);
+  writeln;
+  writeln('term=', term: 2);
+  if term = 1 then
+    { Print inverse of matrix A}
   begin
   begin
-      writeln; writeln('inverse of A =');
-      iomwrm(output, A[1,1], n, n, n, numdig);
+    writeln;
+    writeln('inverse of A =');
+    iomwrm(output, A[1, 1], n, n, n, numdig);
   end; {term=1}
   end; {term=1}
-  close(input); close(output)
+  Close(input);
+  Close(output);
 end.
 end.

+ 4 - 4
packages/extra/numlib/examples/invgsyex.dat

@@ -1,4 +1,4 @@
-5
-7 10
-6 8 10
-5 7 9 10
+5
+7 10
+6 8 10
+5 7 9 10

+ 33 - 20
packages/extra/numlib/examples/invgsyex.pas

@@ -1,29 +1,42 @@
-{
-}
-
 program invgsyex;
 program invgsyex;
-uses typ, iom, inv;
-const n = 4;
-var i, j,  term : ArbInt;
-              A : array[1..n,1..n] of ArbFloat;
+
+uses
+  typ, iom, inv;
+
+const
+  n = 4;
+  
+var
+  i, j, term: ArbInt;
+  A: array[1..n, 1..n] of ArbFloat;
+  
 begin
 begin
-  assign(input, paramstr(1)); reset(input);
-  assign(output, paramstr(2)); rewrite(output);
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
   writeln('program results invgsyex');
   writeln('program results invgsyex');
   { Read bottomleft part of matrix A }
   { Read bottomleft part of matrix A }
-  for i:=1 to n do iomrev(input, A[i,1], i);
+  for i := 1 to n do
+    iomrev(input, A[i, 1], i);
   { print matrix A }
   { print matrix A }
-  writeln; writeln('A =');
-  for i:=1 to n do for j:=1 to i-1 do A[j,i]:=A[i,j];
-  iomwrm(output, A[1,1], n, n, n, numdig);
+  writeln;
+  writeln('A =');
+  for i := 1 to n do
+    for j := 1 to i - 1 do
+      A[j, i] := A[i, j];
+  iomwrm(output, A[1, 1], n, n, n, numdig);
   { calculate inverse of matrix A}
   { calculate inverse of matrix A}
-  invgsy(n, n, A[1,1], term);
-  writeln; writeln('term=', term:2);
-  if term=1 then
-  { print inverse of matrix A }
+  invgsy(n, n, A[1, 1], term);
+  writeln;
+  writeln('term=', term: 2);
+  if term = 1 then
+    { print inverse of matrix A }
   begin
   begin
-      writeln; writeln('inverse of A =');
-      iomwrm(output, A[1,1], n, n, n, numdig);
+    writeln;
+    writeln('inverse of A =');
+    iomwrm(output, A[1, 1], n, n, n, numdig);
   end; {term=1}
   end; {term=1}
-  close(input); close(output)
+  Close(input);
+  Close(output);
 end.
 end.

+ 3 - 0
packages/extra/numlib/examples/iomremex.dat

@@ -0,0 +1,3 @@
+1 2
+3 4
+5 6

+ 28 - 0
packages/extra/numlib/examples/iomremex.pas

@@ -0,0 +1,28 @@
+program iomremex;
+
+uses
+  typ, iom;
+
+const
+  m = 3;
+  n = 2;
+  
+var
+  a: array[1..m, 1..n] of ArbFloat;
+  
+begin
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
+  {inlezen van de matrix}
+  iomrem(input, a[1, 1], m, n, n);
+  writeln('program results iomremex');
+  writeln;
+  writeln('A=');
+  writeln;
+  {afdrukken van de matrix}
+  iomwrm(output, a[1, 1], m, n, n, 12);
+  Close(input);
+  Close(output);
+end.

+ 1 - 0
packages/extra/numlib/examples/iomrevex.dat

@@ -0,0 +1 @@
+ 1  2  3  4  5

+ 27 - 0
packages/extra/numlib/examples/iomrevex.pas

@@ -0,0 +1,27 @@
+program iomrevex;
+
+uses
+  typ, iom;
+
+const
+  n = 5;
+  
+var
+  v: array[1..n] of ArbFloat;
+  
+begin
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
+  {inlezen van de vector v}
+  iomrev(input, v[1], n);
+  writeln('program results iomrevex');
+  writeln;
+  {afdrukken van de vector}
+  writeln('v =');
+  writeln;
+  iomwrv(output, v[1], n, 12);
+  Close(input);
+  Close(output);
+end.

+ 10 - 12
packages/extra/numlib/examples/iomrewrsex.pas

@@ -1,25 +1,23 @@
 program iomrewrsex;
 program iomrewrsex;
 
 
-{$mode objfpc}{$H+}
-
 uses
 uses
   typ, iom, inv;
   typ, iom, inv;
 
 
 var
 var
-  A : array[1..10,1..10] of arbfloat;
-  i : longint;
-  j : longint;
-  s : ArbString;
+  A:    array[1..10, 1..10] of arbfloat;
+  i:    longint;
+  j:    longint;
+  s:    ArbString;
   n, m: longint;
   n, m: longint;
+  
 begin
 begin
-  iomrems('{1 2}{3 4}{5 6}', A[1,1], m, n, 10);
+  iomrems('{1 2}{3 4}{5 6}', A[1, 1], m, n, 10);
 
 
-  for i:= 1 to m do
-    for j:= 1 to n do
-      writeln('A[',i,',',j,'] = ',A[i,j]);
+  for i := 1 to m do
+    for j := 1 to n do
+      writeln('A[', i, ',', j, '] = ', A[i, j]);
 
 
   { Print matrix A }
   { Print matrix A }
-  iomwrms(s, A[1,1], m, n, 2, 10);
+  iomwrms(s, A[1, 1], m, n, 2, 10);
   writeln('A = ', s);
   writeln('A = ', s);
 end.
 end.
-

+ 13 - 0
packages/extra/numlib/examples/iomwrmex.dat

@@ -0,0 +1,13 @@
+program results iomwrm
+
+-2.30000E+0000  -2.40000E+0000  -2.50000E+0000  -2.60000E+0000
+-3.30000E+0000  -3.40000E+0000  -3.50000E+0000  -3.60000E+0000
+-4.30000E+0000  -4.40000E+0000  -4.50000E+0000  -4.60000E+0000
+
+-2.70000E+0000  -2.80000E+0000
+-3.70000E+0000  -3.80000E+0000
+-4.70000E+0000  -4.80000E+0000
+
+-2.3E+0000  -2.4E+0000  -2.5E+0000  -2.6E+0000  -2.7E+0000  -2.8E+0000
+-3.3E+0000  -3.4E+0000  -3.5E+0000  -3.6E+0000  -3.7E+0000  -3.8E+0000
+-4.3E+0000  -4.4E+0000  -4.5E+0000  -4.6E+0000  -4.7E+0000  -4.8E+0000

+ 28 - 0
packages/extra/numlib/examples/iomwrmex.pas

@@ -0,0 +1,28 @@
+program iomwrmex;
+
+uses
+  typ, iom;
+
+const
+  m = 5;
+  n = 13;
+  
+var
+  i, j: integer;
+  a:    array[1..m, 1..n] of ArbFloat;
+  
+begin
+  Assign(output, ParamStr(1));
+  rewrite(output);
+  { genereren van de matrix A }
+  for i := 1 to m do
+    for j := 1 to n do
+      a[i, j] := -(i + j / 10);
+  writeln('program results iomwrm');
+  writeln;
+  { afdrukken van de deelmatrix }
+  iomwrm(output, a[2, 3], 3, 6, n, 14);
+  writeln;
+  iomwrm(output, a[2, 3], 3, 6, n, 10);
+  Close(output);
+end.

+ 27 - 0
packages/extra/numlib/examples/iomwrvex.pas

@@ -0,0 +1,27 @@
+program iomwrvex;
+
+uses
+  typ, iom;
+
+const
+  n = 5;
+  
+var
+  i: integer;
+  v: array[1..n] of ArbFloat;
+  
+begin
+  Assign(output, ParamStr(1));
+  rewrite(output);
+  writeln('program results iomwrv');
+  writeln;
+  {genereren van de vector v}
+  randomize;
+  for i := 1 to n do
+    v[i] := 2 * random - 1;
+  iomwrv(output, v[1], n, 15);
+  {afdrukken van de vector}
+  writeln;
+  iomwrv(output, v[1], n, 12);
+  Close(output);
+end.

+ 2 - 2
packages/extra/numlib/int.pas

@@ -671,7 +671,7 @@ Var  absc, absc1, absc2, centr,
 
 
      fv1, fv2: array[1..7] Of ArbFloat;
      fv1, fv2: array[1..7] Of ArbFloat;
 
 
-     j, min0: ArbInt;
+     j: ArbInt;
 Begin
 Begin
       If inf<1 Then dinf := inf
       If inf<1 Then dinf := inf
  Else dinf := 1;
  Else dinf := 1;
@@ -1022,7 +1022,7 @@ End;
 Procedure int1fr(f: rfunc1r; a, b, ae: ArbFloat; Var integral, err: ArbFloat;
 Procedure int1fr(f: rfunc1r; a, b, ae: ArbFloat; Var integral, err: ArbFloat;
                  Var term: ArbInt);
                  Var term: ArbInt);
 
 
-Var neval, ier, last, inf: ArbInt;
+Var neval, ier, last: ArbInt;
 Begin
 Begin
      term := 3;
      term := 3;
  integral := NaN;
  integral := NaN;

+ 5 - 5
packages/extra/numlib/inv.pas

@@ -42,7 +42,7 @@ procedure invgen(n, rwidth: ArbInt; var ai: ArbFloat; var term: ArbInt);
 var
 var
      success                          : boolean;
      success                          : boolean;
      inn, ii, i, j, k, kk, indexpivot : ArbInt;
      inn, ii, i, j, k, kk, indexpivot : ArbInt;
-     ca, h, pivot, l, s               : ArbFloat;
+     ca, h, pivot, s                  : ArbFloat;
      pa, save                         : ^arfloat1;
      pa, save                         : ^arfloat1;
      p                                : ^arint1;
      p                                : ^arint1;
 
 
@@ -220,10 +220,10 @@ begin
 end; {invgsy}
 end; {invgsy}
 
 
 procedure invgpd(n, rwidth: ArbInt; var ai: ArbFloat; var term: ArbInt);
 procedure invgpd(n, rwidth: ArbInt; var ai: ArbFloat; var term: ArbInt);
-var success             : boolean;
-    i, j, k, kmin1, ind : ArbInt;
-    tk, h, ca           : ArbFloat;
-    pa, t               : ^arfloat1;
+var success      : boolean;
+    i, j, k, ind : ArbInt;
+    tk, h, ca    : ArbFloat;
+    pa, t        : ^arfloat1;
 begin
 begin
   if (n<1) or (rwidth<1) then
   if (n<1) or (rwidth<1) then
   begin
   begin

+ 1 - 1
packages/extra/numlib/iom.pas

@@ -113,7 +113,7 @@ END {iomwrm};
 procedure iomrems(inp: ArbString; var a: ArbFloat; var m, n: ArbInt; c: ArbInt);
 procedure iomrems(inp: ArbString; var a: ArbFloat; var m, n: ArbInt; c: ArbInt);
 var
 var
   pa: ^arfloat1;
   pa: ^arfloat1;
-  i, j, k: ArbInt;
+  i, k: ArbInt;
   err: ArbInt;
   err: ArbInt;
   s: ArbString;
   s: ArbString;
   ni: ArbInt;
   ni: ArbInt;

+ 12 - 12
packages/extra/numlib/mdt.pas

@@ -173,7 +173,7 @@ Procedure mdtgtr(n: ArbInt; Var l, d, u, l1, d1, u1, u2: ArbFloat;
                  Var p: boolean; Var ca: ArbFloat; Var term: ArbInt);
                  Var p: boolean; Var ca: ArbFloat; Var term: ArbInt);
 
 
 Var
 Var
-                         i, j, k, nmin1, sr : ArbInt;
+                            i, j, nmin1, sr : ArbInt;
    normr, normt, sumrowi, h, lj, di, ui, ll : ArbFloat;
    normr, normt, sumrowi, h, lj, di, ui, ll : ArbFloat;
                                        sing : boolean;
                                        sing : boolean;
            pd, pu, pd1, pu1, pu2, t, sumrow : ^arfloat1;
            pd, pu, pd1, pu1, pu2, t, sumrow : ^arfloat1;
@@ -314,12 +314,12 @@ Procedure mdtgsy(n, rwidth: ArbInt; Var a: ArbFloat; Var pp:ArbInt;
                  Var qq:boolean; Var ca:ArbFloat; Var term:ArbInt);
                  Var qq:boolean; Var ca:ArbFloat; Var term:ArbInt);
 
 
 Var
 Var
-   i, j, kmin1, k, kplus1, kmin2, imin2, nsr, nsi, nsb, ii,
-   imin1, jmin1, indexpivot, iplus1, indi, indj, indk, indp       : ArbInt;
-   ra, h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr, s : ArbFloat;
-                               alt, l, d, t, u, v, l1, d1, u1, t1 : ^arfloat1;
-                                                                p : ^arint1;
-                                                                q : ^arbool1;
+   i, j, kmin1, k, kplus1, kmin2, imin2, nsr, nsi, nsb,
+   imin1, jmin1, indexpivot, iplus1, indi, indj, indk, indp : ArbInt;
+    h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr : ArbFloat;
+                         alt, l, d, t, u, v, l1, d1, u1, t1 : ^arfloat1;
+                                                          p : ^arint1;
+                                                          q : ^arbool1;
 Begin
 Begin
   If (n<1) Or (rwidth<1) Then
   If (n<1) Or (rwidth<1) Then
     Begin
     Begin
@@ -615,11 +615,11 @@ Procedure mdtgba(n, lb, rb, rwa: ArbInt; Var a: ArbFloat; rwl: ArbInt;
                  Var l:ArbFloat; Var p: ArbInt; Var ca: ArbFloat; Var term:ArbInt);
                  Var l:ArbFloat; Var p: ArbInt; Var ca: ArbFloat; Var term:ArbInt);
 
 
 Var
 Var
-  sr, i, j, k, ipivot, m, lbj, lbi, ubi, ls,
-             ii, jj, ll, s, js, jl, ubj       : ArbInt;
-  ra, normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
-          pl, au, sumrow, t, row              : ^arfloat1;
-                                           pp : ^arint1;
+  sr, i, j, k, ipivot, lbj, lbi, ubi, ls,
+                ii, jj, ll, jl, ubj       : ArbInt;
+  normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
+      pl, au, sumrow, t, row              : ^arfloat1;
+                                       pp : ^arint1;
 
 
 Begin
 Begin
   If (n<1) Or (lb<0) Or (rb<0) Or (lb>n-1) Or (rb>n-1) Or (rwl<0) Or (rwa<1) Then
   If (n<1) Or (lb<0) Or (rb<0) Or (lb>n-1) Or (rb>n-1) Or (rwl<0) Or (rwa<1) Then

+ 1 - 1
packages/extra/numlib/omv.pas

@@ -110,7 +110,7 @@ End; {omvmmm}
 Procedure omvmmv(Var a: ArbFloat; m, n, rwidth: ArbInt; Var b, c: ArbFloat);
 Procedure omvmmv(Var a: ArbFloat; m, n, rwidth: ArbInt; Var b, c: ArbFloat);
 
 
 Var     pa, pb, pc : ^arfloat1;
 Var     pa, pb, pc : ^arfloat1;
-         i, j, ind : ArbInt;
+            i, ind : ArbInt;
 Begin
 Begin
   If (m<1) Or (n<1) Then
   If (m<1) Or (n<1) Then
     exit;
     exit;

+ 3 - 3
packages/extra/numlib/roo.pas

@@ -502,7 +502,7 @@ Var
     ap   : arfloat1 absolute ap1;
     ap   : arfloat1 absolute ap1;
     x    : arfloat1 absolute x1;
     x    : arfloat1 absolute x1;
     temp : ArbFloat;
     temp : ArbFloat;
-    i, info, ix, j, jx, k, kk, kx: ArbInt;
+    info, ix, j, jx, k, kk, kx: ArbInt;
     nounit: boolean;
     nounit: boolean;
 Begin
 Begin
     info := 0;
     info := 0;
@@ -608,7 +608,7 @@ Procedure roo002(uplo, trans, diag: char; n: ArbInt;
 Var ap : arfloat1 absolute ap1;
 Var ap : arfloat1 absolute ap1;
     x  : arfloat1 absolute x1;
     x  : arfloat1 absolute x1;
     temp : ArbFloat;
     temp : ArbFloat;
-    i, info, ix, j, jx, k, kk, kx: ArbInt;
+    info, ix, j, jx, k, kk, kx: ArbInt;
     nounit: boolean;
     nounit: boolean;
 Begin
 Begin
     info := 0;
     info := 0;
@@ -1135,7 +1135,7 @@ Const   one = 1.0;
  zero = 0.0;
  zero = 0.0;
 
 
 Var    cosine, cotan, sine, tangnt, tau: ArbFloat;
 Var    cosine, cotan, sine, tangnt, tau: ArbFloat;
-                  i, j, jj, l, nm1, nmj: ArbInt;
+                  i, j, jj, nm1, nmj: ArbInt;
     s : arfloat1 absolute s1;
     s : arfloat1 absolute s1;
     u : arfloat1 absolute u1;
     u : arfloat1 absolute u1;
     v : arfloat1 absolute v1;
     v : arfloat1 absolute v1;

+ 12 - 13
packages/extra/numlib/sle.pas

@@ -408,9 +408,9 @@ Procedure slegba(n, l, r: ArbInt;
                  Var a, b, x, ca: ArbFloat; Var term:ArbInt);
                  Var a, b, x, ca: ArbFloat; Var term:ArbInt);
 
 
 Var
 Var
-  sr, i, j, k, ipivot, m, lbj, lbi, ubi, ls,
-         ii, jj, ll, s, js, ubj, rwidth       : ArbInt;
-  ra, normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
+  sr, i, j, k, ipivot, lbj, lbi, ubi, ls,
+         ii, jj, ll, ubj, rwidth       : ArbInt;
+  normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
   pa, pb, px, au, sumrow, t, row              : ^arfloat1;
   pa, pb, px, au, sumrow, t, row              : ^arfloat1;
 Begin
 Begin
   If (n<1) Or (l<0) Or (r<0) Or (l>n-1) Or (r>n-1)
   If (n<1) Or (l<0) Or (r<0) Or (l>n-1) Or (r>n-1)
@@ -562,9 +562,9 @@ Procedure slegbal(n, l, r: ArbInt;
                   Var a1; Var b1, x1, ca: ArbFloat; Var term:ArbInt);
                   Var a1; Var b1, x1, ca: ArbFloat; Var term:ArbInt);
 
 
 Var
 Var
-  sr, i, j, k, ipivot, m, lbj, lbi, ubi, ls,
-                 ll, s, js, ubj, rwidth       : ArbInt;
-  ra, normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
+  sr, i, j, k, ipivot, ubi, ls,
+                 ll, ubj, rwidth       : ArbInt;
+  normr, sumrowi, pivot, normt, maxim, h  : ArbFloat;
   a                                           : ar2dr1 absolute a1;
   a                                           : ar2dr1 absolute a1;
   b                                           : arfloat1 absolute b1;
   b                                           : arfloat1 absolute b1;
   x                                           : arfloat1 absolute x1;
   x                                           : arfloat1 absolute x1;
@@ -955,7 +955,7 @@ Procedure slegls(Var a: ArbFloat; m, n, rwidtha: ArbInt; Var b, x: ArbFloat;
                  Var term: ArbInt);
                  Var term: ArbInt);
 
 
 Var     i, j, ns, ms, ii                : ArbInt;
 Var     i, j, ns, ms, ii                : ArbInt;
-        normy0, norme0, norme1, s       : ArbFloat;
+        normy0, norme1, s       : ArbFloat;
         pa, pb, px, qr, alpha, e, y, r  : ^arfloat1;
         pa, pb, px, qr, alpha, e, y, r  : ^arfloat1;
         pivot                           : ^arint1;
         pivot                           : ^arint1;
 Begin
 Begin
@@ -1034,7 +1034,7 @@ Procedure sleglsl(Var a1; m, n: ArbInt; Var b1, x1: ArbFloat;
                   Var term: ArbInt);
                   Var term: ArbInt);
 
 
 Var     i, j, ns, ms                    : ArbInt;
 Var     i, j, ns, ms                    : ArbInt;
-        normy0, norme0, norme1, s       : ArbFloat;
+        normy0, norme1, s       : ArbFloat;
         a                               : ar2dr1 absolute a1;
         a                               : ar2dr1 absolute a1;
         b                               : arfloat1 absolute b1;
         b                               : arfloat1 absolute b1;
         x                               : arfloat1 absolute x1;
         x                               : arfloat1 absolute x1;
@@ -1625,9 +1625,9 @@ Procedure slegsy(n, rwidth: ArbInt; Var a, b, x, ca: ArbFloat;
                  Var term:ArbInt);
                  Var term:ArbInt);
 
 
 Var
 Var
-   i, j, kmin1, k, kplus1, kmin2, imin2, nsr, nsi, nsb, ii,
+   i, j, kmin1, k, kplus1, kmin2, nsr, nsi, nsb,
    imin1, jmin1, indexpivot, iplus1, indi, indj, indk, indp       : ArbInt;
    imin1, jmin1, indexpivot, iplus1, indi, indj, indk, indp       : ArbInt;
-   ra, h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr, s : ArbFloat;
+   h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr, s : ArbFloat;
               pa, pb, pb1, px, alt, l, d, t, u, v, l1, d1, u1, t1 : ^arfloat1;
               pa, pb, pb1, px, alt, l, d, t, u, v, l1, d1, u1, t1 : ^arfloat1;
                                                                 p : ^arint1;
                                                                 p : ^arint1;
                                                                 q : ^arbool1;
                                                                 q : ^arbool1;
@@ -1885,9 +1885,8 @@ Procedure slegsyl(n: ArbInt; Var a1; Var b1, x1, ca: ArbFloat;
                   Var term: ArbInt);
                   Var term: ArbInt);
 
 
 Var
 Var
-   i, j, kmin1, k, kplus1, kmin2, imin2, nsr, nsi, nsb, ii,
-   imin1, jmin1, indexpivot, iplus1, indi, indj, indk, indp       : ArbInt;
-   ra, h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr, s : ArbFloat;
+   i, j, k, nsr, nsi, nsb, indexpivot: ArbInt;
+   h, absh, maxim, pivot, ct, norma, sumrowi, normt, normr, s : ArbFloat;
                                            a : ar2dr1 absolute a1;
                                            a : ar2dr1 absolute a1;
                                            b : arfloat1 absolute b1;
                                            b : arfloat1 absolute b1;
                                            x : arfloat1 absolute x1;
                                            x : arfloat1 absolute x1;

+ 1 - 1
packages/extra/numlib/spe.pas

@@ -1267,7 +1267,7 @@ end; {speath}
 
 
 var exitsave : pointer;
 var exitsave : pointer;
 
 
-procedure MyExit; Far;
+procedure MyExit;
 const ErrorS : array[400..408,1..6] of char =
 const ErrorS : array[400..408,1..6] of char =
      ('spepow',
      ('spepow',
       'spebk0',
       'spebk0',

+ 32 - 0
packages/extra/numlib/tests/detgpbte.dat

@@ -0,0 +1,32 @@
+5
+
+-3 3 1
+13 7 5 0 4
+
+3 4 1
+4 2 2 0 2 2 4
+
+0 4 3
+3 2 2 2 1 3 2 1 2 3
+
+-1 3 1
+1 2 3 1 4
+
+-1 3 3
+1 1 2 3 3 1
+5
+
+-3 3 1
+13 7 5 0 4
+
+3 4 1
+4 2 2 0 2 2 4
+
+0 4 3
+3 2 2 2 1 3 2 1 2 3
+
+-1 3 1
+1 2 3 1 4
+
+-1 3 3
+1 1 2 3 3 1

+ 177 - 0
packages/extra/numlib/tests/detgpbte.pas

@@ -0,0 +1,177 @@
+program detgpbte;
+
+{
+
+1: 260
+2: 64
+3:
+
+}
+uses
+  typ,
+  iom,
+  det;
+
+const
+  pmin = -10;
+  pmax = 100;
+var
+  l, i, ind, rw, n, k, term, p, vb, nvb: ArbInt;
+  f: ArbFloat;
+  a: array[pmin..pmax] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
+  Write(' program results detgpbte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(extended)');
+  end;
+  Read(nvb);
+  writeln;
+  writeln(' number of examples:', nvb: 3);
+  for vb := 1 to nvb do
+  begin
+    writeln;
+    writeln('example', vb: 2);
+    Read(p, n, l);
+    ind := p;
+    writeln;
+    writeln('  n=', n: 1, '  l=', l: 1);
+    for i := 1 to n do
+    begin
+      if i <= l then
+        rw := i
+      else
+        rw := l + 1;
+      iomrev(input, a[ind], rw);
+      Inc(ind, rw);
+    end;
+    detgpb(n, l, a[p], f, k, term);
+    ind := p;
+    writeln;
+    writeln(' A (left-under) =');
+    for i := 1 to n do
+    begin
+      if i <= l then
+        rw := i
+      else
+        rw := l + 1;
+      if i > l + 1 then
+        Write('': (i - l - 1) * (numdig + 2));
+      iomwrv(output, a[ind], rw, numdig);
+      Inc(ind, rw);
+    end;
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    if term = 2 then
+      writeln(' matrix not pos-def.')
+    else
+    begin
+      Write(' determinant of A =', f: numdig);
+      {      if k <> 0 then } Write(' * 8**', k: 3);
+      writeln;
+    end; {term=1}
+    writeln('---------------------------------------------');
+  end; {vb}
+  Close(input);
+  Close(output);
+end.
+program detgpbte;
+
+{
+
+1: 260
+2: 64
+3:
+
+}
+uses
+  typ,
+  iom,
+  det;
+
+const
+  pmin = -10;
+  pmax = 100;
+var
+  l, i, ind, rw, n, k, term, p, vb, nvb: ArbInt;
+  f: ArbFloat;
+  a: array[pmin..pmax] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Assign(input, ParamStr(1));
+  reset(input);
+  Assign(output, ParamStr(2));
+  rewrite(output);
+  Write(' program results detgpbte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(extended)');
+  end;
+  Read(nvb);
+  writeln;
+  writeln(' number of examples:', nvb: 3);
+  for vb := 1 to nvb do
+  begin
+    writeln;
+    writeln('example', vb: 2);
+    Read(p, n, l);
+    ind := p;
+    writeln;
+    writeln('  n=', n: 1, '  l=', l: 1);
+    for i := 1 to n do
+    begin
+      if i <= l then
+        rw := i
+      else
+        rw := l + 1;
+      iomrev(input, a[ind], rw);
+      Inc(ind, rw);
+    end;
+    detgpb(n, l, a[p], f, k, term);
+    ind := p;
+    writeln;
+    writeln(' A (left-under) =');
+    for i := 1 to n do
+    begin
+      if i <= l then
+        rw := i
+      else
+        rw := l + 1;
+      if i > l + 1 then
+        Write('': (i - l - 1) * (numdig + 2));
+      iomwrv(output, a[ind], rw, numdig);
+      Inc(ind, rw);
+    end;
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    if term = 2 then
+      writeln(' matrix not pos-def.')
+    else
+    begin
+      Write(' determinant of A =', f: numdig);
+      {      if k <> 0 then } Write(' * 8**', k: 3);
+      writeln;
+    end; {term=1}
+    writeln('---------------------------------------------');
+  end; {vb}
+  Close(input);
+  Close(output);
+end.
+

+ 62 - 0
packages/extra/numlib/tests/detgpdte.dat

@@ -0,0 +1,62 @@
+4
+
+-1 -1 3
+
+14
+5 2
+13 5 14
+
+-1 -1 6
+
+3e12
+0 1e10
+0 0  1e11
+0 0 0  2e9
+0 0 0 0 1e11
+0 0 0 0 0 1e12
+
+-1  -1 4
+
+0
+3 4
+1 2 0
+4 1 7 4
+
+0 0 5
+
+1e-13
+0 1e-12
+0 0 1e-12
+0 0 0 1e-8
+0 0 0 0 1e-12
+4
+
+-1 -1 3
+
+14
+5 2
+13 5 14
+
+-1 -1 6
+
+3e12
+0 1e10
+0 0  1e11
+0 0 0  2e9
+0 0 0 0 1e11
+0 0 0 0 0 1e12
+
+-1  -1 4
+
+0
+3 4
+1 2 0
+4 1 7 4
+
+0 0 5
+
+1e-13
+0 1e-12
+0 0 1e-12
+0 0 0 1e-8
+0 0 0 0 1e-12

+ 125 - 0
packages/extra/numlib/tests/detgpdte.pas

@@ -0,0 +1,125 @@
+program detgpdte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  n1  = -5;
+  n2  = 10;
+  rwa = n2 - n1 + 1;
+var
+  e, t, aantal, i, j, k, l, n, term: ArbInt;
+  d: ArbFloat;
+  a: array[n1..n2, n1..n2] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Write(' program results detgpdte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln('  number of examples : ', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, l, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[k + i - 1, l + j - 1]);
+    detgpd(n, rwa, a[k, l], d, e, term);
+    writeln;
+    writeln(' A =');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
+    iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    if term = 2 then
+      writeln(' matrix not pos-def')
+    else
+    begin
+      Write(' det =', d: numdig);
+      if e <> 0 then
+        Write(' * 8**', e: 3);
+      writeln;
+    end; {term=1}
+    writeln('------------------------------------------------------');
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+program detgpdte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  n1  = -5;
+  n2  = 10;
+  rwa = n2 - n1 + 1;
+var
+  e, t, aantal, i, j, k, l, n, term: ArbInt;
+  d: ArbFloat;
+  a: array[n1..n2, n1..n2] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Write(' program results detgpdte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln('  number of examples : ', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, l, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[k + i - 1, l + j - 1]);
+    detgpd(n, rwa, a[k, l], d, e, term);
+    writeln;
+    writeln(' A =');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
+    iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    if term = 2 then
+      writeln(' matrix not pos-def')
+    else
+    begin
+      Write(' det =', d: numdig);
+      if e <> 0 then
+        Write(' * 8**', e: 3);
+      writeln;
+    end; {term=1}
+    writeln('------------------------------------------------------');
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+

+ 58 - 0
packages/extra/numlib/tests/detgsyte.dat

@@ -0,0 +1,58 @@
+4
+
+-1 -1 3
+
+3
+4 7
+2 3 1
+
+-1 -1 6
+1e14
+0 1e16
+0 0 2e18
+0 0 0 3e17
+0 0 0 0 1e15
+0 0 0 0 0 1e10
+
+-1 -1 4
+1
+0 1
+0 1 2
+0 0 3 9
+
+-1 -1 6
+1e-14
+0 1e-16
+0 0 1e-18
+0 0 0 1e-17
+0 0 0 0 1e-15
+0 0 0 0 0 1e-10
+4
+
+-1 -1 3
+
+3
+4 7
+2 3 1
+
+-1 -1 6
+1e14
+0 1e16
+0 0 2e18
+0 0 0 3e17
+0 0 0 0 1e15
+0 0 0 0 0 1e10
+
+-1 -1 4
+1
+0 1
+0 1 2
+0 0 3 9
+
+-1 -1 6
+1e-14
+0 1e-16
+0 0 1e-18
+0 0 0 1e-17
+0 0 0 0 1e-15
+0 0 0 0 0 1e-10

+ 121 - 0
packages/extra/numlib/tests/detgsyte.pas

@@ -0,0 +1,121 @@
+program detgsyte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  n1  = -5;
+  n2  = 10;
+  rwa = n2 - n1 + 1;
+var
+  e, t, aantal, i, j, k, l, n, term: ArbInt;
+  d: ArbFloat;
+  a: array[n1..n2, n1..n2] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+
+  Write(' program results detgsyte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln('  number of examples : ', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, l, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[k + i - 1, l + j - 1]);
+    detgsy(n, rwa, a[k, l], d, e, term);
+    writeln;
+    writeln(' A =');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
+    iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    begin
+      Write(' det =', d: numdig);
+      if e <> 0 then
+        Write(' * 8**', e: 3);
+      writeln;
+    end; {term=1}
+    writeln('------------------------------------------------------');
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+program detgsyte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  n1  = -5;
+  n2  = 10;
+  rwa = n2 - n1 + 1;
+var
+  e, t, aantal, i, j, k, l, n, term: ArbInt;
+  d: ArbFloat;
+  a: array[n1..n2, n1..n2] of ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+
+  Write(' program results detgsyte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln('  number of examples : ', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, l, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[k + i - 1, l + j - 1]);
+    detgsy(n, rwa, a[k, l], d, e, term);
+    writeln;
+    writeln(' A =');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[k + j - 1, l + i - 1] := a[k + i - 1, l + j - 1];
+    iomwrm(output, a[k, l], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    begin
+      Write(' det =', d: numdig);
+      if e <> 0 then
+        Write(' * 8**', e: 3);
+      writeln;
+    end; {term=1}
+    writeln('------------------------------------------------------');
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+

+ 54 - 0
packages/extra/numlib/tests/detgtrte.dat

@@ -0,0 +1,54 @@
+5
+
+-1  4
+2 1 3
+1 2 1 1
+1 1 2
+
+0  3
+2 1
+3 4 5
+1 1
+
+1  2
+2
+4 3
+1
+
+
+0  4
+1 2 -1
+-1 1 1 1
+1 2 1
+
+-1  5
+0 0 0 0
+1e8 1e9 1e10 1e11 1e12
+0 0 0 0
+5
+
+-1  4
+2 1 3
+1 2 1 1
+1 1 2
+
+0  3
+2 1
+3 4 5
+1 1
+
+1  2
+2
+4 3
+1
+
+
+0  4
+1 2 -1
+-1 1 1 1
+1 2 1
+
+-1  5
+0 0 0 0
+1e8 1e9 1e10 1e11 1e12
+0 0 0 0

+ 127 - 0
packages/extra/numlib/tests/detgtrte.pas

@@ -0,0 +1,127 @@
+program detgtrte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  c1 = -10;
+  c2 = 10;
+var
+  k, p, n, term, vb, nvb: ArbInt;
+  l, d, u: array[c1..c2] of ArbFloat;
+  f: ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Write(' program results detgtrte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(nvb);
+  writeln;
+  writeln(' number of examples:', nvb: 4);
+  for vb := 1 to nvb do
+  begin
+    writeln;
+    writeln('example nr', vb: 2);
+    Read(p, n);
+    writeln;
+    writeln(' n=', n: 2);
+    iomrev(input, l[p + 1], n - 1);
+    iomrev(input, d[p], n);
+    iomrev(input, u[p], n - 1);
+    detgtr(n, l[p + 1], d[p], u[p], f, k, term);
+    writeln;
+    writeln('lower diagonal of A =');
+    iomwrv(output, l[p + 1], n - 1, numdig);
+    writeln;
+    writeln('diagonal of A =');
+    iomwrv(output, d[p], n, numdig);
+    writeln;
+    writeln('upper diagonal of A =');
+    iomwrv(output, u[p], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    begin
+      Write(' determinant of A =', f: numdig);
+      if k <> 0 then
+        Write(' * 8**', k: 3);
+      writeln;
+    end; {term=1}
+    writeln('----------------------------------------------------');
+  end;  {vb}
+  Close(input);
+  Close(output);
+end.
+program detgtrte;
+
+uses
+  typ,
+  iom,
+  det;
+
+const
+  c1 = -10;
+  c2 = 10;
+var
+  k, p, n, term, vb, nvb: ArbInt;
+  l, d, u: array[c1..c2] of ArbFloat;
+  f: ArbFloat;
+begin
+  iom.npos := 1000;        {max. width of output to 1000, since this is piped}
+  Write(' program results detgtrte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+    10: writeln('(Extended)');
+  end;
+  Read(nvb);
+  writeln;
+  writeln(' number of examples:', nvb: 4);
+  for vb := 1 to nvb do
+  begin
+    writeln;
+    writeln('example nr', vb: 2);
+    Read(p, n);
+    writeln;
+    writeln(' n=', n: 2);
+    iomrev(input, l[p + 1], n - 1);
+    iomrev(input, d[p], n);
+    iomrev(input, u[p], n - 1);
+    detgtr(n, l[p + 1], d[p], u[p], f, k, term);
+    writeln;
+    writeln('lower diagonal of A =');
+    iomwrv(output, l[p + 1], n - 1, numdig);
+    writeln;
+    writeln('diagonal of A =');
+    iomwrv(output, d[p], n, numdig);
+    writeln;
+    writeln('upper diagonal of A =');
+    iomwrv(output, u[p], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 3 then
+      writeln(' wrong input')
+    else
+    begin
+      Write(' determinant of A =', f: numdig);
+      if k <> 0 then
+        Write(' * 8**', k: 3);
+      writeln;
+    end; {term=1}
+    writeln('----------------------------------------------------');
+  end;  {vb}
+  Close(input);
+  Close(output);
+end.
+

+ 68 - 0
packages/extra/numlib/tests/eigbs1te.dat

@@ -0,0 +1,68 @@
+11
+
+-5 0      7 2
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+-100 10   5 0
+5 4 3 2 1
+
+0 0       4 3
+5 7 10 6 8 10 5 7 9 10
+
+1 -1      4 0
+0 0 0 0
+
+-1 -1     4 1
+1e-20 0 0 0 0 0 0
+
+0 -1      4 1
+0 0 0 0 0 1e-20 0
+
+0  0      1 0
+3
+
+-1 -1    3 0
+0 0 0
+
+-1 -1    4 0
+2 2 2 2
+
+-1 -1    5 2
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1    5 2
+3 0 3 1e-20 0 3 0 0 3 0 0 3
+11
+
+-5 0      7 2
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+-100 10   5 0
+5 4 3 2 1
+
+0 0       4 3
+5 7 10 6 8 10 5 7 9 10
+
+1 -1      4 0
+0 0 0 0
+
+-1 -1     4 1
+1e-20 0 0 0 0 0 0
+
+0 -1      4 1
+0 0 0 0 0 1e-20 0
+
+0  0      1 0
+3
+
+-1 -1    3 0
+0 0 0
+
+-1 -1    4 0
+2 2 2 2
+
+-1 -1    5 2
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1    5 2
+3 0 3 1e-20 0 3 0 0 3 0 0 3

+ 102 - 0
packages/extra/numlib/tests/eigbs1te.pas

@@ -0,0 +1,102 @@
+program eigbs1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  n1 = -100;
+  n2 = 100;
+var
+  ex, nex, nel, p, q, n, b, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigbs1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, n, b);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs1(a[p], n, b, lam[q], term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], n, numdig);
+    end
+    else
+      writeln(' wrong input');
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigbs1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  n1 = -100;
+  n2 = 100;
+var
+  ex, nex, nel, p, q, n, b, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigbs1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, n, b);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs1(a[p], n, b, lam[q], term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], n, numdig);
+    end
+    else
+      writeln(' wrong input');
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 80 - 0
packages/extra/numlib/tests/eigbs2te.dat

@@ -0,0 +1,80 @@
+13
+
+1 3    7 2   3 5
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+0 0    6 0   1 2
+3 7 1 3 4 2
+
+0 0    4 0   2 5
+1 1 1 1
+
+0 1    4 3   3 4
+5 7 10 6 8 10 5 7 9 10
+
+-1 -2  4 0   1 1
+0 0 0 0
+
+-1 -1  4 1   1 4
+1e-20 0 0 0 0 0 0
+
+0 -1   4 1   1 4
+0 0 0 0 0 1e-20 0
+
+0 -1   4 1   1 4
+1e-16 0 0 0 0 0 0
+
+0  0   1 0   1 1
+8
+
+-1 -1   3 0  1 3
+0 0 0
+
+-1 -1   4 0  2 3
+2 2 2 2
+
+-1 -1   5 2  3 4
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1   5 2  3 4
+3 0 3 1e-20 0 3 0 0 3 0 0 3
+13
+
+1 3    7 2   3 5
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+0 0    6 0   1 2
+3 7 1 3 4 2
+
+0 0    4 0   2 5
+1 1 1 1
+
+0 1    4 3   3 4
+5 7 10 6 8 10 5 7 9 10
+
+-1 -2  4 0   1 1
+0 0 0 0
+
+-1 -1  4 1   1 4
+1e-20 0 0 0 0 0 0
+
+0 -1   4 1   1 4
+0 0 0 0 0 1e-20 0
+
+0 -1   4 1   1 4
+1e-16 0 0 0 0 0 0
+
+0  0   1 0   1 1
+8
+
+-1 -1   3 0  1 3
+0 0 0
+
+-1 -1   4 0  2 3
+2 2 2 2
+
+-1 -1   5 2  3 4
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1   5 2  3 4
+3 0 3 1e-20 0 3 0 0 3 0 0 3

+ 102 - 0
packages/extra/numlib/tests/eigbs2te.pas

@@ -0,0 +1,102 @@
+program eigbs2te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  n1 = -100;
+  n2 = 100;
+var
+  ex, nex, nel, p, q, n, b, k1, k2, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigbs2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, n, b, k1, k2);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs2(a[p], n, b, k1, k2, lam[q], term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], k2 - k1 + 1, numdig);
+    end
+    else
+      writeln(' wrong input');
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigbs2te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  n1 = -100;
+  n2 = 100;
+var
+  ex, nex, nel, p, q, n, b, k1, k2, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigbs2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, n, b, k1, k2);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs2(a[p], n, b, k1, k2, lam[q], term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], k2 - k1 + 1, numdig);
+    end
+    else
+      writeln(' wrong input');
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 68 - 0
packages/extra/numlib/tests/eigbs3te.dat

@@ -0,0 +1,68 @@
+11
+1 3 1 2     7 2
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+1 0 -1 0    6 0
+3 7 1 3 4 2
+
+0 -1 -1 0   5 4
+10 1 9 2 -1 7 3 2 3 12 4 -3 -5 -1 15
+
+1 -1 -2 0   4 0
+0 0 0 0
+
+-1 -1 0 -1  4 0
+1e-20 0 0 0
+
+0 -1 -1 -1  4 1
+0 1e-20 0  0 0 0 0
+
+
+0  0  0  0  1 0
+10
+
+-1 -1 0 0   3 0
+0 0 0
+
+-1 -1 0 0   4 0
+2 2 2 2
+
+-1 -1 -1 -1  5 2
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1 -1 -1  5 2
+3 0 3 1e-20 0 3 0 0 3 0 0 3
+11
+1 3 1 2     7 2
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+1 0 -1 0    6 0
+3 7 1 3 4 2
+
+0 -1 -1 0   5 4
+10 1 9 2 -1 7 3 2 3 12 4 -3 -5 -1 15
+
+1 -1 -2 0   4 0
+0 0 0 0
+
+-1 -1 0 -1  4 0
+1e-20 0 0 0
+
+0 -1 -1 -1  4 1
+0 1e-20 0  0 0 0 0
+
+
+0  0  0  0  1 0
+10
+
+-1 -1 0 0   3 0
+0 0 0
+
+-1 -1 0 0   4 0
+2 2 2 2
+
+-1 -1 -1 -1  5 2
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1 -1 -1  5 2
+3 0 3 1e-20 0 3 0 0 3 0 0 3

+ 160 - 0
packages/extra/numlib/tests/eigbs3te.pas

@@ -0,0 +1,160 @@
+program eigbs3te;
+
+uses
+  typ,
+  iom,
+  eig,
+  omv;
+
+const
+  n1  = -100;
+  n2  = 100;
+  i1  = -10;
+  i2  = 10;
+  rwx = i2 - i1 + 1;
+var
+  ex, nex, nel, ind, p, q, r, s, n, i, j, b, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[i1..i2] of ArbFloat;
+  x, mat, e: array[i1..i2, i1..i2] of ArbFloat;
+begin
+  Write(' program results eigbs3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, r, s, n, b);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs3(a[p], n, b, lam[q], x[r, s], rwx, term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[r, s], n, n, rwx, numdig);
+      ind := p;
+      for i := 1 to n do
+        for j := 1 to i do
+          if j < i - b then
+            mat[i + r - 1, j + s - 1] := 0
+          else
+          begin
+            mat[i + r - 1, j + s - 1] := a[ind];
+            ind := ind + 1;
+          end;
+      for i := 1 to n do
+        for j := i + 1 to n do
+          mat[i + r - 1, j + s - 1] := mat[j + r - 1, i + s - 1];
+      writeln;
+      writeln(' matrix A =');
+      iomwrm(output, mat[r, s], n, n, rwx, numdig);
+      writeln;
+      writeln('Ax-lambda.x = ');
+      omvmmm(mat[r, s], n, n, rwx, x[r, s], n, rwx, e[r, s], rwx);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + r - 1, j + s - 1] := e[i + r - 1, j + s - 1] - lam[q + j - 1] * x[i + r - 1, j + s - 1];
+      iomwrm(output, e[r, s], n, n, rwx, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigbs3te;
+
+uses
+  typ,
+  iom,
+  eig,
+  omv;
+
+const
+  n1  = -100;
+  n2  = 100;
+  i1  = -10;
+  i2  = 10;
+  rwx = i2 - i1 + 1;
+var
+  ex, nex, nel, ind, p, q, r, s, n, i, j, b, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[i1..i2] of ArbFloat;
+  x, mat, e: array[i1..i2, i1..i2] of ArbFloat;
+begin
+  Write(' program results eigbs3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, r, s, n, b);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs3(a[p], n, b, lam[q], x[r, s], rwx, term);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[r, s], n, n, rwx, numdig);
+      ind := p;
+      for i := 1 to n do
+        for j := 1 to i do
+          if j < i - b then
+            mat[i + r - 1, j + s - 1] := 0
+          else
+          begin
+            mat[i + r - 1, j + s - 1] := a[ind];
+            ind := ind + 1;
+          end;
+      for i := 1 to n do
+        for j := i + 1 to n do
+          mat[i + r - 1, j + s - 1] := mat[j + r - 1, i + s - 1];
+      writeln;
+      writeln(' matrix A =');
+      iomwrm(output, mat[r, s], n, n, rwx, numdig);
+      writeln;
+      writeln('Ax-lambda.x = ');
+      omvmmm(mat[r, s], n, n, rwx, x[r, s], n, rwx, e[r, s], rwx);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + r - 1, j + s - 1] := e[i + r - 1, j + s - 1] - lam[q + j - 1] * x[i + r - 1, j + s - 1];
+      iomwrm(output, e[r, s], n, n, rwx, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 72 - 0
packages/extra/numlib/tests/eigbs4te.dat

@@ -0,0 +1,72 @@
+12
+1 3 1 2     7 2  3 5
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+1 0 -1 0    6 0  1 3
+3 7 1 3 4 2
+
+0 -1 -1 0   5 4  3 4
+10 1 9 2 -1 7 3 2 3 12 4 -3 -5 -1 15
+
+1 -1 -2 0   4 0  1 1
+0 0 0 0
+
+-1 -1 0 -1  4 0  1 2
+1e-20 0 0 0
+
+0 -1 -1 -1  4 1  2 3
+0 1e-20 0  0 0 0 0
+
+0 0 0 0     5 4  1 5
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+
+-1 -1 0 0   1 0  1 1
+2
+
+-1 -1 0 0   3 0  1 3
+0 0 0
+
+-1 -1 0 0   4 0  2 3
+2 2 2 2
+
+-1 -1 -1 -1  5 2  3 4
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1 -1 -1  5 2  3 4
+3 0 3 1e-20 0 3 0 0 3 0 0 3
+12
+1 3 1 2     7 2  3 5
+5 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 6 1 -4 5
+
+1 0 -1 0    6 0  1 3
+3 7 1 3 4 2
+
+0 -1 -1 0   5 4  3 4
+10 1 9 2 -1 7 3 2 3 12 4 -3 -5 -1 15
+
+1 -1 -2 0   4 0  1 1
+0 0 0 0
+
+-1 -1 0 -1  4 0  1 2
+1e-20 0 0 0
+
+0 -1 -1 -1  4 1  2 3
+0 1e-20 0  0 0 0 0
+
+0 0 0 0     5 4  1 5
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+
+-1 -1 0 0   1 0  1 1
+2
+
+-1 -1 0 0   3 0  1 3
+0 0 0
+
+-1 -1 0 0   4 0  2 3
+2 2 2 2
+
+-1 -1 -1 -1  5 2  3 4
+3 0 3 0 0 3 0 0 3 0 0 3
+
+-1 -1 -1 -1  5 2  3 4
+3 0 3 1e-20 0 3 0 0 3 0 0 3

+ 170 - 0
packages/extra/numlib/tests/eigbs4te.pas

@@ -0,0 +1,170 @@
+program eigbs4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  n1  = -100;
+  n2  = 100;
+  i1  = -10;
+  i2  = 10;
+  rwx = i2 - i1 + 1;
+var
+  ex, nex, nel, p, q, r, s, i, j, ind, n, b, k1, k2, m2, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[i1..i2] of ArbFloat;
+  x, e, mat: array[i1..i2, i1..i2] of ArbFloat;
+begin
+  Assign(input, ParamStr(1));
+  reset(input);
+  Write(' program results eigbs4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, r, s, n, b, k1, k2);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs4(a[p], n, b, k1, k2, lam[q], x[r, s], rwx, m2, term);
+    writeln(' n =', n: 2, '   b =', b: 2, '   k1 =', k1: 2, '   k2 =', k2: 2);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term < 3 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[r, s], n, m2 - k1 + 1, rwx, numdig);
+      ind := p;
+      for i := 1 to n do
+        for j := 1 to i do
+          if j < i - b then
+            mat[i + r - 1, j + s - 1] := 0
+          else
+          begin
+            mat[i + r - 1, j + s - 1] := a[ind];
+            ind := ind + 1;
+          end;
+      for i := 1 to n do
+        for j := i + 1 to n do
+          mat[i + r - 1, j + s - 1] := mat[j + r - 1, i + s - 1];
+      writeln;
+      writeln(' matrix A =');
+      iomwrm(output, mat[r, s], n, n, rwx, numdig);
+      writeln;
+      writeln('Ax-lambda.x = ');
+      omvmmm(mat[r, s], n, n, rwx, x[r, s], m2 - k1 + 1, rwx, e[r, s], rwx);
+      for j := 1 to m2 - k1 + 1 do
+        for i := 1 to n do
+          e[i + r - 1, j + s - 1] := e[i + r - 1, j + s - 1] - lam[q + j - 1] * x[i + r - 1, j + s - 1];
+      iomwrm(output, e[r, s], n, m2 - k1 + 1, rwx, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigbs4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  n1  = -100;
+  n2  = 100;
+  i1  = -10;
+  i2  = 10;
+  rwx = i2 - i1 + 1;
+var
+  ex, nex, nel, p, q, r, s, i, j, ind, n, b, k1, k2, m2, term: ArbInt;
+  a:   array[n1..n2] of ArbFloat;
+  lam: array[i1..i2] of ArbFloat;
+  x, e, mat: array[i1..i2, i1..i2] of ArbFloat;
+begin
+  Assign(input, ParamStr(1));
+  reset(input);
+  Write(' program results eigbs4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(p, q, r, s, n, b, k1, k2);
+    nel := n * (b + 1) - (b * (b + 1)) div 2;
+    iomrev(input, a[p], nel);
+    eigbs4(a[p], n, b, k1, k2, lam[q], x[r, s], rwx, m2, term);
+    writeln(' n =', n: 2, '   b =', b: 2, '   k1 =', k1: 2, '   k2 =', k2: 2);
+    writeln(' A = ');
+    iomwrv(output, a[p], nel, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term < 3 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[q], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[r, s], n, m2 - k1 + 1, rwx, numdig);
+      ind := p;
+      for i := 1 to n do
+        for j := 1 to i do
+          if j < i - b then
+            mat[i + r - 1, j + s - 1] := 0
+          else
+          begin
+            mat[i + r - 1, j + s - 1] := a[ind];
+            ind := ind + 1;
+          end;
+      for i := 1 to n do
+        for j := i + 1 to n do
+          mat[i + r - 1, j + s - 1] := mat[j + r - 1, i + s - 1];
+      writeln;
+      writeln(' matrix A =');
+      iomwrm(output, mat[r, s], n, n, rwx, numdig);
+      writeln;
+      writeln('Ax-lambda.x = ');
+      omvmmm(mat[r, s], n, n, rwx, x[r, s], m2 - k1 + 1, rwx, e[r, s], rwx);
+      for j := 1 to m2 - k1 + 1 do
+        for i := 1 to n do
+          e[i + r - 1, j + s - 1] := e[i + r - 1, j + s - 1] - lam[q + j - 1] * x[i + r - 1, j + s - 1];
+      iomwrm(output, e[r, s], n, m2 - k1 + 1, rwx, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 112 - 0
packages/extra/numlib/tests/eigge1te.dat

@@ -0,0 +1,112 @@
+9
+
+-1 -2  3
+
+8 -1 -5
+-4 4 -2
+18 -5 -7
+
+1 0  4
+
+-2 2 2 2
+-3 3 2 2
+-2 0 4 2
+-1 0 0 5
+
+0 -1 4
+
+6 -3 4 1
+4 2 4 0
+4 -2 3 1
+4 2 3 1
+
+-2 1  6
+
+10 -19 17 -12 4 1
+9 -18 17 -12 4 1
+8 -16 15 -11 4 1
+6 -12 12 -10 4 1
+4 -8  8  -6  1 2
+2 -4  4 -3  1  0
+
+1 1 4
+6 4 4 1
+4 6 1 4
+4 1 6 4
+1 4 4 6
+
+1 0 5
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+1 0 1
+0
+
+0 0 2
+1 0
+0 1
+
+0 0 4
+0 0 0 1e-20
+0 0 0 0
+0 0 0 0
+0 0 0 0
+9
+
+-1 -2  3
+
+8 -1 -5
+-4 4 -2
+18 -5 -7
+
+1 0  4
+
+-2 2 2 2
+-3 3 2 2
+-2 0 4 2
+-1 0 0 5
+
+0 -1 4
+
+6 -3 4 1
+4 2 4 0
+4 -2 3 1
+4 2 3 1
+
+-2 1  6
+
+10 -19 17 -12 4 1
+9 -18 17 -12 4 1
+8 -16 15 -11 4 1
+6 -12 12 -10 4 1
+4 -8  8  -6  1 2
+2 -4  4 -3  1  0
+
+1 1 4
+6 4 4 1
+4 6 1 4
+4 1 6 4
+1 4 4 6
+
+1 0 5
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+1 0 1
+0
+
+0 0 2
+1 0
+0 1
+
+0 0 4
+0 0 0 1e-20
+0 0 0 0
+0 0 0 0
+0 0 0 0

+ 108 - 0
packages/extra/numlib/tests/eigge1te.pas

@@ -0,0 +1,108 @@
+program eigge1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+
+var
+  i, l, nex, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of complex;
+begin
+  Write(' program results eigge1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, n);
+    iomrem(input, a[i1, j1], n, n, n2 - n1 + 1);
+    eigge1(a[i1, j1], n, n2 - n1 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      writeln(' ': 8, 'Re', ' ': 14, 'Im');
+      for i := 1 to n do
+        writeln(lam[i1 + i - 1].re: numdig, '  ', lam[i1 + i - 1].im: numdig);
+      writeln;
+    end;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigge1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+
+var
+  i, l, nex, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of complex;
+begin
+  Write(' program results eigge1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, n);
+    iomrem(input, a[i1, j1], n, n, n2 - n1 + 1);
+    eigge1(a[i1, j1], n, n2 - n1 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      writeln(' ': 8, 'Re', ' ': 14, 'Im');
+      for i := 1 to n do
+        writeln(lam[i1 + i - 1].re: numdig, '  ', lam[i1 + i - 1].im: numdig);
+      writeln;
+    end;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 148 - 0
packages/extra/numlib/tests/eigge3te.dat

@@ -0,0 +1,148 @@
+12
+
+-1 -2  -1 -1 3
+
+8 -1 -5
+-4 4 -2
+18 -5 -7
+
+1 0 -1 0 4
+
+-2 2 2 2
+-3 3 2 2
+-2 0 4 2
+-1 0 0 5
+
+0 -1 -2 0 4
+
+6 -3 4 1
+4 2 4 0
+4 -2 3 1
+4 2 3 1
+
+-2 1 0 0  6
+
+10 -19 17 -12 4 1
+9 -18 17 -12 4 1
+8 -16 15 -11 4 1
+6 -12 12 -10 4 1
+4 -8  8  -6  1 2
+2 -4  4 -3  1  0
+
+0 0 0 0 5
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+
+-1 -1 -1 -1 5
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+1 1 0 0 5
+1e-20 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5
+0 0 0 0 0
+0 0 0 0 0
+0 1e-22 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+0 0 0 0 2
+0 1
+0 0
+
+0 0 0 0 3
+0 0 0
+0 0 1
+0 0 0
+
+0 0 0 0 1
+2
+
+0 0 0 0 2
+1e-18 1e-30
+1e-22 1e-25
+12
+
+-1 -2  -1 -1 3
+
+8 -1 -5
+-4 4 -2
+18 -5 -7
+
+1 0 -1 0 4
+
+-2 2 2 2
+-3 3 2 2
+-2 0 4 2
+-1 0 0 5
+
+0 -1 -2 0 4
+
+6 -3 4 1
+4 2 4 0
+4 -2 3 1
+4 2 3 1
+
+-2 1 0 0  6
+
+10 -19 17 -12 4 1
+9 -18 17 -12 4 1
+8 -16 15 -11 4 1
+6 -12 12 -10 4 1
+4 -8  8  -6  1 2
+2 -4  4 -3  1  0
+
+0 0 0 0 5
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+1 1 1 1 1
+
+-1 -1 -1 -1 5
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+1 1 0 0 5
+1e-20 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5
+0 0 0 0 0
+0 0 0 0 0
+0 1e-22 0 0 0
+0 0 0 0 0
+0 0 0 0 0
+
+0 0 0 0 2
+0 1
+0 0
+
+0 0 0 0 3
+0 0 0
+0 0 1
+0 0 0
+
+0 0 0 0 1
+2
+
+0 0 0 0 2
+1e-18 1e-30
+1e-22 1e-25

+ 192 - 0
packages/extra/numlib/tests/eigge3te.pas

@@ -0,0 +1,192 @@
+program eigge3te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1  = -9;
+  m2  = 5;
+  m3  = -11;
+  m4  = 8;
+  n1  = -10;
+  n2  = 8;
+  n3  = -9;
+  n4  = 7;
+  rwa = n2 - n1 + 1;
+  rwx = n4 - n3 + 1;
+var
+  i, j, l, nex, n, term, i1, j1, i2, j2, k: ArbInt;
+  r:   ArbFloat;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  x:   array[m3..m4, n3..n4] of complex;
+  lam: array[m1..m2] of complex;
+begin
+  Write(' program results eigge3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    iomrem(input, a[i1, j1], n, n, rwa);
+    eigge3(a[i1, j1], n, rwa, lam[i1], x[i2, j2], rwx, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    iomwrm(output, a[i1, j1], n, n, rwa, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      writeln(' ': 10, 'Re', ' ': 10, 'Im');
+      for i := 1 to n do
+        writeln(lam[i1 + i - 1].re: numdig, ' ', lam[i1 + i - 1].im: numdig);
+      writeln;
+      writeln('eigenvectors:');
+      for j := 1 to n do
+      begin
+        writeln('eig. vect. nr', j: 2);
+        writeln(' ': 10, 'Re', ' ': 10, 'Im');
+        for i := 1 to n do
+        begin
+          Write(x[i2 + i - 1, j2 + j - 1].re: numdig, ' ');
+          writeln(x[i2 + i - 1, j2 + j - 1].im: numdig);
+        end;  {i}
+        writeln;
+      end; {j}
+      writeln('residuals:');
+      for j := 1 to n do
+      begin
+        writeln('residual nr', j: 2);
+        writeln(' ': 10, 'Re', ' ': 10, 'Im');
+        for i := 1 to n do
+        begin
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i2 + k - 1, j2 + j - 1].re;
+          r := r - lam[i1 + j - 1].re * x[i2 + i - 1, j2 + j - 1].re;
+          r := r + lam[i1 + j - 1].im * x[i2 + i - 1, j2 + j - 1].im;
+          Write(r: numdig, ' ');
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i2 + k - 1, j2 + j - 1].im;
+          r := r - lam[i1 + j - 1].re * x[i2 + i - 1, j2 + j - 1].im;
+          r := r - lam[i1 + j - 1].im * x[i2 + i - 1, j2 + j - 1].re;
+          writeln(r: numdig);
+        end; {i}
+        writeln;
+      end; {j}
+    end; {term=1}
+    writeln('-------------------------------------------');
+  end; {l}
+  Close(input);
+  Close(output);
+end.
+program eigge3te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1  = -9;
+  m2  = 5;
+  m3  = -11;
+  m4  = 8;
+  n1  = -10;
+  n2  = 8;
+  n3  = -9;
+  n4  = 7;
+  rwa = n2 - n1 + 1;
+  rwx = n4 - n3 + 1;
+var
+  i, j, l, nex, n, term, i1, j1, i2, j2, k: ArbInt;
+  r:   ArbFloat;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  x:   array[m3..m4, n3..n4] of complex;
+  lam: array[m1..m2] of complex;
+begin
+  Write(' program results eigge3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    iomrem(input, a[i1, j1], n, n, rwa);
+    eigge3(a[i1, j1], n, rwa, lam[i1], x[i2, j2], rwx, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    iomwrm(output, a[i1, j1], n, n, rwa, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      writeln(' ': 10, 'Re', ' ': 10, 'Im');
+      for i := 1 to n do
+        writeln(lam[i1 + i - 1].re: numdig, ' ', lam[i1 + i - 1].im: numdig);
+      writeln;
+      writeln('eigenvectors:');
+      for j := 1 to n do
+      begin
+        writeln('eig. vect. nr', j: 2);
+        writeln(' ': 10, 'Re', ' ': 10, 'Im');
+        for i := 1 to n do
+        begin
+          Write(x[i2 + i - 1, j2 + j - 1].re: numdig, ' ');
+          writeln(x[i2 + i - 1, j2 + j - 1].im: numdig);
+        end;  {i}
+        writeln;
+      end; {j}
+      writeln('residuals:');
+      for j := 1 to n do
+      begin
+        writeln('residual nr', j: 2);
+        writeln(' ': 10, 'Re', ' ': 10, 'Im');
+        for i := 1 to n do
+        begin
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i2 + k - 1, j2 + j - 1].re;
+          r := r - lam[i1 + j - 1].re * x[i2 + i - 1, j2 + j - 1].re;
+          r := r + lam[i1 + j - 1].im * x[i2 + i - 1, j2 + j - 1].im;
+          Write(r: numdig, ' ');
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i2 + k - 1, j2 + j - 1].im;
+          r := r - lam[i1 + j - 1].re * x[i2 + i - 1, j2 + j - 1].im;
+          r := r - lam[i1 + j - 1].im * x[i2 + i - 1, j2 + j - 1].re;
+          writeln(r: numdig);
+        end; {i}
+        writeln;
+      end; {j}
+    end; {term=1}
+    writeln('-------------------------------------------');
+  end; {l}
+  Close(input);
+  Close(output);
+end.

+ 144 - 0
packages/extra/numlib/tests/eiggg1te.dat

@@ -0,0 +1,144 @@
+9
+-1 0 1 -1    4
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1   3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0    5
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0      4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0     4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0     4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0    1
+2
+4
+
+0 0 0 0    1
+0
+1
+
+0 0 0 0    1
+0
+0
+9
+-1 0 1 -1    4
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1   3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0    5
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0      4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0     4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0     4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0    1
+2
+4
+
+0 0 0 0    1
+0
+1
+
+0 0 0 0    1
+0
+0

+ 132 - 0
packages/extra/numlib/tests/eiggg1te.pas

@@ -0,0 +1,132 @@
+program eiggg1te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+  n3 = -7;
+  n4 = 6;
+var
+  i, j, l, nex, i1, j1, i2, j2, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  b:   array[m1..m2, n3..n4] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggg1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg1(a[i1, j1], n, n2 - n1 + 1, b[i2, j2], n4 - n3 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+    end;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggg1te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+  n3 = -7;
+  n4 = 6;
+var
+  i, j, l, nex, i1, j1, i2, j2, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  b:   array[m1..m2, n3..n4] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggg1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg1(a[i1, j1], n, n2 - n1 + 1, b[i2, j2], n4 - n3 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+    end;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 144 - 0
packages/extra/numlib/tests/eiggg2te.dat

@@ -0,0 +1,144 @@
+9
+-1 0 1 -1    4  1 2
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1   3  2 2
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0    5  3 4
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0     4  1 2
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0     4  1 4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0     4  1 4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0    1  1 1
+4
+2
+
+0 0 0 0    1  1 1
+0
+2
+
+0 0 0 0    1  1 1
+2
+0
+9
+-1 0 1 -1    4  1 2
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1   3  2 2
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0    5  3 4
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0     4  1 2
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0     4  1 4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0     4  1 4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0    1  1 1
+4
+2
+
+0 0 0 0    1  1 1
+0
+2
+
+0 0 0 0    1  1 1
+2
+0

+ 134 - 0
packages/extra/numlib/tests/eiggg2te.pas

@@ -0,0 +1,134 @@
+program eiggg2te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+  n3 = -7;
+  n4 = 6;
+var
+  i, j, l, nex, k1, k2, i1, j1, i2, j2, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  b:   array[m1..m2, n3..n4] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggg2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg2(a[i1, j1], n, n2 - n1 + 1, k1, k2, b[i2, j2], n4 - n3 + 1,
+      lam[i1 + k1 - 1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda', k1: 2, ' t/m', k2: 2, ' = ');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggg2te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+  n3 = -7;
+  n4 = 6;
+var
+  i, j, l, nex, k1, k2, i1, j1, i2, j2, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  b:   array[m1..m2, n3..n4] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggg2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg2(a[i1, j1], n, n2 - n1 + 1, k1, k2, b[i2, j2], n4 - n3 + 1,
+      lam[i1 + k1 - 1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda', k1: 2, ' t/m', k2: 2, ' = ');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln;
+    writeln('-------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 142 - 0
packages/extra/numlib/tests/eiggg3te.dat

@@ -0,0 +1,142 @@
+9
+-1 0 1 -1 -1 -2   4
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1 0 -2   3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0 -3 -1   5
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+0 0 0 0 0 0    4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0 0 0    4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0    4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0    1
+4
+2
+
+-1 0 0 -1 0 0  1
+0
+1
+
+0 1 -1 0 0 0   1
+1
+0
+9
+-1 0 1 -1 -1 -2   4
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1 0 -2   3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0 -3 -1   5
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+0 0 0 0 0 0    4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+0 0 0 0 0 0    4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0    4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0    1
+4
+2
+
+-1 0 0 -1 0 0  1
+0
+1
+
+0 1 -1 0 0 0   1
+1
+0

+ 222 - 0
packages/extra/numlib/tests/eiggg3te.pas

@@ -0,0 +1,222 @@
+program eiggg3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -10;
+  m2  = 10;
+  m3  = -4;
+  m4  = 15;
+  m5  = -5;
+  m6  = 11;
+  n1  = -5;
+  n2  = 10;
+  n3  = -3;
+  n4  = 10;
+  n5  = -7;
+  n6  = 12;
+  rwa = n2 - n1 + 1;
+  rwb = n4 - n3 + 1;
+  rwx = n6 - n5 + 1;
+
+var
+  i, j, l, nex, n, k, term, i1, j1, i2, j2, i3, j3: ArbInt;
+  r, s: ArbFloat;
+  a:    array[m1..m2, n1..n2] of ArbFloat;
+  b:    array[m3..m4, n3..n4] of ArbFloat;
+  x, xt, xtb, xtbx: array[m5..m6, n5..n6] of ArbFloat;
+  lam:  array[m1..m2] of ArbFloat;
+
+begin
+  Write(' program results eiggg3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, i3, j3, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg3(a[i1, j1], n, rwa, b[i2, j2], rwb, lam[i1], x[i3, j3], rwx, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('eigenvectors:');
+      iomwrm(output, x[i3, j3], n, n, rwx, numdig);
+      writeln;
+      for i := 1 to n do
+        for j := 1 to i - 1 do
+          a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+      for i := 1 to n do
+        for j := 1 to i - 1 do
+          b[i2 + j - 1, j2 + i - 1] := b[i2 + i - 1, j2 + j - 1];
+      writeln('residuals:');
+      for j := 1 to n do
+      begin
+        writeln('residual nr', j: 2);
+        for i := 1 to n do
+        begin
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+          s := 0;
+          for k := 1 to n do
+            s := s + b[i2 + i - 1, j2 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+          r := r - s * lam[i1 + j - 1];
+          Write(r: numdig, ' ');
+        end; {i}
+        writeln;
+      end; {j}
+      writeln('xtbx =');
+      omvtrm(x[i3, j3], n, n, rwx, xt[i3, j3], rwx);
+      omvmmm(xt[i3, j3], n, n, rwx, b[i2, j2], n, rwb, xtb[i3, j3], rwx);
+      omvmmm(xtb[i3, j3], n, n, rwx, x[i3, j3], n, rwx, xtbx[i3, j3], rwx);
+      iomwrm(output, xtbx[i3, j3], n, n, rwx, 17);
+    end;
+    writeln('--------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggg3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -10;
+  m2  = 10;
+  m3  = -4;
+  m4  = 15;
+  m5  = -5;
+  m6  = 11;
+  n1  = -5;
+  n2  = 10;
+  n3  = -3;
+  n4  = 10;
+  n5  = -7;
+  n6  = 12;
+  rwa = n2 - n1 + 1;
+  rwb = n4 - n3 + 1;
+  rwx = n6 - n5 + 1;
+
+var
+  i, j, l, nex, n, k, term, i1, j1, i2, j2, i3, j3: ArbInt;
+  r, s: ArbFloat;
+  a:    array[m1..m2, n1..n2] of ArbFloat;
+  b:    array[m3..m4, n3..n4] of ArbFloat;
+  x, xt, xtb, xtbx: array[m5..m6, n5..n6] of ArbFloat;
+  lam:  array[m1..m2] of ArbFloat;
+
+begin
+  Write(' program results eiggg3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 2);
+    writeln;
+    Read(i1, j1, i2, j2, i3, j3, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg3(a[i1, j1], n, rwa, b[i2, j2], rwb, lam[i1], x[i3, j3], rwx, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('eigenvectors:');
+      iomwrm(output, x[i3, j3], n, n, rwx, numdig);
+      writeln;
+      for i := 1 to n do
+        for j := 1 to i - 1 do
+          a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+      for i := 1 to n do
+        for j := 1 to i - 1 do
+          b[i2 + j - 1, j2 + i - 1] := b[i2 + i - 1, j2 + j - 1];
+      writeln('residuals:');
+      for j := 1 to n do
+      begin
+        writeln('residual nr', j: 2);
+        for i := 1 to n do
+        begin
+          r := 0;
+          for k := 1 to n do
+            r := r + a[i1 + i - 1, j1 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+          s := 0;
+          for k := 1 to n do
+            s := s + b[i2 + i - 1, j2 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+          r := r - s * lam[i1 + j - 1];
+          Write(r: numdig, ' ');
+        end; {i}
+        writeln;
+      end; {j}
+      writeln('xtbx =');
+      omvtrm(x[i3, j3], n, n, rwx, xt[i3, j3], rwx);
+      omvmmm(xt[i3, j3], n, n, rwx, b[i2, j2], n, rwb, xtb[i3, j3], rwx);
+      omvmmm(xtb[i3, j3], n, n, rwx, x[i3, j3], n, rwx, xtbx[i3, j3], rwx);
+      iomwrm(output, xtbx[i3, j3], n, n, rwx, 17);
+    end;
+    writeln('--------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 146 - 0
packages/extra/numlib/tests/eiggg4te.dat

@@ -0,0 +1,146 @@
+9
+-1 0 1 -1 -1 -2   4  1 2
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1 0 -2   3  2 3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0 -3 -1   5  1 1
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0 0 0      4  3 4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+
+0 0 0 0 0 0      4  1 4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0      4 1 4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0     1  1 1
+4
+2
+
+0 -1 0 0 0 0    1  1 1
+0
+1
+
+0 -1 0 0 0 0    1  1 1
+1
+0
+9
+-1 0 1 -1 -1 -2   4  1 2
+1
+2 4
+1 3 2
+1 1 1 1
+3
+1 2
+1 0 2
+0 1 1 4
+
+-1 -1 -2 1 0 -2   3  2 3
+1
+2 1
+0 1 4
+3
+1 5
+0 1 6
+
+0 -1 -2 0 -3 -1   5  1 1
+10
+2 12
+3 1 11
+1 2 1 9
+1 1 -1 1 15
+12
+1 14
+-1 1 16
+2 -1 -1 12
+1 1 1 -1 11
+
+0 0 0 0 0 0      4  3 4
+1
+-1 2
+2 2 4
+1 3 3 4
+2
+3 1
+1 0 2
+1 0 3 -1
+
+
+0 0 0 0 0 0      4  1 4
+0
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0      4 1 4
+1e-20
+0 0
+0 0 0
+0 0 0 0
+3
+1 2
+1 0 2
+0 1 1 4
+
+0 0 0 0 0 0     1  1 1
+4
+2
+
+0 -1 0 0 0 0    1  1 1
+0
+1
+
+0 -1 0 0 0 0    1  1 1
+1
+0

+ 238 - 0
packages/extra/numlib/tests/eiggg4te.pas

@@ -0,0 +1,238 @@
+program eiggg4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  p1  = -9;
+  p2  = 5;
+  n1  = -10;
+  n2  = 8;
+  p3  = -10;
+  p4  = 7;
+  n3  = -11;
+  n4  = 9;
+  p5  = -8;
+  p6  = 11;
+  n5  = -12;
+  n6  = 12;
+  rwa = n2 - n1 + 1;
+  rwb = n4 - n3 + 1;
+  rwx = n6 - n5 + 1;
+var
+  i, j, l, m2, k1, k2, nex, n, term, k, m, i1, j1, i2, j2, i3, j3: ArbInt;
+  r, s: ArbFloat;
+  a:    array[p1..p2, n1..n2] of ArbFloat;
+  b:    array[p3..p4, n3..n4] of ArbFloat;
+  x, xt, xtb, xtbx: array[p5..p6, n5..n6] of ArbFloat;
+  lam:  array[p1..p2] of ArbFloat;
+begin
+  Write(' program results eiggg4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 3);
+    Read(i1, j1, i2, j2, i3, j3, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg4(a[i1, j1], n, rwa, k1, k2, b[i2, j2], rwb, lam[i1 + k1 - 1],
+      x[i3, j3 + k1 - 1], rwx, m2, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln(' k1=', k1: 2, '   k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if (term = 1) or (term = 4) then
+    begin
+      writeln('lambda=', k1: 2, ' t/m', k2: 2, ' = ');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      if m2 = k1 - 1 then
+        writeln(' eigenvectors can not be determined')
+      else
+      begin
+        writeln('eigenvectors', k1: 2, ' t/m', m2: 2, ':');
+        iomwrm(output, x[i3, j3 + k1 - 1], n, m2 - k1 + 1, rwx, numdig);
+        for i := 1 to n do
+          for j := 1 to i - 1 do
+            a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+        for i := 1 to n do
+          for j := 1 to i - 1 do
+            b[i2 + j - 1, j2 + i - 1] := b[i2 + i - 1, j2 + j - 1];
+        writeln('residuals:');
+        for j := k1 to m2 do
+        begin
+          writeln('residual nr', j: 2);
+          for i := 1 to n do
+          begin
+            r := 0;
+            for k := 1 to n do
+              r := r + a[i1 + i - 1, j1 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+            s := 0;
+            for k := 1 to n do
+              s := s + b[i2 + i - 1, j2 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+            r := r - s * lam[i1 + j - 1];
+            Write(r: numdig, ' ');
+          end; {i}
+          writeln;
+        end; {j}
+        m := m2 - k1 + 1;
+        writeln('xtbx =');
+        omvtrm(x[i3, j3 + k1 - 1], n, m, rwx, xt[i3, j3], rwx);
+        omvmmm(xt[i3, j3], m, n, rwx, b[i2, j2], n, rwb, xtb[i3, j3], rwx);
+        omvmmm(xtb[i3, j3], m, n, rwx, x[i3, j3 + k1 - 1], m, rwx,
+          xtbx[i3, j3], rwx);
+        iomwrm(output, xtbx[i3, j3], m, m, rwx, numdig);
+      end; {m2 > k1-1}
+    end; {term=1 or term=4}
+    writeln('----------------------------------------------------------');
+  end; {l}
+  Close(input);
+  Close(output);
+end.
+program eiggg4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  p1  = -9;
+  p2  = 5;
+  n1  = -10;
+  n2  = 8;
+  p3  = -10;
+  p4  = 7;
+  n3  = -11;
+  n4  = 9;
+  p5  = -8;
+  p6  = 11;
+  n5  = -12;
+  n6  = 12;
+  rwa = n2 - n1 + 1;
+  rwb = n4 - n3 + 1;
+  rwx = n6 - n5 + 1;
+var
+  i, j, l, m2, k1, k2, nex, n, term, k, m, i1, j1, i2, j2, i3, j3: ArbInt;
+  r, s: ArbFloat;
+  a:    array[p1..p2, n1..n2] of ArbFloat;
+  b:    array[p3..p4, n3..n4] of ArbFloat;
+  x, xt, xtb, xtbx: array[p5..p6, n5..n6] of ArbFloat;
+  lam:  array[p1..p2] of ArbFloat;
+begin
+  Write(' program results eiggg4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for l := 1 to nex do
+  begin
+    writeln('example number', l: 3);
+    Read(i1, j1, i2, j2, i3, j3, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(b[i2 + i - 1, j2 + j - 1]);
+    eiggg4(a[i1, j1], n, rwa, k1, k2, b[i2, j2], rwb, lam[i1 + k1 - 1],
+      x[i3, j3 + k1 - 1], rwx, m2, term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('B=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, b[i2 + i - 1, j2], i, numdig);
+    writeln;
+    writeln(' k1=', k1: 2, '   k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    writeln;
+    if (term = 1) or (term = 4) then
+    begin
+      writeln('lambda=', k1: 2, ' t/m', k2: 2, ' = ');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      if m2 = k1 - 1 then
+        writeln(' eigenvectors can not be determined')
+      else
+      begin
+        writeln('eigenvectors', k1: 2, ' t/m', m2: 2, ':');
+        iomwrm(output, x[i3, j3 + k1 - 1], n, m2 - k1 + 1, rwx, numdig);
+        for i := 1 to n do
+          for j := 1 to i - 1 do
+            a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+        for i := 1 to n do
+          for j := 1 to i - 1 do
+            b[i2 + j - 1, j2 + i - 1] := b[i2 + i - 1, j2 + j - 1];
+        writeln('residuals:');
+        for j := k1 to m2 do
+        begin
+          writeln('residual nr', j: 2);
+          for i := 1 to n do
+          begin
+            r := 0;
+            for k := 1 to n do
+              r := r + a[i1 + i - 1, j1 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+            s := 0;
+            for k := 1 to n do
+              s := s + b[i2 + i - 1, j2 + k - 1] * x[i3 + k - 1, j3 + j - 1];
+            r := r - s * lam[i1 + j - 1];
+            Write(r: numdig, ' ');
+          end; {i}
+          writeln;
+        end; {j}
+        m := m2 - k1 + 1;
+        writeln('xtbx =');
+        omvtrm(x[i3, j3 + k1 - 1], n, m, rwx, xt[i3, j3], rwx);
+        omvmmm(xt[i3, j3], m, n, rwx, b[i2, j2], n, rwb, xtb[i3, j3], rwx);
+        omvmmm(xtb[i3, j3], m, n, rwx, x[i3, j3 + k1 - 1], m, rwx,
+          xtbx[i3, j3], rwx);
+        iomwrm(output, xtbx[i3, j3], m, m, rwx, numdig);
+      end; {m2 > k1-1}
+    end; {term=1 or term=4}
+    writeln('----------------------------------------------------------');
+  end; {l}
+  Close(input);
+  Close(output);
+end.

+ 104 - 0
packages/extra/numlib/tests/eiggs1te.dat

@@ -0,0 +1,104 @@
+8
+
+1 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+1 1 5
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+1 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+1 1 5
+0
+0 0
+0 1e-22 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1
+3
+
+0 0 4
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 4
+1
+0 1
+0 0 1
+1e-24 0 0 1
+8
+
+1 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+1 1 5
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+1 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+1 1 5
+0
+0 0
+0 1e-22 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1
+3
+
+0 0 4
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 4
+1
+0 1
+0 0 1
+1e-24 0 0 1

+ 108 - 0
packages/extra/numlib/tests/eiggs1te.pas

@@ -0,0 +1,108 @@
+program eiggs1te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+var
+  i, j, ex, nex, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggs1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs1(a[i1, j1], n, n2 - n1 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+    end;
+    writeln('-----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggs1te;
+
+uses
+  typ,
+  eig,
+  iom;
+
+const
+  m1 = -9;
+  m2 = 5;
+  n1 = -10;
+  n2 = 8;
+var
+  i, j, ex, nex, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggs1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs1(a[i1, j1], n, n2 - n1 + 1, lam[i1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+    end;
+    writeln('-----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 154 - 0
packages/extra/numlib/tests/eiggs2te.dat

@@ -0,0 +1,154 @@
+11
+
+1 2 5 1 3
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 2 4
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 5 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 3 2
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+0 0 5 1 4
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 0 5 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 5 1 4
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+
+0 0 5 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 1
+2
+
+0 0 4  2 3
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 4  2 4
+1
+0 1
+0 0 1
+1e-24 0 0 1
+11
+
+1 2 5 1 3
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 2 4
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 5 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 2 5 3 2
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+0 0 5 1 4
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 0 5 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 5 1 4
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+
+0 0 5 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 1
+2
+
+0 0 4  2 3
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 4  2 4
+1
+0 1
+0 0 1
+1e-24 0 0 1

+ 116 - 0
packages/extra/numlib/tests/eiggs2te.pas

@@ -0,0 +1,116 @@
+program eiggs2te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 7;
+  n1 = -10;
+  n2 = 8;
+
+var
+  i, j, ex, nex, k1, k2, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+
+begin
+  Write(' program results eiggs2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs2(a[i1, j1], n, n2 - n1 + 1, k1, k2, lam[i1 + k1 - 1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('k1 =', k1: 2, '    k2 =', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln('----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggs2te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 7;
+  n1 = -10;
+  n2 = 8;
+
+var
+  i, j, ex, nex, k1, k2, i1, j1, n, term: ArbInt;
+  a:   array[m1..m2, n1..n2] of ArbFloat;
+  lam: array[m1..m2] of ArbFloat;
+
+begin
+  Write(' program results eiggs2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs2(a[i1, j1], n, n2 - n1 + 1, k1, k2, lam[i1 + k1 - 1], term);
+    writeln;
+    writeln('A=');
+    writeln;
+    for i := 1 to n do
+      iomwrv(output, a[i1 + i - 1, j1], i, numdig);
+    writeln;
+    writeln('k1 =', k1: 2, '    k2 =', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln('----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 104 - 0
packages/extra/numlib/tests/eiggs3te.dat

@@ -0,0 +1,104 @@
+8
+
+-1 -1 1 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 0 1 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 -1 1 1 5
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 1 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 0 0 1
+5
+
+0 0 0 0 4
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 0 0 4
+1
+0 1
+0 0 1
+1e-24 0 0 1
+8
+
+-1 -1 1 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 0 1 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 -1 1 1 5
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 1 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 0 0 1
+5
+
+0 0 0 0 4
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 0 0 4
+1
+0 1
+0 0 1
+1e-24 0 0 1

+ 144 - 0
packages/extra/numlib/tests/eiggs3te.pas

@@ -0,0 +1,144 @@
+program eiggs3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1 = -10;
+  m2 = 10;
+  m3 = -4;
+  m4 = 15;
+  n1 = -5;
+  n2 = 10;
+  n3 = -3;
+  n4 = 10;
+var
+  i, j, ex, nex, i1, j1, i2, j2, n, term: ArbInt;
+  a:    array[m1..m2, n1..n2] of ArbFloat;
+  x, e: array[m3..m4, n3..n4] of ArbFloat;
+  lam:  array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggs3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs3(a[i1, j1], n, n2 - n1 + 1, lam[i1], x[i2, j2], n4 - n3 + 1, term);
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+    writeln;
+    writeln('A=');
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2], n, n, n4 - n3 + 1, numdig);
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, n2 - n1 + 1, x[i2, j2], n, n4 - n3 + 1,
+        e[i2, j2], n4 - n3 + 1);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2], n, n, n4 - n3 + 1, numdig);
+    end;
+    writeln('-------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggs3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1 = -10;
+  m2 = 10;
+  m3 = -4;
+  m4 = 15;
+  n1 = -5;
+  n2 = 10;
+  n3 = -3;
+  n4 = 10;
+var
+  i, j, ex, nex, i1, j1, i2, j2, n, term: ArbInt;
+  a:    array[m1..m2, n1..n2] of ArbFloat;
+  x, e: array[m3..m4, n3..n4] of ArbFloat;
+  lam:  array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eiggs3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs3(a[i1, j1], n, n2 - n1 + 1, lam[i1], x[i2, j2], n4 - n3 + 1, term);
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+    writeln;
+    writeln('A=');
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2], n, n, n4 - n3 + 1, numdig);
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, n2 - n1 + 1, x[i2, j2], n, n4 - n3 + 1,
+        e[i2, j2], n4 - n3 + 1);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2], n, n, n4 - n3 + 1, numdig);
+    end;
+    writeln('-------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 150 - 0
packages/extra/numlib/tests/eiggs4te.dat

@@ -0,0 +1,150 @@
+11
+
+1 1 -1 0 5 1 3
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 -1 -1 5 2 4
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 -1 -1 5  1 1
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 -1 1 1 5 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 0 1 1 5 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 -1 1 1 5 2 4
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 1 1 5 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 0 0 1 1 1
+2
+
+0 0 0 0 4  2 3
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 0 0 4 2 3
+1
+0 1
+0 0 1
+1e-24 0 0 1
+11
+
+1 1 -1 0 5 1 3
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 -1 -1 5 2 4
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+1 1 -1 -1 5  1 1
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 -1 1 1 5 1 5
+
+ 10
+  1   9
+  2  -1   7
+  3   2   3  12
+  4  -3  -5  -1  15
+
+-1 0 1 1 5 1 5
+1
+1 1
+1 1 1
+1 1 1 1
+1 1 1 1 1
+
+0 -1 1 1 5 2 4
+0
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+0 0 1 1 5 1 5
+1e-20
+0 0
+0 0 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 1 1 5 1 5
+0
+0 0
+0 1e-16 0
+0 0 0 0
+0 0 0 0 0
+
+-1 0 0 0 1 1 1
+2
+
+0 0 0 0 4  2 3
+1
+0 1
+0 0 1
+0 0 0 1
+
+0 0 0 0 4 2 3
+1
+0 1
+0 0 1
+1e-24 0 0 1

+ 156 - 0
packages/extra/numlib/tests/eiggs4te.pas

@@ -0,0 +1,156 @@
+program eiggs4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  p1  = -9;
+  p2  = 5;
+  n1  = -10;
+  n2  = 8;
+  p3  = -10;
+  p4  = 7;
+  n3  = -11;
+  n4  = 9;
+  rwa = n2 - n1 + 1;
+  rwx = n4 - n3 + 1;
+var
+  i, j, ex, nex, m2, k1, k2, i2, j2, i1, j1, n, term: ArbInt;
+  a:    array[p1..p2, n1..n2] of ArbFloat;
+  x, e: array[p3..p4, n3..n4] of ArbFloat;
+  lam:  array[p1..p2] of ArbFloat;
+begin
+  Write(' program results eiggs4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs4(a[i1, j1], n, rwa, k1, k2, lam[i1 + k1 - 1], x[i2, j2 + k1 - 1],
+      rwx, m2, term);
+    writeln;
+    writeln('A=');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term < 3 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2 + k1 - 1], n, m2 - k1 + 1, rwx, numdig);
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, n2 - n1 + 1, x[i2, j2 + k1 - 1], m2 - k1 + 1, n4 - n3 + 1,
+        e[i2, j2 + k1 - 1], n4 - n3 + 1);
+      for j := k1 to m2 do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2 + k1 - 1], n, m2 - k1 + 1, n4 - n3 + 1, numdig);
+    end;
+    writeln('---------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eiggs4te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  p1  = -9;
+  p2  = 5;
+  n1  = -10;
+  n2  = 8;
+  p3  = -10;
+  p4  = 7;
+  n3  = -11;
+  n4  = 9;
+  rwa = n2 - n1 + 1;
+  rwx = n4 - n3 + 1;
+var
+  i, j, ex, nex, m2, k1, k2, i2, j2, i1, j1, n, term: ArbInt;
+  a:    array[p1..p2, n1..n2] of ArbFloat;
+  x, e: array[p3..p4, n3..n4] of ArbFloat;
+  lam:  array[p1..p2] of ArbFloat;
+begin
+  Write(' program results eiggs4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    Read(i1, j1, i2, j2, n, k1, k2);
+    for i := 1 to n do
+      for j := 1 to i do
+        Read(a[i1 + i - 1, j1 + j - 1]);
+    eiggs4(a[i1, j1], n, rwa, k1, k2, lam[i1 + k1 - 1], x[i2, j2 + k1 - 1],
+      rwx, m2, term);
+    writeln;
+    writeln('A=');
+    for i := 1 to n do
+      for j := 1 to i - 1 do
+        a[i1 + j - 1, j1 + i - 1] := a[i1 + i - 1, j1 + j - 1];
+    iomwrm(output, a[i1, j1], n, n, n2 - n1 + 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term < 3 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[i1 + k1 - 1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2 + k1 - 1], n, m2 - k1 + 1, rwx, numdig);
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, n2 - n1 + 1, x[i2, j2 + k1 - 1], m2 - k1 + 1, n4 - n3 + 1,
+        e[i2, j2 + k1 - 1], n4 - n3 + 1);
+      for j := k1 to m2 do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2 + k1 - 1], n, m2 - k1 + 1, n4 - n3 + 1, numdig);
+    end;
+    writeln('---------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 48 - 0
packages/extra/numlib/tests/eigsv1te.dat

@@ -0,0 +1,48 @@
+4
+
+-2 1 0    6 5
+  3.6e1  -6.3e2  3.36e3  -7.56e3    7.56e3
+ -6.3e2  1.47e4 -8.82e4   2.1168e5  -2.205e5
+ 3.36e3 -8.82e4  5.6448e5 -1.4112e6  1.512e6
+-7.56e3 2.1168e5 -1.4112e6 3.6288e6 -3.969e6
+ 7.56e3 -2.205e5  1.512e6 -3.969e6   4.41e6
+-2.772e3 8.316e4 -5.8212e5 1.55232e6 -1.74636e6
+
+-2 1 0   8 5
+22 10  2  3  7
+14  7 10  0  8
+-1 13 -1 -11 3
+-3 -2 13 -2  4
+ 9  8  1 -2  4
+ 9  1 -7  5 -1
+ 2 -6  6  5  1
+ 4  5  0 -2  2
+
+0 0 0    1 1
+4
+
+ 0 -2 -1  30 30
+4
+
+-2 1 0    6 5
+  3.6e1  -6.3e2  3.36e3  -7.56e3    7.56e3
+ -6.3e2  1.47e4 -8.82e4   2.1168e5  -2.205e5
+ 3.36e3 -8.82e4  5.6448e5 -1.4112e6  1.512e6
+-7.56e3 2.1168e5 -1.4112e6 3.6288e6 -3.969e6
+ 7.56e3 -2.205e5  1.512e6 -3.969e6   4.41e6
+-2.772e3 8.316e4 -5.8212e5 1.55232e6 -1.74636e6
+
+-2 1 0   8 5
+22 10  2  3  7
+14  7 10  0  8
+-1 13 -1 -11 3
+-3 -2 13 -2  4
+ 9  8  1 -2  4
+ 9  1 -7  5 -1
+ 2 -6  6  5  1
+ 4  5  0 -2  2
+
+0 0 0    1 1
+4
+
+ 0 -2 -1  30 30

+ 126 - 0
packages/extra/numlib/tests/eigsv1te.pas

@@ -0,0 +1,126 @@
+program eigsv1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -2;
+  m2 = 40;
+  n1 = -3;
+  n2 = 30;
+  l1 = -2;
+  l2 = 30;
+  rw = n2 - n1 + 1;
+var
+  ex, nex, k, i, j, m, n, p, term, l: ArbInt;
+  a: array[m1..m2, n1..n2] of ArbFloat;
+  q: array[l1..l2] of ArbFloat;
+begin
+  Write(' program results eigsv1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(k, p, l, m, n);
+    if ex < nex then
+      iomrem(input, a[k, p], m, n, rw)
+    else
+      for i := 1 to m do
+        for j := 1 to n do
+          if i > j then
+            a[k - 1 + i, p - 1 + j] := 0
+          else
+          if i = j then
+            a[k - 1 + i, p - 1 + j] := 1
+          else
+            a[k - 1 + i, p - 1 + j] := -1;
+    eigsv1(a[k, p], m, n, rw, q[l], term);
+    writeln;
+    writeln(' A =');
+    iomwrm(output, a[k, p], m, n, rw, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('q=');
+      iomwrv(output, q[l], n, numdig);
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigsv1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -2;
+  m2 = 40;
+  n1 = -3;
+  n2 = 30;
+  l1 = -2;
+  l2 = 30;
+  rw = n2 - n1 + 1;
+var
+  ex, nex, k, i, j, m, n, p, term, l: ArbInt;
+  a: array[m1..m2, n1..n2] of ArbFloat;
+  q: array[l1..l2] of ArbFloat;
+begin
+  Write(' program results eigsv1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(k, p, l, m, n);
+    if ex < nex then
+      iomrem(input, a[k, p], m, n, rw)
+    else
+      for i := 1 to m do
+        for j := 1 to n do
+          if i > j then
+            a[k - 1 + i, p - 1 + j] := 0
+          else
+          if i = j then
+            a[k - 1 + i, p - 1 + j] := 1
+          else
+            a[k - 1 + i, p - 1 + j] := -1;
+    eigsv1(a[k, p], m, n, rw, q[l], term);
+    writeln;
+    writeln(' A =');
+    iomwrm(output, a[k, p], m, n, rw, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('q=');
+      iomwrv(output, q[l], n, numdig);
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.

+ 65 - 0
packages/extra/numlib/tests/eigsv3te.dat

@@ -0,0 +1,65 @@
+4
+-2 1 0 0 1 -1 -1   8 5
+22 10  2  3  7
+14  7 10  0  8
+-1 13 -1 -11 3
+-3 -2 13 -2  4
+ 9  8  1 -2  4
+ 9  1 -7  5 -1
+ 2 -6  6  5  1
+ 4  5  0 -2  2
+
+ -1 -1 0 0 1 -1 0  12 8
+ 1 0 1 0 1 0 1 0
+ 0 1 0 1 0 1 0 1
+ 0 0 1 1 0 0 1 1
+ 1 1 0 0 1 1 0 0
+ 1 0 0 1 1 0 0 1
+ 0 0 1 0 0 1 0 0
+ 1 0 0 1 1 0 0 1
+ 1 1 0 0 0 0 1 1
+ 0 0 0 0 1 1 1 1
+ 0 0 1 1 1 1 0 0
+ 0 0 0 1 1 0 0 0
+ 0 1 1 1 1 1 1 0
+
+ 0 0 0 0 0 0 0  1 1
+ 2
+
+ 0 0 0 0 0 0 0  4 2
+ 0 0
+ 0 0
+ 0 0
+ 0 04
+-2 1 0 0 1 -1 -1   8 5
+22 10  2  3  7
+14  7 10  0  8
+-1 13 -1 -11 3
+-3 -2 13 -2  4
+ 9  8  1 -2  4
+ 9  1 -7  5 -1
+ 2 -6  6  5  1
+ 4  5  0 -2  2
+
+ -1 -1 0 0 1 -1 0  12 8
+ 1 0 1 0 1 0 1 0
+ 0 1 0 1 0 1 0 1
+ 0 0 1 1 0 0 1 1
+ 1 1 0 0 1 1 0 0
+ 1 0 0 1 1 0 0 1
+ 0 0 1 0 0 1 0 0
+ 1 0 0 1 1 0 0 1
+ 1 1 0 0 0 0 1 1
+ 0 0 0 0 1 1 1 1
+ 0 0 1 1 1 1 0 0
+ 0 0 0 1 1 0 0 0
+ 0 1 1 1 1 1 1 0
+
+ 0 0 0 0 0 0 0  1 1
+ 2
+
+ 0 0 0 0 0 0 0  4 2
+ 0 0
+ 0 0
+ 0 0
+ 0 0

+ 182 - 0
packages/extra/numlib/tests/eigsv3te.pas

@@ -0,0 +1,182 @@
+program eigsv3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -4;
+  m2  = 20;
+  n1  = -5;
+  n2  = 10;
+  r1  = -3;
+  r2  = 18;
+  s1  = -2;
+  s2  = 18;
+  x1  = -5;
+  x2  = 22;
+  y1  = -3;
+  y2  = 21;
+  l1  = -2;
+  l2  = 17;
+  rwa = n2 - n1 + 1;
+  rwu = s2 - s1 + 1;
+  rwv = y2 - y1 + 1;
+var
+  ex, nex, k, i, j, m, n, p, term, l, r, s, x, y: ArbInt;
+  a, usvt, e: array[m1..m2, n1..n2] of ArbFloat;
+  u, ut, utu, us: array[r1..r2, s1..s2] of ArbFloat;
+  v, vt, vtv: array[x1..x2, y1..y2] of ArbFloat;
+  q: array[l1..l2] of ArbFloat;
+begin
+  Write(' program results eigsv3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(k, p, l, r, s, x, y, m, n);
+    iomrem(input, a[k, p], m, n, rwa);
+    eigsv3(a[k, p], m, n, rwa, q[l], u[r, s], rwu, v[x, y], rwv, term);
+    writeln;
+    writeln(' a =');
+    iomwrm(output, a[k, p], m, n, rwa, 17);
+    writeln;
+    writeln(' term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln(' q =');
+      iomwrv(output, q[l], n, numdig);
+      writeln;
+      writeln(' u =');
+      iomwrm(output, u[r, s], m, n, rwu, numdig);
+      writeln;
+      writeln(' v =');
+      iomwrm(output, v[x, y], n, n, rwv, numdig);
+      writeln;
+      writeln(' u(t) x u =');
+      omvtrm(u[r, s], m, n, rwu, ut[r, s], rwu);
+      omvmmm(ut[r, s], n, m, rwu, u[r, s], n, rwu, utu[r, s], rwu);
+      iomwrm(output, utu[r, s], n, n, rwu, numdig);
+      writeln;
+      writeln(' v(t) x v =');
+      omvtrm(v[x, y], n, n, rwv, vt[x, y], rwv);
+      omvmmm(vt[x, y], n, n, rwv, v[x, y], n, rwv, vtv[x, y], rwv);
+      iomwrm(output, vtv[x, y], n, n, rwv, numdig);
+      writeln;
+      writeln(' a - u x sigma x v(t) = ');
+      for i := 1 to m do
+        for j := 1 to n do
+          us[r - 1 + i, s - 1 + j] := u[r - 1 + i, s - 1 + j] * q[l - 1 + j];
+      omvmmm(us[r, s], m, n, rwu, vt[x, y], n, rwv, usvt[k, p], rwa);
+      for i := 1 to m do
+        for j := 1 to n do
+          e[k - 1 + i, p - 1 + j] := a[k - 1 + i, p - 1 + j] - usvt[k - 1 + i, p - 1 + j];
+      iomwrm(output, e[k, p], m, n, rwa, numdig);
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigsv3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -4;
+  m2  = 20;
+  n1  = -5;
+  n2  = 10;
+  r1  = -3;
+  r2  = 18;
+  s1  = -2;
+  s2  = 18;
+  x1  = -5;
+  x2  = 22;
+  y1  = -3;
+  y2  = 21;
+  l1  = -2;
+  l2  = 17;
+  rwa = n2 - n1 + 1;
+  rwu = s2 - s1 + 1;
+  rwv = y2 - y1 + 1;
+var
+  ex, nex, k, i, j, m, n, p, term, l, r, s, x, y: ArbInt;
+  a, usvt, e: array[m1..m2, n1..n2] of ArbFloat;
+  u, ut, utu, us: array[r1..r2, s1..s2] of ArbFloat;
+  v, vt, vtv: array[x1..x2, y1..y2] of ArbFloat;
+  q: array[l1..l2] of ArbFloat;
+begin
+  Write(' program results eigsv3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(k, p, l, r, s, x, y, m, n);
+    iomrem(input, a[k, p], m, n, rwa);
+    eigsv3(a[k, p], m, n, rwa, q[l], u[r, s], rwu, v[x, y], rwv, term);
+    writeln;
+    writeln(' a =');
+    iomwrm(output, a[k, p], m, n, rwa, 17);
+    writeln;
+    writeln(' term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln(' q =');
+      iomwrv(output, q[l], n, numdig);
+      writeln;
+      writeln(' u =');
+      iomwrm(output, u[r, s], m, n, rwu, numdig);
+      writeln;
+      writeln(' v =');
+      iomwrm(output, v[x, y], n, n, rwv, numdig);
+      writeln;
+      writeln(' u(t) x u =');
+      omvtrm(u[r, s], m, n, rwu, ut[r, s], rwu);
+      omvmmm(ut[r, s], n, m, rwu, u[r, s], n, rwu, utu[r, s], rwu);
+      iomwrm(output, utu[r, s], n, n, rwu, numdig);
+      writeln;
+      writeln(' v(t) x v =');
+      omvtrm(v[x, y], n, n, rwv, vt[x, y], rwv);
+      omvmmm(vt[x, y], n, n, rwv, v[x, y], n, rwv, vtv[x, y], rwv);
+      iomwrm(output, vtv[x, y], n, n, rwv, numdig);
+      writeln;
+      writeln(' a - u x sigma x v(t) = ');
+      for i := 1 to m do
+        for j := 1 to n do
+          us[r - 1 + i, s - 1 + j] := u[r - 1 + i, s - 1 + j] * q[l - 1 + j];
+      omvmmm(us[r, s], m, n, rwu, vt[x, y], n, rwv, usvt[k, p], rwa);
+      for i := 1 to m do
+        for j := 1 to n do
+          e[k - 1 + i, p - 1 + j] := a[k - 1 + i, p - 1 + j] - usvt[k - 1 + i, p - 1 + j];
+      iomwrm(output, e[k, p], m, n, rwa, numdig);
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.

+ 32 - 0
packages/extra/numlib/tests/eigts1te.dat

@@ -0,0 +1,32 @@
+5
+
+-1 2    5
+1 1 1 1 1
+1 2 0 1
+
+1 2     4
+1 1 1 1
+1 2 1
+
+1 2     4
+0 0 0 0
+0 0 0
+
+0 0     1
+4
+5
+
+-1 2    5
+1 1 1 1 1
+1 2 0 1
+
+1 2     4
+1 1 1 1
+1 2 1
+
+1 2     4
+0 0 0 0
+0 0 0
+
+0 0     1
+4

+ 132 - 0
packages/extra/numlib/tests/eigts1te.pas

@@ -0,0 +1,132 @@
+program eigts1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 37;
+var
+  i, ex, nex, i1, j1, n, term: ArbInt;
+  t: ArbFloat;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    if ex < nex then
+    begin
+      Read(i1, j1, n);
+      iomrev(input, d[i1], n);
+      iomrev(input, cd[j1 + 1], n - 1);
+    end
+    else
+    begin
+      i1 := 1;
+      j1 := 1;
+      n  := 30;
+      for i := 1 to n do
+      begin
+        t    := i;
+        d[i] := sqr(t * t);
+      end;
+      for i := 2 to n do
+        cd[i] := i - 1;
+    end;
+    eigts1(d[i1], cd[j1 + 1], n, lam[j1], term);
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[j1], n, numdig);
+    end;
+    writeln('------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigts1te;
+
+uses
+  typ,
+  iom,
+  eig;
+
+const
+  m1 = -9;
+  m2 = 37;
+var
+  i, ex, nex, i1, j1, n, term: ArbInt;
+  t: ArbFloat;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    if ex < nex then
+    begin
+      Read(i1, j1, n);
+      iomrev(input, d[i1], n);
+      iomrev(input, cd[j1 + 1], n - 1);
+    end
+    else
+    begin
+      i1 := 1;
+      j1 := 1;
+      n  := 30;
+      for i := 1 to n do
+      begin
+        t    := i;
+        d[i] := sqr(t * t);
+      end;
+      for i := 2 to n do
+        cd[i] := i - 1;
+    end;
+    eigts1(d[i1], cd[j1 + 1], n, lam[j1], term);
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[j1], n, numdig);
+    end;
+    writeln('------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 32 - 0
packages/extra/numlib/tests/eigts2te.dat

@@ -0,0 +1,32 @@
+5
+
+-1 2     5  2 4
+1 1 1 1 1
+1 2 0 1
+
+1 2      3  3 1
+1 1 2
+2 0
+
+0 0      4  2 4
+0 0 0 0
+0 0 0
+
+0 0      1  1 1
+2
+5
+
+-1 2     5  2 4
+1 1 1 1 1
+1 2 0 1
+
+1 2      3  3 1
+1 1 2
+2 0
+
+0 0      4  2 4
+0 0 0 0
+0 0 0
+
+0 0      1  1 1
+2

+ 138 - 0
packages/extra/numlib/tests/eigts2te.pas

@@ -0,0 +1,138 @@
+program eigts2te;
+
+uses
+  eig,
+  iom,
+  typ;
+
+const
+  m1 = -9;
+  m2 = 37;
+var
+  t: ArbFloat;
+  i, ex, nex, k1, k2, i1, j1, n, term: ArbInt;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    if ex < nex then
+    begin
+      Read(i1, j1, n, k1, k2);
+      iomrev(input, d[i1], n);
+      iomrev(input, cd[j1 + 1], n - 1);
+    end
+    else
+    begin
+      i1 := 1;
+      j1 := 1;
+      n  := 30;
+      k1 := 5;
+      k2 := 8;
+      for i := 1 to n do
+      begin
+        t    := i;
+        d[i] := sqr(t * t);
+      end;
+      for i := 2 to n do
+        cd[i] := i - 1;
+    end;
+    eigts2(d[i1], cd[j1 + 1], n, k1, k2, lam[j1 + k1 - 1], term);
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[j1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln('------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigts2te;
+
+uses
+  eig,
+  iom,
+  typ;
+
+const
+  m1 = -9;
+  m2 = 37;
+var
+  t: ArbFloat;
+  i, ex, nex, k1, k2, i1, j1, n, term: ArbInt;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  writeln;
+  for ex := 1 to nex do
+  begin
+    writeln('example number', ex: 2);
+    writeln;
+    if ex < nex then
+    begin
+      Read(i1, j1, n, k1, k2);
+      iomrev(input, d[i1], n);
+      iomrev(input, cd[j1 + 1], n - 1);
+    end
+    else
+    begin
+      i1 := 1;
+      j1 := 1;
+      n  := 30;
+      k1 := 5;
+      k2 := 8;
+      for i := 1 to n do
+      begin
+        t    := i;
+        d[i] := sqr(t * t);
+      end;
+      for i := 2 to n do
+        cd[i] := i - 1;
+    end;
+    eigts2(d[i1], cd[j1 + 1], n, k1, k2, lam[j1 + k1 - 1], term);
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('lambda=');
+      iomwrv(output, lam[j1 + k1 - 1], k2 - k1 + 1, numdig);
+    end;
+    writeln('------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 46 - 0
packages/extra/numlib/tests/eigts3te.dat

@@ -0,0 +1,46 @@
+5
+
+1 2 3 4    5
+1 1 1 1 1
+1 2 0 1
+
+1 2 3 4    1
+4
+
+
+0 0 0 0    4
+0 0 0 0
+0 0 0
+
+
+
+0 0 0 0    2
+1 1
+1
+
+
+0 0 0 0    1
+0
+5
+
+1 2 3 4    5
+1 1 1 1 1
+1 2 0 1
+
+1 2 3 4    1
+4
+
+
+0 0 0 0    4
+0 0 0 0
+0 0 0
+
+
+
+0 0 0 0    2
+1 1
+1
+
+
+0 0 0 0    1
+0

+ 146 - 0
packages/extra/numlib/tests/eigts3te.pas

@@ -0,0 +1,146 @@
+program eigts3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -10;
+  m2  = 10;
+  rwx = m2 - m1 + 1;
+  rwa = rwx;
+var
+  ex, nex, i1, j1, i2, j2, n, i, j, term: ArbInt;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+  a, x, e:    array[m1..m2, m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('example number', ex: 2);
+    Read(i1, j1, i2, j2, n);
+    iomrev(input, d[i1], n);
+    iomrev(input, cd[j1 + 1], n - 1);
+    eigts3(d[i1], cd[j1 + 1], n, lam[i1], x[i2, j2], rwx, term);
+    writeln;
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln;
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2], n, n, rwx, numdig);
+      for i := i1 to i1 + n - 1 do
+        for j := j1 to j1 + n - 1 do
+          a[i, j] := 0;
+      for i := 1 to n do
+        a[i1 + i - 1, j1 + i - 1] := d[i1 + i - 1];
+      for i := 1 to n - 1 do
+        a[i1 + i, j1 + i - 1] := cd[j1 + i];
+      for i := 1 to n - 1 do
+        a[i1 + i - 1, j1 + i] := cd[j1 + i];
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, rwa, x[i2, j2], n, rwx, e[i2, j2], rwx);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2], n, n, rwx, numdig);
+    end;
+    writeln('-------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigts3te;
+
+uses
+  typ,
+  iom,
+  omv,
+  eig;
+
+const
+  m1  = -10;
+  m2  = 10;
+  rwx = m2 - m1 + 1;
+  rwa = rwx;
+var
+  ex, nex, i1, j1, i2, j2, n, i, j, term: ArbInt;
+  d, cd, lam: array[m1..m2] of ArbFloat;
+  a, x, e:    array[m1..m2, m1..m2] of ArbFloat;
+begin
+  Write(' program results eigts3te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('example number', ex: 2);
+    Read(i1, j1, i2, j2, n);
+    iomrev(input, d[i1], n);
+    iomrev(input, cd[j1 + 1], n - 1);
+    eigts3(d[i1], cd[j1 + 1], n, lam[i1], x[i2, j2], rwx, term);
+    writeln;
+    writeln('diag =');
+    iomwrv(output, d[i1], n, numdig);
+    writeln;
+    writeln('codiag =');
+    iomwrv(output, cd[j1 + 1], n - 1, numdig);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[i1], n, numdig);
+      writeln;
+      writeln('X=');
+      iomwrm(output, x[i2, j2], n, n, rwx, numdig);
+      for i := i1 to i1 + n - 1 do
+        for j := j1 to j1 + n - 1 do
+          a[i, j] := 0;
+      for i := 1 to n do
+        a[i1 + i - 1, j1 + i - 1] := d[i1 + i - 1];
+      for i := 1 to n - 1 do
+        a[i1 + i, j1 + i - 1] := cd[j1 + i];
+      for i := 1 to n - 1 do
+        a[i1 + i - 1, j1 + i] := cd[j1 + i];
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[i1, j1], n, n, rwa, x[i2, j2], n, rwx, e[i2, j2], rwx);
+      for j := 1 to n do
+        for i := 1 to n do
+          e[i + i2 - 1, j + j2 - 1] := e[i + i2 - 1, j + j2 - 1] - lam[i1 + j - 1] * x[i + i2 - 1, j + j2 - 1];
+      iomwrm(output, e[i2, j2], n, n, rwx, numdig);
+    end;
+    writeln('-------------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 50 - 0
packages/extra/numlib/tests/eigts4te.dat

@@ -0,0 +1,50 @@
+6
+
+5 1 3
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 2 4
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 5 5
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 3 2
+1 1 1 1 1
+ 1 2 0 1
+
+4 2 4
+0 0 0 0
+0 0 0
+
+
+1 1 1
+0
+6
+
+5 1 3
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 2 4
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 5 5
+ 1 1 1 1 1
+ 1 2 0 1
+
+5 3 2
+1 1 1 1 1
+ 1 2 0 1
+
+4 2 4
+0 0 0 0
+0 0 0
+
+
+1 1 1
+0

+ 160 - 0
packages/extra/numlib/tests/eigts4te.pas

@@ -0,0 +1,160 @@
+program eigts4te;
+
+uses
+  iom,
+  typ,
+  omv,
+  eig;
+
+const
+  n1  = -10;
+  n2  = 8;
+  n3  = -11;
+  n4  = 9;
+  rwx = n4 - n3 + 1;
+  rwa = rwx;
+var
+  i, j, ex, nex, m2, k1, k2, n, term: ArbInt;
+  d, cd:   array[n1..n2] of ArbFloat;
+  a, e, x: array[n1..n2, n3..n4] of ArbFloat;
+  lam:     array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigts4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('example number', ex: 2);
+    Read(n, k1, k2);
+    iomrev(input, d[1], n);
+    iomrev(input, cd[2], n - 1);
+    eigts4(d[1], cd[2], n, k1, k2, lam[k1], x[1, k1], rwx, m2, term);
+    writeln;
+    writeln('diag = ');
+    iomwrv(output, d[1], n, numdig);
+    writeln;
+    writeln('codiag = ');
+    iomwrv(output, cd[2], n - 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[k1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln(' X=');
+      iomwrm(output, x[1, k1], n, m2 - k1 + 1, rwx, numdig);
+      for i := 1 to n do
+        for j := 1 to n do
+          a[i, j] := 0;
+      for i := 1 to n do
+        a[i, i] := d[i];
+      for i := 1 to n - 1 do
+        a[1 + i, i] := cd[i + 1];
+      for i := 1 to n - 1 do
+        a[i, i + 1] := cd[i + 1];
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[1, 1], n, n, rwa, x[1, k1], m2 - k1 + 1, rwx, e[1, k1], rwx);
+      for j := 1 to m2 - k1 + 1 do
+        for i := 1 to n do
+          e[i, j + k1 - 1] := e[i, j + k1 - 1] - lam[k1 + j - 1] * x[i, j + k1 - 1];
+      iomwrm(output, e[1, k1], n, m2 - k1 + 1, rwx, numdig);
+    end;
+    writeln('-----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.
+program eigts4te;
+
+uses
+  iom,
+  typ,
+  omv,
+  eig;
+
+const
+  n1  = -10;
+  n2  = 8;
+  n3  = -11;
+  n4  = 9;
+  rwx = n4 - n3 + 1;
+  rwa = rwx;
+var
+  i, j, ex, nex, m2, k1, k2, n, term: ArbInt;
+  d, cd:   array[n1..n2] of ArbFloat;
+  a, e, x: array[n1..n2, n3..n4] of ArbFloat;
+  lam:     array[n1..n2] of ArbFloat;
+begin
+  Write(' program results eigts4te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nex);
+  writeln;
+  writeln('number of examples', nex: 2);
+  for ex := 1 to nex do
+  begin
+    writeln;
+    writeln('example number', ex: 2);
+    Read(n, k1, k2);
+    iomrev(input, d[1], n);
+    iomrev(input, cd[2], n - 1);
+    eigts4(d[1], cd[2], n, k1, k2, lam[k1], x[1, k1], rwx, m2, term);
+    writeln;
+    writeln('diag = ');
+    iomwrv(output, d[1], n, numdig);
+    writeln;
+    writeln('codiag = ');
+    iomwrv(output, cd[2], n - 1, numdig);
+    writeln;
+    writeln('k1=', k1: 2, '  k2=', k2: 2);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln;
+      writeln('lambda=');
+      iomwrv(output, lam[k1], k2 - k1 + 1, numdig);
+      writeln;
+      writeln(' m2 =', m2: 2);
+      writeln;
+      writeln(' X=');
+      iomwrm(output, x[1, k1], n, m2 - k1 + 1, rwx, numdig);
+      for i := 1 to n do
+        for j := 1 to n do
+          a[i, j] := 0;
+      for i := 1 to n do
+        a[i, i] := d[i];
+      for i := 1 to n - 1 do
+        a[1 + i, i] := cd[i + 1];
+      for i := 1 to n - 1 do
+        a[i, i + 1] := cd[i + 1];
+      writeln;
+      writeln('AX-lambda.X = ');
+      omvmmm(a[1, 1], n, n, rwa, x[1, k1], m2 - k1 + 1, rwx, e[1, k1], rwx);
+      for j := 1 to m2 - k1 + 1 do
+        for i := 1 to n do
+          e[i, j + k1 - 1] := e[i, j + k1 - 1] - lam[k1 + j - 1] * x[i, j + k1 - 1];
+      iomwrm(output, e[1, k1], n, m2 - k1 + 1, rwx, numdig);
+    end;
+    writeln('-----------------------------------------------------');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 996 - 0
packages/extra/numlib/tests/intge1te.pas

@@ -0,0 +1,996 @@
+program intge1te;
+
+uses
+  typ,
+  spe,
+  int;
+
+const
+  e      = 2.71828182845905;
+  fnames = 'KI A0 A1 A2 A3 A4 SS SL SE V1 V2 ';
+  ogs: array[1..11] of ArbFloat = (0, 0, 1, e, 0, 1, 0, 1, 1, 1, 1);
+  integraaltekst: array[1..11, 1..5] of string[60] =
+    (('  ì                                                       ',
+    ' ô  -àcosh(x)                                             ',
+    {k0}  ' ³ e         dx  = k0(à), mits à > 0.                     ',
+    ' õ                                                        ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô  sin x     àcos x                                      ',
+    {a0}  ' ³ ------- + ---------- dx  =  1, mits  à>0               ',
+    ' õ (x+1)à   (x+1)(à+1)                                  ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô   1                                                    ',
+    {a1}  ' ³ ---- dx   =  1/(à-1), mits  à>1                        ',
+    ' õ  xà                                                   ',
+    '1                                                         '),
+    ('  ì                                                       ',
+    ' ô     dx                                                 ',
+    {a2}  ' ³  ---------    =  1/(à-1), mits  à>1                    ',
+    ' õ  x.ln(x)à                                             ',
+    'e                                                         '),
+    ('  ì                                                       ',
+    ' ô Ú àùxàùsin(xà)    cos(xà)¿                          ',
+    {a3}  ' ³ ³ -------------- + ---------³ dx = 1, mits  à>0        ',
+    ' õ À    x(x+1)          (x+1)ý Ù                          ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô Ú 2sin(«ãùxà)       xàùcos(«ãùxà) ¿                 ',
+    {a4}  ' ³ ³-------------- + ãà-----------------³ dx = 1, mits àò0',
+    ' õ À   (x+1)ý                x(x+1)     Ù                 ',
+    '1                                                         '),
+    ('  ss(n)=2*(n+1)(à-1)/n  (n=1,2,3...), àò0                ',
+    {ss}  '  ss(x)=0 als min(|n-x|) ò 0.5/(n+1)à                    ',
+    '  ss lineair interpoleren als min(|n-x|) ó 0.5/(n+1)à    ',
+    '  int. 0:ì = ä [1:ì] 1/(n(n+1)) = 1                       ',
+    '                                                          '),
+    ('  ì                                                       ',
+    ' ô  sin(ln(x))          1                                 ',
+    {sl}  ' ³  --------- dx =  ---------,   mits  à>1                ',
+    ' õ     xà          (à-1)ý+1                              ',
+    '1                                                         '),
+    (' ì                                                        ',
+    ' ô  sin(xà)-à.x(à-1).cos(xà)       sin(1)              ',
+    {se}  ' ³  --------------------------- dx =  ------              ',
+    ' õ            ex                       e                 ',
+    '1                                                         '),
+    ('  ì                                                       ',
+    '  ô    à.|x|(à-1)                                        ',
+    {v1}  '  ³  ---------------- dx =  1, mits à > 0                 ',
+    '  õ  ã.(|x|(2à) + 1)                                     ',
+    '-ì                                                        '),
+    ('  ì            0           ì                              ',
+    '  ô            ô  àx      ô  -x/à                         ',
+    {v2}  '  ³ v2(x)dx =  ³ e   dx + ³ e    dx =  à + 1/à, mits à > 0',
+    '  õ            õ          õ                               ',
+    '-ì           -ì          0                                '));
+
+var
+  alfa, ond, inte, int1: ArbFloat;
+  u, i:  ArbInt;
+  s:     string;
+  q:     char;
+  f:     rfunc1r;
+  scale: boolean;
+
+  function Ki(x: ArbFloat): ArbFloat;
+  var
+    kk: ArbFloat;
+  begin
+    if abs(x) < ln(100 / alfa) then
+      kk := Exp(-alfa * Specoh(x))
+    else
+      kk := 0;
+    if scale then
+      ki := kk / int1
+    else
+      ki := kk;
+  end;
+
+  function uki(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      uki := ki((1 - u) / u) / sqr(u)
+    else
+      uki := 0;
+  end;
+
+  function a0(x: ArbFloat): ArbFloat;
+  begin
+    a0 := ((x + 1) * sin(x) + alfa * cos(x)) * spepow(x + 1, -alfa - 1);
+  end;
+
+  function ua0(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      ua0 := a0((1 - u) / u) / sqr(u)
+    else
+      ua0 := 0;
+  end;
+
+  function a1(x: ArbFloat): ArbFloat;
+  var
+    a: ArbFloat;
+  begin
+    a := spepow(x, -alfa);
+    if scale then
+      a1 := (alfa - 1) * a
+    else
+      a1 := a;
+  end;
+
+  function ua1(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua1 := a1(ond / u) * ond / sqr(u)
+    else
+      ua1 := 0;
+  end;
+
+  function a2(x: ArbFloat): ArbFloat;
+  var
+    a: ArbFloat;
+  begin
+    a := spepow(ln(x), -alfa) / x;
+    if scale then
+      a2 := (alfa - 1) * a
+    else
+      a2 := a;
+  end;
+
+  function ua2(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua2 := a2(ond / u) * ond / sqr(u)
+    else
+      ua2 := 0;
+  end;
+
+  function a3(x: ArbFloat): ArbFloat;
+  var
+    y: ArbFloat;
+  begin
+    if x = 0 then
+      a3 := 0
+    else
+    begin
+      y  := spepow(x, alfa);
+      a3 := alfa * y * sin(y) / (x * (x + 1)) + cos(y) / sqr(x + 1);
+    end;
+  end;
+
+  function ua3(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      ua3 := a3((1 - u) / u) / sqr(u)
+    else
+      ua3 := 0;
+  end;
+
+  function a4(x: ArbFloat): ArbFloat;
+  var
+    y, z: ArbFloat;
+  begin
+    y  := spepow(x, alfa);
+    z  := y * pi / 2;
+    a4 := 2 * sin(z) / sqr(x + 1) - pi * alfa * y * cos(z) / (x * (x + 1));
+  end;
+
+  function ua4(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua4 := a4(ond / u) * ond / sqr(u)
+    else
+      ua4 := 0;
+  end;
+
+  function ss(x: ArbFloat): ArbFloat;
+  var
+    d, eps, r: ArbFloat;
+  begin
+    if x > 0.5 then
+    begin
+      d := frac(x);
+      r := x - d;
+      if d > 0.5 then
+      begin
+        d := 1 - d;
+        r := r + 1;
+      end;
+      eps := 0.5 / spepow(r + 1, alfa);
+      if d > eps then
+        ss := 0
+      else
+        ss := (1 - d / eps) / (r * (r + 1) * eps);
+    end
+    else
+      ss := 0;
+  end;
+
+  function uss(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      uss := ss(ond / u) * ond / sqr(u)
+    else
+      uss := 0;
+  end;
+
+  function sl(x: ArbFloat): ArbFloat;
+  var
+    sl1: ArbFloat;
+  begin
+    sl1 := sin(ln(x)) * spepow(x, -alfa);
+    if scale then
+      sl := sl1 / int1
+    else
+      sl := sl1;
+  end;
+
+  function usl(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      usl := sl(ond / u) * ond / sqr(u)
+    else
+      usl := 0;
+  end;
+
+  function se(x: ArbFloat): ArbFloat;
+  var
+    y, se1: ArbFloat;
+  begin
+    y   := spepow(x, alfa);
+    se1 := (sin(y) - alfa * (y / x) * cos(y)) * exp(-x);
+    if scale then
+      se := se1 / int1
+    else
+      se := se1;
+  end;
+
+  function use(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      use := se(ond / u) * ond / sqr(u)
+    else
+      use := 0;
+  end;
+
+  function v1(x: ArbFloat): ArbFloat;
+  var
+    a, y: ArbFloat;
+  begin
+    x    := abs(x);
+    alfa := abs(alfa);
+    if x = 0 then
+    begin
+      if alfa = 1 then
+        v1 := alfa / pi
+      else
+        v1 := 0;
+    end
+    else
+    begin
+      if x > 1 then
+        a := -alfa - 1
+      else
+        a := alfa - 1;
+      y := spepow(x, a);
+      v1 := alfa * y / (pi * (sqr(x * y) + 1));
+    end;
+  end;
+
+  function uv1(u: ArbFloat): ArbFloat;  { u=«((2/ã)arctan(x)+1) of x=tan(«ã(2u-1)) }
+  var
+    y: ArbFloat;                         { 0 ó u ó 1 }
+  begin
+    if (u = 0) or (u = 1) then
+      uv1 := 0
+    else
+    begin
+      y   := 1 / sqr(cos(pi * (u - 0.5)));
+      uv1 := pi * v1(sqrt(y - 1)) * y;
+    end;
+  end;
+
+  function v2(x: ArbFloat): ArbFloat;
+  var
+    v: ArbFloat;
+  begin
+    alfa := abs(alfa);
+    if x > 0 then
+      v := exp(-x / alfa)
+    else
+    if x < 0 then
+      v := exp(x * alfa)
+    else
+      v := 1;
+    if scale then
+      v2 := v / (alfa + 1 / alfa)
+    else
+      v2 := v;
+  end;
+
+  function uv2(u: ArbFloat): ArbFloat;  { u=«((2/ã)arctan(x)+1) of x=tan(«ã(2u-1)) }
+  var
+    y: ArbFloat;                         { 0 ó u ó 1 }
+  begin
+    if (u = 0) or (u = 1) then
+      uv2 := 0
+    else
+    begin
+      y := 1 / sqr(cos(pi * (u - 0.5)));
+      if u > 0.5 then
+        uv2 := pi * v2(sqrt(y - 1)) * y
+      else
+        uv2 := pi * v2(-sqrt(y - 1)) * y;
+    end;
+  end;
+
+var
+  integral, ae, err: ArbFloat;
+  term, num2:   ArbInt;
+  intex, First: boolean;
+
+  procedure Header;
+  var
+    i: ArbInt;
+  begin
+    for i := 1 to 5 do
+      if i = 3 then
+        writeln(s: 3, ': ', Integraaltekst[u, i])
+      else
+        writeln('': 5, Integraaltekst[u, i]);
+  end;
+
+  procedure ShowResults;
+  var
+    f: ArbFloat;
+  begin
+    if First then
+      writeln('alfa': num2, '': numdig - num2, 'ae': 7, ' ': 4, 'int': num2,
+        '': numdig - num2, ' ', 'err': 7, ' ': 4, 'f': 6);
+    First := False;
+    if intex then
+      f := inte - integral;
+    case term of
+      1:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+      end;
+      2:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        Writeln('    proces afgebroken, te hoge nauwkeurigheid?');
+      end;
+      3: Writeln('Verkeerde waarde ae (<=0) bij aanroep: ', ae: 8);
+      4:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        writeln('    proces afgebroken, moeilijk, mogelijk divergent?');
+      end;
+    end;
+  end;
+
+const
+  fint: array[boolean, 1..11] of rfunc1r =
+    ((@ki, @a0, @a1, @a2, @a3, @a4, @ss, @sl, @se, @v1, @v2),
+    (@uki, @ua0, @ua1, @ua2, @ua3, @ua4, @uss, @usl, @use, @uv1, @uv2));
+begin
+  s := ParamStr(1);
+  if s = '' then
+  begin
+    writeln(' Vergeten  functienaam mee te geven!');
+    writeln(' Kies uit: ', fnames);
+    halt;
+  end;
+  for i := 1 to length(s) do
+    s[i] := Upcase(s[i]);
+  u := (Pos(s, fnames) + 2) div 3;
+  if u = 0 then
+  begin
+    writeln(' Commandlineparameter ', s, ' bestaat niet');
+    writeln(' Kies uit: ', fnames);
+    halt;
+  end;
+
+  Write('program results int1fr function ' + s);
+  case SizeOf(ArbFloat) of
+    4: writeln('(single)');
+    8: writeln('(double)');
+    6: writeln('(real)');
+  end;
+  num2 := numdig div 2;
+  if Pos(s, 'a0 a4 a3 ss v1') > 0 then
+    scale := True
+  else
+  begin
+    Write(' scale ? (y or n)');
+    readln(q);
+    scale := Upcase(q) = 'Y';
+  end;
+  Write('Transformatie naar 0 => 1 ? (y or n)');
+  readln(q);
+  ond := ogs[u];
+  f   := fint[Upcase(q) = 'Y'][u];
+  Header;
+  Writeln('à en ae: ');
+  First := True;
+  while not eoln do
+  begin
+    Read(alfa, ae);
+    intex := True;
+    case u of
+      1: int1 := spebk0(alfa);
+      2:
+      begin
+        int1  := 1;
+        intex := alfa > 0;
+      end;
+      3:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (alfa - 1);
+        intex := alfa > 1;
+      end;
+      4:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (alfa - 1);
+        intex := alfa > 1;
+      end;
+      5:
+      begin
+        if alfa > 0 then
+          int1 := 1
+        else
+          int1 := cos(1);
+        intex := alfa > 0;
+      end;
+      6:
+      begin
+        int1  := 1;
+        intex := alfa > 0;
+      end;
+      7: int1 := 1;
+      8:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (sqr(alfa - 1) + 1);
+        intex := alfa > 1;
+      end;
+      9: int1 := sin(1) / e;
+      10:
+      begin
+        int1  := 1;
+        intex := alfa <> 0;
+      end;
+      11:
+      begin
+        if alfa <> 0 then
+          int1 := abs(alfa) + 1 / abs(alfa);
+        intex := alfa <> 0;
+      end;
+    end;
+    if scale then
+      inte := 1
+    else
+      inte := int1;
+    if Upcase(q) = 'Y' then
+      int1fr(f, 0, 1, ae, integral, err, term)
+    else if u < 10 then
+      int1fr(f, ond, infinity, ae, integral, err, term)
+    else
+      int1fr(f, -infinity, infinity, ae, integral, err, term);
+    Showresults;
+  end;
+end.
+program intge1te;
+
+uses
+  typ,
+  spe,
+  int;
+
+const
+  e      = 2.71828182845905;
+  fnames = 'KI A0 A1 A2 A3 A4 SS SL SE V1 V2 ';
+  ogs: array[1..11] of ArbFloat = (0, 0, 1, e, 0, 1, 0, 1, 1, 1, 1);
+  integraaltekst: array[1..11, 1..5] of string[60] =
+    (('  ì                                                       ',
+    ' ô  -àcosh(x)                                             ',
+    {k0}  ' ³ e         dx  = k0(à), mits à > 0.                     ',
+    ' õ                                                        ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô  sin x     àcos x                                      ',
+    {a0}  ' ³ ------- + ---------- dx  =  1, mits  à>0               ',
+    ' õ (x+1)à   (x+1)(à+1)                                  ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô   1                                                    ',
+    {a1}  ' ³ ---- dx   =  1/(à-1), mits  à>1                        ',
+    ' õ  xà                                                   ',
+    '1                                                         '),
+    ('  ì                                                       ',
+    ' ô     dx                                                 ',
+    {a2}  ' ³  ---------    =  1/(à-1), mits  à>1                    ',
+    ' õ  x.ln(x)à                                             ',
+    'e                                                         '),
+    ('  ì                                                       ',
+    ' ô Ú àùxàùsin(xà)    cos(xà)¿                          ',
+    {a3}  ' ³ ³ -------------- + ---------³ dx = 1, mits  à>0        ',
+    ' õ À    x(x+1)          (x+1)ý Ù                          ',
+    '0                                                         '),
+    ('  ì                                                       ',
+    ' ô Ú 2sin(«ãùxà)       xàùcos(«ãùxà) ¿                 ',
+    {a4}  ' ³ ³-------------- + ãà-----------------³ dx = 1, mits àò0',
+    ' õ À   (x+1)ý                x(x+1)     Ù                 ',
+    '1                                                         '),
+    ('  ss(n)=2*(n+1)(à-1)/n  (n=1,2,3...), àò0                ',
+    {ss}  '  ss(x)=0 als min(|n-x|) ò 0.5/(n+1)à                    ',
+    '  ss lineair interpoleren als min(|n-x|) ó 0.5/(n+1)à    ',
+    '  int. 0:ì = ä [1:ì] 1/(n(n+1)) = 1                       ',
+    '                                                          '),
+    ('  ì                                                       ',
+    ' ô  sin(ln(x))          1                                 ',
+    {sl}  ' ³  --------- dx =  ---------,   mits  à>1                ',
+    ' õ     xà          (à-1)ý+1                              ',
+    '1                                                         '),
+    (' ì                                                        ',
+    ' ô  sin(xà)-à.x(à-1).cos(xà)       sin(1)              ',
+    {se}  ' ³  --------------------------- dx =  ------              ',
+    ' õ            ex                       e                 ',
+    '1                                                         '),
+    ('  ì                                                       ',
+    '  ô    à.|x|(à-1)                                        ',
+    {v1}  '  ³  ---------------- dx =  1, mits à > 0                 ',
+    '  õ  ã.(|x|(2à) + 1)                                     ',
+    '-ì                                                        '),
+    ('  ì            0           ì                              ',
+    '  ô            ô  àx      ô  -x/à                         ',
+    {v2}  '  ³ v2(x)dx =  ³ e   dx + ³ e    dx =  à + 1/à, mits à > 0',
+    '  õ            õ          õ                               ',
+    '-ì           -ì          0                                '));
+
+var
+  alfa, ond, inte, int1: ArbFloat;
+  u, i:  ArbInt;
+  s:     string;
+  q:     char;
+  f:     rfunc1r;
+  scale: boolean;
+
+  function Ki(x: ArbFloat): ArbFloat;
+  var
+    kk: ArbFloat;
+  begin
+    if abs(x) < ln(100 / alfa) then
+      kk := Exp(-alfa * Specoh(x))
+    else
+      kk := 0;
+    if scale then
+      ki := kk / int1
+    else
+      ki := kk;
+  end;
+
+  function uki(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      uki := ki((1 - u) / u) / sqr(u)
+    else
+      uki := 0;
+  end;
+
+  function a0(x: ArbFloat): ArbFloat;
+  begin
+    a0 := ((x + 1) * sin(x) + alfa * cos(x)) * spepow(x + 1, -alfa - 1);
+  end;
+
+  function ua0(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      ua0 := a0((1 - u) / u) / sqr(u)
+    else
+      ua0 := 0;
+  end;
+
+  function a1(x: ArbFloat): ArbFloat;
+  var
+    a: ArbFloat;
+  begin
+    a := spepow(x, -alfa);
+    if scale then
+      a1 := (alfa - 1) * a
+    else
+      a1 := a;
+  end;
+
+  function ua1(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua1 := a1(ond / u) * ond / sqr(u)
+    else
+      ua1 := 0;
+  end;
+
+  function a2(x: ArbFloat): ArbFloat;
+  var
+    a: ArbFloat;
+  begin
+    a := spepow(ln(x), -alfa) / x;
+    if scale then
+      a2 := (alfa - 1) * a
+    else
+      a2 := a;
+  end;
+
+  function ua2(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua2 := a2(ond / u) * ond / sqr(u)
+    else
+      ua2 := 0;
+  end;
+
+  function a3(x: ArbFloat): ArbFloat;
+  var
+    y: ArbFloat;
+  begin
+    if x = 0 then
+      a3 := 0
+    else
+    begin
+      y  := spepow(x, alfa);
+      a3 := alfa * y * sin(y) / (x * (x + 1)) + cos(y) / sqr(x + 1);
+    end;
+  end;
+
+  function ua3(u: ArbFloat): ArbFloat;   {u=1/(x+1), of x=1/u-1}
+  begin
+    if u > 0 then
+      ua3 := a3((1 - u) / u) / sqr(u)
+    else
+      ua3 := 0;
+  end;
+
+  function a4(x: ArbFloat): ArbFloat;
+  var
+    y, z: ArbFloat;
+  begin
+    y  := spepow(x, alfa);
+    z  := y * pi / 2;
+    a4 := 2 * sin(z) / sqr(x + 1) - pi * alfa * y * cos(z) / (x * (x + 1));
+  end;
+
+  function ua4(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      ua4 := a4(ond / u) * ond / sqr(u)
+    else
+      ua4 := 0;
+  end;
+
+  function ss(x: ArbFloat): ArbFloat;
+  var
+    d, eps, r: ArbFloat;
+  begin
+    if x > 0.5 then
+    begin
+      d := frac(x);
+      r := x - d;
+      if d > 0.5 then
+      begin
+        d := 1 - d;
+        r := r + 1;
+      end;
+      eps := 0.5 / spepow(r + 1, alfa);
+      if d > eps then
+        ss := 0
+      else
+        ss := (1 - d / eps) / (r * (r + 1) * eps);
+    end
+    else
+      ss := 0;
+  end;
+
+  function uss(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      uss := ss(ond / u) * ond / sqr(u)
+    else
+      uss := 0;
+  end;
+
+  function sl(x: ArbFloat): ArbFloat;
+  var
+    sl1: ArbFloat;
+  begin
+    sl1 := sin(ln(x)) * spepow(x, -alfa);
+    if scale then
+      sl := sl1 / int1
+    else
+      sl := sl1;
+  end;
+
+  function usl(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      usl := sl(ond / u) * ond / sqr(u)
+    else
+      usl := 0;
+  end;
+
+  function se(x: ArbFloat): ArbFloat;
+  var
+    y, se1: ArbFloat;
+  begin
+    y   := spepow(x, alfa);
+    se1 := (sin(y) - alfa * (y / x) * cos(y)) * exp(-x);
+    if scale then
+      se := se1 / int1
+    else
+      se := se1;
+  end;
+
+  function use(u: ArbFloat): ArbFloat;  {u=ond/x of x=ond/u}
+  begin
+    if u > 0 then
+      use := se(ond / u) * ond / sqr(u)
+    else
+      use := 0;
+  end;
+
+  function v1(x: ArbFloat): ArbFloat;
+  var
+    a, y: ArbFloat;
+  begin
+    x    := abs(x);
+    alfa := abs(alfa);
+    if x = 0 then
+    begin
+      if alfa = 1 then
+        v1 := alfa / pi
+      else
+        v1 := 0;
+    end
+    else
+    begin
+      if x > 1 then
+        a := -alfa - 1
+      else
+        a := alfa - 1;
+      y := spepow(x, a);
+      v1 := alfa * y / (pi * (sqr(x * y) + 1));
+    end;
+  end;
+
+  function uv1(u: ArbFloat): ArbFloat;  { u=«((2/ã)arctan(x)+1) of x=tan(«ã(2u-1)) }
+  var
+    y: ArbFloat;                         { 0 ó u ó 1 }
+  begin
+    if (u = 0) or (u = 1) then
+      uv1 := 0
+    else
+    begin
+      y   := 1 / sqr(cos(pi * (u - 0.5)));
+      uv1 := pi * v1(sqrt(y - 1)) * y;
+    end;
+  end;
+
+  function v2(x: ArbFloat): ArbFloat;
+  var
+    v: ArbFloat;
+  begin
+    alfa := abs(alfa);
+    if x > 0 then
+      v := exp(-x / alfa)
+    else
+    if x < 0 then
+      v := exp(x * alfa)
+    else
+      v := 1;
+    if scale then
+      v2 := v / (alfa + 1 / alfa)
+    else
+      v2 := v;
+  end;
+
+  function uv2(u: ArbFloat): ArbFloat;  { u=«((2/ã)arctan(x)+1) of x=tan(«ã(2u-1)) }
+  var
+    y: ArbFloat;                         { 0 ó u ó 1 }
+  begin
+    if (u = 0) or (u = 1) then
+      uv2 := 0
+    else
+    begin
+      y := 1 / sqr(cos(pi * (u - 0.5)));
+      if u > 0.5 then
+        uv2 := pi * v2(sqrt(y - 1)) * y
+      else
+        uv2 := pi * v2(-sqrt(y - 1)) * y;
+    end;
+  end;
+
+var
+  integral, ae, err: ArbFloat;
+  term, num2:   ArbInt;
+  intex, First: boolean;
+
+  procedure Header;
+  var
+    i: ArbInt;
+  begin
+    for i := 1 to 5 do
+      if i = 3 then
+        writeln(s: 3, ': ', Integraaltekst[u, i])
+      else
+        writeln('': 5, Integraaltekst[u, i]);
+  end;
+
+  procedure ShowResults;
+  var
+    f: ArbFloat;
+  begin
+    if First then
+      writeln('alfa': num2, '': numdig - num2, 'ae': 7, ' ': 4, 'int': num2,
+        '': numdig - num2, ' ', 'err': 7, ' ': 4, 'f': 6);
+    First := False;
+    if intex then
+      f := inte - integral;
+    case term of
+      1:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+      end;
+      2:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        Writeln('    proces afgebroken, te hoge nauwkeurigheid?');
+      end;
+      3: Writeln('Verkeerde waarde ae (<=0) bij aanroep: ', ae: 8);
+      4:
+      begin
+        Write(alfa: numdig, ae: 10, integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        writeln('    proces afgebroken, moeilijk, mogelijk divergent?');
+      end;
+    end;
+  end;
+
+const
+  fint: array[boolean, 1..11] of rfunc1r =
+    ((@ki, @a0, @a1, @a2, @a3, @a4, @ss, @sl, @se, @v1, @v2),
+    (@uki, @ua0, @ua1, @ua2, @ua3, @ua4, @uss, @usl, @use, @uv1, @uv2));
+begin
+  s := ParamStr(1);
+  if s = '' then
+  begin
+    writeln(' Vergeten  functienaam mee te geven!');
+    writeln(' Kies uit: ', fnames);
+    halt;
+  end;
+  for i := 1 to length(s) do
+    s[i] := Upcase(s[i]);
+  u := (Pos(s, fnames) + 2) div 3;
+  if u = 0 then
+  begin
+    writeln(' Commandlineparameter ', s, ' bestaat niet');
+    writeln(' Kies uit: ', fnames);
+    halt;
+  end;
+
+  Write('program results int1fr function ' + s);
+  case SizeOf(ArbFloat) of
+    4: writeln('(single)');
+    8: writeln('(double)');
+    6: writeln('(real)');
+  end;
+  num2 := numdig div 2;
+  if Pos(s, 'a0 a4 a3 ss v1') > 0 then
+    scale := True
+  else
+  begin
+    Write(' scale ? (y or n)');
+    readln(q);
+    scale := Upcase(q) = 'Y';
+  end;
+  Write('Transformatie naar 0 => 1 ? (y or n)');
+  readln(q);
+  ond := ogs[u];
+  f   := fint[Upcase(q) = 'Y'][u];
+  Header;
+  Writeln('à en ae: ');
+  First := True;
+  while not eoln do
+  begin
+    Read(alfa, ae);
+    intex := True;
+    case u of
+      1: int1 := spebk0(alfa);
+      2:
+      begin
+        int1  := 1;
+        intex := alfa > 0;
+      end;
+      3:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (alfa - 1);
+        intex := alfa > 1;
+      end;
+      4:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (alfa - 1);
+        intex := alfa > 1;
+      end;
+      5:
+      begin
+        if alfa > 0 then
+          int1 := 1
+        else
+          int1 := cos(1);
+        intex := alfa > 0;
+      end;
+      6:
+      begin
+        int1  := 1;
+        intex := alfa > 0;
+      end;
+      7: int1 := 1;
+      8:
+      begin
+        if alfa > 1 then
+          int1 := 1 / (sqr(alfa - 1) + 1);
+        intex := alfa > 1;
+      end;
+      9: int1 := sin(1) / e;
+      10:
+      begin
+        int1  := 1;
+        intex := alfa <> 0;
+      end;
+      11:
+      begin
+        if alfa <> 0 then
+          int1 := abs(alfa) + 1 / abs(alfa);
+        intex := alfa <> 0;
+      end;
+    end;
+    if scale then
+      inte := 1
+    else
+      inte := int1;
+    if Upcase(q) = 'Y' then
+      int1fr(f, 0, 1, ae, integral, err, term)
+    else if u < 10 then
+      int1fr(f, ond, infinity, ae, integral, err, term)
+    else
+      int1fr(f, -infinity, infinity, ae, integral, err, term);
+    Showresults;
+  end;
+end.

+ 852 - 0
packages/extra/numlib/tests/intge2te.pas

@@ -0,0 +1,852 @@
+program InitInfEx;
+
+uses
+  Typ,
+  Spe,
+  Int;
+
+var
+  num2: ArbInt;
+  inte: ArbFloat;
+const
+  e = 2.71828182845905;
+
+  function cx(x: ArbFloat): ArbFloat;
+  begin
+    cx := cos(x) / (sqr(x) + 1);
+  end;
+
+  function pcx(x: ArbFloat): ArbFloat;
+  begin
+    pcx := 2 * x * sin(x) / sqr(sqr(x) + 1);
+  end;
+
+  function ppcx(x: ArbFloat): ArbFloat;
+  var
+    s: ArbFloat;
+  begin
+    s    := sqr(x);
+    ppcx := cos(x) * (2 - 6 * s) / ((s + 1) * sqr(s + 1));
+  end;
+
+  function cc2(x: ArbFloat): ArbFloat;
+  var
+    x2: ArbFloat;
+  begin
+    x2  := sqr(x);
+    cc2 := cos(x) / (sqr(x2) + x2 + 1);
+  end;
+
+  function ucx(x: ArbFloat): ArbFloat;
+  begin
+    if x = 0 then
+      ucx := 0
+    else
+      ucx := cx((1 - x) / x) / sqr(x);
+  end;
+
+  function ucc2(x: ArbFloat): ArbFloat;
+  begin
+    if x = 0 then
+      ucc2 := 0
+    else
+      ucc2 := cc2((1 - x) / x) / sqr(x);
+  end;
+
+  function uz(x: ArbFloat): ArbFloat;
+  begin
+    uz := sin(x) * exp(-x);
+  end;
+
+  function ss1(x: ArbFloat): ArbFloat;    { f(«n(n-1))=0 (n=1,2,3,...) }
+  var
+    n, s, c: ArbFloat;                    { f(«ný)=2/(ný(n+1))  }
+  begin                                   { overigens: f linear interpoleren}
+    s := sqrt(2 * x);
+    n := trunc(s);
+    if n * (n + 1) / 2 <= x then
+      n := n + 1;  { n z.d.d. «n(n-1) ó x ó «n(n-1) }
+    c := 4 / (n * sqr(n) * (n + 1));
+    if s < n then
+      ss1 := c * (x - n * (n - 1) / 2)
+    else
+      ss1 := c * (n * (n + 1) / 2 - x);
+  end;
+
+  function ss2(x: ArbFloat): ArbFloat;   { als ss1 met f(«ný)=2/(n.2ü)  }
+  var
+    n, s, c: ArbFloat;
+  begin
+    s := sqrt(2 * x);
+    n := trunc(s);
+    if n * (n + 1) / 2 <= x then
+      n := n + 1;
+    c := spepow(2, 2 - n) / sqr(n);
+    if s < n then
+      ss2 := c * (x - n * (n - 1) / 2)
+    else
+      ss2 := c * (n * (n + 1) / 2 - x);
+  end;
+
+  function ss3(x: ArbFloat): ArbFloat;       { x  z.d.d. «.2ü ó x+1 ó 2ü  s=2ü}
+  var
+    s, c, f, x1: ArbFloat;
+    n: ArbInt;        {n even: f(n)=-4/(n.2ü)}
+  begin                                  {n oneven: f(n) = 4/(n.2ü)}
+    n  := 0;
+    s  := 1;
+    x1 := x + 1;               { overigens: f lineair interpol.}
+    repeat
+      n := n + 1;
+      s := s * 2
+    until s > x1;
+    c := 16 / (n * sqr(s));
+    if x1 < 0.75 * s then
+      f := c * (x1 - s / 2)
+    else
+      f := c * (s - x1);
+    if odd(n) then
+      ss3 := f
+    else
+      ss3 := -f;
+  end;
+
+  function ss4(x: ArbFloat): ArbFloat;        { 0 ó x ó 1}
+  var
+    y, h:  ArbFloat;                        { zij x = ä [1:ì] c(n)/3ü c(n)=0,1,2}
+    ready: boolean;                         { zoek kleinste k met c(k)=1}
+  begin                                     { dan geldt f(x)=u(y)/3k }
+    y     := 3 * x;
+    h     := 1 / 3;
+    ready := False;         { met u(y)=|y-1«|, 1 ó y ó 2}
+    repeat                                { en y =  ä [k:ì] (c(n)/3ü)*3k }
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss4   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        if y < 1.5 then
+          ss4 := h * (y - 1)
+        else
+          ss4 := h * (2 - y);
+      end
+    until ready;
+  end;
+
+  function ss5(x: ArbFloat): ArbFloat;   { uitbreiding ss4}
+  var
+    y, h:  ArbFloat;                   {functiewaarden op 'volgend' interval}
+    ready: boolean;                    { [n, n+1] telkens halveren}
+  begin
+    y     := 3 * frac(x);
+    h     := spepow(0.5, trunc(x)) / 3;
+    ready := False;
+    repeat
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss5   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        if y < 1.5 then
+          ss5 := h * (y - 1)
+        else
+          ss5 := h * (2 - y);
+      end
+    until ready;
+  end;
+
+  function ss6(x: ArbFloat): ArbFloat;   { 0 ó x ó 1, 'gladdere' variant van ss4}
+  var
+    y, h:  ArbFloat;
+    ready: boolean;
+
+    function f(y: ArbFloat): ArbFloat; { 1 ó y ó 2, 1 x cont. diff, symm. max in 1.5}
+    begin
+      if y > 1.5 then
+        y := 3 - y;
+      if y < 1.25 then
+        f := sqr(y - 1)
+      else
+        f := 0.125 - sqr(1.5 - y);
+    end;
+
+  begin
+    y     := 3 * x;
+    h     := 1 / 3;
+    ready := False;
+    repeat
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss6   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        ss6   := h * f(y);
+      end
+    until ready;
+  end;
+
+  function bb(x: ArbFloat): ArbFloat;
+  begin
+    bb := spepow(x, -x) * (ln(x) + 1);
+  end;
+
+var
+  integral, ae, err: ArbFloat;
+  term:  ArbInt;
+  intex: boolean;
+
+  procedure Header;
+  begin
+    Write('int': num2, '': numdig - num2, ' ', 'err': 7, ' ': 4);
+    if intex then
+      Write('f': 6);
+    writeln;
+  end;
+
+  procedure ShowResults;
+  var
+    f: ArbFloat;
+  begin
+    if intex then
+      f := inte - integral;
+    case term of
+      1:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+      end;
+      2:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        Writeln('    proces afgebroken, te hoge nauwkeurigheid?');
+      end;
+      3: Writeln('Verkeerde parameterwaarde (<=0) bij aanroep: ', ae: 8);
+      4:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        writeln('    proces afgebroken, moeilijk, mogelijk divergent?');
+      end;
+    end;
+  end;
+
+begin
+  num2 := numdig div 2;
+
+  Writeln('     ì   ');
+  Writeln('    ô  cos x           ã ');
+  Writeln('    ³ ------- dx   =   -- ');
+  Writeln('  0 õ  xý+ 1           2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  inte  := 0.5 * pi / e;
+  intex := True;
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@cx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  writeln;
+  Writeln('berekend met Int1fr via transformatie x=(1-t)/t');
+  writeln;
+  Int1fr(@ucx, 0, 1, ae, integral, err, term);
+  Header;
+  ShowResults;
+  Writeln('     ì   ');
+  Writeln('    ô  2x sin x           ã ');
+  Writeln('    ³ --------- dx   =    -- ');
+  Writeln('  0 õ  (xý+ 1)ý           2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@pcx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  Writeln('     ì   ');
+  Writeln('    ô (2-6xý)cos x            ã ');
+  Writeln('    ³ ------------ dx   =    -- ');
+  Writeln('  0 õ  (xý+ 1)3             2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@ppcx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  Writeln('     ì   ');
+  Writeln('    ô     cos x ');
+  Writeln('    ³ ------------ dx   =  (ã/û3) exp(-«û3) sin(ã/6+«) ');
+  Writeln('  0 õ  (xý)ý+xý+ 1 ');
+  writeln;
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  inte := (pi / sqrt(3)) * exp(-sqrt(0.75)) * sin(pi / 6 + 0.5);
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@cc2, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  writeln;
+  Writeln('berekend met Int1fr via transformatie x=(1-t)/t');
+  writeln;
+  writeln;
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@ucc2, 0, 1, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  Writeln('     ì   ');
+  Writeln('    ô sin u                ');
+  Writeln('    ³ ------ du   =  « ');
+  Writeln('    õ exp(u)            ');
+  writeln('   0 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 0.5;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@uz, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  writeln(' functie ss1;  int = ä {1:ì}1/n(n+1)  =  1');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss1, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss2;  int = ä {1:ì} («)ü  =  1');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss2, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss3;  int = ä {1:ì} (-1)ü/n  =  ln(2)');
+  ae    := 1e-8;
+  intex := True;
+  inte  := ln(2);
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss3, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss4 (op [0,1]); int = 1/28 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 28;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss4, 0, 1, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss5 (op [0,ì)); int = 1/14 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 14;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss5, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss6 (op [0,1]); int = 1/112 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 112;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss6, 0, 1, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  Writeln('     ì   ');
+  Writeln('    ô  ln(x)+1         ');
+  Writeln('    ³ ---------- dx   = 1  ');
+  Writeln('    õ     xx            ');
+  writeln('   1 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@bb, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+end.
+program InitInfEx;
+
+uses
+  Typ,
+  Spe,
+  Int;
+
+var
+  num2: ArbInt;
+  inte: ArbFloat;
+const
+  e = 2.71828182845905;
+
+  function cx(x: ArbFloat): ArbFloat;
+  begin
+    cx := cos(x) / (sqr(x) + 1);
+  end;
+
+  function pcx(x: ArbFloat): ArbFloat;
+  begin
+    pcx := 2 * x * sin(x) / sqr(sqr(x) + 1);
+  end;
+
+  function ppcx(x: ArbFloat): ArbFloat;
+  var
+    s: ArbFloat;
+  begin
+    s    := sqr(x);
+    ppcx := cos(x) * (2 - 6 * s) / ((s + 1) * sqr(s + 1));
+  end;
+
+  function cc2(x: ArbFloat): ArbFloat;
+  var
+    x2: ArbFloat;
+  begin
+    x2  := sqr(x);
+    cc2 := cos(x) / (sqr(x2) + x2 + 1);
+  end;
+
+  function ucx(x: ArbFloat): ArbFloat;
+  begin
+    if x = 0 then
+      ucx := 0
+    else
+      ucx := cx((1 - x) / x) / sqr(x);
+  end;
+
+  function ucc2(x: ArbFloat): ArbFloat;
+  begin
+    if x = 0 then
+      ucc2 := 0
+    else
+      ucc2 := cc2((1 - x) / x) / sqr(x);
+  end;
+
+  function uz(x: ArbFloat): ArbFloat;
+  begin
+    uz := sin(x) * exp(-x);
+  end;
+
+  function ss1(x: ArbFloat): ArbFloat;    { f(«n(n-1))=0 (n=1,2,3,...) }
+  var
+    n, s, c: ArbFloat;                    { f(«ný)=2/(ný(n+1))  }
+  begin                                   { overigens: f linear interpoleren}
+    s := sqrt(2 * x);
+    n := trunc(s);
+    if n * (n + 1) / 2 <= x then
+      n := n + 1;  { n z.d.d. «n(n-1) ó x ó «n(n-1) }
+    c := 4 / (n * sqr(n) * (n + 1));
+    if s < n then
+      ss1 := c * (x - n * (n - 1) / 2)
+    else
+      ss1 := c * (n * (n + 1) / 2 - x);
+  end;
+
+  function ss2(x: ArbFloat): ArbFloat;   { als ss1 met f(«ný)=2/(n.2ü)  }
+  var
+    n, s, c: ArbFloat;
+  begin
+    s := sqrt(2 * x);
+    n := trunc(s);
+    if n * (n + 1) / 2 <= x then
+      n := n + 1;
+    c := spepow(2, 2 - n) / sqr(n);
+    if s < n then
+      ss2 := c * (x - n * (n - 1) / 2)
+    else
+      ss2 := c * (n * (n + 1) / 2 - x);
+  end;
+
+  function ss3(x: ArbFloat): ArbFloat;       { x  z.d.d. «.2ü ó x+1 ó 2ü  s=2ü}
+  var
+    s, c, f, x1: ArbFloat;
+    n: ArbInt;        {n even: f(n)=-4/(n.2ü)}
+  begin                                  {n oneven: f(n) = 4/(n.2ü)}
+    n  := 0;
+    s  := 1;
+    x1 := x + 1;               { overigens: f lineair interpol.}
+    repeat
+      n := n + 1;
+      s := s * 2
+    until s > x1;
+    c := 16 / (n * sqr(s));
+    if x1 < 0.75 * s then
+      f := c * (x1 - s / 2)
+    else
+      f := c * (s - x1);
+    if odd(n) then
+      ss3 := f
+    else
+      ss3 := -f;
+  end;
+
+  function ss4(x: ArbFloat): ArbFloat;        { 0 ó x ó 1}
+  var
+    y, h:  ArbFloat;                        { zij x = ä [1:ì] c(n)/3ü c(n)=0,1,2}
+    ready: boolean;                         { zoek kleinste k met c(k)=1}
+  begin                                     { dan geldt f(x)=u(y)/3k }
+    y     := 3 * x;
+    h     := 1 / 3;
+    ready := False;         { met u(y)=|y-1«|, 1 ó y ó 2}
+    repeat                                { en y =  ä [k:ì] (c(n)/3ü)*3k }
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss4   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        if y < 1.5 then
+          ss4 := h * (y - 1)
+        else
+          ss4 := h * (2 - y);
+      end
+    until ready;
+  end;
+
+  function ss5(x: ArbFloat): ArbFloat;   { uitbreiding ss4}
+  var
+    y, h:  ArbFloat;                   {functiewaarden op 'volgend' interval}
+    ready: boolean;                    { [n, n+1] telkens halveren}
+  begin
+    y     := 3 * frac(x);
+    h     := spepow(0.5, trunc(x)) / 3;
+    ready := False;
+    repeat
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss5   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        if y < 1.5 then
+          ss5 := h * (y - 1)
+        else
+          ss5 := h * (2 - y);
+      end
+    until ready;
+  end;
+
+  function ss6(x: ArbFloat): ArbFloat;   { 0 ó x ó 1, 'gladdere' variant van ss4}
+  var
+    y, h:  ArbFloat;
+    ready: boolean;
+
+    function f(y: ArbFloat): ArbFloat; { 1 ó y ó 2, 1 x cont. diff, symm. max in 1.5}
+    begin
+      if y > 1.5 then
+        y := 3 - y;
+      if y < 1.25 then
+        f := sqr(y - 1)
+      else
+        f := 0.125 - sqr(1.5 - y);
+    end;
+
+  begin
+    y     := 3 * x;
+    h     := 1 / 3;
+    ready := False;
+    repeat
+      if (y < 1) or (y > 2) then
+      begin
+        if y < 1 then
+          y := 3 * y
+        else
+          y := 3 * (y - 2);
+        h := h / 3;
+        if h < macheps then
+        begin
+          ready := True;
+          ss6   := 0;
+        end;
+      end
+      else
+      begin
+        ready := True;
+        ss6   := h * f(y);
+      end
+    until ready;
+  end;
+
+  function bb(x: ArbFloat): ArbFloat;
+  begin
+    bb := spepow(x, -x) * (ln(x) + 1);
+  end;
+
+var
+  integral, ae, err: ArbFloat;
+  term:  ArbInt;
+  intex: boolean;
+
+  procedure Header;
+  begin
+    Write('int': num2, '': numdig - num2, ' ', 'err': 7, ' ': 4);
+    if intex then
+      Write('f': 6);
+    writeln;
+  end;
+
+  procedure ShowResults;
+  var
+    f: ArbFloat;
+  begin
+    if intex then
+      f := inte - integral;
+    case term of
+      1:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+      end;
+      2:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        Writeln('    proces afgebroken, te hoge nauwkeurigheid?');
+      end;
+      3: Writeln('Verkeerde parameterwaarde (<=0) bij aanroep: ', ae: 8);
+      4:
+      begin
+        Write(integral: numdig, ' ', err: 10, ' ');
+        if intex then
+          writeln(f: 10)
+        else
+          writeln;
+        writeln('    proces afgebroken, moeilijk, mogelijk divergent?');
+      end;
+    end;
+  end;
+
+begin
+  num2 := numdig div 2;
+
+  Writeln('     ì   ');
+  Writeln('    ô  cos x           ã ');
+  Writeln('    ³ ------- dx   =   -- ');
+  Writeln('  0 õ  xý+ 1           2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  inte  := 0.5 * pi / e;
+  intex := True;
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@cx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  writeln;
+  Writeln('berekend met Int1fr via transformatie x=(1-t)/t');
+  writeln;
+  Int1fr(@ucx, 0, 1, ae, integral, err, term);
+  Header;
+  ShowResults;
+  Writeln('     ì   ');
+  Writeln('    ô  2x sin x           ã ');
+  Writeln('    ³ --------- dx   =    -- ');
+  Writeln('  0 õ  (xý+ 1)ý           2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@pcx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  Writeln('     ì   ');
+  Writeln('    ô (2-6xý)cos x            ã ');
+  Writeln('    ³ ------------ dx   =    -- ');
+  Writeln('  0 õ  (xý+ 1)3             2e ');
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@ppcx, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  Writeln('     ì   ');
+  Writeln('    ô     cos x ');
+  Writeln('    ³ ------------ dx   =  (ã/û3) exp(-«û3) sin(ã/6+«) ');
+  Writeln('  0 õ  (xý)ý+xý+ 1 ');
+  writeln;
+  writeln;
+  ae := 1e-8;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  inte := (pi / sqrt(3)) * exp(-sqrt(0.75)) * sin(pi / 6 + 0.5);
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@cc2, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+  writeln;
+  Writeln('berekend met Int1fr via transformatie x=(1-t)/t');
+  writeln;
+  writeln;
+  writeln(inte: numdig, ' is ''exacte'' oplossing');
+  Int1fr(@ucc2, 0, 1, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  Writeln('     ì   ');
+  Writeln('    ô sin u                ');
+  Writeln('    ³ ------ du   =  « ');
+  Writeln('    õ exp(u)            ');
+  writeln('   0 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 0.5;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@uz, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+
+  writeln(' functie ss1;  int = ä {1:ì}1/n(n+1)  =  1');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss1, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss2;  int = ä {1:ì} («)ü  =  1');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss2, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss3;  int = ä {1:ì} (-1)ü/n  =  ln(2)');
+  ae    := 1e-8;
+  intex := True;
+  inte  := ln(2);
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss3, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss4 (op [0,1]); int = 1/28 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 28;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss4, 0, 1, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss5 (op [0,ì)); int = 1/14 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 14;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss5, 0, infinity, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  writeln(' functie ss6 (op [0,1]); int = 1/112 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1 / 112;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  int1fr(@ss6, 0, 1, ae, integral, err, term);
+  Header;
+  Showresults;
+
+  Writeln('     ì   ');
+  Writeln('    ô  ln(x)+1         ');
+  Writeln('    ³ ---------- dx   = 1  ');
+  Writeln('    õ     xx            ');
+  writeln('   1 ');
+  ae    := 1e-8;
+  intex := True;
+  inte  := 1;
+  Writeln('   Gevraagde nauwkeurigheid', ae: 12);
+  writeln;
+  Int1fr(@bb, 0, infinity, ae, integral, err, term);
+  Header;
+  ShowResults;
+end.

+ 178 - 0
packages/extra/numlib/tests/intge3te.pas

@@ -0,0 +1,178 @@
+program Intge3te;
+
+uses
+  Typ,
+  Int;
+
+const
+  ae: ArbFloat = 1e-5;
+var
+  a, b, integral, err: ArbFloat;
+  i, term, nd: ArbInt;
+
+  function cx(x: ArbFloat): ArbFloat;
+  begin
+    cx := 1 / (sqr(x) + 1);
+  end;
+
+begin
+  nd := numdig div 2;
+  for i := 1 to 11 do
+  begin
+    case i of
+      1:
+      begin
+        a := -infinity;
+        b := 0;
+      end;
+      2:
+      begin
+        a := infinity;
+        b := 0;
+      end;
+      3:
+      begin
+        a := -infinity;
+        b := infinity;
+      end;
+      4:
+      begin
+        a := infinity;
+        b := -infinity;
+      end;
+      5:
+      begin
+        a := 0;
+        b := 1;
+      end;
+      6:
+      begin
+        a := 1;
+        b := 1;
+      end;
+      7:
+      begin
+        a := 1;
+        b := 0;
+      end;
+      8:
+      begin
+        a := infinity;
+        b := infinity;
+      end;
+      9:
+      begin
+        a := 0;
+        b := infinity;
+      end;
+      10:
+      begin
+        a := 0;
+        b := -infinity;
+      end;
+      11:
+      begin
+        a := -infinity;
+        b := -infinity;
+      end;
+    end;
+    Int1fr(@cx, a, b, ae, integral, err, term);
+    if i = 1 then
+    begin
+      writeln(' ae =', ae: numdig);
+      writeln('': nd, 'a', '': numdig, 'b', '': numdig, 'int', '': nd + 3,
+        'err', '': nd - 2, 'term');
+    end;
+    Writeln(a: numdig, ' ', b: numdig, ' ', integral: numdig, '  ',
+      err: 12, '   ', term: 1);
+  end;
+end.
+program Intge3te;
+
+uses
+  Typ,
+  Int;
+
+const
+  ae: ArbFloat = 1e-5;
+var
+  a, b, integral, err: ArbFloat;
+  i, term, nd: ArbInt;
+
+  function cx(x: ArbFloat): ArbFloat;
+  begin
+    cx := 1 / (sqr(x) + 1);
+  end;
+
+begin
+  nd := numdig div 2;
+  for i := 1 to 11 do
+  begin
+    case i of
+      1:
+      begin
+        a := -infinity;
+        b := 0;
+      end;
+      2:
+      begin
+        a := infinity;
+        b := 0;
+      end;
+      3:
+      begin
+        a := -infinity;
+        b := infinity;
+      end;
+      4:
+      begin
+        a := infinity;
+        b := -infinity;
+      end;
+      5:
+      begin
+        a := 0;
+        b := 1;
+      end;
+      6:
+      begin
+        a := 1;
+        b := 1;
+      end;
+      7:
+      begin
+        a := 1;
+        b := 0;
+      end;
+      8:
+      begin
+        a := infinity;
+        b := infinity;
+      end;
+      9:
+      begin
+        a := 0;
+        b := infinity;
+      end;
+      10:
+      begin
+        a := 0;
+        b := -infinity;
+      end;
+      11:
+      begin
+        a := -infinity;
+        b := -infinity;
+      end;
+    end;
+    Int1fr(@cx, a, b, ae, integral, err, term);
+    if i = 1 then
+    begin
+      writeln(' ae =', ae: numdig);
+      writeln('': nd, 'a', '': numdig, 'b', '': numdig, 'int', '': nd + 3,
+        'err', '': nd - 2, 'term');
+    end;
+    Writeln(a: numdig, ' ', b: numdig, ' ', integral: numdig, '  ',
+      err: 12, '   ', term: 1);
+  end;
+end.

+ 33 - 0
packages/extra/numlib/tests/invgente.dat

@@ -0,0 +1,33 @@
+3
+
+-3 -2 4
+
+2 5 3 1
+1 4 4 3
+3 2 5 3
+1 4 2 2
+
+-1 -1 3
+
+1 4 3
+1 1 1
+3 6 5
+
+-1 -1 1
+23
+
+-3 -2 4
+
+2 5 3 1
+1 4 4 3
+3 2 5 3
+1 4 2 2
+
+-1 -1 3
+
+1 4 3
+1 1 1
+3 6 5
+
+-1 -1 1
+2

+ 122 - 0
packages/extra/numlib/tests/invgente.pas

@@ -0,0 +1,122 @@
+program invgente;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgente');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgen(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+program invgente;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgente');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgen(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.

+ 39 - 0
packages/extra/numlib/tests/invgpdte.dat

@@ -0,0 +1,39 @@
+3
+
+-1 -2 5
+1 3 4 2 1
+3 2 1 0 1
+4 1 0 3 2
+2 0 3 1 0
+1 1 2 0 1
+
+-1 -1 4
+2 1 1 2
+1 3 2 1
+1 2 2 1
+2 1 1 3
+
+-2 -1 1
+5
+
+
+3
+
+-1 -2 5
+1 3 4 2 1
+3 2 1 0 1
+4 1 0 3 2
+2 0 3 1 0
+1 1 2 0 1
+
+-1 -1 4
+2 1 1 2
+1 3 2 1
+1 2 2 1
+2 1 1 3
+
+-2 -1 1
+5
+
+
+

+ 122 - 0
packages/extra/numlib/tests/invgpdte.pas

@@ -0,0 +1,122 @@
+program invgpdte;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgpdte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgpd(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+program invgpdte;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgpdte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgpd(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.

+ 31 - 0
packages/extra/numlib/tests/invgsyte.dat

@@ -0,0 +1,31 @@
+3
+
+-1 -1 4
+
+3 1 2 4
+1 1 3 2
+2 3 2 5
+4 2 5 3
+
+-3 -2 3
+1 2 3
+2 4 6
+3 6 7
+
+0 0 1
+43
+
+-1 -1 4
+
+3 1 2 4
+1 1 3 2
+2 3 2 5
+4 2 5 3
+
+-3 -2 3
+1 2 3
+2 4 6
+3 6 7
+
+0 0 1
+4

+ 122 - 0
packages/extra/numlib/tests/invgsyte.pas

@@ -0,0 +1,122 @@
+program invgsyte;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgsyte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgsy(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.
+program invgsyte;
+
+uses
+  typ,
+  iom,
+  inv;
+
+const
+  m1 = -10;
+  m2 = 10;
+  n1 = -5;
+  n2 = 10;
+var
+  t, aantal, kk, ii, jj, k, j, n, term: ArbInt;
+  s: ArbFloat;
+  u, h, a: array[m1..m2, n1..n2] of ArbFloat;
+begin
+  Write(' program results invgsyte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(aantal);
+  writeln;
+  writeln(' number of examples:', aantal: 3);
+  for t := 1 to aantal do
+  begin
+    writeln;
+    writeln('       example nr ', t: 3);
+    Read(k, j, n);
+    iomrem(input, a[k, j], n, n, n2 - n1 + 1);
+    writeln;
+    writeln('a =');
+    iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+    for ii := 1 to n do
+      for jj := 1 to n do
+        h[k - 1 + ii, j - 1 + jj] := a[k - 1 + ii, j - 1 + jj];
+    invgsy(n, n2 - n1 + 1, a[k, j], term);
+    writeln;
+    writeln('term=', term: 2);
+    if term = 1 then
+    begin
+      writeln('inv(a)=');
+      iomwrm(output, a[k, j], n, n, n2 - n1 + 1, numdig);
+      for ii := 1 to n do
+        for jj := 1 to n do
+        begin
+          s := 0;
+          for kk := 1 to n do
+            s := s + h[k - 1 + ii, j - 1 + kk] * a[k - 1 + kk, j - 1 + jj];
+          u[ii, jj] := s;
+        end; {ii,jj}
+      writeln;
+      writeln('a x inv(a) =');
+      iomwrm(output, u[1, 1], n, n, n2 - n1 + 1, numdig);
+    end; {term=1}
+  end; {t}
+  Close(input);
+  Close(output);
+end.

+ 86 - 0
packages/extra/numlib/tests/iomwrmte.pas

@@ -0,0 +1,86 @@
+program iomwrmte;
+
+uses
+  typ,
+  iom;
+
+const
+  n1 = -5;
+  n2 = 10;
+  m1 = -3;
+  m2 = 20;
+  r  = m2 - m1 + 1;
+  p  = 3;
+  q  = 2;
+  n  = 7;
+  m  = 15;
+
+var
+  i, j, f, s: ArbInt;
+  a: array[n1..n2, m1..m2] of ArbFloat;
+begin
+  Assign(output, ParamStr(2));
+  rewrite(output);
+
+  Write(output, ' program results iomwrmte');
+  s := sizeof(ArbFloat);
+  case s of
+    4: writeln(output, '(single)');
+    6: writeln(output, '(real)');
+    8: writeln(output, '(double)')
+  end;
+  writeln(output);
+  for i := 1 to n do
+    for j := 1 to m do
+      a[i + p - 1, j + q - 1] := i + j * 1e-3;
+  for f := minform to maxform do
+  begin
+    writeln(output, 'A = (form=', f: 2, ')');
+    iomwrm(output, a[p, q], n, m, r, f);
+    writeln(output);
+  end;
+  Close(output);
+end.
+program iomwrmte;
+
+uses
+  typ,
+  iom;
+
+const
+  n1 = -5;
+  n2 = 10;
+  m1 = -3;
+  m2 = 20;
+  r  = m2 - m1 + 1;
+  p  = 3;
+  q  = 2;
+  n  = 7;
+  m  = 15;
+
+var
+  i, j, f, s: ArbInt;
+  a: array[n1..n2, m1..m2] of ArbFloat;
+begin
+  Assign(output, ParamStr(2));
+  rewrite(output);
+
+  Write(output, ' program results iomwrmte');
+  s := sizeof(ArbFloat);
+  case s of
+    4: writeln(output, '(single)');
+    6: writeln(output, '(real)');
+    8: writeln(output, '(double)')
+  end;
+  writeln(output);
+  for i := 1 to n do
+    for j := 1 to m do
+      a[i + p - 1, j + q - 1] := i + j * 1e-3;
+  for f := minform to maxform do
+  begin
+    writeln(output, 'A = (form=', f: 2, ')');
+    iomwrm(output, a[p, q], n, m, r, f);
+    writeln(output);
+  end;
+  Close(output);
+end.

+ 25 - 0
packages/extra/numlib/tests/odeiv1te.dat

@@ -0,0 +1,25 @@
+6
+0 0.2 0 1e-4
+
+0 0.2 0 1e-8
+
+0 0.2 0 1e-10
+
+0 -0.2 0 1e-4
+
+0 -0.2 0 1e-8
+
+0 -0.2 0 1e-10
+6
+0 0.2 0 1e-4
+
+0 0.2 0 1e-8
+
+0 0.2 0 1e-10
+
+0 -0.2 0 1e-4
+
+0 -0.2 0 1e-8
+
+0 -0.2 0 1e-10
+

+ 182 - 0
packages/extra/numlib/tests/odeiv1te.pas

@@ -0,0 +1,182 @@
+program odeiv1te;
+
+uses
+  typ,
+  ode;
+
+var
+  ex, nv, i, term:     ArbInt;
+  a, b, d, ya, yb, ae: ArbFloat;
+
+  function f(x, y: ArbFloat): ArbFloat;
+  begin
+    f := -10 * (y - sqr(x));
+  end; {f}
+
+  function g(x, y: ArbFloat): ArbFloat;
+  begin
+    g := -100 * (y - sin(x)) + cos(x);
+  end; {g}
+
+  function h(x, y: ArbFloat): ArbFloat;
+  begin
+    h := 15 * y;
+  end; {h}
+
+  function phi(x: ArbFloat): ArbFloat;
+  begin
+    phi := -exp(-10 * x) * 0.02 + sqr(x) - x * 0.2 + 0.02;
+  end; {phi}
+
+begin
+  Write(' program results odeiv1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nv);
+  writeln('program results odeiv1te');
+  writeln;
+  writeln('   number of examples: ', nv: 2);
+  for ex := 1 to nv do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(a, b, ya, ae);
+    d := b - a;
+    writeln('a': 3, 'b': 5, 'yb': 12, 'phi(b)': 20, 'ae': 10, 'term': 9);
+    for i := 1 to 5 do
+    begin
+      odeiv1(@f, a, ya, b, yb, ae, term);
+      writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', phi(b): numdig, ae: 9, term: 3);
+      a  := b;
+      ya := yb;
+      b  := b + d;
+    end; {i}
+    writeln(' -------------------------------------------------');
+  end; {ex}
+  a  := 0;
+  ya := 1;
+  b  := 1;
+  ae := 1e-6;
+  odeiv1(@g, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb - sin(1): numdig, ' ', ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := 1;
+  ae := 1e-4;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := 1;
+  ae := 1e-6;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := a;
+  ae := 1e-6;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := a;
+  ae := 0;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  Close(input);
+  Close(output);
+end.
+program odeiv1te;
+
+uses
+  typ,
+  ode;
+
+var
+  ex, nv, i, term:     ArbInt;
+  a, b, d, ya, yb, ae: ArbFloat;
+
+  function f(x, y: ArbFloat): ArbFloat;
+  begin
+    f := -10 * (y - sqr(x));
+  end; {f}
+
+  function g(x, y: ArbFloat): ArbFloat;
+  begin
+    g := -100 * (y - sin(x)) + cos(x);
+  end; {g}
+
+  function h(x, y: ArbFloat): ArbFloat;
+  begin
+    h := 15 * y;
+  end; {h}
+
+  function phi(x: ArbFloat): ArbFloat;
+  begin
+    phi := -exp(-10 * x) * 0.02 + sqr(x) - x * 0.2 + 0.02;
+  end; {phi}
+
+begin
+  Write(' program results odeiv1te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nv);
+  writeln('program results odeiv1te');
+  writeln;
+  writeln('   number of examples: ', nv: 2);
+  for ex := 1 to nv do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(a, b, ya, ae);
+    d := b - a;
+    writeln('a': 3, 'b': 5, 'yb': 12, 'phi(b)': 20, 'ae': 10, 'term': 9);
+    for i := 1 to 5 do
+    begin
+      odeiv1(@f, a, ya, b, yb, ae, term);
+      writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', phi(b): numdig, ae: 9, term: 3);
+      a  := b;
+      ya := yb;
+      b  := b + d;
+    end; {i}
+    writeln(' -------------------------------------------------');
+  end; {ex}
+  a  := 0;
+  ya := 1;
+  b  := 1;
+  ae := 1e-6;
+  odeiv1(@g, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb - sin(1): numdig, ' ', ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := 1;
+  ae := 1e-4;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := 1;
+  ae := 1e-6;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := a;
+  ae := 1e-6;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  a  := 0;
+  ya := 1e-3;
+  b  := a;
+  ae := 0;
+  odeiv1(@h, a, ya, b, yb, ae, term);
+  writeln(a: 5: 2, b: 5: 2, ' ', yb: numdig, ' ', 1e-3 * exp(15): numdig, ae: 9, term: 3);
+  Close(input);
+  Close(output);
+end.

+ 27 - 0
packages/extra/numlib/tests/odeiv2te.dat

@@ -0,0 +1,27 @@
+6
+0 0.2 0 1 1e-4
+
+0 0.2 0 1 1e-8
+
+0 0.2 0 1 1e-12
+
+0 -0.2 0 1 1e-4
+
+0 -0.2 0 1 1e-8
+
+0 -0.2 0 1 1e-12
+
+6
+0 0.2 0 1 1e-4
+
+0 0.2 0 1 1e-8
+
+0 0.2 0 1 1e-12
+
+0 -0.2 0 1 1e-4
+
+0 -0.2 0 1 1e-8
+
+0 -0.2 0 1 1e-12
+
+

+ 152 - 0
packages/extra/numlib/tests/odeiv2te.pas

@@ -0,0 +1,152 @@
+program odeiv2te;
+
+uses
+  typ,
+  ode;
+
+const
+  n1 = 3;
+  n2 = 4;
+  n3 = 6;
+  n  = n2 - n1 + 1;
+  n4 = n3 + n - 1;
+var
+  ex, nv, i, j, k, h, term: ArbInt;
+  a, b, d, ae: ArbFloat;
+  ya: array[n1..n2] of ArbFloat;
+  yb: array[n3..n4] of ArbFloat;
+
+  procedure f(x: ArbFloat; var y, y1: ArbFloat);
+  var
+    yloc:  array[1..n] of ArbFloat absolute y;
+    y1loc: array[1..n] of ArbFloat absolute y1;
+  begin
+    y1loc[1] := 2 * x * yloc[1] + yloc[2];
+    y1loc[2] := -yloc[1] + 2 * x * yloc[2];
+  end; {f}
+
+  function phi1(x: ArbFloat): ArbFloat;
+  begin
+    phi1 := exp(x * x) * sin(x);
+  end; {phi1}
+
+  function phi2(x: ArbFloat): ArbFloat;
+  begin
+    phi2 := exp(x * x) * cos(x);
+  end; {phi2}
+
+begin
+  Write(' program results odeiv2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nv);
+  writeln;
+  writeln('   number of examples: ', nv: 2);
+  k := numdig;
+  h := k div 2;
+  for ex := 1 to nv do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(a, b);
+    for j := n1 to n2 do
+      Read(ya[j]);
+    Read(ae);
+    d := b - a;
+    writeln;
+    writeln(' ae =', ae: 10);
+    writeln;
+    writeln('b': 3, 'yb1': h + 4, 'yb2': k, 'phi1(x)': k + 3, 'phi2(x)': k - 2, 'term': h + 2);
+    for i := 1 to 5 do
+    begin
+      odeiv2(@f, a, ya[n1], b, yb[n3], n, ae, term);
+      writeln(b: 5: 2, yb[n3]: k, yb[n3 + 1]: k, phi1(b): k, phi2(b): k, term: 3);
+      a := b;
+      for j := n1 to n2 do
+        ya[j] := yb[n3 - n1 + j];
+      b := b + d;
+    end; {i}
+    writeln(' -------------------------------------------------');
+  end; {ex}
+  Close(input);
+  Close(output);
+end.
+program odeiv2te;
+
+uses
+  typ,
+  ode;
+
+const
+  n1 = 3;
+  n2 = 4;
+  n3 = 6;
+  n  = n2 - n1 + 1;
+  n4 = n3 + n - 1;
+var
+  ex, nv, i, j, k, h, term: ArbInt;
+  a, b, d, ae: ArbFloat;
+  ya: array[n1..n2] of ArbFloat;
+  yb: array[n3..n4] of ArbFloat;
+
+  procedure f(x: ArbFloat; var y, y1: ArbFloat);
+  var
+    yloc:  array[1..n] of ArbFloat absolute y;
+    y1loc: array[1..n] of ArbFloat absolute y1;
+  begin
+    y1loc[1] := 2 * x * yloc[1] + yloc[2];
+    y1loc[2] := -yloc[1] + 2 * x * yloc[2];
+  end; {f}
+
+  function phi1(x: ArbFloat): ArbFloat;
+  begin
+    phi1 := exp(x * x) * sin(x);
+  end; {phi1}
+
+  function phi2(x: ArbFloat): ArbFloat;
+  begin
+    phi2 := exp(x * x) * cos(x);
+  end; {phi2}
+
+begin
+  Write(' program results odeiv2te');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  Read(nv);
+  writeln;
+  writeln('   number of examples: ', nv: 2);
+  k := numdig;
+  h := k div 2;
+  for ex := 1 to nv do
+  begin
+    writeln;
+    writeln('  example number :', ex: 2);
+    Read(a, b);
+    for j := n1 to n2 do
+      Read(ya[j]);
+    Read(ae);
+    d := b - a;
+    writeln;
+    writeln(' ae =', ae: 10);
+    writeln;
+    writeln('b': 3, 'yb1': h + 4, 'yb2': k, 'phi1(x)': k + 3, 'phi2(x)': k - 2, 'term': h + 2);
+    for i := 1 to 5 do
+    begin
+      odeiv2(@f, a, ya[n1], b, yb[n3], n, ae, term);
+      writeln(b: 5: 2, yb[n3]: k, yb[n3 + 1]: k, phi1(b): k, phi2(b): k, term: 3);
+      a := b;
+      for j := n1 to n2 do
+        ya[j] := yb[n3 - n1 + j];
+      b := b + d;
+    end; {i}
+    writeln(' -------------------------------------------------');
+  end; {ex}
+  Close(input);
+  Close(output);
+end.

+ 46 - 0
packages/extra/numlib/tests/roof1rte.dat

@@ -0,0 +1,46 @@
+4
+0 1.5 1e-4 1e-4
+0 1.5 1e-8 1e-8
+0 1.5 0      0
+0 0.5 1e-8 1e-8
+5
+0 2 1e-4 1e-4
+0 2 1e-8 1e-8
+0 2  0      0
+2 4 1e-6 1e-6
+0 4 1e-6 1e-6
+6
+0   1.5 1e-4 1e-4
+0.1 0.5 1e-6 1e-6
+0.5 1.5 1e-6 1e-6
+0.5 1.5 1e-8 1e-8
+1.0 1.5 1e-8 1e-8
+1.5 2.5 1e-6 1e-6
+4
+0 1.5 1e-4 1e-4
+0 1.5 1e-8 1e-8
+0 1.5 0      0
+0 0.5 1e-8 1e-8
+4
+0 1.5 1e-4 1e-4
+0 1.5 1e-8 1e-8
+0 1.5 0      0
+0 0.5 1e-8 1e-8
+5
+0 2 1e-4 1e-4
+0 2 1e-8 1e-8
+0 2  0      0
+2 4 1e-6 1e-6
+0 4 1e-6 1e-6
+6
+0   1.5 1e-4 1e-4
+0.1 0.5 1e-6 1e-6
+0.5 1.5 1e-6 1e-6
+0.5 1.5 1e-8 1e-8
+1.0 1.5 1e-8 1e-8
+1.5 2.5 1e-6 1e-6
+4
+0 1.5 1e-4 1e-4
+0 1.5 1e-8 1e-8
+0 1.5 0      0
+0 0.5 1e-8 1e-8

+ 126 - 0
packages/extra/numlib/tests/roof1rte.pas

@@ -0,0 +1,126 @@
+program roof1rte;
+
+uses
+  typ,
+  spe,
+  roo;
+
+const
+  num = 4;
+var
+  term, i, j, n, p: ArbInt;
+  a, b, ae, re, x:  ArbFloat;
+
+  function f(x: ArbFloat): ArbFloat;
+  begin
+    case i of
+      1: f := spepow(x - 1, 3);
+      2: f := cos(x);
+      3: f := sin(x) - x / 2;
+      4: f := exp(x) - sqr(sqr(x))
+    end;
+  end;
+
+begin
+  Write(' program results roof1rte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  writeln;
+  writeln(' number of examples:', num: 3);
+  writeln;
+  if sizeof(ArbFloat) = 6 then
+    p := 8
+  else
+    p := 10;
+  writeln(' ': 2, 'a', ' ': 5, 'b', ' ': 5, 'ae', ' ': p, 're',
+    ' ': p - 2, 'term', ' ': 2, 'root', ' ': numdig - 2, 'f(root)');
+  for i := 1 to num do
+  begin
+    Write('Locating the root of the equation ');
+    case i of
+      1: writeln('(x-1)**3 = 0');
+      2: writeln('cos(x) = 0');
+      3: writeln('sin(x) = x/2');
+      4: writeln('exp(x)=x**4');
+    end;
+    Read(n);
+    for j := 1 to n do
+    begin
+      Read(a, b, ae, re);
+      roof1r(@f, a, b, ae, re, x, term);
+      Write(a: 4: 1, ' ': 2, b: 4: 1, ' ': 2, ae: p, ' ': 2, re: p, ' ': 2, term: 1);
+      if term < 3 then
+        writeln(' ': 2, x: numdig, ' ': 2, f(x): numdig)
+      else
+        writeln;
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.
+program roof1rte;
+
+uses
+  typ,
+  spe,
+  roo;
+
+const
+  num = 4;
+var
+  term, i, j, n, p: ArbInt;
+  a, b, ae, re, x:  ArbFloat;
+
+  function f(x: ArbFloat): ArbFloat;
+  begin
+    case i of
+      1: f := spepow(x - 1, 3);
+      2: f := cos(x);
+      3: f := sin(x) - x / 2;
+      4: f := exp(x) - sqr(sqr(x))
+    end;
+  end;
+
+begin
+  Write(' program results roof1rte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  writeln;
+  writeln(' number of examples:', num: 3);
+  writeln;
+  if sizeof(ArbFloat) = 6 then
+    p := 8
+  else
+    p := 10;
+  writeln(' ': 2, 'a', ' ': 5, 'b', ' ': 5, 'ae', ' ': p, 're',
+    ' ': p - 2, 'term', ' ': 2, 'root', ' ': numdig - 2, 'f(root)');
+  for i := 1 to num do
+  begin
+    Write('Locating the root of the equation ');
+    case i of
+      1: writeln('(x-1)**3 = 0');
+      2: writeln('cos(x) = 0');
+      3: writeln('sin(x) = x/2');
+      4: writeln('exp(x)=x**4');
+    end;
+    Read(n);
+    for j := 1 to n do
+    begin
+      Read(a, b, ae, re);
+      roof1r(@f, a, b, ae, re, x, term);
+      Write(a: 4: 1, ' ': 2, b: 4: 1, ' ': 2, ae: p, ' ': 2, re: p, ' ': 2, term: 1);
+      if term < 3 then
+        writeln(' ': 2, x: numdig, ' ': 2, f(x): numdig)
+      else
+        writeln;
+    end;
+  end;
+  Close(input);
+  Close(output);
+end.

+ 460 - 0
packages/extra/numlib/tests/roofnrt1.pas

@@ -0,0 +1,460 @@
+program Roofnrte;
+
+uses
+  typ,
+  roo;
+
+type
+  maxarray = array[1..128] of ArbFloat;
+var
+  n: ArbInt;
+  a: ArbFloat;
+  ah2: ArbFloat;
+
+  procedure PraktikumEx(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: maxarray absolute x;
+    floc: maxarray absolute fx;
+    i:    ArbInt;
+  begin
+    floc[1] := 2 * (xloc[1] - xloc[2]) - ah2 * exp(xloc[1]);
+    for i := 2 to n - 1 do
+      floc[i] := -xloc[i - 1] + 2 * xloc[i] - xloc[i + 1] - ah2 * exp(xloc[i]);
+    floc[n] := -xloc[n - 1] + 2 * xloc[n] - ah2 * exp(xloc[n]);
+  end;
+
+const
+  m = 9;
+
+  procedure NagExample(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..m] of ArbFloat absolute x;
+    floc: array[1..m] of ArbFloat absolute fx;
+    k:    ArbInt;
+  begin
+    floc[1] := 1 + (3 - 2 * xloc[1]) * xloc[1] - 2 * xloc[2];
+    for k := 2 to m - 1 do
+      floc[k] := 1 + (3 - 2 * xloc[k]) * xloc[k] - xloc[k - 1] - 2 * xloc[k + 1];
+    floc[m] := 1 + (3 - 2 * xloc[m]) * xloc[m] - xloc[m - 1];
+  end;
+
+  procedure MatlabEx(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..3] of ArbFloat absolute x;
+    floc: array[1..3] of ArbFloat absolute fx;
+  begin
+    floc[1] := sin(xloc[1]) + sqr(xloc[2]) + ln(xloc[3]) - 7;
+    floc[2] := 3 * xloc[1] + exp(xloc[2] * ln(2)) - xloc[3] * sqr(xloc[3]) + 1;
+    floc[3] := xloc[1] + xloc[2] + xloc[3] - 5;
+  end;
+
+  procedure TPNumlibEx(var x, fx: ArbFloat; var deff: boolean);
+  begin
+    fx := cos(x);
+  end;
+
+  procedure JdeJongEx(var x, fx: ArbFloat; var deff: boolean);
+  begin
+    if (x >= 0) and (x <= 1) then
+      fx   := x - 2
+    else
+      deff := False;
+  end;
+
+  procedure Uitvoer(var x1: ArbFloat; n, step: ArbInt);
+  var
+    i:    ArbInt;
+    xloc: maxarray absolute x1;
+  begin
+    i := 1;
+    while (i <= n) do
+    begin
+      writeln(i: 5, ' ', xloc[i]: 20);
+      Inc(i, step);
+    end;
+    writeln;
+  end;
+
+var
+  x: ^maxarray;
+  t, residu: ArbFloat;
+  i, term: ArbInt;
+begin
+
+  { praktikum sommetje }
+
+  n := 8;
+  a := 0.50;
+  repeat
+    ah2 := a / sqr(n);
+    GetMem(x, n * SizeOf(ArbFloat));
+
+    for i := 1 to n do
+      x^[i] := 0;
+
+    writeln('Voorbeeld programma ''praktikum'',  resultaten voor n= ', n: 2);
+    writeln;
+
+    roofnr(@PraktikumEx, n, x^[1], residu, 1e-4, term);
+    if term = 1 then
+      writeln('    Norm van de residuen', residu: 20, #13#10,
+        '    Berekende oplossing')
+    else
+      writeln('  Proces afgebroken term = ', term, #13#10,
+        '  Laatst berekende waarden');
+    writeln;
+    Uitvoer(x^[1], n, n div 8);
+    FreeMem(x, n * SizeOf(ArbFloat));
+    n := n * 2
+  until n = 128;
+
+  { Nag procedure bibliotheek voorbeeld }
+
+  GetMem(x, m * SizeOf(ArbFloat));
+
+  for i := 1 to m do
+    x^[i] := -1;
+
+  writeln('Voorbeeld programma ''NAG-bibliotheek'' met m= ', m: 2);
+  writeln;
+
+  roofnr(@NagExample, m, x^[1], residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], m, 1);
+  FreeMem(x, m * SizeOf(ArbFloat));
+
+  { Matlab voorbeeld uit handleiding }
+
+  n := 3;
+
+  GetMem(x, n * SizeOf(ArbFloat));
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+  FreeMem(x, n * SizeOf(ArbFloat));
+
+  { 1-dimensionaal voorbeeld uit TPNumlib }
+
+  writeln('Voorbeeld programma ''TPNumlib'' voor ‚‚n dimensie');
+  writeln;
+
+  t := 1;
+  roofnr(@TPNumlibEx, 1, t, residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Writeln('   ', t: 20);
+
+  { Matlab voorbeeld uit handleiding }
+  { dit moet fout gaan               }
+
+  n := 3;
+
+  GetMem(x, n * SizeOf(ArbFloat));
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  writeln;
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln('Gaat niet goed want de relatieve fout is gelijk aan 0 gekozen');
+  writeln;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 0, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+
+  writeln;
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln;
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 1e-8, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+  FreeMem(x, n * SizeOf(ArbFloat));
+
+  { 1-dimensionaal voorbeeld voor deff }
+
+  writeln('Voorbeeld programma in ‚‚n dimensie, voor domein [0..1]');
+  writeln;
+
+  t := 0.5;
+  roofnr(@JdeJongEx, 1, t, residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Writeln('   ', t: 20);
+
+end.
+program Roofnrte;
+
+uses
+  typ,
+  roo;
+
+type
+  maxarray = array[1..128] of ArbFloat;
+var
+  n: ArbInt;
+  a: ArbFloat;
+  ah2: ArbFloat;
+
+  procedure PraktikumEx(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: maxarray absolute x;
+    floc: maxarray absolute fx;
+    i:    ArbInt;
+  begin
+    floc[1] := 2 * (xloc[1] - xloc[2]) - ah2 * exp(xloc[1]);
+    for i := 2 to n - 1 do
+      floc[i] := -xloc[i - 1] + 2 * xloc[i] - xloc[i + 1] - ah2 * exp(xloc[i]);
+    floc[n] := -xloc[n - 1] + 2 * xloc[n] - ah2 * exp(xloc[n]);
+  end;
+
+const
+  m = 9;
+
+  procedure NagExample(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..m] of ArbFloat absolute x;
+    floc: array[1..m] of ArbFloat absolute fx;
+    k:    ArbInt;
+  begin
+    floc[1] := 1 + (3 - 2 * xloc[1]) * xloc[1] - 2 * xloc[2];
+    for k := 2 to m - 1 do
+      floc[k] := 1 + (3 - 2 * xloc[k]) * xloc[k] - xloc[k - 1] - 2 * xloc[k + 1];
+    floc[m] := 1 + (3 - 2 * xloc[m]) * xloc[m] - xloc[m - 1];
+  end;
+
+  procedure MatlabEx(var x, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..3] of ArbFloat absolute x;
+    floc: array[1..3] of ArbFloat absolute fx;
+  begin
+    floc[1] := sin(xloc[1]) + sqr(xloc[2]) + ln(xloc[3]) - 7;
+    floc[2] := 3 * xloc[1] + exp(xloc[2] * ln(2)) - xloc[3] * sqr(xloc[3]) + 1;
+    floc[3] := xloc[1] + xloc[2] + xloc[3] - 5;
+  end;
+
+  procedure TPNumlibEx(var x, fx: ArbFloat; var deff: boolean);
+  begin
+    fx := cos(x);
+  end;
+
+  procedure JdeJongEx(var x, fx: ArbFloat; var deff: boolean);
+  begin
+    if (x >= 0) and (x <= 1) then
+      fx   := x - 2
+    else
+      deff := False;
+  end;
+
+  procedure Uitvoer(var x1: ArbFloat; n, step: ArbInt);
+  var
+    i:    ArbInt;
+    xloc: maxarray absolute x1;
+  begin
+    i := 1;
+    while (i <= n) do
+    begin
+      writeln(i: 5, ' ', xloc[i]: 20);
+      Inc(i, step);
+    end;
+    writeln;
+  end;
+
+var
+  x: ^maxarray;
+  t, residu: ArbFloat;
+  i, term: ArbInt;
+begin
+
+  { praktikum sommetje }
+
+  n := 8;
+  a := 0.50;
+  repeat
+    ah2 := a / sqr(n);
+    GetMem(x, n * SizeOf(ArbFloat));
+
+    for i := 1 to n do
+      x^[i] := 0;
+
+    writeln('Voorbeeld programma ''praktikum'',  resultaten voor n= ', n: 2);
+    writeln;
+
+    roofnr(@PraktikumEx, n, x^[1], residu, 1e-4, term);
+    if term = 1 then
+      writeln('    Norm van de residuen', residu: 20, #13#10,
+        '    Berekende oplossing')
+    else
+      writeln('  Proces afgebroken term = ', term, #13#10,
+        '  Laatst berekende waarden');
+    writeln;
+    Uitvoer(x^[1], n, n div 8);
+    FreeMem(x, n * SizeOf(ArbFloat));
+    n := n * 2
+  until n = 128;
+
+  { Nag procedure bibliotheek voorbeeld }
+
+  GetMem(x, m * SizeOf(ArbFloat));
+
+  for i := 1 to m do
+    x^[i] := -1;
+
+  writeln('Voorbeeld programma ''NAG-bibliotheek'' met m= ', m: 2);
+  writeln;
+
+  roofnr(@NagExample, m, x^[1], residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], m, 1);
+  FreeMem(x, m * SizeOf(ArbFloat));
+
+  { Matlab voorbeeld uit handleiding }
+
+  n := 3;
+
+  GetMem(x, n * SizeOf(ArbFloat));
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+  FreeMem(x, n * SizeOf(ArbFloat));
+
+  { 1-dimensionaal voorbeeld uit TPNumlib }
+
+  writeln('Voorbeeld programma ''TPNumlib'' voor ‚‚n dimensie');
+  writeln;
+
+  t := 1;
+  roofnr(@TPNumlibEx, 1, t, residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Writeln('   ', t: 20);
+
+  { Matlab voorbeeld uit handleiding }
+  { dit moet fout gaan               }
+
+  n := 3;
+
+  GetMem(x, n * SizeOf(ArbFloat));
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  writeln;
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln('Gaat niet goed want de relatieve fout is gelijk aan 0 gekozen');
+  writeln;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 0, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+
+  writeln;
+  writeln('Voorbeeld programma ''MATLAB handleiding'',  resultaten voor n= ', n: 2);
+  writeln;
+
+  for i := 1 to n do
+    x^[i] := 1;
+
+  roofnr(@MatlabEx, n, x^[1], residu, 1e-8, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Uitvoer(x^[1], n, 1);
+  FreeMem(x, n * SizeOf(ArbFloat));
+
+  { 1-dimensionaal voorbeeld voor deff }
+
+  writeln('Voorbeeld programma in ‚‚n dimensie, voor domein [0..1]');
+  writeln;
+
+  t := 0.5;
+  roofnr(@JdeJongEx, 1, t, residu, 1e-6, term);
+  if term = 1 then
+    writeln('    Norm van de residuen', residu: 20, #13#10,
+      '    Berekende oplossing')
+  else
+    writeln('  Proces afgebroken term = ', term, #13#10,
+      '  Laatst berekende waarden');
+  writeln;
+  Writeln('   ', t: 20);
+
+end.

+ 46 - 0
packages/extra/numlib/tests/roofnrte.dat

@@ -0,0 +1,46 @@
+6
+1 -1 1e-6
+2 -2  0
+1  0 1e-6
+-0.5 0.5 0
+-2 1 1e-6
+-4 0 1e-6
+8
+0 0 0  1e-6
+0 0 0  0
+0 1 1  1e-6
+0 1 1  0
+1 0 0  1e-6
+2 2 2  1e-6
+8 8 8  1e-6
+2 8 4  1e-6
+6
+1 1 1e-6
+3 1 1e-6
+1 3 1e-6
+2 2 1e-6
+4 8 1e-6
+6 1 1e-6
+6
+1 -1 1e-6
+2 -2  0
+1  0 1e-6
+-0.5 0.5 0
+-2 1 1e-6
+-4 0 1e-6
+8
+0 0 0  1e-6
+0 0 0  0
+0 1 1  1e-6
+0 1 1  0
+1 0 0  1e-6
+2 2 2  1e-6
+8 8 8  1e-6
+2 8 4  1e-6
+6
+1 1 1e-6
+3 1 1e-6
+1 3 1e-6
+2 2 1e-6
+4 8 1e-6
+6 1 1e-6

+ 226 - 0
packages/extra/numlib/tests/roofnrte.pas

@@ -0,0 +1,226 @@
+program roofnrte;
+
+uses
+  typ,
+  spe,
+  roo;
+
+const
+  num  = 3;
+  nmax = 3;
+var
+  term, i, j, k, l, n: ArbInt;
+  re, residu: ArbFloat;
+  x: array[1..nmax] of ArbFloat;
+
+  procedure f(var x0, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..nmax] of ArbFloat absolute x0;
+    f:    array[1..nmax] of ArbFloat absolute fx;
+    x, y, z: ArbFloat;
+  begin
+    x := xloc[1];
+    y := xloc[2];
+    if n = 3 then
+      z := xloc[3];
+    case i of
+      1:
+      begin
+        if j * 2 <= k then
+          deff := x >= 0
+        else
+          deff := y >= 0;
+        f[1] := x * x - y * y - 2;
+        f[2] := x + y - 1;
+      end;
+      2:
+      begin
+        f[1] := exp(x) + exp(y) - exp(z);
+        f[2] := sin(x) + cos(y) - z;
+        f[3] := x * y - sqr(z);
+      end;
+      3: if (x > 0) and (y > 0) then
+        begin
+          f[1] := spepow(x, y) - spepow(y, x);
+          f[2] := sin(x) - cos(y);
+        end
+        else
+          deff := False
+    end;
+  end;
+
+begin
+  Write(' program results roofnrte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  writeln;
+  writeln(' number of examples:', num: 3);
+  for i := 1 to num do
+  begin
+    writeln;
+    writeln('Locating the root of the equations ');
+    case i of
+      1:
+      begin
+        n := 2;
+        writeln('x + y = 1');
+        writeln('xý + yý = 2');
+      end;
+      2:
+      begin
+        n := 3;
+        writeln('exp(x) + exp(y) = exp(z)');
+        writeln('sin(x) + cos(y) = z');
+        writeln('xy = zý');
+      end;
+      3:
+      begin
+        n := 2;
+        writeln('xy = yx');
+        writeln('sin(x) = cos(y)');
+      end
+    end;
+    Read(k);
+    for j := 1 to k do
+    begin
+      for l := 1 to n do
+        Read(x[l]);
+      Read(re);
+      writeln(' starting values: (n=', n: 1, ')');
+      for l := 1 to n do
+        Write(x[l]: numdig, ' ');
+      writeln(' re =', re: 8);
+      roofnr(@f, n, x[1], residu, re, term);
+      writeln;
+      writeln(' term =', term: 2);
+      if term < 3 then
+      begin
+        writeln(' solution vector');
+        for l := 1 to n do
+          Write(x[l]: numdig, ' ');
+        writeln;
+        writeln(' residu = ', residu: 8);
+      end;
+      writeln('-------------------------------------------------');
+    end;
+    writeln('======================================================');
+  end;
+  Close(input);
+  Close(output);
+end.
+program roofnrte;
+
+uses
+  typ,
+  spe,
+  roo;
+
+const
+  num  = 3;
+  nmax = 3;
+var
+  term, i, j, k, l, n: ArbInt;
+  re, residu: ArbFloat;
+  x: array[1..nmax] of ArbFloat;
+
+  procedure f(var x0, fx: ArbFloat; var deff: boolean);
+  var
+    xloc: array[1..nmax] of ArbFloat absolute x0;
+    f:    array[1..nmax] of ArbFloat absolute fx;
+    x, y, z: ArbFloat;
+  begin
+    x := xloc[1];
+    y := xloc[2];
+    if n = 3 then
+      z := xloc[3];
+    case i of
+      1:
+      begin
+        if j * 2 <= k then
+          deff := x >= 0
+        else
+          deff := y >= 0;
+        f[1] := x * x - y * y - 2;
+        f[2] := x + y - 1;
+      end;
+      2:
+      begin
+        f[1] := exp(x) + exp(y) - exp(z);
+        f[2] := sin(x) + cos(y) - z;
+        f[3] := x * y - sqr(z);
+      end;
+      3: if (x > 0) and (y > 0) then
+        begin
+          f[1] := spepow(x, y) - spepow(y, x);
+          f[2] := sin(x) - cos(y);
+        end
+        else
+          deff := False
+    end;
+  end;
+
+begin
+  Write(' program results roofnrte');
+  case sizeof(ArbFloat) of
+    4: writeln('(single)');
+    6: writeln('(real)');
+    8: writeln('(double)');
+  end;
+  writeln;
+  writeln(' number of examples:', num: 3);
+  for i := 1 to num do
+  begin
+    writeln;
+    writeln('Locating the root of the equations ');
+    case i of
+      1:
+      begin
+        n := 2;
+        writeln('x + y = 1');
+        writeln('xý + yý = 2');
+      end;
+      2:
+      begin
+        n := 3;
+        writeln('exp(x) + exp(y) = exp(z)');
+        writeln('sin(x) + cos(y) = z');
+        writeln('xy = zý');
+      end;
+      3:
+      begin
+        n := 2;
+        writeln('xy = yx');
+        writeln('sin(x) = cos(y)');
+      end
+    end;
+    Read(k);
+    for j := 1 to k do
+    begin
+      for l := 1 to n do
+        Read(x[l]);
+      Read(re);
+      writeln(' starting values: (n=', n: 1, ')');
+      for l := 1 to n do
+        Write(x[l]: numdig, ' ');
+      writeln(' re =', re: 8);
+      roofnr(@f, n, x[1], residu, re, term);
+      writeln;
+      writeln(' term =', term: 2);
+      if term < 3 then
+      begin
+        writeln(' solution vector');
+        for l := 1 to n do
+          Write(x[l]: numdig, ' ');
+        writeln;
+        writeln(' residu = ', residu: 8);
+      end;
+      writeln('-------------------------------------------------');
+    end;
+    writeln('======================================================');
+  end;
+  Close(input);
+  Close(output);
+end.

+ 9 - 0
packages/extra/numlib/tests/roopolte.dat

@@ -0,0 +1,9 @@
+ 4
+ 1 -1
+ 5  3  4 -8  0  0
+15  0  0  3  0  0  4  0  0  -8  0  0  0  0  0  0
+ 0 4
+ 1 -1
+ 5  3  4 -8  0  0
+15  0  0  3  0  0  4  0  0  -8  0  0  0  0  0  0
+ 0

Some files were not shown because too many files changed in this diff