1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::DbHelper Class Reference

#include <DbHelper.hpp>

Inheritance diagram for gstlrn::DbHelper:
gstlrn::DbH

Static Public Member Functions

static Id findDuplicates (Db *db1, Db *db2, bool flag_same, bool verbose, Id opt_code, double tolcode, const 1 &dist, 1 &sel)
 
static Id centerPointToGrid (Db *db_point, DbGrid *db_grid, double eps_random=EPSILON6)
 
static Id normalizeVariables (Db *db, const char *oper, const 1 &cols, double center, double stdv)
 
static Id dbgrid_filling (DbGrid *dbgrid, Id mode=0, Id seed=34342, Id radius=1, bool verbose=false, const NamingConvention &namconv=NamingConvention("Fill"))
 
static Id db_duplicate (Db *db, bool verbose=false, const 1 &dist=1(), Id opt_code=0, double tolcode=0., const NamingConvention &namconv=NamingConvention("Duplicate", true, true, true, ELoc::fromKey("SEL")))
 
static Id db_compositional_transform (Db *db, Id verbose, Id mode, Id type, Id number, Id *iatt_in, Id *iatt_out, Id *numout)
 
static DbGriddbgrid_sampling (DbGrid *dbin, const 1 &nmult)
 
static Id db_grid1D_fill (DbGrid *dbgrid, Id mode=0, Id seed=34243, const NamingConvention &namconv=NamingConvention("Fill"))
 

Member Function Documentation

◆ centerPointToGrid()

Id gstlrn::DbHelper::centerPointToGrid ( Db db_point,
DbGrid db_grid,
double  eps_random = EPSILON6 
)
static

Centers the samples of a Db to the center of blocks of a grid Db

Returns
Error return code
Parameters
[in]db_pointdescriptor of the point parameters
[in]db_griddescriptor of the grid parameters
[in]eps_randomRandomisation Epsilon
Remarks
The argument 'eps_random' allows perturbating the centered
coordinate so that it does not lie exactly on the node.
This possibility makes sense in order to identify centered data
from data actually located on the grid center (before migration)
The perturbation is calculated as DX(i) * eps

◆ db_compositional_transform()

Id gstlrn::DbHelper::db_compositional_transform ( Db db,
Id  verbose,
Id  mode,
Id  type,
Id  number,
Id iatt_in,
Id iatt_out,
Id numout 
)
static

Translate a set of compositional variables into auxiliary variables

Returns
Error return code
Parameters
[in]dbDb characteristics
[in]verbose1 for a Verbose option
[in]mode1 for Forward and -1 for Backward transformation
[in]typeType of conversion
  • 0 : Simple transformation in proportion
  • 1 : Additive logratio
  • 2 : Centered logratio
  • 3 : Isometric logratio
[in]numberNumber of input attributes
[in]iatt_inArray of the input attribute
[in]iatt_outArray of the output attribute
[out]numoutNumber of variables in output
Remarks
The additive and the isometric logratio transformations
transform N+1 compositional variables into N elements (Forward)
and from N transformed elements into N+1 compositional variables
(Backwards).
The zero-values are replaced by a conventional small value
This is defined by a variable that can be corrected using
the keypair facility with the keyword 'CompositionalEps'
The arguments 'iatt_in' and 'iatt_out' can coincide.
Outlier Detection for Compositional Data Using Robust Methods
Math Geosciences (2008) 40: 233-248

◆ db_duplicate()

Id gstlrn::DbHelper::db_duplicate ( Db db,
bool  verbose = false,
const 1 &  dist = 1(),
Id  opt_code = 0,
double  tolcode = 0.,
const NamingConvention namconv = NamingConvention("Duplicate", true, true, true,                                                                             ELoc::fromKey("SEL")) 
)
static

Look for duplicates within a Db

Returns
Error return code
Parameters
[in]dbDb Structure
[in]verboseTrue for verbose output
[in]distArray of the minimum distance
[in]opt_codecode selection option (if code is defined)
  • 0 : no use of the code selection
  • 1 : codes must be close enough
  • 2 : codes must be different
[in]tolcodeCode tolerance
[in]namconvNaming convention

◆ db_grid1D_fill()

Id gstlrn::DbHelper::db_grid1D_fill ( DbGrid dbgrid,
Id  mode = 0,
Id  seed = 34243,
const NamingConvention namconv = NamingConvention("Fill") 
)
static

Fill an incomplete 1-D grid

Returns
Error returned code
Parameters
[in]dbgridDb grid structure
[in]modeType of interpolation
  • 0 : Linear interpolation
  • 1 : Cubic Spline
[in]seedSeed used for the random number generation
[in]namconvNaming convention

◆ dbgrid_filling()

Id gstlrn::DbHelper::dbgrid_filling ( DbGrid dbgrid,
Id  mode = 0,
Id  seed = 34342,
Id  radius = 1,
bool  verbose = false,
const NamingConvention namconv = NamingConvention("Fill") 
)
static

Fill an incomplete grid

Returns
Error returned code
Parameters
[in]dbgridDb grid structure
[in]modeType of interpolation
  • 0 : Moving average
  • 1 : Inverse squared distance
  • 2 : Interpolation by a linear plane
  • 3 : Distance to the initial grains
[in]seedSeed used for the random number generation
[in]radiusRadius of the neighborhood
[in]verboseVerbose flag
[in]namconvNaming convention

◆ dbgrid_sampling()

DbGrid * gstlrn::DbHelper::dbgrid_sampling ( DbGrid dbin,
const 1 &  nmult 
)
static

Sample a grid into a finer subgrid (all variables)

Returns
Error return code
Parameters
[in]dbinDescriptor of the grid parameters
[in]nmultArray of multiplicity coefficients

◆ findDuplicates()

Id gstlrn::DbHelper::findDuplicates ( Db db1,
Db db2,
bool  flag_same,
bool  verbose,
Id  opt_code,
double  tolcode,
const 1 &  dist,
1 &  sel 
)
static

Look for duplicates

Returns
Error return code
Parameters
[in]db1First Db
[in]db2Second Db
[in]flag_sameTrue if the two Db files are the same
[in]verboseTrue for verbose output
[in]opt_codecode selection option (if code is defined)
  • 0 : no use of the code selection
  • 1 : codes must be close enough
  • 2 : codes must be different
[in]tolcodeCode tolerance
[in]distArray of the minimum distance whose length is the space dimension (or NULL for a null distance)
[out]selArray containing the selection

◆ normalizeVariables()

Id gstlrn::DbHelper::normalizeVariables ( Db db,
const char *  oper,
const 1 &  cols,
double  center,
double  stdv 
)
static

Normalize a set of variables

Returns
Error returned code
Parameters
[in]dbDb structure
[in]operName of the operator
  • "mean" : Normalize the mean to the input value
  • "stdv" : Normalize the st. dev. to the input value
  • "scal" : Normalize the mean and st. dev.
  • "prop" : Normalize the variables to proportions
[in]colsRanks of the variables
[in]centerTheoretical Mean value
[in]stdvTheoretical Standard Deviation value

The documentation for this class was generated from the following files: