baud@GATECH.EDU (Kurt Baudendistel) (10/01/88)
BUG REPORT 12
BEHAVIOR:
compiler failed to match required function when built-in conversion
(int to double) needed. when explicit conversion operator ``double()''
is used to force the conversion, no error is generated.
COMPILER VERSION: GNU C++ compiler driver, version 1.25.0
INPUT FILES:
pis.cc
doubleVec.h
nr.h
error.h
overload.h
type.h
COMMAND LINE: g++ -v -g -c pis.cc
GNU C++ version 1.25.0 (vax) compiled by GNU C version 1.25.
g++ version 1.25.0
/usr/local/lib/gcc-cpp+ -v -I . -I ./include -I /dsp/mcclellan/baud/c++/include -I /usr/local/lib/g++-include -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix pis.cc /tmp/cc007442.cpp
GNU CPP version 1.25.0
/usr/local/lib/gcc-c++ /tmp/cc007442.cpp -quiet -dumpbase pis.cc -noreg -version -G -o /tmp/cc007442.s
In function mcov (struct doubleMat &):
pis.cc:39: bad argument 1 for function `operator / (struct doubleVec &, double &)' (type was struct doubleMat )
pis.cc:39: type conversion required for type `doubleMat'
FILE NAMES:
tm.h = tm-vax.h
md = vax.md
MACHINE: vax 11/780 with BRL UNIX (4.2 BSD)
SOURCE FILES:
----------------------------------------------------------------------------
//
// pis.cc : pisarenko's method using vectors and matrices
//
#include <doubleVec.h>
#include <nr.h>
//
// mean: matrix mean
//
double mean(doubleMat& M) {
double m = 0.;
for ( int i=0; i < csize(M); i++ )
m += sum(M(i));
return m / (rsize(M) * csize(M));
}
//
// mpad: pad out doubleVec to yield transposed convolution matrix
//
doubleMat mpad(int p, doubleVec& v) {
doubleMat Z(p,size(v)+p-1,0.);
for ( int i=0; i < p; i++ )
Z(i)(i,i+size(v)-1) = v;
return doubleMat_t(Z);
}
//
// mcov: construct covariance matrix from transposed convolution matrix
//
doubleMat mcov(doubleMat& M) {
int s = csize(M);
doubleMat N = M - doubleMat(s,s,mean(M));
return doubleMat_t((N ^ N) / s);
}
//
// eig: compute eigen-value and -vectors of a doubleMat
//
// note: rows of E are e-values corresponding to e-vector
// elements of e.
//
void eig(doubleMat& M, doubleMat& Ev, doubleVec& ev) {
int i, j; // counters
int s = rsize(M); // matrix sizes
// check input vector sizes
if ( !square(M) || !square(Ev) || s != rsize(Ev) || s != size(ev) )
error("eig: illegal vector/matrix size");
float **a = matrix(1,s,1,s); // data of input matrix
float *d = vector(1,s), // diagonal elements
*e = vector(1,s); // off-diagonal elements
for ( i=0; i < s; i++ ) // copy input data
for ( j=0; j < s; j++ )
a[1+i][1+j] = M(i,j);
tred2(a,s,d,e); // tri-diagonalize matrix
tqli(d,e,s,a); // find e's by ql algorithm
for ( i=0; i < s; i++ ) // copy output data
for ( j=0; j < s; j++ )
Ev(i,j) = a[1+j][1+i];
for ( i=0; i < s; i++ )
ev(i) = e[1+i];
free_vector(d,1,s); // deallocate storage
free_vector(e,1,s);
free_matrix(a,1,s,1,s);
}
//
// pisarenko:
//
// use pisarenko's method to perform p-th order harmonic
// decomposition of input complex data doubleVec.
//
// note: line splitting can occur if wrong order polynomial
// is requested.
//
// a = solution polynomial: A(z) = SUM a_i * z^(-1)
// (order of input vector `a' determines solution order)
// x = input data vector
//
void pisarenko(doubleVec& a, doubleVec& x) {
int p = size(a) - 1, // polynomial order
n = size(x); // number of input points
a = 0.; // initialize a
if ( n < 2 * p )
error("pisarenko: more data required for given model order");
doubleMat A = mpad(p+1,x), // convolution doubleMat
B = mcov(A), // covariance doubleMat
E(p+1,p+1); // e-doubleVecs
doubleVec e(p+1); // e-values
eig(B,E,e);
a = E(min(e)); // e-doubleVec of min e-value
}
// main function to test pisarenko
main(int argc, char **argv) {
int p, // polynomial order
n; // number of data points
if ( argc != 3
|| sscanf(*++argv,"%d",&p) != 1 || p < 1
|| sscanf(*++argv,"%d",&n) != 1 || n < 1 )
error("usage: pis model-order number-of-input-points");
doubleVec a(p+1); // polynomial
doubleVec x(n); // input data
cin >> x;
pisarenko(a,x);
cout << "solution polynomial: " << a << "\n";
}
----------------------------------------------------------------------------
//
// doubleVec.h : vector and matrix class definitions
//
// the `vector' and `matrix' classes provide the c++ programmer
// with a complete set of matrix/vector operations:
//
// vector:
// - constructor: specify size, size & value to be replicated,
// size & an array of values to load, or another vector.
// - assignment =: from a vector, an array, or a value to be
// replicated.
// - subscripting (): direct element and sub-vector access (lvalue).
// - scaling operators: *, /.
// - scaling update operators: *=, /=.
// - vector arithmetic operators: unary +-, binary +-,
// * (correlation), ^ (convolution), and % (outer product).
// - vector arithmetic update operators: +=, -=.
// - matrix multiplication *: vector-matrix & matrix-vector.
// - vector reverse operator: ~.
// - vector rotation operators: <<, >>.
// - equality operator: ==, !=.
// - stream output operator: <<.
// - elemental utility functions: size, min, max, sum, mse.
//
// matrix:
// - constructor: specify size, size & value to be replicated,
// size & an array of values to load, or another vector.
// - assignment =: from a matrix, an array, or a value to be
// replicated.
// - subscripting (): direct element access -- lvalue.
// - scaling operators: *, /.
// - scaling update operators: *=, /=.
// - matrix arithmetic operators: binary +-, unary +-, *, ^.
// - matrix arithmetic update operators: +=, -=, *=, ^=.
// - transpose operator: ~.
// - equality operator: ==, !=.
// - stream output operator: <<.
// - elemental utility functions: rsize, csize, eye, trace, square.
//
// note: `a ^ b' is equivalent to `a * ~b', but more efficient.
//
#ifndef _doubleVec_h
#define _doubleVec_h
#include <stream.h>
#include <std.h>
#include <type.h>
#include <error.h>
class doubleVec;
class doubleVec_t;
class doubleMat;
class doubleMat_t;
//
// doubleVec: vector class
//
enum doubleVec_type {
doubleVec_type_plain,
doubleVec_type_temp,
doubleVec_type_reference };
struct doubleVec_ {
doubleVec_type t; // vector type
uint s; // vector size
double *p; // ptr to vector values
uint del() { return t != doubleVec_type_reference; }
uint copy_from() { return t == doubleVec_type_temp; }
uint copy_to() { return t == doubleVec_type_plain; }
uint subvec() { return t == doubleVec_type_reference; }
};
class doubleVec_t : doubleVec_ {
friend class doubleVec;
friend class doubleMat;
doubleVec_t(doubleVec_type T, uint S, double* P)
{ t = T, s = S, p = P; }
public:
doubleVec_t(doubleVec& v);
};
class doubleVec : doubleVec_ {
friend class doubleVec_t;
copy(double* from ) {
double* to = p;
for ( uint i=s; i--; ) *to++ = *from++; }
public:
doubleVec(uint i)
{ t = doubleVec_type_plain, p = new double[s=i]; }
doubleVec(doubleVec& v) {
t = doubleVec_type_plain, s = v.s;
if ( v.copy_from() )
p = v.p, v.t = doubleVec_type_reference;
else
p = new double[s], copy(v.p); }
doubleVec(uint i, double *pd)
{ t = doubleVec_type_plain, p = new double[s=i], copy(pd); }
doubleVec(uint i, double d) {
t = doubleVec_type_plain, p = new double[s=i];
for ( double *pp = p; i--; ) *pp++ = d; }
doubleVec(doubleVec_t& v)
{ t = v.t, v.t = doubleVec_type_reference, s = v.s, p = v.p; }
~doubleVec()
{ if ( del() ) delete p; }
double& operator()(uint i);
doubleVec operator()(uint, uint);
doubleVec& operator=(doubleVec&);
doubleVec& operator=(double*);
doubleVec& operator=(double);
doubleVec& operator+()
{ return *this; }
friend doubleVec operator-(doubleVec&);
friend doubleVec operator~(doubleVec&);
friend doubleVec operator+(doubleVec&, doubleVec&);
friend doubleVec operator-(doubleVec&, doubleVec&);
friend double operator*(doubleVec&, doubleVec&);
friend double operator^(doubleVec&, doubleVec&);
friend doubleVec operator*(doubleVec&, double&);
friend doubleVec operator*(double&, doubleVec&);
friend doubleVec doubleMat::operator*(doubleVec&);
friend doubleVec operator*(doubleVec&, doubleMat&);
friend doubleVec operator/(doubleVec&, double&);
friend doubleMat operator%(doubleVec&, doubleVec&);
friend doubleVec operator>>(doubleVec&, uint );
friend doubleVec operator<<(doubleVec&, uint );
friend int operator==(doubleVec&, doubleVec&);
friend int operator!=(doubleVec&, doubleVec&);
doubleVec& operator+=(doubleVec&);
doubleVec& operator-=(doubleVec&);
doubleVec& operator*=(double&);
doubleVec& operator/=(double&);
doubleVec& operator>>=(uint);
doubleVec& operator<<=(uint);
friend uint size(doubleVec& v)
{ return v.s; }
friend double* contents(doubleVec& v)
{ return v.p; }
friend uint min(doubleVec&);
friend uint max(doubleVec&);
friend double sum(doubleVec&);
friend double mse(doubleVec&, doubleVec&);
friend istream& operator>>(istream&, doubleVec&);
friend ostream& operator<<(ostream&, doubleVec&);
};
inline doubleVec_t::doubleVec_t(doubleVec& v)
{ t = doubleVec_type_temp, v.t = doubleVec_type_reference, s = v.s, p = v.p; }
inline double& doubleVec::operator()(uint i) {
if ( i >= s ) crash("doubleVec::operator() : subscript range error");
return p[i];
}
inline doubleVec doubleVec::operator()(uint i, uint j) {
if ( j < i || j >= s )
crash("doubleVec::operator() : sub-vector range error");
return doubleVec_t(doubleVec_type_reference,j-i+1,p+i);
}
inline doubleVec operator*(double& d, doubleVec& v)
{ return doubleVec_t(v * d); }
inline int operator!=(doubleVec& u, doubleVec& v)
{ return !(u == v); }
inline doubleVec& doubleVec::operator>>=(uint i)
{ *this = *this >> i; return *this; }
inline doubleVec& doubleVec::operator<<=(uint i)
{ *this = *this << i; return *this; }
//
// doubleMat: doubleMat class
//
struct doubleMat_ {
doubleVec_type t; // vector type
uint l, // total matrix size
m, // number of rows
n; // number of columns
double *p; // ptr to matrix values
uint del() { return t != doubleVec_type_reference; }
uint copy_from() { return t == doubleVec_type_temp; }
uint copy_to() { return t == doubleVec_type_plain; }
uint subvec() { return t == doubleVec_type_reference; }
};
class doubleMat_t : doubleMat_ {
friend class doubleMat;
doubleMat_t(doubleVec_type T, uint L, uint M, uint N, double* P)
{ t = T, l = L, m = M, n = N, p = P; }
public:
doubleMat_t(doubleMat& v);
};
class doubleMat : doubleMat_ {
friend doubleMat_t;
copy(double* from ) {
double* to = p;
for ( uint i=l; i--; ) *to++ = *from++; }
doubleMat(uint i, uint j, uint k)
{ t=doubleVec_type_plain, l=i, m=j, n=k, p = new double[l]; }
public:
doubleMat(uint i, uint j)
{ t=doubleVec_type_plain, l=i*j, m=i, n=j, p = new double[l]; }
doubleMat(doubleMat& v) {
t=doubleVec_type_plain, l=v.l, m=v.m, n=v.n;
if ( v.copy_from() )
p = v.p, v.t = doubleVec_type_reference;
else
p = new double[l], copy(v.p); }
doubleMat(uint i, uint j, double *pd) {
t=doubleVec_type_plain, l=i*j, m=i, n=j, p=new double[l];
copy(pd); }
doubleMat(uint i, uint j, double d) {
t=doubleVec_type_plain, l=i*j, m=i, n=j, p=new double[l];
double *pp = p;
for ( uint k=l; k--; ) *pp++ = d; }
doubleMat(doubleMat_t& v)
{ t=v.t, v.t=doubleVec_type_reference, l=v.l, m=v.m, n=v.n, p=v.p; }
~doubleMat()
{ if ( del() ) delete p; }
doubleVec operator()(uint i);
double& operator()(uint i, uint j);
doubleMat& operator=(doubleMat&);
doubleMat& operator=(double*);
doubleMat& operator=(double);
doubleMat& operator+()
{ return *this; }
friend doubleMat operator-(doubleMat&);
friend doubleMat operator~(doubleMat&);
friend doubleMat operator+(doubleMat&, doubleMat&);
friend doubleMat operator-(doubleMat&, doubleMat&);
friend doubleMat operator*(doubleMat&, doubleMat&);
friend doubleVec operator*(doubleMat&, doubleVec&);
friend doubleVec operator*(doubleVec&, doubleMat&);
friend doubleMat operator*(doubleMat&, double&);
friend doubleMat operator*(double&, doubleMat&);
friend doubleMat operator^(doubleMat&, doubleMat&);
friend doubleMat operator/(doubleMat&, double&);
friend doubleMat operator%(doubleVec&, doubleVec&);
friend int operator==(doubleMat&, doubleMat&);
doubleMat& operator+=(doubleMat&);
doubleMat& operator-=(doubleMat&);
doubleMat& operator*=(doubleMat&);
doubleMat& operator^=(doubleMat&);
doubleMat& operator*=(double&);
doubleMat& operator/=(double&);
friend uint csize(doubleMat& M) { return M.m; }
friend uint rsize(doubleMat& M) { return M.n; }
friend double trace(doubleMat&);
friend doubleMat eye(uint, double =1.);
friend istream& operator>>(istream&, doubleMat&);
friend ostream& operator<<(ostream&, doubleMat&);
};
inline doubleMat_t::doubleMat_t(doubleMat& v) {
t = doubleVec_type_temp, v.t = doubleVec_type_reference;
l = v.l, m = v.m, n = v.n, p = v.p;
}
inline doubleVec doubleMat::operator()(uint i) {
if ( i >= m ) crash("doubleMat::operator() : row subscript range error");
return doubleVec_t(doubleVec_type_reference,n,p+i*n);
}
inline double& doubleMat::operator()(uint i, uint j) {
if ( i >= m || j >= n )
crash("doubleMat::operator() : subscript range error");
return p[i*n+j];
}
inline doubleMat operator*(double& d, doubleMat& m)
{ return doubleMat_t(m * d); }
inline int operator!=(doubleMat& M, doubleMat& N)
{ return !(M == N); }
inline int square(doubleMat& M)
{ return rsize(M) == csize(M); }
#endif
----------------------------------------------------------------------------
/* moved to vax [9/88 kbg] */
#ifndef _nr_h_
#define _nr_h_
typedef struct FCOMPLEX {float r,i;} fcomplex;
typedef struct IMMENSE {unsigned long l,r;} immense;
typedef struct GREAT {unsigned short l,c,r;} great;
void adi(double **a, double **b, double **c, double **d, double **e,
double **f, double **g, double **u, int jmax, int k,
double alpha, double beta, double eps);
void anneal(float *x, float *y, int *iorder, int ncity);
void avevar(float *data, int n, float *ave, float *svar);
void balanc(float **a, int n);
void bcucof(float *y, float *y1, float *y2, float *y12, float d1,
float d2, float **c);
void bcuint(float *y, float *y1, float *y2, float *y12, float x1l,
float x1u, float x2l, float x2u, float x1, float x2,
float *ansy, float *ansy1, float *ansy2);
float bessi(int n, float x);
float bessi0(float x);
float bessi1(float x);
float bessj(int n, float x);
float bessj0(float x);
float bessj1(float x);
float bessk(int n, float x);
float bessk0(float x);
float bessk1(float x);
float bessy(int n, float x);
float bessy0(float x);
float bessy1(float x);
float beta(float z, float w);
float betacf(float a, float b, float x);
float betai(float a, float b, float x);
float bico(int n, int k);
void bksub(int ne, int nb, int jf, int k1, int k2, float ***c);
float bnldev(float pp, int n, int *idum);
void caldat(long julian, int *mm, int *id, int *iyyy);
float cel(float qqc, float pp, float aa, float bb);
void chder(float a, float b, float *c, float *cder, int n);
float chebev(float a, float b, float *c, int m, float x);
void chebpc(float *c, float *d, int n);
void chint(float a, float b, float *c, float *cint, int n);
void chsone(float *bins, float *ebins, int nbins, int knstrn,
float *df, float *chsq, float *prob);
void chstwo(float *bins1, float *bins2, int nbins, int knstrn,
float *df, float *chsq, float *prob);
void cntab1(int **nn, int n1, int nj, float *chisq, float *df,
float *prob, float *cramrv, float *ccc);
void cntab2(int **nn, int ni, int nj, float *h, float *hx, float *hy,
float *hygx, float *hxgy, float *uygx, float *uxgy,
float *uxy);
void convlv(float *data, int n, float *respns, int m, int isign,
float *ans);
void correl(float *data1, float *data2, int n, float *ans);
void cosft(float *y, int n, int isign);
void covsrt(float **covar, int ma, int *lista, int mfit);
void crank(int n, float *w, float *s);
void ddpoly(float *c, int nc, float x, float *pd, int nd);
void des(immense inp, immense key, int *newkey, int isw, immense *out);
void ks(immense key, int n, great *kn);
void cyfun(unsigned long ir, great k, unsigned long *iout);
float df1dim(float x);
void difeq(int k, int k1, int k2, int jsf, int is1, int isf,
int *indexv, int ne, float **s, float **y);
void eclass(int *nf, int n, int *lista, int *listb, int m);
void eclazz(int *nf, int n, int (*equiv)(int,int));
void eigsrt(float *d, float **v, int n);
float el2(float x, float qqc, float aa, float bb);
void elmhes(float **a, int n);
float erfcc(float x);
void eulsum(float *sum, float term, int jterm, float *wksp);
float evlmem(float fdt, float *cof, int m, float pm);
float expdev(int *idum);
float f1dim(float x);
float factln(int n);
float factrl(int n);
void fgauss(float x, float *a, float *y, float *dyda, int na);
void fit(float *x, float *y, int ndata, float *sig, int mwt, float *a,
float *b, float *siga, float *sigb, float *chi2, float *q);
void fixrts(float *d, int npoles);
void fleg(float x, float *pl, int nl);
void flmoon(int n, int nph, long *jd, float *frac);
void four1(float *data, int nn, int isign);
void fourn(float *data, int *nn, int ndim, int isign);
void fpoly(float x, float *p, int np);
void ftest(float *data1, int n1, float *data2, int n2, float *f,
float *prob);
float gamdev(int ia, int *idum);
float gammln(float xx);
float gammp(float a, float x);
float gammq(float a, float x);
float gasdev(int *idum);
void gauleg(double x1, double x2, double *x, double *w, int n);
void gaussj(float **a, int n, float **b, int m);
void gcf(float *gammcf, float a, float x, float *gln);
void gser(float *gamser, float a, float x, float *gln);
void hqr(float **a, int n, float *wr, float *wi);
void hunt(float *xx, int n, float x, int *jlo);
void indexx(int n, float *arrin, int *indx);
int irbit1(unsigned long int *iseed);
int irbit2(unsigned long int *iseed);
void jacobi(float **a, int n, float *d, float **v, int *nrot);
long julday(int mm, int id, int iyyy);
void kendl1(float *data1, float *data2, int n, float *tau, float *z,
float *prob);
void kendl2(float **tab, int i, int j, float *tau, float *z,
float *prob);
void kstwo(float *data1, int n1, float *data2, int n2, float *d,
float *prob);
void laguer(fcomplex *a, int m, fcomplex *x, float eps, int polish);
void locate(float *xx, int n, float x, int *j);
void lubksb(float **a, int n, int *indx, float *b);
void ludcmp(float **a, int n, int *indx, float *d);
void mdian1(float *x, int n, float *xmed);
void mdian2(float *x, int n, float *xmed);
void medfit(float *x, float *y, int ndata, float *a, float *b,
float *abdev);
void memcof(float *data, int n, int m, float *pm, float *cof);
void mnewt(int ntrial, float *x, int n, float tolx, float tolf);
void moment(float *data, int n, float *ave, float *adev, float *sdev,
float *svar, float *skew, float *curt);
void mprove(float **a, float **alud, int n, int *indx, float *b,
float *x);
void pcshft(float a, float b, float *d, int n);
void pearsn(float *x, float *y, int n, float *r, float *prob, float *z);
void piksr2(int n, float *arr, float *brr);
void piksrt(int n, float *arr);
void pinvs(int ie1, int ie2, int je1, int jsf, int jc1, int k,
float ***c, float **s);
float plgndr(int l, int m, float x);
float poidev(float xm, int *idum);
void polcoe(float *x, float *y, int n, float *cof);
void polcof(float *xa, float *ya, int n, float *cof);
void poldiv(float *u, int n, float *v, int nv, float *q, float *r);
void polin2(float *x1a, float *x2a, float **ya, int m, int n, float x1,
float x2, float *y, float *dy);
void polint(float *xa, float *ya, int n, float x, float *y, float *dy);
void predic(float *data, int ndata, float *d, int npoles,
float *future, int nfut);
float probks(float alam);
void pzextr(int iest, float xest, float *yest, float *yz, float *dy,
int nv, int nuse);
void qcksrt(int n, float *arr);
void qroot(float *p, int n, float *b, float *c, float eps);
float ran0(int *idum);
float ran1(int *idum);
float ran2(long *idum);
float ran3(int *idum);
float ran4(int *idum);
void rank(int n, int *indx, int *irank);
void ratint(float *xa, float *ya, int n, float x, float *y, float *dy);
void realft(float *data, int n, int isign);
void red(int iz1, int iz2, int jz1, int jz2, int jm1, int jm2, int jmf,
int ic1, int jc1, int jcf, int kc, float ***c, float **s);
float rofunc(float b);
void rzextr(int iest, float xest, float *yest, float *yz, float *dy,
int nv, int nuse);
void shell(int n, float *arr);
void shoot(int nvar, float *v, float *delv, int n2, float x1, float x2,
float eps, float h1, float hmin, float *f, float *dv);
void shootf(int nvar, float *v1, float *v2, float *delv1, float *delv2,
int n1, int n2, float x1, float x2, float xf, float eps,
float h1, float hmin, float *f, float *dv1, float *dv2);
void simp1(float **a, int mm, int *ll, int nll, int iabf, int *kp,
float *bmax);
void simp2(float **a, int n, int *l2, int nl2, int *ip, int kp,
float *q1);
void simp3(float **a, int i1, int k1, int ip, int kp);
void simplx(float **a, int m, int n, int m1, int m2, int m3,
int *icase, int *izrov, int *iposv);
void sinft(float *y, int n);
void smooft(float *y, int n, float pts);
void sncndn(float uu, float emmc, float *sn, float *cn, float *dn);
void solvde(int itmax, float conv, float slowc, float *scalv,
int *indexv, int ne, int nb, int m, float **y, float ***c,
float **s);
void sor(double **a, double **b, double **c, double **d, double **e,
double **f, double **u, int jmax, double rjac);
void sort(int n, float *ra);
void sort2(int n, float *ra, float *rb);
void sort3(int n, float *ra, float *rb, float *rc);
void sparse(float *b, int n, float *x, float *rsq);
void spctrm(FILE *fp, float *p, int m, int k, int ovrlap);
void spear(float *data1, float *data2, int n, float *d, float *zd,
float *probd, float *rs, float *probrs);
void splie2(float *x1a, float *x2a, float **ya, int m, int n,
float **y2a);
void splin2(float *x1a, float *x2a, float **ya, float **y2a, int m,
int n, float x1, float x2, float *y);
void spline(float *x, float *y, int n, float yp1, float ypn, float *y2);
void splint(float *xa, float *ya, float *y2a, int n, float x, float *y);
void svbksb(float **u, float *w, float **v, int m, int n, float *b,
float *x);
void svdcmp(float **a, int m, int n, float *w, float **v);
void svdvar(float **v, int ma, float *w, float **cvm);
void toeplz(float *r, float *x, float *y, int n);
void tptest(float *data1, float *data2, int n, float *t, float *prob);
void tqli(float *d, float *e, int n, float **z);
void tred2(float **a, int n, float *d, float *e);
void tridag(float *a, float *b, float *c, float *r, float *u, int n);
void ttest(float *data1, int n1, float *data2, int n2, float *t,
float *prob);
void tutest(float *data1, int n1, float *data2, int n2, float *t,
float *prob);
void twofft(float *data1, float *data2, float *fft1, float *fft2,
int n);
void vander(float *x, float *w, float *q, int n);
void zroots(fcomplex *a, int m, fcomplex *roots, int polish);
float *vector(int, int);
float **matrix(int, int, int, int);
float **convert_matrix(float*, int, int, int, int);
double *dvector(int, int);
double **dmatrix(int, int, int, int);
int *ivector(int, int);
int **imatrix(int, int);
float **submatrix(float**, int, int, int, int, int, int);
void free_vector(float*, int, int);
void free_dvector(float*, int, int);
void free_ivector(float*, int, int);
void free_matrix(float**, int, int, int, int);
void free_dmatrix(float**, int, int, int, int);
void free_imatrix(float**, int, int, int, int);
void free_submatrix(float**, int, int, int, int);
void free_convert_matrix(float**, int, int, int, int);
void nrerror(char*);
#endif
----------------------------------------------------------------------------
//
// type.h : machine type definitions
//
#ifndef TYPEH
#define TYPEH
typedef short int int16;
typedef long int int32;
typedef unsigned short int uint16;
typedef unsigned long int uint32;
typedef unsigned int uint;
typedef unsigned char byte;
#endif
----------------------------------------------------------------------------
//
// error.h : error function header file
//
#ifndef _error_h
#define _error_h
#include <overload.h>
#include <stream.h>
#include <std.h>
void warning(const char*);
void error(const char*);
void crash(const char*);
#endif
----------------------------------------------------------------------------
//
// overload.h : single repository for overload statements
//
// this single repository avoids warning messages of multiple
// overloads.
//
#ifndef _overload_h_
#define _overload_h_
overload warning;
overload error;
overload crash;
overload square;
#endif
----------------------------------------------------------------------------