/* de_indices.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" /*float window_width_const = 3.12;*/ float calc_kernel2(float Y[2][2], int n, float bandwidth) { float return_val; float tmpf; /* float window_width2; */ /* window_width2 = window_width_const / (float)pow((double)n, (double)window_width_exponent);*/ return_val = 0.; Y[0][0] -= Y[1][0]; Y[0][1] -= Y[1][1]; Y[0][0] /= bandwidth; Y[0][1] /= bandwidth; tmpf = Y[0][0]*Y[0][0] + Y[0][1]*Y[0][1]; if (tmpf < 1.0) { tmpf = 1.0 - tmpf; return_val = 3.0 * tmpf * tmpf / (float)M_PI; } return(return_val); } float calc_kernel3(float Y[2][2], int n, float bandwidth) { float return_val; float tmpf; /* float window_width3; */ /* window_width3 = window_width_const / (float)pow((double)n, (double)window_width_exponent);*/ return_val = 0.; Y[0][0] -= Y[1][0]; Y[0][1] -= Y[1][1]; Y[0][0] /= bandwidth; Y[0][1] /= bandwidth; tmpf = Y[0][0]*Y[0][0] + Y[0][1]*Y[0][1]; if (tmpf < 1.0) { tmpf = 1.0 - tmpf; return_val = 4.0 * tmpf * tmpf * tmpf/ (float)M_PI; } return(return_val); } float fts_index(float **proj_data, int n, int *rows_in_plot, float bandwidth) { int i, j; /* float window_width3 = window_width_const; */ float Y[2][2]; float indx_val; /* tmpf = (float) pow((double)n, (double)window_width_exponent); window_width3 /= tmpf;*/ indx_val = 0.; for (i=0; i