#include #include "globals.h" #include "local_proto.h" int within (int samptot, int nclass, double nsamp[MC], double cov[MC][MX][MX], double w[MX][MX], int bands) { int i,j,k; /* Initialize within class covariance matrix */ for (i = 1 ; i <= bands ; i++) for (j = 1 ; j <= bands ; j++) w[i][j] = 0.0; for (i = 1 ; i <= nclass ; i++) for (j = 1 ; j <= bands ; j++) for (k = 1 ; k <= bands ; k++) w[j][k] += (nsamp[i] - 1) * cov[i][j][k]; for (i = 1 ; i <= bands ; i++) for (j = 1 ; j <= bands ; j++) w[i][j] = (1.0 / ((double) (samptot - nclass))) * w[i][j]; return 0; } /****************************************************************************/ int between (int samptot, int nclass, double nsamp[MC], double mu[MC][MX], double p[MX][MX], int bands) { int i,j,k; double tmp0[MX][MX],tmp1[MX][MX],tmp2[MX][MX]; double newvec[MX]; for (i=0; i