15 int getg(
double w,
double *
g[2],
int size)
17 long i, j, totsize, n, g_row;
18 float rsq, sigma, two_ssq, val, sum = 0.0;
20 totsize = size * size;
22 for (i = 0; i < totsize; i++) {
27 sigma = w / (2.0 * sqrt((
double)2.0));
28 two_ssq = 2.0 * sigma * sigma;
29 for (i = 0; i < n; i++) {
31 for (j = 0; j < n; j++) {
33 val = (rsq / two_ssq - 1) * exp(-rsq / two_ssq);
34 *(
g[0] + g_row + j) = val;
38 *(
g[0] + g_row + (size - j)) = val;
42 *(
g[0] + (size - i) * size + j) = val;
46 *(
g[0] + (size - i) * size + (size - j)) = val;
int getg(double w, double *g[2], int size)