1.4.0
CCC
 
DbHelper.cpp File Reference
#include "geoslib_old_f.h"
#include "Db/DbHelper.hpp"
#include "Db/Db.hpp"
#include "Db/DbGrid.hpp"
#include "Skin/Skin.hpp"
#include "Basic/Law.hpp"
#include "Basic/Memory.hpp"
#include "Core/Keypair.hpp"

Classes

class  LocalSkin
 

Macros

#define R(i, j)   (R[(i) * n + (j)])
 

Functions

static int st_code_comparable (const Db *db1, const Db *db2, int iech, int jech, int opt_code, int tolcode)
 
static void st_grid_fill_neigh (int ipos, int ndim, int radius, int *nech_loc, int *tabind, double *tabval)
 
static int st_grid_fill_calculate (int ipos, int mode, int nech, int *tabind, const double *tabval)
 
static void st_write_active_sample (Db *db, int iech, int nvar, int *iatt, double *tab)
 
static int st_read_active_sample (Db *db, int flag_zero, int iech, int nvar, int *iatt, double eps, double *tab)
 
static int st_find_interval (double x, int ndef, const double *X)
 
static void st_grid1D_interpolate_linear (Db *dbgrid, int ivar, int ndef, const double *X, const double *Y)
 
static int st_grid1D_interpolate_spline (Db *dbgrid, int ivar, int ndef, const double *X, const double *Y)
 

Variables

static DbGridDB_GRID_FILL
 

Macro Definition Documentation

◆ R

#define R (   i,
 
)    (R[(i) * n + (j)])

Function Documentation

◆ st_code_comparable()

static int st_code_comparable ( const Db db1,
const Db db2,
int  iech,
int  jech,
int  opt_code,
int  tolcode 
)
static

Check if a pair must be kept according to code criterion

Returns
1 if the codes are not comparable
Parameters
[in]db1First Db structure
[in]db2Second Db structure
[in]iechRank of the first sample
[in]jechRank of the second sample
[in]opt_codecode selection option
  • 0 : no use of the code selection
  • 1 : codes must be close enough
  • 2 : codes must be different
[in]tolcodeCode tolerance
Remarks
When used in variogram calculation, pairs are discarded then the
resulting value is 1.

◆ st_find_interval()

static int st_find_interval ( double  x,
int  ndef,
const double *  X 
)
static

Find the interval (among vector X) to which the sample (x) belongs

Returns
Rank of the interval containing the target
Parameters
[in]xTarget coordinate
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
Remarks
If x < min(X) or x > max(X) the returned index is -1
Array X is assumed to be increasingly ordered

◆ st_grid1D_interpolate_linear()

static void st_grid1D_interpolate_linear ( Db dbgrid,
int  ivar,
int  ndef,
const double *  X,
const double *  Y 
)
static

Fill an incomplete 1-D grid by linear interpolation from a set of valued samples

Parameters
[in]dbgridDb grid structure
[in]ivarRank of the variable to be filled
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
[in]YVector of values of valued samples

◆ st_grid1D_interpolate_spline()

static int st_grid1D_interpolate_spline ( Db dbgrid,
int  ivar,
int  ndef,
const double *  X,
const double *  Y 
)
static

Fill an incomplete 1-D grid by spline interpolation from a set of valued samples

Returns
Error returned code
Parameters
[in]dbgridDb grid structure
[in]ivarRank of the variable to be filled
[in]ndefNumber of defined samples
[in]XVector of coordinate of valued samples
[in]YVector of values of valued samples

◆ st_grid_fill_calculate()

static int st_grid_fill_calculate ( int  ipos,
int  mode,
int  nech,
int *  tabind,
const double *  tabval 
)
static

Calculate the extrapolation

Returns
Error return code
Parameters
[in]iposAbsolute grid index of the input grid node
[in]modeType of interpolation
  • 0 : Moving average
  • 1 : Inverse squared distance
  • 2 : Interpolation by a linear plane
  • 3 : Distance to the initial grains
[in]nechNumber of samples in the neighborhood
[in]tabindIndex of the neighboring sample
[in]tabvalValue of the neighboring sample

◆ st_grid_fill_neigh()

static void st_grid_fill_neigh ( int  ipos,
int  ndim,
int  radius,
int *  nech_loc,
int *  tabind,
double *  tabval 
)
static

Find the neighborhood of the current cell

Parameters
[in]iposAbsolute grid index of the input grid node
[in]ndimSpace dimension
[in]radiusRadius of the neighborhood
[out]nech_locNumber of samples in the neighborhood
[out]tabindIndex of the neighboring sample
[out]tabvalValue of the neighboring sample

◆ st_read_active_sample()

static int st_read_active_sample ( Db db,
int  flag_zero,
int  iech,
int  nvar,
int *  iatt,
double  eps,
double *  tab 
)
static

Check if a sample must be kept or not

Returns
1 if the sample must be kept
Parameters
[in]dbDb characteristics
[in]flag_zero1 to forbid zero values
[in]iechRank of the sample
[in]nvarNumber of attributes
[in]iattArray of the input attribute
[in]epsMinimum value assigned to a zero
[out]tabArray of values

◆ st_write_active_sample()

static void st_write_active_sample ( Db db,
int  iech,
int  nvar,
int *  iatt,
double *  tab 
)
static

Write a sample in the output file

Parameters
[in]dbDb characteristics
[in]iechRank of the sample
[in]nvarNumber of attributes
[in]iattArray of the output attribute
[in]tabArray of values

Variable Documentation

◆ DB_GRID_FILL

DbGrid* DB_GRID_FILL
static