Loading...
Searching...
No Matches
interpf.h File Reference
`#include <grass/config.h>`
`#include <stdio.h>`
`#include <grass/gis.h>`
`#include <grass/raster.h>`
`#include <grass/vector.h>`
`#include <grass/bitmap.h>`
`#include <grass/dataquad.h>`
`#include <grass/qtree.h>`
`#include <grass/dbmi.h>`
Include dependency graph for interpf.h:

Go to the source code of this file.

## Data Structures

struct | fcell_triple
struct | interp_params

## Macros

#define | GRASS_INTERPFL_EXPORT

## Typedefs

typedef int | grid_calc_fn(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
typedef int | matrix_create_fn(struct interp_params *, struct triple *, int, double **, int *)
typedef int | check_points_fn(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple *)
typedef int | secpar_fn(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
typedef double | interp_fn(double, double)
typedef int | interpder_fn(double, double, double *, double *)
typedef int | wr_temp_fn(struct interp_params *, int, int, off_t)

## Functions

double | IL_dist_square (double *, double *, int)
double | IL_crst (double, double)
| Radial basis function.
int | IL_crstg (double, double, double *, double *)
| Function for calculating derivatives (d=2).
void | IL_init_params_2d (struct interp_params *, FILE *, int, int, double, int, int, char *, int, int, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, DCELL *, double, int, int, int, int, double, char *, char *, char *, char *, char *, char *, double, double, double, int, double, double, FILE *, FILE *, FILE *, FILE *, FILE *, FILE *, bool, struct TimeStamp *, int, const char *)
void | IL_init_func_2d (struct interp_params *, grid_calc_fn *, matrix_create_fn *, check_points_fn *, secpar_fn *, interp_fn *, interpder_fn *, wr_temp_fn *)
int | IL_input_data_2d (struct interp_params *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *)
struct BM * | IL_create_bitmask (struct interp_params *)
int | translate_quad (struct multtree *, double, double, double, int)
int | IL_grid_calc_2d (struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)
int | IL_matrix_create (struct interp_params *, struct triple *, int, double **, int *)
int | IL_matrix_create_alloc (struct interp_params *, struct triple *, int, double **, int *, double *)
| Creates system of linear equations from interpolated points.
int | min1 (int, int)
int | max1 (int, int)
double | amax1 (double, double)
double | amin1 (double, double)
int | IL_interp_segments_new_2d (struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, int, double)
int | IL_output_2d (struct interp_params *, struct Cell_head *, double, double, double, double, double, double, double, double, double, double, double, char *, double, int, int, int)
int | IL_check_at_points_2d (struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple *)
int | IL_write_point_2d (struct triple, double)
| A function to write out point and deviation at point to database.
int | IL_check_at_points_2d_cvdev (struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple *)
| A parallel version of IL_check_at_points_2d. Sperate the cross-validation/deviation computing part and the database writing part.
int | IL_resample_output_2d (struct interp_params *, double, double, double, double, double, double, double, double, double, double, double, char *, double *, struct Cell_head *, struct Cell_head *, char *, int)
int | IL_resample_interp_segments_2d (struct interp_params *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double *, int, int, int, int, int, double, double, double, double, int)
int | IL_secpar_loop_2d (struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)
double | smallest_segment (struct multtree *, int)
int | IL_interp_segments_2d (struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, off_t, double)
int | IL_interp_segments_2d_parallel (struct interp_params *, struct tree_info *, struct multtree *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, int, off_t, double, int)
int | IL_vector_input_data_2d (struct interp_params *, struct Map_info *, int, char *, char *, struct tree_info *, double *, double *, double *, double *, double *, double *, int *, double *)
int | process_point (double, double, double, double, struct tree_info *, double, double *, double *, double *, double *, double *, double *, int *, int *, int *)
int | IL_write_temp_2d (struct interp_params *, int, int, off_t)

## Variables

struct line_pnts * | Pnts
struct line_cats * | Cats2
dbDriver * | driver2
dbString | sql2
struct Map_info | Map2
struct field_info * | ff
int | count

## Macro Definition Documentation

## GRASS_INTERPFL_EXPORT

#define GRASS_INTERPFL_EXPORT

Definition at line 18 of file interpf.h.

## Typedef Documentation

## check_points_fn

typedef int check_points_fn(struct interp_params *, struct quaddata *, double *, double *, double, double, struct triple *)

Definition at line 57 of file interpf.h.

## grid_calc_fn

typedef int grid_calc_fn(struct interp_params *, struct quaddata *, struct BM *, double, double, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, off_t, double)

Definition at line 49 of file interpf.h.

## interp_fn

typedef double interp_fn(double, double)

Definition at line 64 of file interpf.h.

## interpder_fn

typedef int interpder_fn(double, double, double *, double *)

Definition at line 66 of file interpf.h.

## matrix_create_fn

typedef int matrix_create_fn(struct interp_params *, struct triple *, int, double **, int *)

Definition at line 54 of file interpf.h.

## secpar_fn

typedef int secpar_fn(struct interp_params *, int, int, int, struct BM *, double *, double *, double *, double *, double *, double *, int, int)

Definition at line 60 of file interpf.h.

## wr_temp_fn

typedef int wr_temp_fn(struct interp_params *, int, int, off_t)

Definition at line 68 of file interpf.h.

## Function Documentation

## amax1()

double amax1 | ( | double | arg1,
|  | double | arg2 )

Definition at line 52 of file minmax.c.

Referenced by IL_grid_calc_2d(), IL_matrix_create_alloc(), IL_output_2d(), IL_resample_output_2d(), IL_secpar_loop_2d(), and process_point().

## amin1()

double amin1 | ( | double | arg1,
|  | double | arg2 )

Definition at line 65 of file minmax.c.

Referenced by IL_grid_calc_2d(), IL_output_2d(), IL_resample_output_2d(), IL_secpar_loop_2d(), and process_point().

## IL_check_at_points_2d()

int IL_check_at_points_2d | ( | struct interp_params * | params,
|  | struct quaddata * | data,
|  | double * | b,
|  | double * | ertot,
|  | double | zmin,
|  | double | dnorm,
|  | struct triple * | skip_point )

Checks if interpolating function interp() evaluates correct z-values at given points. If smoothing is used calculate the maximum error caused by smoothing.

ertot is a RMS deviation of the interpolated surface.

Todo
  Alternative description: ...calculate the maximum and RMS deviation caused by smoothing.

Parameters

  data | current region
  b | solution of linear equations
  ertot | total error
  zmin | min z-value

Definition at line 52 of file point2d.c.

References b, interp_params::create_devi, interp_params::cv, err(), interp_params::fi, IL_write_point_2d(), interp_params::interp, r, triple::x, interp_params::x_orig, triple::y, interp_params::y_orig, and triple::z.

## IL_check_at_points_2d_cvdev()

int IL_check_at_points_2d_cvdev | ( | struct interp_params * | params,
|  | struct quaddata * | data,
|  | double * | b,
|  | double * | ertot,
|  | double | zmin,
|  | double | dnorm,
|  | struct triple * | target_point )

A parallel version of IL_check_at_points_2d. Sperate the cross-validation/deviation computing part and the database writing part.

Parameters

  params | interpolation parameters
  data | data in the segment for computing, NULL for writing out
  b | solution of linear equations for computing, NULL for writing out
  ertot | total error for computing, point at single point for writing out
  zmin | min z-value for computing
  dnorm | normalization factor for computing
  target_point | point for computing or writing out

Returns
  1

Todo
  Alternative description: ...calculate the maximum and RMS deviation caused by smoothing.

Parameters

  data | current region
  b | solution of linear equations
  ertot | total error
  zmin | min z-value

Definition at line 60 of file point2d_parallel.c.

References b, interp_params::cv, err(), interp_params::fi, IL_write_point_2d(), interp_params::interp, NULL, r, triple::x, interp_params::x_orig, triple::y, interp_params::y_orig, and triple::z.

## IL_create_bitmask()

struct BM * IL_create_bitmask | ( | struct interp_params * | params | ) |

Creates a bitmap mask from given raster map

Creates a bitmap mask from maskmap raster file and/or current MASK if present and returns a pointer to the bitmask. If no mask is in force returns NULL.

Definition at line 37 of file input2d.c.

References BM_create(), BM_set(), G_fatal_error(), G_find_raster2(), G_message(), interp_params::maskmap, interp_params::nsizc, interp_params::nsizr, and NULL.

## IL_crst()

double IL_crst | ( | double | r,
|  | double | fi )

Radial basis function.

Radial basis function - completely regularized spline with tension (d=2)

parameter description from DESCRIPTION.INTERP

Parameters

  r | distance squared
  fi | tension

Returns

Definition at line 49 of file func2d.c.

References b, r, and x.

## IL_crstg()

int IL_crstg | ( | double | r,
|  | double | fi,
|  | double * | gd1,
|  | double * | gd2 )

Function for calculating derivatives (d=2).

Derivatives of radial basis function - regularized spline with tension(d=2)

Parameters

  r | distance squared
  fi | tension
  gd1 | G1(r)
  gd2 | G2(r)

Returns

Definition at line 111 of file func2d.c.

References r, and x.

## IL_dist_square()

double IL_dist_square | ( | double * | pt1,
|  | double * | pt2,
|  | int | dim )

Definition at line 18 of file rst/interp_float/distance.c.

## IL_grid_calc_2d()

int IL_grid_calc_2d | ( | struct interp_params * | params,
|  | struct quaddata * | data,
|  | struct BM * | bitmask,
|  | double | zmin,
|  | double | zmax,
|  | double * | zminac,
|  | double * | zmaxac,
|  | double * | gmin,
|  | double * | gmax,
|  | double * | c1min,
|  | double * | c1max,
|  | double * | c2min,
|  | double * | c2max,
|  | double * | ertot,
|  | double * | b,
|  | off_t | offset1,
|  | double | dnorm )

Calculates grid values for a given segment

Calculates grid for the given segment represented by data (contains n_rows, n_cols, ew_res,ns_res, and all points inside + overlap) using solutions of system of linear equations and interpolating functions interp() and interpder(). Also calls secpar() to compute slope, aspect and curvatures if required.

ertot can be also called RMS deviation of the interpolated surface

Parameters

  data | given segment
  bitmask | bitmask
  zmax | min and max input z-values
  zmaxac | min and max interp. z-values
  gmax | min and max interp. slope val.
  c1max | min and max interp. curv. val.
  c2max | min and max interp. curv. val.
  ertot | total interpolating func. error
  b | solutions of linear equations
  offset1 | offset for temp file writing

Definition at line 61 of file interp2d.c.

References interp_params::adx, interp_params::adxx, interp_params::adxy, interp_params::ady, interp_params::adyy, amax1(), amin1(), interp_params::az, b, BM_get(), interp_params::deriv, interp_params::fi, G_warning(), interp_params::interp, interp_params::interpder, interp_params::KMAX2, l, quaddata::n_cols, quaddata::n_points, quaddata::n_rows, NULL, quaddata::points, r, interp_params::scalex, interp_params::secpar, interp_params::theta, interp_params::wr_temp, triple::x, and triple::y.

## IL_init_func_2d()

void IL_init_func_2d | ( | struct interp_params * | params,
|  | grid_calc_fn * | grid_f,
|  | matrix_create_fn * | matr_f,
|  | check_points_fn * | point_f,
|  | secpar_fn * | secp_f,
|  | interp_fn * | interp_f,
|  | interpder_fn * | interpder_f,
|  | wr_temp_fn * | temp_f )

Initializes functions used by the library

Parameters

  grid_f | calculates grid for given segment
  matr_f | creates matrix for a given segment
  point_f | checks interpolation function at points
  secp_f | calculates aspect, slope, curvature
  interp_f | radial basis function
  interpder_f | derivatives of radial basis function
  temp_f | writes temp files

Definition at line 107 of file init2d.c.

References interp_params::check_points, interp_params::grid_calc, interp_params::interp, interp_params::interpder, interp_params::matrix_create, interp_params::secpar, and interp_params::wr_temp.

## IL_init_params_2d()

void IL_init_params_2d | ( | struct interp_params * | params,
|  | FILE * | inp,
|  | int | elatt,
|  | int | smatt,
|  | double | zm,
|  | int | k1,
|  | int | k2,
|  | char * | msk,
|  | int | rows,
|  | int | cols,
|  | DCELL * | ar1,
|  | DCELL * | ar2,
|  | DCELL * | ar3,
|  | DCELL * | ar4,
|  | DCELL * | ar5,
|  | DCELL * | ar6,
|  | double | tension,
|  | int | k3,
|  | int | sc1,
|  | int | sc2,
|  | int | sc3,
|  | double | sm,
|  | char * | f1,
|  | char * | f2,
|  | char * | f3,
|  | char * | f4,
|  | char * | f5,
|  | char * | f6,
|  | double | dm,
|  | double | x_or,
|  | double | y_or,
|  | int | der,
|  | double | tet,
|  | double | scl,
|  | FILE * | t1,
|  | FILE * | t2,
|  | FILE * | t3,
|  | FILE * | t4,
|  | FILE * | t5,
|  | FILE * | t6,
|  | bool | create_devi,
|  | struct TimeStamp * | ts,
|  | int | c,
|  | const char * | wheresql )

Initializes parameters used by the library

Parameters

  inp | input stream
  elatt | which fp att in sites file? 1 = first
  smatt | which fp att in sites file to use for smoothing? (if zero use sm) 1 = first
  zm | multiplier for z-values
  k1 | min number of points per segment for interpolation
  k2 | max number of points per segment
  msk | name of mask
  cols | number of rows and columns
  ar6 | arrays for interpolated values (ar1-ar6)
  tension | tension
  k3 | max number of points for interpolation
  sc3 | multipliers for interpolation values
  sm | smoothing
  f6 | output files (f1-f6)
  dm | min distance between points
  x_or | x of origin
  y_or | y of origin
  der | 1 if compute partial derivatives
  tet | anisotropy angle (0 is East, counter-clockwise)
  scl | anisotropy scaling factor
  t6 | temp files for writing interp. values (t1-t6)
  create_devi | create deviations file?
  c | cross validation
  wheresql | SQL WHERE statement

Definition at line 30 of file init2d.c.

References interp_params::adx, interp_params::adxx, interp_params::adxy, interp_params::ady, interp_params::adyy, interp_params::aspect, interp_params::az, interp_params::create_devi, interp_params::cv, interp_params::deriv, interp_params::dmin, interp_params::elatt, interp_params::elev, interp_params::fdinp, interp_params::fi, interp_params::kmax, interp_params::KMAX2, interp_params::kmin, interp_params::maskmap, interp_params::mcurv, interp_params::nsizc, interp_params::nsizr, interp_params::pcurv, interp_params::rsm, interp_params::scalex, interp_params::scik1, interp_params::scik2, interp_params::scik3, interp_params::slope, interp_params::smatt, interp_params::tcurv, interp_params::theta, interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, interp_params::Tmp_fd_z, interp_params::ts, interp_params::wheresql, interp_params::x_orig, interp_params::y_orig, and interp_params::zmult.

## IL_input_data_2d()

int IL_input_data_2d | ( | struct interp_params * | ,
|  | struct tree_info * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | int * | )

## IL_interp_segments_2d()

int IL_interp_segments_2d | ( | struct interp_params * | params,
|  | struct tree_info * | info,
|  | struct multtree * | tree,
|  | struct BM * | bitmask,
|  | double | zmin,
|  | double | zmax,
|  | double * | zminac,
|  | double * | zmaxac,
|  | double * | gmin,
|  | double * | gmax,
|  | double * | c1min,
|  | double * | c1max,
|  | double * | c2min,
|  | double * | c2max,
|  | double * | ertot,
|  | int | totsegm,
|  | off_t | offset1,
|  | double | dnorm )

Interpolate recursively a tree of segments

Recursively processes each segment in a tree by:

- finding points from neighbouring segments so that the total number of points is between KMIN and KMAX2 by calling tree function MT_get_region().
- creating and solving the system of linear equations using these points and interp() by calling matrix_create() and G_ludcmp().
- checking the interpolating function values at points by calling check_points().
- computing grid for this segment using points and interp() by calling grid_calc().

Todo
  Isn't this in fact the updated version of the function (IL_interp_segments_new_2d)? The function IL_interp_segments_new_2d has the following, better behavior: The difference between this function and IL_interp_segments_2d() is making sure that additional points are taken from all directions, i.e. it finds equal number of points from neighboring segments in each of 8 neighborhoods.

Parameters

  info | info for the quad tree
  tree | current leaf of the quad tree
  bitmask | bitmask
  zmax | min and max input z-values
  zmaxac | min and max interp. z-values
  gmax | min and max inperp. slope val.
  c1max | min and max interp. curv. val.
  c2max | min and max interp. curv. val.
  ertot | total interplating func. error
  totsegm | total number of segments
  offset1 | offset for temp file writing

Definition at line 46 of file segmen2d.c.

References b, interp_params::check_points, interp_params::cv, multtree::data, G_alloc_ivector(), G_alloc_matrix(), G_alloc_vector(), G_debug(), G_free(), G_lubksb(), G_percent(), G_warning(), interp_params::grid_calc, IL_interp_segments_2d(), interp_params::KMAX2, interp_params::kmin, multtree::leafs, interp_params::matrix_create, MT_region_data(), quaddata::n_cols, quaddata::n_rows, interp_params::nsizc, interp_params::nsizr, NULL, quad_data_new(), tree_info::root, smallest_segment(), interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, interp_params::Tmp_fd_z, triple::x, interp_params::x_orig, quaddata::x_orig, quaddata::xmax, triple::y, interp_params::y_orig, quaddata::y_orig, quaddata::ymax, and triple::z.

Referenced by IL_interp_segments_2d().

## IL_interp_segments_2d_parallel()

int IL_interp_segments_2d_parallel | ( | struct interp_params * | params,
|  | struct tree_info * | info,
|  | struct multtree * | tree,
|  | struct BM * | bitmask,
|  | double | zmin,
|  | double | zmax,
|  | double * | zminac,
|  | double * | zmaxac,
|  | double * | gmin,
|  | double * | gmax,
|  | double * | c1min,
|  | double * | c1max,
|  | double * | c2min,
|  | double * | c2max,
|  | double * | ertot,
|  | int | totsegm,
|  | off_t | offset1,
|  | double | dnorm,
|  | int | threads )

See documentation for IL_interp_segments_2d. This is a parallel processing implementation.

Parameters

  info | info for the quad tree
  tree | current leaf of the quad tree
  bitmask | bitmask
  zmax | min and max input z-values
  zmaxac | min and max interp. z-values
  gmax | min and max inperp. slope val.
  c1max | min and max interp. curv. val.
  c2max | min and max interp. curv. val.
  ertot | total interplating func. error
  totsegm | total number of segments
  offset1 | offset for temp file writing

Definition at line 36 of file segmen2d_parallel.c.

References b, interp_params::check_points, interp_params::create_devi, interp_params::cv, multtree::data, err(), G_alloc_ivector(), G_alloc_matrix(), G_alloc_vector(), G_debug(), G_fatal_error(), G_free(), G_lubksb(), G_message(), G_percent(), G_warning(), interp_params::grid_calc, IL_matrix_create_alloc(), interp_params::KMAX2, interp_params::kmin, MT_region_data(), quaddata::n_cols, quaddata::n_points, quaddata::n_rows, interp_params::nsizc, interp_params::nsizr, NULL, quaddata::points, quad_data_new(), smallest_segment(), interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, interp_params::Tmp_fd_z, triple::x, interp_params::x_orig, quaddata::x_orig, quaddata::xmax, triple::y, interp_params::y_orig, quaddata::y_orig, quaddata::ymax, and triple::z.

## IL_interp_segments_new_2d()

int IL_interp_segments_new_2d | ( | struct interp_params * | ,
|  | struct tree_info * | ,
|  | struct multtree * | ,
|  | struct BM * | ,
|  | double | ,
|  | double | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | double * | ,
|  | int | ,
|  | int | ,
|  | double | )

## IL_matrix_create()

int IL_matrix_create | ( | struct interp_params * | params,
|  | struct triple * | points,
|  | int | n_points,
|  | double ** | matrix,
|  | int * | indx )

Author
  Lubos Mitas (original program and various modifications)
  H. Mitasova, I. Kosinovsky, D. Gerdes, D. McCauley (GRASS4.1 version of the program and GRASS4.2 modifications)
  L. Mitas, H. Mitasova, I. Kosinovsky, D.Gerdes, D. McCauley (1993, 1995)
  modified by McCauley in August 1995
  modified by Mitasova in August 1995, Nov. 1996

Copyright
  (C) 1993-1996 by Lubos Mitas and the GRASS Development Team
  This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Definition at line 37 of file matrix.c.

References G_alloc_vector(), IL_matrix_create_alloc(), interp_params::KMAX2, and NULL.

## IL_matrix_create_alloc()

int IL_matrix_create_alloc | ( | struct interp_params * | params,
|  | struct triple * | points,
|  | int | n_points,
|  | double ** | matrix,
|  | int * | indx,
|  | double * | A )

Creates system of linear equations from interpolated points.

Creates system of linear equations represented by matrix using given points and interpolating function interp()

Parameters

  | params | struct interp_params *
  | points | points for interpolation as struct triple
  | n_points | number of points
  [out] | matrix | the matrix
  | indx |

Returns
  -1 on failure, 1 on success

Definition at line 69 of file matrix.c.

References amax1(), interp_params::fi, G_debug(), G_ludcmp(), interp_params::interp, l, r, interp_params::rsm, interp_params::scalex, triple::sm, interp_params::theta, triple::x, x, and triple::y.

Referenced by IL_interp_segments_2d_parallel(), and IL_matrix_create().

## IL_output_2d()

int IL_output_2d | ( | struct interp_params * | params,
|  | struct Cell_head * | cellhd,
|  | double | zmin,
|  | double | zmax,
|  | double | zminac,
|  | double | zmaxac,
|  | double | c1min,
|  | double | c1max,
|  | double | c2min,
|  | double | c2max,
|  | double | gmin,
|  | double | gmax,
|  | double | ertot,
|  | char * | input,
|  | double | dnorm,
|  | int | dtens,
|  | int | vect,
|  | int | n_points )

Creates output files as well as history files and color tables for them.

ertot can be also called RMS deviation of the interpolated surface.

Parameters

  cellhd | current region
  zmax | min,max input z-values
  c1max | min,max interpolated values
  ertot | total interpolating func. error
  input | input file name
  dnorm | normalization factor

Definition at line 57 of file output2d.c.

References amax1(), amin1(), interp_params::aspect, interp_params::deriv, interp_params::dmin, interp_params::elev, interp_params::fi, G_fatal_error(), G_find_file(), G_warning(), G_write_raster_timestamp(), interp_params::kmax, interp_params::kmin, interp_params::mcurv, MULT, interp_params::nsizc, interp_params::nsizr, NULL, interp_params::pcurv, interp_params::rsm, interp_params::scalex, interp_params::slope, interp_params::smatt, interp_params::tcurv, interp_params::theta, interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, interp_params::Tmp_fd_z, interp_params::ts, and interp_params::zmult.

## IL_resample_interp_segments_2d()

int IL_resample_interp_segments_2d | ( | struct interp_params * | params,
|  | struct BM * | bitmask,
|  | double | zmin,
|  | double | zmax,
|  | double * | zminac,
|  | double * | zmaxac,
|  | double * | gmin,
|  | double * | gmax,
|  | double * | c1min,
|  | double * | c1max,
|  | double * | c2min,
|  | double * | c2max,
|  | double * | ertot,
|  | off_t | offset1,
|  | double * | dnorm,
|  | int | overlap,
|  | int | inp_rows,
|  | int | inp_cols,
|  | int | fdsmooth,
|  | int | fdinp,
|  | double | ns_res,
|  | double | ew_res,
|  | double | inp_ns_res,
|  | double | inp_ew_res,
|  | int | dtens )

Definition at line 33 of file ressegm2d.c.

References b, interp_params::check_points, interp_params::fi, G_alloc_ivector(), G_alloc_matrix(), G_alloc_vector(), G_free(), G_lubksb(), G_percent(), interp_params::grid_calc, interp_params::kmax, interp_params::KMAX2, interp_params::kmin, l, interp_params::matrix_create, min1(), quaddata::n_cols, quaddata::n_points, quaddata::n_rows, interp_params::nsizc, interp_params::nsizr, NULL, quad_data_new(), r, fcell_triple::smooth, fcell_triple::x, x, interp_params::x_orig, quaddata::xmax, fcell_triple::y, interp_params::y_orig, and quaddata::ymax.

## IL_resample_output_2d()

int IL_resample_output_2d | ( | struct interp_params * | params,
|  | double | zmin,
|  | double | zmax,
|  | double | zminac,
|  | double | zmaxac,
|  | double | c1min,
|  | double | c1max,
|  | double | c2min,
|  | double | c2max,
|  | double | gmin,
|  | double | gmax,
|  | double | ertot,
|  | char * | input,
|  | double * | dnorm,
|  | struct Cell_head * | outhd,
|  | struct Cell_head * | winhd,
|  | char * | smooth,
|  | int | n_points )

Definition at line 45 of file resout2d.c.

References amax1(), amin1(), interp_params::aspect, interp_params::deriv, interp_params::elev, interp_params::fi, G_fatal_error(), G_find_file(), G_find_file2(), G_mapset(), G_verbose_message(), G_warning(), interp_params::kmax, interp_params::kmin, interp_params::mcurv, MULT, interp_params::nsizc, interp_params::nsizr, NULL, interp_params::pcurv, interp_params::slope, interp_params::tcurv, interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, interp_params::Tmp_fd_z, and interp_params::zmult.

## IL_secpar_loop_2d()

int IL_secpar_loop_2d | ( | struct interp_params * | params,
|  | int | ngstc,
|  | int | nszc,
|  | int | k,
|  | struct BM * | bitmask,
|  | double * | gmin,
|  | double * | gmax,
|  | double * | c1min,
|  | double * | c1max,
|  | double * | c2min,
|  | double * | c2max,
|  | int | cond1,
|  | int | cond2 )

Compute slope aspect and curvatures

Computes slope, aspect and curvatures (depending on cond1, cond2) for derivative arrays adx,...,adxy between columns ngstc and nszc.

Parameters

  ngstc | starting column
  nszc | ending column
  k | current row
  c2max | min,max interp. values
  cond2 | determine if particular values need to be computed

Definition at line 34 of file secpar2d.c.

References interp_params::adx, interp_params::adxx, interp_params::adxy, interp_params::ady, interp_params::adyy, amax1(), amin1(), BM_get(), and NULL.

## IL_vector_input_data_2d()

int IL_vector_input_data_2d | ( | struct interp_params * | params,
|  | struct Map_info * | Map,
|  | int | field,
|  | char * | zcol,
|  | char * | scol,
|  | struct tree_info * | info,
|  | double * | xmin,
|  | double * | xmax,
|  | double * | ymin,
|  | double * | ymax,
|  | double * | zmin,
|  | double * | zmax,
|  | int * | n_points,
|  | double * | dmax )

Insert into a quad tree

Inserts input data inside the region into a quad tree. Also translates data. Returns number of segments in the quad tree.

As z values may be used (in Map):

- z coordinates in 3D file -> field = 0
- categories -> field > 0, zcol = NULL
- attributes -> field > 0, zcol != NULL

Parameters

  params | interpolation parameters
  Map | input vector map
  field | category field number
  zcol | name of the column containing z values
  scol | name of the column containing smooth values
  info | quadtree info
  n_points | number of points used for interpolation
  dmax | max distance between points

Definition at line 50 of file vinput2d.c.

References multtree::data, G_debug(), G_fatal_error(), G_important_message(), G_message(), G_verbose_message(), G_warning(), interp_params::kmax, interp_params::KMAX2, interp_params::kmin, NULL, process_point(), tree_info::root, translate_quad(), interp_params::wheresql, and interp_params::zmult.

## IL_write_point_2d()

int IL_write_point_2d | ( | struct triple | point,
|  | double | err )

A function to write out point and deviation at point to database.

Parameters

  point | point to write out
  error | deviation at point

Returns
  1

Definition at line 163 of file point2d.c.

References Cats2, count, driver2, err(), ff, G_debug(), G_fatal_error(), Map2, Pnts, and sql2.

Referenced by IL_check_at_points_2d(), and IL_check_at_points_2d_cvdev().

## IL_write_temp_2d()

int IL_write_temp_2d | ( | struct interp_params * | params,
|  | int | ngstc,
|  | int | nszc,
|  | off_t | offset2 )

Writes az,adx,...,adxy into appropriate place (depending on ngstc, nszc and offset) in corresponding temp file

Parameters

  ngstc | begin. column
  nszc | end. column
  offset2 | offset

Definition at line 34 of file write2d.c.

References interp_params::adx, interp_params::adxx, interp_params::adxy, interp_params::ady, interp_params::adyy, interp_params::az, interp_params::deriv, G_fatal_error(), interp_params::nsizc, NULL, interp_params::scik1, interp_params::scik2, interp_params::scik3, interp_params::Tmp_fd_dx, interp_params::Tmp_fd_dy, interp_params::Tmp_fd_xx, interp_params::Tmp_fd_xy, interp_params::Tmp_fd_yy, and interp_params::Tmp_fd_z.

## max1()

int max1 | ( | int | arg1,
|  | int | arg2 )

Definition at line 30 of file minmax.c.

## min1()

int min1 | ( | int | arg1,
|  | int | arg2 )

Definition at line 17 of file minmax.c.

Referenced by IL_resample_interp_segments_2d().

## process_point()

int process_point | ( | double | x,
|  | double | y,
|  | double | z,
|  | double | sm,
|  | struct tree_info * | info,
|  | double | zmult,
|  | double * | xmin,
|  | double * | xmax,
|  | double * | ymin,
|  | double * | ymax,
|  | double * | zmin,
|  | double * | zmax,
|  | int * | npoint,
|  | int * | OUTRANGE,
|  | int * | total )

Definition at line 306 of file vinput2d.c.

References amax1(), amin1(), multtree::data, G_warning(), MT_insert(), quad_point_new(), tree_info::root, x, quaddata::xmax, and quaddata::ymax.

Referenced by IL_vector_input_data_2d().

## smallest_segment()

double smallest_segment | ( | struct multtree * | tree,
|  | int | n_leafs )

Definition at line 342 of file segmen2d.c.

References multtree::data, multtree::leafs, NULL, smallest_segment(), and quaddata::xmax.

Referenced by IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), and smallest_segment().

## translate_quad()

int translate_quad | ( | struct multtree * | tree,
|  | double | numberx,
|  | double | numbery,
|  | double | numberz,
|  | int | n_leafs )

Definition at line 90 of file input2d.c.

References multtree::data, multtree::leafs, NULL, quaddata::points, translate_quad(), x, quaddata::x_orig, quaddata::xmax, quaddata::y_orig, and quaddata::ymax.

Referenced by IL_vector_input_data_2d(), and translate_quad().

## Variable Documentation

## Cats2

struct line_cats* Cats2

extern

Referenced by IL_write_point_2d().

## count

int count

extern

Referenced by AS_basic_stats(), AS_class_discont(), AS_class_equiprob(), AS_class_frequencies(), AS_class_interval(), AS_class_quant(), AS_class_stdev(), BM_create_sparse(), c_ave(), c_count(), c_divr(), c_intr(), c_kurt(), c_mode(), c_skew(), c_sum(), c_var(), Cairo_font_info(), Cairo_font_list(), COM_Font_info(), COM_Font_list(), COM_Set_font(), G__read_Cell_head(), G_asprintf(), G_get_timestamps(), G_list(), G_list_element(), G_math_A_to_Asp(), G_math_sband_matrix_to_Asp(), G_rasprintf(), G_snprintf(), G_str_replace(), G_str_to_sql(), G_switch_search_path(), G_vasprintf(), GPJ_get_datum_transform_by_name(), GPJ_get_default_datum_params_by_name(), IL_write_point_2d(), json_validate(), kdtree_insert(), N_assemble_les_2d_param(), N_assemble_les_3d_param(), N_calc_solute_transport_transmission_2d(), N_convert_array_2d_null_to_zero(), N_convert_array_3d_null_to_zero(), N_les_integrate_dirichlet_2d(), N_les_integrate_dirichlet_3d(), pj_do_transform(), w_ave(), w_count(), w_kurt(), w_mode(), w_skew(), w_sum(), and w_var().

## driver2

dbDriver* driver2

extern

Referenced by IL_write_point_2d().

## ff

struct field_info* ff

extern

Referenced by IL_write_point_2d().

## Map2

struct Map_info Map2

extern

Referenced by IL_write_point_2d().

## Pnts

struct line_pnts* Pnts

extern

Referenced by IL_write_point_2d().

## sql2

dbString sql2

extern

Referenced by IL_write_point_2d().