From: elkins@nmrlab.cabm.rutgers.edu (George Elkins)
Subject: report of internal compiler error for gcc 2.3.3
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 29 Dec 1992 14:08:05 GMT

The following script shows an internal compiler error for gcc 2.3.3
when compiling a C++ file from newmat version 06.  The compiler
requested that I send a report to this email address.  The make file
and the source file which gives the error are also listed below.

Script started on Tue Dec 29 19:00:50 1992
nmrlab /C++/Newmat-06 2> make -f Makefile.tmt
g++ -c tmte.cxx
In file included from newmat.h:22, from newmatap.h:8, from tmte.cxx:7:
except.h:134: warning: class `Janitor' has virtual functions but non-virtual destructor
tmte.cxx: In function `void  trymate ()':
tmte.cxx:109: Internal compiler error.
tmte.cxx:109: Please report this to `bug-g++@prep.ai.mit.edu'.
make: *** [tmte.o] Error 1
nmrlab /C++/Newmat-06 2> 
nmrlab /C++/Newmat-06 2> cat Makefile.tmt
OBJ = fft.o evalue.o submat.o cholesky.o hholder.o sort.o newmatrm.o     \
  jacobi.o tmtf.o svd.o tmte.o tmtd.o newmat8.o tmtc.o tmtb.o            \
  newmat7.o newmat6.o newmat5.o newmat3.o newmat4.o newmat2.o newmat1.o  \
  tmt.o tmt1.o tmt2.o tmt3.o tmt4.o tmt5.o tmt6.o tmt7.o tmt8.o          \
  tmt9.o tmta.o tmtg.o tmth.o tmti.o bandmat.o except.o newmatex.o

tmt:          $(OBJ)
	      g++ -o $@ $(OBJ) -lm

%.o:          %.cxx
	      g++ -c $*.cxx

newmatxx:     include.h newmat.h boolean.h except.h
	      rm -f newmatxx
	      echo "main .h files uptodate?" > newmatxx

except.o:     except.h except.cxx

newmatex.o:   newmatxx newmatex.cxx

example.o:    newmatxx newmatap.h example.cxx

cholesky.o:   newmatxx cholesky.cxx

evalue.o:     newmatxx newmatrm.h precisio.h evalue.cxx

fft.o:        newmatxx newmatap.h fft.cxx

hholder.o:    newmatxx newmatap.h hholder.cxx

jacobi.o:     newmatxx precisio.h newmatrm.h jacobi.cxx

bandmat.o:    newmatxx newmatrc.h controlw.h bandmat.cxx

newmat1.o:    newmatxx newmat1.cxx

newmat2.o:    newmatxx newmatrc.h controlw.h newmat2.cxx

newmat3.o:    newmatxx newmatrc.h controlw.h newmat3.cxx

newmat4.o:    newmatxx newmatrc.h controlw.h newmat4.cxx

newmat5.o:    newmatxx newmatrc.h controlw.h newmat5.cxx

newmat6.o:    newmatxx newmatrc.h controlw.h newmat6.cxx

newmat7.o:    newmatxx newmatrc.h controlw.h newmat7.cxx

newmat8.o:    newmatxx newmatap.h newmat8.cxx

newmat9.o:    newmatxx newmatrc.h controlw.h newmatio.h newmat9.cxx

newmatrm.o:   newmatxx newmatrm.h newmatrm.cxx

sort.o:       newmatxx newmatap.h sort.cxx

submat.o:     newmatxx newmatrc.h controlw.h submat.cxx

svd.o:        newmatxx newmatrm.h precisio.h svd.cxx

tmt.o:        newmatxx newmatap.h tmt.cxx 

tmt1.o:       newmatxx newmatap.h tmt1.cxx 

tmt2.o:       newmatxx newmatap.h tmt2.cxx 

tmt3.o:       newmatxx newmatap.h tmt3.cxx 

tmt4.o:       newmatxx newmatap.h tmt4.cxx 

tmt5.o:       newmatxx newmatap.h tmt5.cxx 

tmt6.o:       newmatxx newmatap.h tmt6.cxx 

tmt7.o:       newmatxx newmatap.h tmt7.cxx 

tmt8.o:       newmatxx newmatap.h tmt8.cxx 

tmt9.o:       newmatxx newmatap.h tmt9.cxx 

tmta.o:       newmatxx newmatap.h tmta.cxx 

tmtb.o:       newmatxx newmatap.h tmtb.cxx 

tmtc.o:       newmatxx newmatap.h tmtc.cxx 

tmtd.o:       newmatxx newmatap.h tmtd.cxx 

tmte.o:       newmatxx newmatap.h tmte.cxx 

tmtf.o:       newmatxx newmatap.h tmtf.cxx 

tmtg.o:       newmatxx newmatap.h tmtg.cxx 

tmth.o:       newmatxx newmatap.h tmth.cxx

tmti.o:       newmatxx newmatap.h tmti.cxx


nmrlab /C++/Newmat-06 2> cat tmte.cxx

//#define WANT_STREAM
#define WANT_MATH

#include "include.h"

#include "newmatap.h"

void Print(const Matrix& X);
void Print(const UpperTriangularMatrix& X);
void Print(const DiagonalMatrix& X);
void Print(const SymmetricMatrix& X);
void Print(const LowerTriangularMatrix& X);

void Clean(Matrix&, Real);
void Clean(DiagonalMatrix&, Real);




void trymate()
{
//   cout << "\nFourteenth test of Matrix package\n";
   Tracer et("Fourteenth test of Matrix package");
   Exception::PrintTrace(TRUE);

   {
      Tracer et1("Stage 1");
      Matrix A(8,5);
#ifndef ATandT
      Real   a[] =   { 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 };
#else
      Real a[40];
      a[ 0]=22; a[ 1]=10; a[ 2]= 2; a[ 3]= 3; a[ 4]= 7;
      a[ 5]=14; a[ 6]= 7; a[ 7]=10; a[ 8]= 0; a[ 9]= 8;
      a[10]=-1; a[11]=13; a[12]=-1; a[13]=-11;a[14]= 3;
      a[15]=-3; a[16]=-2; a[17]=13; a[18]=-2; a[19]= 4;
      a[20]= 9; a[21]= 8; a[22]= 1; a[23]=-2; a[24]= 4;
      a[25]= 9; a[26]= 1; a[27]=-7; a[28]= 5; a[29]=-1;
      a[30]= 2; a[31]=-6; a[32]= 6; a[33]= 5; a[34]= 1;
      a[35]= 4; a[36]= 5; a[37]= 0; a[38]=-2; a[39]= 2;
#endif
      A << a;
      DiagonalMatrix D; Matrix U; Matrix V;
#ifdef ATandT
      int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
#else
      DiagonalMatrix I(A.Ncols());
#endif
      I=1.0;
      SymmetricMatrix S1; S1 << A.t() * A;
      SymmetricMatrix S2; S2 << A * A.t();
      Real zero = 0.0; SVD(A+zero,D,U,V);
      DiagonalMatrix D1; SVD(A,D1); Print(DiagonalMatrix(D-D1));
      Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU);
      Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV);
      Matrix B = U * D * V.t() - A; Clean(B,0.000000001);Print(B);
      D1=0.0;  SVD(A,D1,A); Print(Matrix(A-U));
      SortDescending(D);
      D(1) -= sqrt(1248); D(2) -= 20; D(3) -= sqrt(384);
      Clean(D,0.000000001); Print(D);
      Jacobi(S1, D, V);
      V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      SortDescending(D); D(1)-=1248; D(2)-=400; D(3)-=384;
      Clean(D,0.000000001); Print(D);
      Jacobi(S2, D, V);
      V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      SortDescending(D); D(1)-=1248; D(2)-=400; D(3)-=384;
      Clean(D,0.000000001); Print(D);

      EigenValues(S1, D, V);
      V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      D(5)-=1248; D(4)-=400; D(3)-=384;
      Clean(D,0.000000001); Print(D);
      EigenValues(S2, D, V);
      V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      D(8)-=1248; D(7)-=400; D(6)-=384;
      Clean(D,0.000000001); Print(D);

      EigenValues(S1, D);
      D(5)-=1248; D(4)-=400; D(3)-=384;
      Clean(D,0.000000001); Print(D);
      EigenValues(S2, D);
      D(8)-=1248; D(7)-=400; D(6)-=384;
      Clean(D,0.000000001); Print(D);
   }
   {
      Tracer et1("Stage 2");
      Matrix A(20,21);
      for (int i=1; i<=20; i++) for (int j=1; j<=21; j++)
      { if (i>j) A(i,j) = 0; else if (i==j) A(i,j) = 21-i; else A(i,j) = -1; }
      A = A.t();
      SymmetricMatrix S1; S1 << A.t() * A;
      SymmetricMatrix S2; S2 << A * A.t();
      DiagonalMatrix D; Matrix U; Matrix V;
#ifdef ATandT
      int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
#else
      DiagonalMatrix I(A.Ncols());
#endif
      I=1.0;
      SVD(A,D,U,V);
      Matrix SU = U.t() * U - I;    Clean(SU,0.000000001); Print(SU);
      Matrix SV = V.t() * V - I;    Clean(SV,0.000000001); Print(SV);
      Matrix B = U * D * V.t() - A; Clean(B,0.000000001);  Print(B);
      for (i=1; i<=20; i++)  D(i) -= sqrt((22-i)*(21-i));
      Clean(D,0.000000001); Print(D);
      Jacobi(S1, D, V);
      V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      SortDescending(D);
      for (i=1; i<=20; i++)  D(i) -= (22-i)*(21-i);
      Clean(D,0.000000001); Print(D);
      Jacobi(S2, D, V);
      V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      SortDescending(D);
      for (i=1; i<=20; i++)  D(i) -= (22-i)*(21-i);
      Clean(D,0.000000001); Print(D);

      EigenValues(S1, D, V);
      V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      for (i=1; i<=20; i++)  D(i) -= (i+1)*i;
      Clean(D,0.000000001); Print(D);
      EigenValues(S2, D, V);
      V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V);
      for (i=2; i<=21; i++)  D(i) -= (i-1)*i;
      Clean(D,0.000000001); Print(D);

      EigenValues(S1, D);
      for (i=1; i<=20; i++)  D(i) -= (i+1)*i;
      Clean(D,0.000000001); Print(D);
      EigenValues(S2, D);
      for (i=2; i<=21; i++)  D(i) -= (i-1)*i;
      Clean(D,0.000000001); Print(D);
   }

   {
      Tracer et1("Stage 3");
      Matrix A(30,30);
      for (int i=1; i<=30; i++) for (int j=1; j<=30; j++)
      { if (i>j) A(i,j) = 0; else if (i==j) A(i,j) = 1; else A(i,j) = -1; }
      Real d1 = A.LogDeterminant().Value();
      DiagonalMatrix D; Matrix U; Matrix V;
#ifdef ATandT
      int anc = A.Ncols(); DiagonalMatrix I(anc);     // AT&T 2.1 bug
#else
      DiagonalMatrix I(A.Ncols());
#endif
      I=1.0;
      SVD(A,D,U,V);
      Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU);
      Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV);
      Real d2 = D.LogDeterminant().Value();
      Matrix B = U * D * V.t() - A; Clean(B,0.000000001); Print(B);
      SortDescending(D);  // Print(D);
      Real d3 = D.LogDeterminant().Value();
      ColumnVector Test(3);
      Test(1) = d1 - 1; Test(2) = d2 - 1; Test(3) = d3 - 1;
      Clean(Test,0.00000001); Print(Test); // only 8 decimal figures
   }

//   cout << "\nEnd of Fourteenth test\n";
}
nmrlab /C++/Newmat-06 2> 
script done on Tue Dec 29 19:02:07 1992

--
                  ude.sregtur.mbac.balrmn@snikle          sniklE egroeG
  8365-45880 JN ,yawatacsiP ,enaL seoH 976 ,MBAC     7235 ,5235-364 809


Newsgroups: gnu.g++.bug