home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- Path: sparky!uunet!cis.ohio-state.edu!cse.ucsc.EDU!conrad
- From: conrad@cse.ucsc.EDU (Al Conrad)
- Subject: g++ error
- Message-ID: <199212291938.AA16689@arapaho.ucsc.edu>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Tue, 29 Dec 1992 03:38:52 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 537
-
- Please find below a shar file. If you unpack the files and type:
-
- g++ -c symplnf.c
-
- you will (hopefully) get the error.
-
- /usr/local/gnu/bin/gcc: Internal compiler error: program cc1plus got
- fatal signal 6
-
- When I compile this in my normal build environment I get the error:
-
- symplnf.c: In function `void symplnf (class polynomial::matrix&, class
- polynomial::matrix&, class polynomial::matrix&, class coefficient::
- polynomial*, int, int)':
-
- symplnf.c:62: Internal compiler error.
- symplnf.c:62: Please report this to `bug-g++@prep.ai.mit.edu'.
- *** Error code 1
- make: Fatal error: Command failed for target `symplnf.o'
-
- So I am sending you this mail as per that message.
-
- Good luck,
-
- Al Conrad
-
- --------------------------------------------------------------------------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: axl.h eval.h gbug.shar mat.h poly.h rational.h symplnf.c
- # vec.h
- # Wrapped by conrad@arapaho on Tue Dec 29 11:21:32 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'axl.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'axl.h'\"
- else
- echo shar: Extracting \"'axl.h'\" \(2357 characters\)
- sed "s/^X//" >'axl.h' <<'END_OF_FILE'
- X//
- X// Class definition for axl
- X// (algebraic extension of an underlying field)
- X//
- X
- X#include <stream.h>
- X#include <Rational.h>
- X
- Xclass axl2 {
- Xpublic:
- X axl2() {}
- X
- X virtual int is_rational()
- X { cerr << __LINE__ << "," << __FILE__ << " ouch\n"; return 0; }
- X virtual Integer get_numerator()
- X { cerr << __LINE__ << "," << __FILE__ << " ouch\n"; return 0; }
- X virtual Integer get_denominator()
- X { cerr << __LINE__ << "," << __FILE__ << " ouch\n"; return 0; }
- X virtual void get_irrational( int&, axl2**&, int&, axl2**& )
- X { cerr << __LINE__ << "," << __FILE__ << " ouch\n"; }
- X virtual char* form();
- X int depth();
- X
- Xfriend axl2* add( axl2*, axl2* );
- Xfriend axl2* mul( axl2*, axl2* );
- Xfriend axl2* div( axl2*, axl2* );
- Xfriend int equal( axl2*, axl2* );
- X};
- X
- Xclass axl {
- Xfriend class axl2;
- Xfriend class rational;
- Xfriend class irrational;
- X axl2* v;
- Xpublic:
- X axl();
- X axl( int );
- X axl( int, int );
- X axl( axl2* );
- X int is_rational() { return v->is_rational(); }
- X Integer get_numerator() { return v->get_numerator(); }
- X Integer get_denominator(){return v->get_denominator(); }
- X void get_irrational(int& cd, axl2**& cc, int& md ,axl2**& mc)
- X { v->get_irrational( cd, cc, md, mc ); }
- X char* form() { return v->form(); }
- X double eval();
- X axl operator =( axl );
- X axl operator =( axl2 );
- X axl operator+=( axl );
- X axl operator-=( axl );
- X axl operator*=( axl );
- X axl operator/=( axl );
- X axl operator- ();
- X axl2* getvalue();
- X
- Xfriend ostream& operator<<( ostream&, axl );
- Xfriend axl root( axl );
- Xfriend axl operator+ ( axl, axl );
- Xfriend axl operator- ( axl, axl );
- Xfriend axl operator* ( axl, axl );
- Xfriend axl operator/ ( axl, axl );
- Xfriend int operator==( axl, axl );
- Xfriend int operator>=( axl, axl );
- Xfriend int operator<=( axl, axl );
- Xfriend int operator> ( axl, axl );
- Xfriend int operator< ( axl, axl );
- Xfriend int operator!=( axl, axl );
- X};
- X
- Xclass irrational : public axl2 {
- X int coset_rep_degree;
- X axl2** coset_rep_coefficients;
- X int min_poly_degree;
- X axl2** min_poly_coefficients;
- Xpublic:
- X irrational() {}
- X irrational( int, axl2**, int, axl2** );
- X int is_rational() { return 0; }
- X void get_irrational( int&, axl2**&, int&, axl2**& );
- X
- Xfriend axl root( axl );
- X};
- Xinline axl operator/( int a, axl b )
- X { return (*(new axl(a))) / b ; }
- Xinline axl operator*( int a, axl b )
- X { return (*(new axl(a))) * b ; }
- END_OF_FILE
- if test 2357 -ne `wc -c <'axl.h'`; then
- echo shar: \"'axl.h'\" unpacked with wrong size!
- fi
- # end of 'axl.h'
- fi
- if test -f 'eval.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'eval.h'\"
- else
- echo shar: Extracting \"'eval.h'\" \(123 characters\)
- sed "s/^X//" >'eval.h' <<'END_OF_FILE'
- X//
- X// header file for function to evaluate an axl by an approximated Complex.
- X//
- X#include <Complex.h>
- X
- XComplex
- Xeval(axl);
- END_OF_FILE
- if test 123 -ne `wc -c <'eval.h'`; then
- echo shar: \"'eval.h'\" unpacked with wrong size!
- fi
- # end of 'eval.h'
- fi
- if test -f 'gbug.shar' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gbug.shar'\"
- else
- echo shar: Extracting \"'gbug.shar'\" \(0 characters\)
- sed "s/^X//" >'gbug.shar' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'gbug.shar'`; then
- echo shar: \"'gbug.shar'\" unpacked with wrong size!
- fi
- # end of 'gbug.shar'
- fi
- if test -f 'mat.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mat.h'\"
- else
- echo shar: Extracting \"'mat.h'\" \(2529 characters\)
- sed "s/^X//" >'mat.h' <<'END_OF_FILE'
- X//
- X// Matrix utilities header file.
- X//
- X// ARC 10/11/88
- X//
- X
- X#include <stream.h>
- X
- Xclass matrix {
- X int width;
- X axl **data;
- Xpublic:
- X matrix( int w );
- X matrix( int w, axl* );
- X matrix( vector* );
- X
- X axl * &operator[](int i) { return data[i]; }
- X void put( int, int, axl );
- X axl get( int, int );
- X void J();
- X void zero(); // replace with = 0 someday.
- X void id(); // replace with = 1 someday.
- X int nilpotent( int& );
- X void swap_rows( int, int );
- X matrix& pow( int );
- X matrix& eval( polynomial& );
- X matrix& transpose();
- X matrix& operator=( matrix& );
- X matrix& operator-();
- X matrix& operator+=( matrix& );
- X matrix& operator-=( matrix& );
- X matrix& operator*=( matrix& );
- X matrix& operator*=( axl );
- X matrix& operator/=( axl );
- X void print( ostream& );
- X void read();
- X int symplectic();
- X
- Xfriend matrix& operator* ( axl, matrix& );
- Xfriend matrix& operator/ ( matrix&, axl );
- Xfriend matrix& operator* ( matrix&, matrix& );
- Xfriend matrix& operator+ ( matrix&, matrix& );
- Xfriend matrix& operator- ( matrix&, matrix& );
- Xfriend int operator==( matrix&, axl );
- X
- Xfriend void sigmaN( matrix&, matrix&, matrix&, polynomial&, int );
- Xfriend matrix& sigmaNsum( matrix&, polynomial&, int );
- Xfriend matrix& sigmaNterm( matrix&, polynomial&, int );
- X
- Xfriend void symplnf( matrix&, matrix&, matrix&, polynomial[], int, int );
- X/*
- Xfriend matrix& exp( matrix& );
- Xfriend vector& operator*( matrix&, vector& );
- Xfriend vector& operator/( vector&, matrix& );
- Xfriend matrix& operator/( matrix&, matrix& );
- Xfriend void forward_eliminate( matrix&, vector&, vector& );
- Xfriend void backward_substitute( matrix&, vector&, vector& );
- Xfriend void solve_for_vector( matrix&, matrix&, matrix&, vector&, vector& );
- Xfriend void lu( matrix&, matrix&, matrix&, matrix& );
- Xfriend void frugal_lu( matrix&, matrix&, vector& );
- Xfriend int max_in_column( int, matrix& );
- Xfriend double max_entry( matrix& );
- Xfriend void swap_rows( int, matrix&, int );
- Xfriend void swap_sub_rows( int, matrix&, int );
- Xfriend void copy_spike( int, matrix&, matrix& );
- Xfriend void extract_sub_row( int, vector&, matrix& );
- Xfriend void extract_column( vector&, matrix&, int );
- Xfriend void insert_column( vector&, matrix&, int );
- Xfriend int scale_factor( matrix& );
- Xfriend int floorlog2( double );
- Xfriend double maxentry( matrix& );
- X*/
- X};
- X int fact( int );
- X int choose( int, int );
- Xinline int operator==( matrix& a, int n )
- X { return a == axl(n); }
- Xinline int operator!=( matrix& a, int n )
- X { return ! ( a == axl(n) ); }
- END_OF_FILE
- if test 2529 -ne `wc -c <'mat.h'`; then
- echo shar: \"'mat.h'\" unpacked with wrong size!
- fi
- # end of 'mat.h'
- fi
- if test -f 'poly.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'poly.h'\"
- else
- echo shar: Extracting \"'poly.h'\" \(1785 characters\)
- sed "s/^X//" >'poly.h' <<'END_OF_FILE'
- X//
- X// polynomial class header file
- X//
- X// Maintains coefficients as a doubly linked list.
- X// leading_coefficient is the head and constant_term is the tail.
- X//
- X// ARC 5/31/89
- X//
- X
- X#include <stream.h>
- X
- Xclass coefficient {
- Xfriend class polynomial;
- X axl value;
- X coefficient *next;
- X coefficient *prev;
- Xpublic:
- X coefficient( ) { value = *(new rational(0));
- X next = prev = NULL; }
- X coefficient( axl v ) { value = v;
- X next = prev = NULL; }
- Xfriend polynomial& operator+( polynomial&, polynomial& );
- Xfriend polynomial& operator-( polynomial&, polynomial& );
- Xfriend polynomial& operator/( polynomial&, rational& );
- X};
- X
- Xclass polynomial {
- Xfriend class matrix;
- X coefficient *leading_coefficient;
- X coefficient *constant_term;
- Xpublic:
- X polynomial();
- X polynomial( int );
- X polynomial( int, axl* );
- X
- X void head_add( coefficient* );
- X void tail_add( coefficient* );
- X void head_pop();
- X int degree();
- X void clear_leading_zeros();
- X axl coefficient_of_term( int );
- X void reset( axl * );
- X void get_coefficients( axl ** );
- X polynomial& operator=( polynomial& );
- X polynomial& operator=( int n )
- X { return *this = *(new polynomial(n) ); };
- X polynomial& operator+=( polynomial& );
- X polynomial& operator-=( polynomial& );
- X
- Xfriend polynomial& operator* ( polynomial&, polynomial& );
- Xfriend polynomial& operator/ ( polynomial&, polynomial& );
- Xfriend polynomial& operator/ ( polynomial&, rational& );
- Xfriend polynomial& operator% ( polynomial&, polynomial& );
- Xfriend polynomial& operator+ ( polynomial&, polynomial& );
- Xfriend polynomial& operator- ( polynomial&, polynomial& );
- Xfriend int operator==( polynomial&, polynomial& );
- Xfriend ostream& operator<<( ostream&, polynomial& );
- Xfriend void divide_polys( polynomial&, polynomial&, polynomial&, polynomial&);
- X};
- END_OF_FILE
- if test 1785 -ne `wc -c <'poly.h'`; then
- echo shar: \"'poly.h'\" unpacked with wrong size!
- fi
- # end of 'poly.h'
- fi
- if test -f 'rational.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rational.h'\"
- else
- echo shar: Extracting \"'rational.h'\" \(2153 characters\)
- sed "s/^X//" >'rational.h' <<'END_OF_FILE'
- X//
- X// Class definition for rationals.
- X//
- X// ARC 10/24/90
- X//
- X
- X#include <stream.h>
- X
- Xclass rational : public axl2 {
- X Rational r;
- Xpublic:
- X rational() { r = *(new Rational(0)); }
- X rational(int n) { r = *(new Rational((long)n)); }
- X rational(long n) { r = *(new Rational(n)); }
- X rational(rational& rr) { r = *(new Rational(rr.r)); }
- X rational(int n, int d) { r = *(new Rational((long)n,(long)d));}
- X rational(Integer n, Integer d) { r = *(new Rational(n,d)); }
- X int is_rational() { return 1; };
- X Integer get_numerator() { return r.numerator(); };
- X Integer get_denominator() { return r.denominator(); };
- X axl& promote() { axl* a = new axl;
- X a->v = new rational( *this );
- X return *a; }
- X rational operator =( rational );
- X rational operator =( int n ) { r = Rational(n); return *this; };
- X rational operator+=( rational );
- X rational operator-=( rational );
- X rational operator*=( rational );
- X rational operator/=( rational );
- X rational operator- ();
- X char* rform();
- X int perfect_square( rational* );
- X
- Xfriend rational operator+ ( rational, rational );
- Xfriend rational operator- ( rational, rational );
- Xfriend rational operator* ( rational, rational );
- Xfriend rational operator/ ( rational, rational );
- Xfriend int operator==( rational, rational );
- Xfriend int operator!=( rational, rational );
- Xfriend int operator< ( rational, rational );
- Xfriend int operator> ( rational, rational );
- Xfriend int operator<=( rational, rational );
- Xfriend int operator>=( rational, rational );
- X};
- X
- Xint lcm( int, int );
- Xint gcd( int, int );
- Xint perfect_square( int& );
- XInteger greatest_square_divisor( Integer );
- X
- Xinline int operator==( rational a, int n )
- X { return a == *(new rational(n)); }
- Xinline int operator!=( rational a, int n )
- X { return a != *(new rational(n)); }
- Xinline int operator> ( rational a, int n )
- X { return a > *(new rational(n)); }
- Xinline int operator< ( rational a, int n )
- X { return a < *(new rational(n)); }
- Xinline int operator>=( rational a, int n )
- X { return a >= *(new rational(n)); }
- Xinline int operator<=( rational a, int n )
- X { return a <= *(new rational(n)); }
- END_OF_FILE
- if test 2153 -ne `wc -c <'rational.h'`; then
- echo shar: \"'rational.h'\" unpacked with wrong size!
- fi
- # end of 'rational.h'
- fi
- if test -f 'symplnf.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'symplnf.c'\"
- else
- echo shar: Extracting \"'symplnf.c'\" \(2387 characters\)
- sed "s/^X//" >'symplnf.c' <<'END_OF_FILE'
- X//
- X// Functions for computing the normal form of a matrix
- X// as given in Burgoyne/Cushman 1972. B is the normal form
- X// and P is the change of basis matrix.
- X// The array of polynomials, p, contains terms of the
- X// minimal polynomial of the form p[i] = (x^2 + alpha_i^2). m is the
- X// number of polynomials in the array (i.e., the degree of the minimal
- X// polynomial is 2m). If m=1, or if m=2 and alpha_1 = alpha_2, then we
- X// follow the bc72 algorithm as described on page 436 (example on page
- X// 440). Otherwise (m=2 and alpha_1 != alpha_2) we follow the bc72
- X// algorithm as described on page 439 (example on page 441).
- X//
- X// ARC 5/31/89
- X//
- X
- X#include <libc.h>
- X#include <assert.h>
- X
- X#include "axl.h"
- X#include "rational.h"
- X#include "poly.h"
- X#include "vec.h"
- X#include "mat.h"
- X
- Xvoid symplnf( matrix &A, matrix& B, matrix& P, polynomial p[], int m, int n )
- X{
- X matrix S(A.width), N(A.width);
- X
- X if ( n != 2 ) {
- X cout << "symplnf: char poly must be degree 4\n";
- X exit( -1 );
- X }
- X
- X if ( m == 1 || ( m == 2 && p[0].coefficient_of_term(0) ==
- X p[1].coefficient_of_term(0) ) ) {
- X/*
- X if ( m == 1 || ( m == 2 && p[0] == p[1] ) ) {
- X*/
- X // first decompose into semi-simple and nilpotent parts
- X sigmaN( A, S, N, p[0], m );
- X
- X // for now we require that N^2 = 0
- X if ( N * N != 0 ) {
- X cout << "symplnf: Sorry, only implemented for N*N = 0\n";
- X exit(1);
- X }
- X
- X // in this case normal form is as in 11/25/90 notes.
- X axl alpha;
- X alpha = root( p[0].coefficient_of_term(0) );
- X B[1][0] = B[3][2] = alpha;
- X B[0][1] = B[2][3] = -alpha;
- X B[2][0] = B[3][1] = -1;
- X
- X // change of basis matrix is as on bc72 p. 441.
- X axl sigma, gamma;
- X sigma = root( -1/N[2][0] ); // see 1/24/91 notes
- X gamma = root( -N[2][0] ); // see 1/24/91 notes
- X
- X matrix J(4);
- X J.J();
- X axl z0_values[] = { sigma, 0, 0, 0 };
- X vector z0( 4, z0_values );
- X
- X vector b1( 4 );
- X vector b2( 4 );
- X vector b3( 4 );
- X vector b4( 4 );
- X
- X b1 = z0 - ( 1 / ( 2 * alpha * alpha ) ) * ( z0 * ( J * (S * z0 ) ) )
- X * ( N * ( S * z0 ) );
- X b2 = ( 1 / alpha ) * ( S * b1 );
- X b3 = -N * b1;
- X b4 = -( 1 / alpha ) * ( S * N ) * b1;
- X
- X vector columns[] = { b1, b2, b3, b4 };
- X matrix PP( columns );
- X P = PP.transpose();
- X }
- X else if ( m == 2 ) {
- X cout << "Code for non-repeating eigenvalues is TBD.\n";
- X exit(-1);
- X }
- X else {
- X cout << "Bad m value.\n";
- X exit(-1);
- X }
- X}
- END_OF_FILE
- if test 2387 -ne `wc -c <'symplnf.c'`; then
- echo shar: \"'symplnf.c'\" unpacked with wrong size!
- fi
- # end of 'symplnf.c'
- fi
- if test -f 'vec.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vec.h'\"
- else
- echo shar: Extracting \"'vec.h'\" \(493 characters\)
- sed "s/^X//" >'vec.h' <<'END_OF_FILE'
- X//
- X// vector utilities header file.
- X//
- X// ARC 10/11/88
- X//
- X
- X#include <stream.h>
- X
- Xclass vector {
- Xfriend matrix;
- X int width;
- X axl *data;
- Xpublic:
- X vector( int w );
- X vector( int w, axl* );
- X
- X axl operator[](int i) {return data[i]; };
- X char* form();
- X
- X vector operator= ( vector );
- X
- Xfriend axl operator*( vector, vector );
- Xfriend vector operator-( vector, vector );
- Xfriend vector operator*( axl, vector );
- Xfriend vector operator*( matrix, vector );
- Xfriend ostream& operator<<( ostream&, vector );
- X};
- END_OF_FILE
- if test 493 -ne `wc -c <'vec.h'`; then
- echo shar: \"'vec.h'\" unpacked with wrong size!
- fi
- # end of 'vec.h'
- fi
- echo shar: End of shell archive.
- exit 0
-
-