/*#define maxdim 13 */
#define maxdim 40
#define maxmodes 257
#define PI	3.1415927

float gauss(float *x,
	    float *mean, 
	    float *hafinvvar, 
	    float corprod, 
	    int Ndim);

char **alloc2d(int dim1, 
	       int dim2, 
	       int size);

void free2d(void **p);

int areadfloat(char *file, 
	       float **buff, 
	       int *numfloats);

void vector_quantize(float **codes, 
		     int Ncodes,
		     float **vector, 
		     int Nvecs, 
		     int Ndim, 
		     int *bin);

int read_backup_distribution(char *filen,
                             float ***mean,
			     float ***variance,
			     float **pi, int *Nmodes, int Ndim);

int store_distribution(char *file,
		       int Nmodes,
		       int Ndim,
		       float *c, 
		       float **mean, 
		       float **var);

void estimate_multi_modals(float **x, 
			   int N, 
			   int Ndim, 
			   int K, 
			   float **mean, 
			   float **var, 
			   float *c, 
			   char *tempfile, 
			   int numiters);



