1.4.0
CCC
 
DbHelper Class Reference

#include <DbHelper.hpp>

Inheritance diagram for DbHelper:
DbH

Static Public Member Functions

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

Member Function Documentation

◆ centerPointToGrid()

int 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()

int DbHelper::db_compositional_transform ( Db db,
int  verbose,
int  mode,
int  type,
int  number,
int *  iatt_in,
int *  iatt_out,
int *  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()

int DbHelper::db_duplicate ( Db db,
bool  verbose = false,
const VectorDouble dist = VectorDouble(),
int  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()

int DbHelper::db_grid1D_fill ( DbGrid dbgrid,
int  mode = 0,
int  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()

int DbHelper::dbgrid_filling ( DbGrid dbgrid,
int  mode = 0,
int  seed = 34342,
int  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 * DbHelper::dbgrid_sampling ( DbGrid dbin,
const VectorInt 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()

int DbHelper::findDuplicates ( Db db1,
Db db2,
bool  flag_same,
bool  verbose,
int  opt_code,
double  tolcode,
const VectorDouble dist,
VectorDouble 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()

int DbHelper::normalizeVariables ( Db db,
const char *  oper,
const VectorInt 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: