GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ressegm2d.c
Go to the documentation of this file.
1 
2 /*-
3  * Written by H. Mitasova, I. Kosinovsky, D. Gerdes Summer 1993
4  * University of Illinois
5  * US Army Construction Engineering Research Lab
6  * Copyright 1993, H. Mitasova (University of Illinois),
7  * I. Kosinovsky, (USA-CERL), and D.Gerdes (USA-CERL)
8  *
9  * modified by McCauley in August 1995
10  * modified by Mitasova in August 1995
11  *
12  * bug fixes by Jaro Hofierka in February 1999:
13  * line: 175,348 (*dnorm)
14  * 177,350 (points[m1].sm)
15  * 457,461 (})
16  *
17  * modified by Mitasova November 1999 (option for dnorm ind. tension)
18  *
19  */
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <math.h>
24 #include <grass/gis.h>
25 #include <grass/interpf.h>
26 #include <grass/gmath.h>
27 
28 static int input_data(struct interp_params *,
29  int, int, struct fcell_triple *, int, int, int, int,
30  double, double, double);
31 static int write_zeros(struct interp_params *, struct quaddata *, int);
32 
33 int IL_resample_interp_segments_2d(struct interp_params *params, struct BM *bitmask, /* bitmask */
34  double zmin, double zmax, /* min and max input z-values */
35  double *zminac, double *zmaxac, /* min and max interp. z-values */
36  double *gmin, double *gmax, /* min and max inperp. slope val. */
37  double *c1min, double *c1max, double *c2min, double *c2max, /* min and max interp. curv. val. */
38  double *ertot, /* total interplating func. error */
39  int offset1, /* offset for temp file writing */
40  double *dnorm,
41  int overlap,
42  int inp_rows,
43  int inp_cols,
44  int fdsmooth,
45  int fdinp,
46  double ns_res,
47  double ew_res,
48  double inp_ns_res,
49  double inp_ew_res, int dtens)
50 {
51 
52  int i, j, k, l, m, m1, i1; /* loop coounters */
53  int cursegm = 0;
54  int new_comp = 0;
55  int n_rows, n_cols, inp_r, inp_c;
56  double x_or, y_or, xm, ym;
57  static int first = 1, new_first = 1;
58  double **matrix = NULL, **new_matrix = NULL, *b = NULL;
59  int *indx = NULL, *new_indx = NULL;
60  static struct fcell_triple *in_points = NULL; /* input points */
61  int inp_check_rows, inp_check_cols, /* total input rows/cols */
62  out_check_rows, out_check_cols; /* total output rows/cols */
63  int first_row, last_row; /* first and last input row of segment */
64  int first_col, last_col; /* first and last input col of segment */
65  int num, prev;
66  int div; /* number of divides */
67  int rem_out_row, rem_out_col; /* output rows/cols remainders */
68  int inp_seg_r, inp_seg_c, /* # of input rows/cols in segment */
69  out_seg_r, out_seg_c; /* # of output rows/cols in segment */
70  int ngstc, nszc /* first and last output col of the
71  * segment */
72  , ngstr, nszr; /* first and last output row of the
73  * segment */
74  int index; /* index for input data */
75  int c, r;
76  int overlap1;
77  int p_size;
78  struct quaddata *data;
79  double xmax, xmin, ymax, ymin;
80  int totsegm; /* total number of segments */
81  int total_points = 0;
82 
83 
84  xmin = params->x_orig;
85  ymin = params->y_orig;
86  xmax = xmin + ew_res * params->nsizc;
87  ymax = ymin + ns_res * params->nsizr;
88  prev = inp_rows * inp_cols;
89  if (prev <= params->kmax)
90  div = 1; /* no segmentation */
91 
92  else { /* find the number of divides */
93  for (i = 2;; i++) {
94  c = inp_cols / i;
95  r = inp_rows / i;
96  num = c * r;
97  if (num < params->kmin) {
98  if (((params->kmin - num) > (prev + 1 - params->kmax)) &&
99  (prev + 1 < params->KMAX2)) {
100  div = i - 1;
101  break;
102  }
103  else {
104  div = i;
105  break;
106  }
107  }
108  if ((num > params->kmin) && (num + 1 < params->kmax)) {
109  div = i;
110  break;
111  }
112  prev = num;
113  }
114  }
115  out_seg_r = params->nsizr / div; /* output rows per segment */
116  out_seg_c = params->nsizc / div; /* output cols per segment */
117  inp_seg_r = inp_rows / div; /* input rows per segment */
118  inp_seg_c = inp_cols / div; /* input rows per segment */
119  rem_out_col = params->nsizc % div;
120  rem_out_row = params->nsizr % div;
121  overlap1 = min1(overlap, inp_seg_c - 1);
122  overlap1 = min1(overlap1, inp_seg_r - 1);
123  out_check_rows = 0;
124  out_check_cols = 0;
125  inp_check_rows = 0;
126  inp_check_cols = 0;
127 
128  if (div == 1) {
129  p_size = inp_seg_c * inp_seg_r;
130  }
131  else {
132  p_size = (overlap1 * 2 + inp_seg_c) * (overlap1 * 2 + inp_seg_r);
133  }
134  if (!in_points) {
135  if (!
136  (in_points =
137  (struct fcell_triple *)G_malloc(sizeof(struct fcell_triple) *
138  p_size * div))) {
139  fprintf(stderr, "Cannot allocate memory for in_points\n");
140  return -1;
141  }
142  }
143 
144  *dnorm =
145  sqrt(((xmax - xmin) * (ymax -
146  ymin) * p_size) / (inp_rows * inp_cols));
147 
148  if (dtens) {
149  params->fi = params->fi * (*dnorm) / 1000.;
150  fprintf(stderr, "dnorm = %f, rescaled tension = %f\n", *dnorm,
151  params->fi);
152  }
153 
154  if (div == 1) { /* no segmentation */
155  totsegm = 1;
156  cursegm = 1;
157 
158  input_data(params, 1, inp_rows, in_points, fdsmooth, fdinp, inp_rows,
159  inp_cols, zmin, inp_ns_res, inp_ew_res);
160 
161  x_or = 0.;
162  y_or = 0.;
163  xm = params->nsizc * ew_res;
164  ym = params->nsizr * ns_res;
165 
166  data = (struct quaddata *)quad_data_new(x_or, y_or, xm, ym,
167  params->nsizr, params->nsizc,
168  0, params->KMAX2);
169  m1 = 0;
170  for (k = 1; k <= p_size; k++) {
171  if (!G_is_f_null_value(&(in_points[k - 1].z))) {
172  data->points[m1].x = in_points[k - 1].x / (*dnorm);
173  data->points[m1].y = in_points[k - 1].y / (*dnorm);
174  /* data->points[m1].z = (double) (in_points[k - 1].z) / (*dnorm); */
175  data->points[m1].z = (double)(in_points[k - 1].z);
176  data->points[m1].sm = in_points[k - 1].smooth;
177  m1++;
178  }
179  }
180  data->n_points = m1;
181  total_points = m1;
182  if (!(indx = G_alloc_ivector(params->KMAX2 + 1))) {
183  fprintf(stderr, "Cannot allocate memory for indx\n");
184  return -1;
185  }
186  if (!(matrix = G_alloc_matrix(params->KMAX2 + 1, params->KMAX2 + 1))) {
187  fprintf(stderr, "Cannot allocate memory for matrix\n");
188  return -1;
189  }
190  if (!(b = G_alloc_vector(params->KMAX2 + 2))) {
191  fprintf(stderr, "Cannot allocate memory for b\n");
192  return -1;
193  }
194 
195  if (params->matrix_create(params, data->points, m1, matrix, indx) < 0)
196  return -1;
197  for (i = 0; i < m1; i++) {
198  b[i + 1] = data->points[i].z;
199  }
200  b[0] = 0.;
201  G_lubksb(matrix, m1 + 1, indx, b);
202 
203  params->check_points(params, data, b, ertot, zmin, *dnorm);
204 
205  if (params->grid_calc(params, data, bitmask,
206  zmin, zmax, zminac, zmaxac, gmin, gmax,
207  c1min, c1max, c2min, c2max, ertot, b, offset1,
208  *dnorm) < 0) {
209  fprintf(stderr, "interpolation failed\n");
210  return -1;
211  }
212  else {
213  if (totsegm != 0) {
214  G_percent(cursegm, totsegm, 1);
215  }
216  /*
217  * if (b) G_free_vector(b); if (matrix) G_free_matrix(matrix); if
218  * (indx) G_free_ivector(indx);
219  */
220  fprintf(stderr, "dnorm in ressegm after grid before out= %f \n",
221  *dnorm);
222  return total_points;
223  }
224  }
225 
226  out_seg_r = params->nsizr / div; /* output rows per segment */
227  out_seg_c = params->nsizc / div; /* output cols per segment */
228  inp_seg_r = inp_rows / div; /* input rows per segment */
229  inp_seg_c = inp_cols / div; /* input rows per segment */
230  rem_out_col = params->nsizc % div;
231  rem_out_row = params->nsizr % div;
232  overlap1 = min1(overlap, inp_seg_c - 1);
233  overlap1 = min1(overlap1, inp_seg_r - 1);
234  out_check_rows = 0;
235  out_check_cols = 0;
236  inp_check_rows = 0;
237  inp_check_cols = 0;
238 
239  totsegm = div * div;
240 
241  /* set up a segment */
242  for (i = 1; i <= div; i++) { /* input and output rows */
243  if (i <= div - rem_out_row)
244  n_rows = out_seg_r;
245  else
246  n_rows = out_seg_r + 1;
247  inp_r = inp_seg_r;
248  out_check_cols = 0;
249  inp_check_cols = 0;
250  ngstr = out_check_rows + 1; /* first output row of the segment */
251  nszr = ngstr + n_rows - 1; /* last output row of the segment */
252  y_or = (ngstr - 1) * ns_res; /* y origin of the segment */
253  /*
254  * Calculating input starting and ending rows and columns of this
255  * segment
256  */
257  first_row = (int)(y_or / inp_ns_res) + 1;
258  if (first_row > overlap1) {
259  first_row -= overlap1; /* middle */
260  last_row = first_row + inp_seg_r + overlap1 * 2 - 1;
261  if (last_row > inp_rows) {
262  first_row -= (last_row - inp_rows); /* bottom */
263  last_row = inp_rows;
264  }
265  }
266  else {
267  first_row = 1; /* top */
268  last_row = first_row + inp_seg_r + overlap1 * 2 - 1;
269  }
270  if ((last_row > inp_rows) || (first_row < 1)) {
271  fprintf(stderr, "Row overlap too large!\n");
272  return -1;
273  }
274  input_data(params, first_row, last_row, in_points, fdsmooth, fdinp,
275  inp_rows, inp_cols, zmin, inp_ns_res, inp_ew_res);
276 
277  for (j = 1; j <= div; j++) { /* input and output cols */
278  if (j <= div - rem_out_col)
279  n_cols = out_seg_c;
280  else
281  n_cols = out_seg_c + 1;
282  inp_c = inp_seg_c;
283 
284  ngstc = out_check_cols + 1; /* first output col of the segment */
285  nszc = ngstc + n_cols - 1; /* last output col of the segment */
286  x_or = (ngstc - 1) * ew_res; /* x origin of the segment */
287 
288  first_col = (int)(x_or / inp_ew_res) + 1;
289  if (first_col > overlap1) {
290  first_col -= overlap1; /* middle */
291  last_col = first_col + inp_seg_c + overlap1 * 2 - 1;
292  if (last_col > inp_cols) {
293  first_col -= (last_col - inp_cols); /* right */
294  last_col = inp_cols;
295  }
296  }
297  else {
298  first_col = 1; /* left */
299  last_col = first_col + inp_seg_c + overlap1 * 2 - 1;
300  }
301  if ((last_col > inp_cols) || (first_col < 1)) {
302  fprintf(stderr, "Column overlap too large!\n");
303  return -1;
304  }
305  m = 0;
306  /* Getting points for interpolation (translated) */
307 
308  xm = nszc * ew_res;
309  ym = nszr * ns_res;
310  data = (struct quaddata *)quad_data_new(x_or, y_or, xm, ym,
311  nszr - ngstr + 1,
312  nszc - ngstc + 1, 0,
313  params->KMAX2);
314  new_comp = 0;
315 
316  for (k = 0; k <= last_row - first_row; k++) {
317  for (l = first_col - 1; l < last_col; l++) {
318  index = k * inp_cols + l;
319  if (!G_is_f_null_value(&(in_points[index].z))) {
320  /* if the point is inside the segment (not overlapping) */
321  if ((in_points[index].x - x_or >= 0) &&
322  (in_points[index].y - y_or >= 0) &&
323  ((nszc - 1) * ew_res - in_points[index].x >= 0) &&
324  ((nszr - 1) * ns_res - in_points[index].y >= 0))
325  total_points += 1;
326  data->points[m].x =
327  (in_points[index].x - x_or) / (*dnorm);
328  data->points[m].y =
329  (in_points[index].y - y_or) / (*dnorm);
330  /* data->points[m].z = (double) (in_points[index].z) / (*dnorm); */
331  data->points[m].z = (double)(in_points[index].z);
332  data->points[m].sm = in_points[index].smooth;
333  m++;
334  }
335  else
336  new_comp = 1;
337 
338  /* fprintf(stderr,"%f,%f,%f
339  zmin=%f\n",in_points[index].x,in_points[index].y,in_points[index].z,zmin);
340  */
341  }
342  }
343  /* fprintf (stdout,"m,index:%di,%d\n",m,index); */
344  if (m <= params->KMAX2)
345  data->n_points = m;
346  else
347  data->n_points = params->KMAX2;
348  out_check_cols += n_cols;
349  inp_check_cols += inp_c;
350  cursegm = (i - 1) * div + j - 1;
351 
352  /* show before to catch 0% */
353  if (totsegm != 0) {
354  G_percent(cursegm, totsegm, 1);
355  }
356  if (m == 0) {
357  /*
358  * fprintf(stderr,"Warning: segment with zero points encountered,
359  * insrease overlap\n");
360  */
361  write_zeros(params, data, offset1);
362  }
363  else {
364  if (new_comp) {
365  if (new_first) {
366  new_first = 0;
367  if (!b) {
368  if (!(b = G_alloc_vector(params->KMAX2 + 2))) {
369  fprintf(stderr,
370  "Cannot allocate memory for b\n");
371  return -1;
372  }
373  }
374  if (!(new_indx = G_alloc_ivector(params->KMAX2 + 1))) {
375  fprintf(stderr,
376  "Cannot allocate memory for new_indx\n");
377  return -1;
378  }
379  if (!
380  (new_matrix =
381  G_alloc_matrix(params->KMAX2 + 1,
382  params->KMAX2 + 1))) {
383  fprintf(stderr,
384  "Cannot allocate memory for new_matrix\n");
385  return -1;
386  }
387  } /*new_first */
388  if (params->
389  matrix_create(params, data->points, data->n_points,
390  new_matrix, new_indx) < 0)
391  return -1;
392 
393  for (i1 = 0; i1 < m; i1++) {
394  b[i1 + 1] = data->points[i1].z;
395  }
396  b[0] = 0.;
397  G_lubksb(new_matrix, data->n_points + 1, new_indx, b);
398 
399  params->check_points(params, data, b, ertot, zmin,
400  *dnorm);
401 
402  if (params->grid_calc(params, data, bitmask,
403  zmin, zmax, zminac, zmaxac, gmin,
404  gmax, c1min, c1max, c2min, c2max,
405  ertot, b, offset1, *dnorm) < 0) {
406 
407  fprintf(stderr, "interpolate() failed\n");
408  return -1;
409  }
410  } /*new_comp */
411  else {
412  if (first) {
413  first = 0;
414  if (!b) {
415  if (!(b = G_alloc_vector(params->KMAX2 + 2))) {
416  fprintf(stderr,
417  "Cannot allocate memory for b\n");
418  return -1;
419  }
420  }
421  if (!(indx = G_alloc_ivector(params->KMAX2 + 1))) {
422  fprintf(stderr,
423  "Cannot allocate memory for indx\n");
424  return -1;
425  }
426  if (!
427  (matrix =
428  G_alloc_matrix(params->KMAX2 + 1,
429  params->KMAX2 + 1))) {
430  fprintf(stderr,
431  "Cannot allocate memory for matrix\n");
432  return -1;
433  }
434  } /* first */
435  if (params->
436  matrix_create(params, data->points, data->n_points,
437  matrix, indx) < 0)
438  return -1;
439  /* } here it was bug */
440  for (i1 = 0; i1 < m; i1++)
441  b[i1 + 1] = data->points[i1].z;
442  b[0] = 0.;
443  G_lubksb(matrix, data->n_points + 1, indx, b);
444 
445  params->check_points(params, data, b, ertot, zmin,
446  *dnorm);
447 
448  if (params->grid_calc(params, data, bitmask,
449  zmin, zmax, zminac, zmaxac, gmin,
450  gmax, c1min, c1max, c2min, c2max,
451  ertot, b, offset1, *dnorm) < 0) {
452 
453  fprintf(stderr, "interpolate() failed\n");
454  return -1;
455  }
456  }
457  }
458  if (data) {
459  G_free(data->points);
460  G_free(data);
461  }
462  /*
463  * cursegm++;
464  */
465  }
466 
467  inp_check_rows += inp_r;
468  out_check_rows += n_rows;
469  }
470 
471  /* run one last time after the loop is done to catch 100% */
472  if (totsegm != 0)
473  G_percent(1, 1, 1); /* cursegm doesn't get to totsegm so we force 100% */
474 
475  /*
476  * if (b) G_free_vector(b); if (indx) G_free_ivector(indx); if (matrix)
477  * G_free_matrix(matrix);
478  */
479  fprintf(stderr, "dnorm in ressegm after grid before out2= %f \n", *dnorm);
480  return total_points;
481 }
482 
483 /* input of data for interpolation and smoothing parameters */
484 
485 static int input_data(struct interp_params *params,
486  int first_row, int last_row,
487  struct fcell_triple *points,
488  int fdsmooth, int fdinp,
489  int inp_rows, int inp_cols,
490  double zmin, double inp_ns_res, double inp_ew_res)
491 {
492  double x, y, sm; /* input data and smoothing */
493  int m1, m2; /* loop counters */
494  int ret_val, ret_val1; /* return values of G_get_map_row */
495  static FCELL *cellinp = NULL; /* cell buffer for input data */
496  static FCELL *cellsmooth = NULL; /* cell buffer for smoothing */
497 
498 
499  if (!cellinp)
500  cellinp = G_allocate_f_raster_buf();
501  if (!cellsmooth)
502  cellsmooth = G_allocate_f_raster_buf();
503 
504  for (m1 = 0; m1 <= last_row - first_row; m1++) {
505  ret_val =
506  G_get_f_raster_row(fdinp, cellinp, inp_rows - m1 - first_row);
507  if (ret_val < 0) {
508  fprintf(stderr, "Cannot get row %d (return value = %d)\n", m1,
509  ret_val);
510  return -1;
511  }
512  if (fdsmooth >= 0) {
513  ret_val1 =
514  G_get_f_raster_row(fdsmooth, cellsmooth,
515  inp_rows - m1 - first_row);
516  if (ret_val1 < 0) {
517  fprintf(stderr, "Cannot get smoothing row\n");
518  }
519  }
520  y = params->y_orig + (m1 + first_row - 1 + 0.5) * inp_ns_res;
521  for (m2 = 0; m2 < inp_cols; m2++) {
522  x = params->x_orig + (m2 + 0.5) * inp_ew_res;
523  /*
524  * z = cellinp[m2]*params->zmult;
525  */
526  if (fdsmooth >= 0)
527  sm = (double)cellsmooth[m2];
528  else
529  sm = 0.01;
530 
531  points[m1 * inp_cols + m2].x = x - params->x_orig;
532  points[m1 * inp_cols + m2].y = y - params->y_orig;
533  if (!G_is_f_null_value(cellinp + m2)) {
534  points[m1 * inp_cols + m2].z =
535  cellinp[m2] * params->zmult - zmin;
536  }
537  else {
538  G_set_f_null_value(&(points[m1 * inp_cols + m2].z), 1);
539  }
540 
541  /* fprintf (stdout,"sm: %f\n",sm); */
542 
543  points[m1 * inp_cols + m2].smooth = sm;
544  }
545  }
546  return 1;
547 }
548 
549 static int write_zeros(struct interp_params *params, struct quaddata *data, /* given segment */
550  int offset1 /* offset for temp file writing */
551  )
552 {
553 
554  /*
555  * C C INTERPOLATION BY FUNCTIONAL METHOD : TPS + complete regul.
556  * c
557  */
558  double x_or = data->x_orig;
559  double y_or = data->y_orig;
560  int n_rows = data->n_rows;
561  int n_cols = data->n_cols;
562  int cond1, cond2;
563  int k, l;
564  int ngstc, nszc, ngstr, nszr;
565  int offset, offset2;
566  double ns_res, ew_res;
567 
568  ns_res = (((struct quaddata *)(data))->ymax -
569  ((struct quaddata *)(data))->y_orig) / data->n_rows;
570  ew_res = (((struct quaddata *)(data))->xmax -
571  ((struct quaddata *)(data))->x_orig) / data->n_cols;
572 
573  cond2 = ((params->adxx != NULL) || (params->adyy != NULL) ||
574  (params->adxy != NULL));
575  cond1 = ((params->adx != NULL) || (params->ady != NULL) || cond2);
576 
577  ngstc = (int)(x_or / ew_res + 0.5) + 1;
578  nszc = ngstc + n_cols - 1;
579  ngstr = (int)(y_or / ns_res + 0.5) + 1;
580  nszr = ngstr + n_rows - 1;
581 
582  for (k = ngstr; k <= nszr; k++) {
583  offset = offset1 * (k - 1); /* rows offset */
584  for (l = ngstc; l <= nszc; l++) {
585  /*
586  * params->az[l] = 0.;
587  */
588  G_set_d_null_value(params->az + l, 1);
589  if (cond1) {
590  /*
591  * params->adx[l] = (FCELL)0.; params->ady[l] = (FCELL)0.;
592  */
593  G_set_d_null_value(params->adx + l, 1);
594  G_set_d_null_value(params->ady + l, 1);
595  if (cond2) {
596  G_set_d_null_value(params->adxx + l, 1);
597  G_set_d_null_value(params->adyy + l, 1);
598  G_set_d_null_value(params->adxy + l, 1);
599  /*
600  * params->adxx[l] = (FCELL)0.; params->adyy[l] = (FCELL)0.;
601  * params->adxy[l] = (FCELL)0.;
602  */
603  }
604  }
605  }
606  offset2 = (offset + ngstc - 1) * sizeof(FCELL);
607  if (params->wr_temp(params, ngstc, nszc, offset2) < 0)
608  return -1;
609  }
610  return 1;
611 }
double y
Definition: interpf.h:15
void G_free(void *buf)
Free allocated memory.
Definition: gis/alloc.c:142
int l
Definition: dataquad.c:292
float b
Definition: named_colr.c:8
double xmax
Definition: dataquad.c:293
double y_orig
Definition: dataquad.h:33
FCELL * G_allocate_f_raster_buf(void)
Allocates memory for a raster map of type FCELL.
Definition: alloc_cell.c:111
void G_set_d_null_value(DCELL *dcellVals, int numVals)
Definition: null_val.c:176
double ** G_alloc_matrix(int rows, int cols)
Matrix memory allocation.
Definition: dalloc.c:60
float r
Definition: named_colr.c:8
double xmin
Definition: dataquad.c:293
int(* wr_temp)()
Definition: interpf.h:70
double z
Definition: dataquad.h:26
long num
Definition: g3dcats.c:93
DCELL * adxx
Definition: interpf.h:48
int G_get_f_raster_row(int fd, FCELL *buf, int row)
Get raster row (FCELL type)
Definition: gis/get_row.c:945
double y_orig
Definition: interpf.h:55
double ymin
Definition: dataquad.c:293
int y
Definition: plot.c:34
double x_orig
Definition: dataquad.h:32
DCELL * adx
Definition: interpf.h:48
struct triple * points
Definition: dataquad.h:39
int G_percent(long n, long d, int s)
Print percent complete messages.
Definition: percent.c:63
struct quaddata * quad_data_new(double x_or, double y_or, double xmax, double ymax, int rows, int cols, int n_points, int kmax)
Definition: dataquad.c:36
void G_lubksb(double **a, int n, int *indx, double b[])
Definition: lu.c:71
tuple data
int(* matrix_create)()
Definition: interpf.h:65
int G_is_f_null_value(const FCELL *fcellVal)
Returns 1 if fcell is NULL, 0 otherwise. This will test if the value fcell is a NaN. It isn&#39;t good enough to test for a particular NaN bit pattern since the machine code may change this bit pattern to a different NaN. The test will be.
Definition: null_val.c:281
DCELL * az
Definition: interpf.h:48
double x
Definition: interpf.h:14
double x
Definition: dataquad.h:24
int
Definition: g3dcolor.c:48
double sm
Definition: dataquad.h:27
double fi
Definition: interpf.h:49
double ymax
Definition: dataquad.c:293
double x_orig
Definition: interpf.h:55
int first
Definition: form/open.c:25
void G_set_f_null_value(FCELL *fcellVals, int numVals)
Definition: null_val.c:158
int IL_resample_interp_segments_2d(struct interp_params *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, double *, int, int, int, int, int, double, double, double, double, int)
Definition: ressegm2d.c:33
DCELL * ady
Definition: interpf.h:48
return NULL
Definition: dbfopen.c:1394
int * G_alloc_ivector(size_t n)
Vector matrix memory allocation.
Definition: ialloc.c:41
double zmult
Definition: interpf.h:40
int n_rows
Definition: dataquad.h:36
DCELL * adxy
Definition: interpf.h:48
double * G_alloc_vector(size_t n)
Vector matrix memory allocation.
Definition: dalloc.c:41
double smooth
Definition: interpf.h:17
int(* check_points)()
Definition: interpf.h:66
int(* grid_calc)()
Definition: interpf.h:64
int n_cols
Definition: dataquad.h:37
double y
Definition: dataquad.h:25
int min1(int, int)
Definition: minmax.c:18
FCELL z
Definition: interpf.h:16
int n_points
Definition: dataquad.h:38
DCELL * adyy
Definition: interpf.h:48