home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2098 < prev    next >
Encoding:
Text File  |  1992-12-30  |  9.5 KB  |  306 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!nmrlab.cabm.rutgers.edu!elkins
  3. From: elkins@nmrlab.cabm.rutgers.edu (George Elkins)
  4. Subject: report of internal compiler error for gcc 2.3.3
  5. Message-ID: <9212300008.AA06664@nmrlab.cabm.rutgers.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 29 Dec 1992 14:08:05 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 293
  12.  
  13. The following script shows an internal compiler error for gcc 2.3.3
  14. when compiling a C++ file from newmat version 06.  The compiler
  15. requested that I send a report to this email address.  The make file
  16. and the source file which gives the error are also listed below.
  17.  
  18. Script started on Tue Dec 29 19:00:50 1992
  19. nmrlab /C++/Newmat-06 2> make -f Makefile.tmt
  20. g++ -c tmte.cxx
  21. In file included from newmat.h:22, from newmatap.h:8, from tmte.cxx:7:
  22. except.h:134: warning: class `Janitor' has virtual functions but non-virtual destructor
  23. tmte.cxx: In function `void  trymate ()':
  24. tmte.cxx:109: Internal compiler error.
  25. tmte.cxx:109: Please report this to `bug-g++@prep.ai.mit.edu'.
  26. make: *** [tmte.o] Error 1
  27. nmrlab /C++/Newmat-06 2> 
  28. nmrlab /C++/Newmat-06 2> cat Makefile.tmt
  29. OBJ = fft.o evalue.o submat.o cholesky.o hholder.o sort.o newmatrm.o     \
  30.   jacobi.o tmtf.o svd.o tmte.o tmtd.o newmat8.o tmtc.o tmtb.o            \
  31.   newmat7.o newmat6.o newmat5.o newmat3.o newmat4.o newmat2.o newmat1.o  \
  32.   tmt.o tmt1.o tmt2.o tmt3.o tmt4.o tmt5.o tmt6.o tmt7.o tmt8.o          \
  33.   tmt9.o tmta.o tmtg.o tmth.o tmti.o bandmat.o except.o newmatex.o
  34.  
  35. tmt:          $(OBJ)
  36.           g++ -o $@ $(OBJ) -lm
  37.  
  38. %.o:          %.cxx
  39.           g++ -c $*.cxx
  40.  
  41. newmatxx:     include.h newmat.h boolean.h except.h
  42.           rm -f newmatxx
  43.           echo "main .h files uptodate?" > newmatxx
  44.  
  45. except.o:     except.h except.cxx
  46.  
  47. newmatex.o:   newmatxx newmatex.cxx
  48.  
  49. example.o:    newmatxx newmatap.h example.cxx
  50.  
  51. cholesky.o:   newmatxx cholesky.cxx
  52.  
  53. evalue.o:     newmatxx newmatrm.h precisio.h evalue.cxx
  54.  
  55. fft.o:        newmatxx newmatap.h fft.cxx
  56.  
  57. hholder.o:    newmatxx newmatap.h hholder.cxx
  58.  
  59. jacobi.o:     newmatxx precisio.h newmatrm.h jacobi.cxx
  60.  
  61. bandmat.o:    newmatxx newmatrc.h controlw.h bandmat.cxx
  62.  
  63. newmat1.o:    newmatxx newmat1.cxx
  64.  
  65. newmat2.o:    newmatxx newmatrc.h controlw.h newmat2.cxx
  66.  
  67. newmat3.o:    newmatxx newmatrc.h controlw.h newmat3.cxx
  68.  
  69. newmat4.o:    newmatxx newmatrc.h controlw.h newmat4.cxx
  70.  
  71. newmat5.o:    newmatxx newmatrc.h controlw.h newmat5.cxx
  72.  
  73. newmat6.o:    newmatxx newmatrc.h controlw.h newmat6.cxx
  74.  
  75. newmat7.o:    newmatxx newmatrc.h controlw.h newmat7.cxx
  76.  
  77. newmat8.o:    newmatxx newmatap.h newmat8.cxx
  78.  
  79. newmat9.o:    newmatxx newmatrc.h controlw.h newmatio.h newmat9.cxx
  80.  
  81. newmatrm.o:   newmatxx newmatrm.h newmatrm.cxx
  82.  
  83. sort.o:       newmatxx newmatap.h sort.cxx
  84.  
  85. submat.o:     newmatxx newmatrc.h controlw.h submat.cxx
  86.  
  87. svd.o:        newmatxx newmatrm.h precisio.h svd.cxx
  88.  
  89. tmt.o:        newmatxx newmatap.h tmt.cxx 
  90.  
  91. tmt1.o:       newmatxx newmatap.h tmt1.cxx 
  92.  
  93. tmt2.o:       newmatxx newmatap.h tmt2.cxx 
  94.  
  95. tmt3.o:       newmatxx newmatap.h tmt3.cxx 
  96.  
  97. tmt4.o:       newmatxx newmatap.h tmt4.cxx 
  98.  
  99. tmt5.o:       newmatxx newmatap.h tmt5.cxx 
  100.  
  101. tmt6.o:       newmatxx newmatap.h tmt6.cxx 
  102.  
  103. tmt7.o:       newmatxx newmatap.h tmt7.cxx 
  104.  
  105. tmt8.o:       newmatxx newmatap.h tmt8.cxx 
  106.  
  107. tmt9.o:       newmatxx newmatap.h tmt9.cxx 
  108.  
  109. tmta.o:       newmatxx newmatap.h tmta.cxx 
  110.  
  111. tmtb.o:       newmatxx newmatap.h tmtb.cxx 
  112.  
  113. tmtc.o:       newmatxx newmatap.h tmtc.cxx 
  114.  
  115. tmtd.o:       newmatxx newmatap.h tmtd.cxx 
  116.  
  117. tmte.o:       newmatxx newmatap.h tmte.cxx 
  118.  
  119. tmtf.o:       newmatxx newmatap.h tmtf.cxx 
  120.  
  121. tmtg.o:       newmatxx newmatap.h tmtg.cxx 
  122.  
  123. tmth.o:       newmatxx newmatap.h tmth.cxx
  124.  
  125. tmti.o:       newmatxx newmatap.h tmti.cxx
  126.  
  127.  
  128. nmrlab /C++/Newmat-06 2> cat tmte.cxx
  129.  
  130. //#define WANT_STREAM
  131. #define WANT_MATH
  132.  
  133. #include "include.h"
  134.  
  135. #include "newmatap.h"
  136.  
  137. void Print(const Matrix& X);
  138. void Print(const UpperTriangularMatrix& X);
  139. void Print(const DiagonalMatrix& X);
  140. void Print(const SymmetricMatrix& X);
  141. void Print(const LowerTriangularMatrix& X);
  142.  
  143. void Clean(Matrix&, Real);
  144. void Clean(DiagonalMatrix&, Real);
  145.  
  146.  
  147.  
  148.  
  149. void trymate()
  150. {
  151. //   cout << "\nFourteenth test of Matrix package\n";
  152.    Tracer et("Fourteenth test of Matrix package");
  153.    Exception::PrintTrace(TRUE);
  154.  
  155.    {
  156.       Tracer et1("Stage 1");
  157.       Matrix A(8,5);
  158. #ifndef ATandT
  159.       Real   a[] =   { 22, 10,  2,  3,  7,
  160.                14,  7, 10,  0,  8,
  161.                -1, 13, -1,-11,  3,
  162.                -3, -2, 13, -2,  4,
  163.             9,  8,  1, -2,  4,
  164.             9,  1, -7,  5, -1,
  165.             2, -6,  6,  5,  1,
  166.             4,  5,  0, -2,  2 };
  167. #else
  168.       Real a[40];
  169.       a[ 0]=22; a[ 1]=10; a[ 2]= 2; a[ 3]= 3; a[ 4]= 7;
  170.       a[ 5]=14; a[ 6]= 7; a[ 7]=10; a[ 8]= 0; a[ 9]= 8;
  171.       a[10]=-1; a[11]=13; a[12]=-1; a[13]=-11;a[14]= 3;
  172.       a[15]=-3; a[16]=-2; a[17]=13; a[18]=-2; a[19]= 4;
  173.       a[20]= 9; a[21]= 8; a[22]= 1; a[23]=-2; a[24]= 4;
  174.       a[25]= 9; a[26]= 1; a[27]=-7; a[28]= 5; a[29]=-1;
  175.       a[30]= 2; a[31]=-6; a[32]= 6; a[33]= 5; a[34]= 1;
  176.       a[35]= 4; a[36]= 5; a[37]= 0; a[38]=-2; a[39]= 2;
  177. #endif
  178.       A << a;
  179.       DiagonalMatrix D; Matrix U; Matrix V;
  180. #ifdef ATandT
  181.       int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
  182. #else
  183.       DiagonalMatrix I(A.Ncols());
  184. #endif
  185.       I=1.0;
  186.       SymmetricMatrix S1; S1 << A.t() * A;
  187.       SymmetricMatrix S2; S2 << A * A.t();
  188.       Real zero = 0.0; SVD(A+zero,D,U,V);
  189.       DiagonalMatrix D1; SVD(A,D1); Print(DiagonalMatrix(D-D1));
  190.       Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU);
  191.       Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV);
  192.       Matrix B = U * D * V.t() - A; Clean(B,0.000000001);Print(B);
  193.       D1=0.0;  SVD(A,D1,A); Print(Matrix(A-U));
  194.       SortDescending(D);
  195.       D(1) -= sqrt(1248); D(2) -= 20; D(3) -= sqrt(384);
  196.       Clean(D,0.000000001); Print(D);
  197.       Jacobi(S1, D, V);
  198.       V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  199.       SortDescending(D); D(1)-=1248; D(2)-=400; D(3)-=384;
  200.       Clean(D,0.000000001); Print(D);
  201.       Jacobi(S2, D, V);
  202.       V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  203.       SortDescending(D); D(1)-=1248; D(2)-=400; D(3)-=384;
  204.       Clean(D,0.000000001); Print(D);
  205.  
  206.       EigenValues(S1, D, V);
  207.       V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  208.       D(5)-=1248; D(4)-=400; D(3)-=384;
  209.       Clean(D,0.000000001); Print(D);
  210.       EigenValues(S2, D, V);
  211.       V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  212.       D(8)-=1248; D(7)-=400; D(6)-=384;
  213.       Clean(D,0.000000001); Print(D);
  214.  
  215.       EigenValues(S1, D);
  216.       D(5)-=1248; D(4)-=400; D(3)-=384;
  217.       Clean(D,0.000000001); Print(D);
  218.       EigenValues(S2, D);
  219.       D(8)-=1248; D(7)-=400; D(6)-=384;
  220.       Clean(D,0.000000001); Print(D);
  221.    }
  222.    {
  223.       Tracer et1("Stage 2");
  224.       Matrix A(20,21);
  225.       for (int i=1; i<=20; i++) for (int j=1; j<=21; j++)
  226.       { if (i>j) A(i,j) = 0; else if (i==j) A(i,j) = 21-i; else A(i,j) = -1; }
  227.       A = A.t();
  228.       SymmetricMatrix S1; S1 << A.t() * A;
  229.       SymmetricMatrix S2; S2 << A * A.t();
  230.       DiagonalMatrix D; Matrix U; Matrix V;
  231. #ifdef ATandT
  232.       int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
  233. #else
  234.       DiagonalMatrix I(A.Ncols());
  235. #endif
  236.       I=1.0;
  237.       SVD(A,D,U,V);
  238.       Matrix SU = U.t() * U - I;    Clean(SU,0.000000001); Print(SU);
  239.       Matrix SV = V.t() * V - I;    Clean(SV,0.000000001); Print(SV);
  240.       Matrix B = U * D * V.t() - A; Clean(B,0.000000001);  Print(B);
  241.       for (i=1; i<=20; i++)  D(i) -= sqrt((22-i)*(21-i));
  242.       Clean(D,0.000000001); Print(D);
  243.       Jacobi(S1, D, V);
  244.       V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  245.       SortDescending(D);
  246.       for (i=1; i<=20; i++)  D(i) -= (22-i)*(21-i);
  247.       Clean(D,0.000000001); Print(D);
  248.       Jacobi(S2, D, V);
  249.       V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  250.       SortDescending(D);
  251.       for (i=1; i<=20; i++)  D(i) -= (22-i)*(21-i);
  252.       Clean(D,0.000000001); Print(D);
  253.  
  254.       EigenValues(S1, D, V);
  255.       V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  256.       for (i=1; i<=20; i++)  D(i) -= (i+1)*i;
  257.       Clean(D,0.000000001); Print(D);
  258.       EigenValues(S2, D, V);
  259.       V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
  260.       for (i=2; i<=21; i++)  D(i) -= (i-1)*i;
  261.       Clean(D,0.000000001); Print(D);
  262.  
  263.       EigenValues(S1, D);
  264.       for (i=1; i<=20; i++)  D(i) -= (i+1)*i;
  265.       Clean(D,0.000000001); Print(D);
  266.       EigenValues(S2, D);
  267.       for (i=2; i<=21; i++)  D(i) -= (i-1)*i;
  268.       Clean(D,0.000000001); Print(D);
  269.    }
  270.  
  271.    {
  272.       Tracer et1("Stage 3");
  273.       Matrix A(30,30);
  274.       for (int i=1; i<=30; i++) for (int j=1; j<=30; j++)
  275.       { if (i>j) A(i,j) = 0; else if (i==j) A(i,j) = 1; else A(i,j) = -1; }
  276.       Real d1 = A.LogDeterminant().Value();
  277.       DiagonalMatrix D; Matrix U; Matrix V;
  278. #ifdef ATandT
  279.       int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
  280. #else
  281.       DiagonalMatrix I(A.Ncols());
  282. #endif
  283.       I=1.0;
  284.       SVD(A,D,U,V);
  285.       Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU);
  286.       Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV);
  287.       Real d2 = D.LogDeterminant().Value();
  288.       Matrix B = U * D * V.t() - A; Clean(B,0.000000001); Print(B);
  289.       SortDescending(D);  // Print(D);
  290.       Real d3 = D.LogDeterminant().Value();
  291.       ColumnVector Test(3);
  292.       Test(1) = d1 - 1; Test(2) = d2 - 1; Test(3) = d3 - 1;
  293.       Clean(Test,0.00000001); Print(Test); // only 8 decimal figures
  294.    }
  295.  
  296. //   cout << "\nEnd of Fourteenth test\n";
  297. }
  298. nmrlab /C++/Newmat-06 2> 
  299. script done on Tue Dec 29 19:02:07 1992
  300.  
  301. --
  302.                   ude.sregtur.mbac.balrmn@snikle          sniklE egroeG
  303.   8365-45880 JN ,yawatacsiP ,enaL seoH 976 ,MBAC     7235 ,5235-364 809
  304.  
  305.  
  306.