GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
segmen2d.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include <grass/interpf.h>
#include <grass/gmath.h>
Include dependency graph for segmen2d.c:

Go to the source code of this file.

Functions

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)
 
double smallest_segment (struct multtree *tree, int n_leafs)
 

Detailed Description

Author
H. Mitasova, I. Kosinovsky, D. Gerdes
Author
H. Mitasova, I. Kosinovsky, D. Gerdes (single core)
Stanislav Zubal, Michal Lacko (OpenMP version)
Anna Petrasova (OpenMP version GRASS integration)

Definition in file segmen2d.c.

Function Documentation

◆ 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
infoinfo for the quad tree
treecurrent leaf of the quad tree
bitmaskbitmask
zmaxmin and max input z-values
zmaxacmin and max interp. z-values
gmaxmin and max inperp. slope val.
c1maxmin and max interp. curv. val.
c2maxmin and max interp. curv. val.
ertottotal interplating func. error
totsegmtotal number of segments
offset1offset for temp file writing

Definition at line 47 of file segmen2d.c.

◆ smallest_segment()

double smallest_segment ( struct multtree tree,
int  n_leafs 
)

Definition at line 346 of file segmen2d.c.

References multtree::data, multtree::leafs, NULL, and quaddata::xmax.