/* skewness.c */ /************************************************************ * * * Permission is hereby granted to any individual or * * institution for use, copying, or redistribution of * * the xgobi code and associated documentation, provided * * that such code and documentation are not sold for * * profit and the following copyright notice is retained * * in the code and documentation: * * Copyright (c) 1990, ..., 1996 Bellcore * * * * We welcome your questions and comments, and request * * that you share any modifications with us. * * * * Deborah F. Swayne Dianne Cook * * dfs@research.att.com dicook@iastate.edu * * (973) 360-8423 www.public.iastate.edu/~dicook/ * * * * Andreas Buja * * andreas@research.att.com * * www.research.att.com/~andreas/ * * * ************************************************************/ #include #include "xincludes.h" #include "xgobitypes.h" #include "xgobivars.h" #include "xgobiexterns.h" #define QUROOTPI 1.3313353638003898 #define SQROOTPI 1.7724538509055159 #define ONEON4PI 0.079577471545947673 static float *h0, *h1, *norm0, *norm1; static float acoefs[2]; void alloc_skewness(int n) { h0 = (float *) XtMalloc( (unsigned int) n*sizeof(float)); h1 = (float *) XtMalloc( (unsigned int) n*sizeof(float)); norm0 = (float *) XtMalloc( (unsigned int) n*sizeof(float)); norm1 = (float *) XtMalloc( (unsigned int) n*sizeof(float)); } void free_skewness() { XtFree((XtPointer) h0); XtFree((XtPointer) h1); XtFree((XtPointer) norm0); XtFree((XtPointer) norm1); } float skewness_index(float **proj_data, int n, int *rows_in_plot) { int i, m; float indx_val; /* Calculate Hermite polynomials */ for (i=0; i