gstlearn
1.0.0
CCC
|
#include "geoslib_f.h"
#include "geoslib_old_f.h"
#include "Enum/EJustify.hpp"
#include "Enum/ECalcVario.hpp"
#include "Variogram/Vario.hpp"
#include "Variogram/VarioParam.hpp"
#include "Anamorphosis/AAnam.hpp"
#include "Anamorphosis/AnamHermite.hpp"
#include "Polynomials/Hermite.hpp"
#include "Polygon/Polygons.hpp"
#include "Morpho/Morpho.hpp"
#include "Basic/AStringable.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/NamingConvention.hpp"
#include "Basic/File.hpp"
#include "Basic/String.hpp"
#include "Basic/OptDbg.hpp"
#include "Db/Db.hpp"
#include "Model/Model.hpp"
#include "Stats/PCA.hpp"
#include "Stats/PCAStringFormat.hpp"
#include "Matrix/MatrixSquareGeneral.hpp"
#include "Geometry/GeometryHelper.hpp"
#include "Geometry/BiTargetCheckGeometry.hpp"
#include <string.h>
#include <math.h>
Functions | |
void | vario_fix_codir (int ndim, VectorDouble &codir) |
int | variogram_maximum_dist1D_reached (Db *db, int iech, int jech, double maxdist) |
int | variogram_get_lag (const DirParam &dirparam, double dist) |
void | variogram_scale (Vario *vario, int idir) |
bool | variogramKeep (const Vario *vario, int idir, SpaceTarget &T1, SpaceTarget &T2, double *dist) |
void | vardir_print (Vario *vario, int idir, int verbose) |
int | variovect_compute (Db *db, Vario *vario, int ncomp) |
void | variogram_extension (const Vario *vario, int ivar, int jvar, int idir0, int flag_norm, int flag_vars, double distmin, double distmax, double varmin, double varmax, int *flag_hneg, int *flag_gneg, double *c0, double *hmin, double *hmax, double *gmin, double *gmax) |
int | variogram_direction_add (VarioParam *varioparam, int npas, int opt_code, int idate, double dpas, double toldis, double tolang, double bench, double cylrad, double tolcode, const VectorDouble &breaks, const VectorDouble &codir) |
int | correlation_f (Db *db1, Db *db2, DbGrid *dbgrid, int flag_same, int icol1, int icol2, int flag_verbose, double dmin, double dmax, VarioParam *varioparam, int *nindice, int **indices, double *correl) |
int | correlation_ident (Db *db1, Db *db2, int icol1, int icol2, Polygons *polygon) |
void | variogram_cloud_ident (Db *db, DbGrid *dbgrid, Vario *vario, Polygons *polygon) |
int | variogram_cloud (Db *db, const VarioParam *varioparam, DbGrid *dbgrid, const NamingConvention &namconv) |
int | variogram_cloud_dim (Db *db, const VarioParam *varioparam, double *vmax) |
int | vario_extract (Vario *vario, ECalcVario *calcul_type, int *ndim, int *nvar, int *ndir, int *ndate, double *scale, double **dates) |
int | vario_get_rank (Vario *vario, int idir, int idate) |
void | vardir_copy (VarioParam *vario_in, int idir_in, VarioParam *vario_out, int idir_out) |
int | geometry_compute (Db *db, Vario *vario, Vario_Order *vorder, int *npair) |
void | variogram_trans_cut (Vario *vario, int nh, double ycut) |
int | variogram_mlayers (Db *db, int *seltab, Vario *vario, Vario_Order *vorder) |
int | variogram_y2z (Vario *vario, AAnam *anam, Model *model) |
void | condexp (Db *db1, Db *db2, int icol1, int icol2, double mini, double maxi, int nclass, int verbose, int *ncond, double *xcond, double *ycond) |
int | _variogram_compute (Db *db, Vario *vario, int flag_gen, int flag_sample, int verr_mode, Model *model, int verbose) |
ECalcVario | vario_identify_calcul_type (const String &calcul_name) |
DbGrid * | db_variogram_cloud (Db *db, const VarioParam *varioparam, double lagmax, double varmax, int lagnb, int varnb, const NamingConvention &namconv) |
int | vmap_compute (Db *db, DbGrid *dbmap, const ECalcVario &calcul_type, int radius, bool flag_FFT, const NamingConvention &namconv) |
Db * | db_variogram (Db *db, const VarioParam *varioparam) |
DbGrid * | db_vmap_compute (Db *db, const ECalcVario &calcul_type, const VectorInt &nx_arg, const VectorDouble &dxx, int radius, bool flag_FFT, const NamingConvention &namconv) |
int | dbgrid_model (DbGrid *dbgrid, Model *model, const NamingConvention &namconv) |
int _variogram_compute | ( | Db * | db, |
Vario * | vario, | ||
int | flag_gen, | ||
int | flag_sample, | ||
int | verr_mode, | ||
Model * | model, | ||
int | verbose | ||
) |
Evaluate the experimental variogram
[in] | db | Db descriptor |
[in] | vario | Vario structure |
[in] | flag_gen | 1 for calculation of generalized variogram |
[in] | flag_sample | calculate the variogram per sample |
[in] | verr_mode | Mode of variogram correction (1, 2 or 3) |
[in] | model | Model structure (triggers the KU option) |
[in] | verbose | Verbose flag |
void condexp | ( | Db * | db1, |
Db * | db2, | ||
int | icol1, | ||
int | icol2, | ||
double | mini, | ||
double | maxi, | ||
int | nclass, | ||
int | verbose, | ||
int * | ncond, | ||
double * | xcond, | ||
double * | ycond | ||
) |
Evaluate the experimental conditional expectation
[in] | db1 | Db descriptor (for target variable) |
[in] | db2 | Db descriptor (for auxiliary variables) |
[in] | icol1 | Rank of the target variable |
[in] | icol2 | Rank of the explanatory variable |
[in] | mini | Minimum value for the explanaroty variable |
[in] | maxi | Maximum value for the explanaroty variable |
[in] | nclass | Number of classes |
[in] | verbose | Verbose flag |
[out] | ncond | Array of number of samples per class |
[out] | xcond | Array of conditional expectation along X |
[out] | ycond | Array of conditional expectation along Y |
int correlation_f | ( | Db * | db1, |
Db * | db2, | ||
DbGrid * | dbgrid, | ||
int | flag_same, | ||
int | icol1, | ||
int | icol2, | ||
int | flag_verbose, | ||
double | dmin, | ||
double | dmax, | ||
VarioParam * | varioparam, | ||
int * | nindice, | ||
int ** | indices, | ||
double * | correl | ||
) |
Evaluate the correlation (according to argument flag_same):
[in] | db1 | Db descriptor (first variable) |
[in] | db2 | Db descriptor (second variable for flag.same=T) |
[in] | dbgrid | Discretization Grid descriptor |
[in] | flag_same | 1 if the two samples must coincide |
[in] | icol1 | Rank of the first column |
[in] | icol2 | Rank of the second column |
[in] | flag_verbose | 1 for a verbose output |
[in] | dmin | Minimum distance |
[in] | dmax | Maximum distance |
[in] | varioparam | pointer to a VarioParam structure |
[out] | nindice | Number of pairs |
[out] | indices | Array of the indices of pairs of samples (Dimension: 2 * nindice) |
[out] | correl | Correlation coefficient |
Identify samples from scatter plot when included within a polygon
[in] | db1 | Db descriptor (first variable) |
[in] | db2 | Db descriptor (second variable for flag.same=T) |
[in] | icol1 | Rank of the first column |
[in] | icol2 | Rank of the second column |
[in] | polygon | Polygons structure |
Db* db_variogram | ( | Db * | db, |
const VarioParam * | varioparam | ||
) |
Establish a new Db containing the pairs of the Variogram
[in] | db | Db structure |
[in] | varioparam | VarioParam structure |
DbGrid* db_variogram_cloud | ( | Db * | db, |
const VarioParam * | varioparam, | ||
double | lagmax, | ||
double | varmax, | ||
int | lagnb, | ||
int | varnb, | ||
const NamingConvention & | namconv | ||
) |
Evaluate the experimental variogram cloud
[in] | db | Db descriptor |
[in] | varioparam | VarioParam structure |
[in] | lagmax | Maximum distance |
[in] | varmax | Maximum Variance value |
[in] | lagnb | Number of discretization steps along distance axis |
[in] | varnb | Number of discretization steps along variance axis |
[in] | namconv | Naming convention |
DbGrid* db_vmap_compute | ( | Db * | db, |
const ECalcVario & | calcul_type, | ||
const VectorInt & | nx_arg, | ||
const VectorDouble & | dxx, | ||
int | radius, | ||
bool | flag_FFT, | ||
const NamingConvention & | namconv | ||
) |
Calculate the variogram map
[in] | db | Db containing the data |
[in] | calcul_type | Type of calculation (ECalcVario) |
[in] | nx_arg | Vector of (Half-) number of nodes for Vmap (def:20) |
[in] | dxx | Vector of mesh for Vmap (see details) |
[in] | radius | Dilation radius (mooth resulting maps) only on points |
[in] | flag_FFT | Use FFT method (only valid on grid) |
[in] | namconv | Naming convention |
int dbgrid_model | ( | DbGrid * | dbgrid, |
Model * | model, | ||
const NamingConvention & | namconv | ||
) |
int geometry_compute | ( | Db * | db, |
Vario * | vario, | ||
Vario_Order * | vorder, | ||
int * | npair | ||
) |
Calculate the geometry for a given direction
[in] | db | Db description |
[in] | vario | Vario structure |
[out] | vorder | Vario_Order structure |
[out] | npair | Number of pairs |
void vardir_copy | ( | VarioParam * | vario_in, |
int | idir_in, | ||
VarioParam * | vario_out, | ||
int | idir_out | ||
) |
void vardir_print | ( | Vario * | vario, |
int | idir, | ||
int | verbose | ||
) |
Print the experimental variograms in one direction
[in] | vario | Vario structure |
[in] | idir | Rank of the direction |
[in] | verbose | 0 for brief output; 1 for a long output |
int vario_extract | ( | Vario * | vario, |
ECalcVario * | calcul_type, | ||
int * | ndim, | ||
int * | nvar, | ||
int * | ndir, | ||
int * | ndate, | ||
double * | scale, | ||
double ** | dates | ||
) |
Ask the characteristics of the Vario structure
[in] | vario | Vario structure |
[out] | calcul_type | Type of calculation (ECalcVario) |
[out] | ndim | Space dimension |
[out] | nvar | Number of variables |
[out] | ndir | Number of calculation directions |
[out] | ndate | Number of Date Intervals |
[out] | scale | Scaling factor for the transitive covariogram |
[out] | dates | Array of bounds for Date Intervals |
void vario_fix_codir | ( | int | ndim, |
VectorDouble & | codir | ||
) |
Fix plausible values for the Direction coefficients. They must be defined and with norm equal to 1
[in] | ndim | Space dimension |
[in,out] | codir | Input/Output Direction coefficients |
int vario_get_rank | ( | Vario * | vario, |
int | idir, | ||
int | idate | ||
) |
Ask for the rank of the 'vardir' structure, given direction and date
[in] | vario | Vario structure |
[in] | idir | Rank for the direction (starting from 0) |
[in] | idate | Rank for the Date (starting from 0) |
ECalcVario vario_identify_calcul_type | ( | const String & | calcul_name | ) |
int variogram_cloud | ( | Db * | db, |
const VarioParam * | varioparam, | ||
DbGrid * | dbgrid, | ||
const NamingConvention & | namconv | ||
) |
Evaluate the experimental variogram cloud on irregular data
[in] | db | Db descriptor |
[in] | varioparam | VarioParam structure |
[in] | dbgrid | Output grid for storing the variogram cloud |
[in] | namconv | Naming convention |
int variogram_cloud_dim | ( | Db * | db, |
const VarioParam * | varioparam, | ||
double * | vmax | ||
) |
Evaluate the bounds for the experimental variogram cloud
[in] | db | Db descriptor |
[in] | varioparam | VarioParam structure |
[out] | vmax | Maximum variogram value |
int variogram_direction_add | ( | VarioParam * | varioparam, |
int | npas, | ||
int | opt_code, | ||
int | idate, | ||
double | dpas, | ||
double | toldis, | ||
double | tolang, | ||
double | bench, | ||
double | cylrad, | ||
double | tolcode, | ||
const VectorDouble & | breaks, | ||
const VectorDouble & | codir | ||
) |
Initialize a new calculation direction
[in] | varioparam | VarioParam structure |
[in] | npas | number of lags |
[in] | opt_code | code selection option
|
[in] | idate | Rank of the Date interval |
[in] | dpas | lag value |
[in] | toldis | tolerance on distance (proportion of the lag) |
[in] | tolang | angular tolerance (in degrees) |
[in] | bench | Slicing bench |
[in] | cylrad | Slicing radius |
[in] | tolcode | Tolerance on the code |
[in] | breaks | array for irregular lags |
[in] | codir | calculation direction (Dimension = ndim) |
void variogram_extension | ( | const Vario * | vario, |
int | ivar, | ||
int | jvar, | ||
int | idir0, | ||
int | flag_norm, | ||
int | flag_vars, | ||
double | distmin, | ||
double | distmax, | ||
double | varmin, | ||
double | varmax, | ||
int * | flag_hneg, | ||
int * | flag_gneg, | ||
double * | c0, | ||
double * | hmin, | ||
double * | hmax, | ||
double * | gmin, | ||
double * | gmax | ||
) |
Calculate the variogram extension for a pair of variables
[in] | vario | Vario structure |
[in] | ivar | Rank of the first variable |
[in] | jvar | Rank of the second variable |
[in] | idir0 | Rank of the direction (-1 for all) |
[in] | flag_norm | 1 if the variogram must be normalized by variance |
[in] | flag_vars | 1 if the global statistics must be taken into account |
[in] | distmin | Minimum along the distance axis |
[in] | distmax | Maximum along the distance axis |
[in] | varmin | Minimum along the variogram (or covariance) axis |
[in] | varmax | Maximum along the variogram (or covariance) axis |
[out] | flag_hneg | 1 if the distance scale can be negative |
[out] | flag_gneg | 1 if the variogram scale can be negative |
[out] | c0 | Value of the variogram at the origin |
[out] | hmin | Minimum distance |
[out] | hmax | Maximum distance |
[out] | gmin | Minimum variogram value |
[out] | gmax | Maximum variogram value |
int variogram_get_lag | ( | const DirParam & | dirparam, |
double | dist | ||
) |
Return the rank of the lag
[in] | dirparam | Dirparam structure |
[in] | dist | Distance |
int variogram_maximum_dist1D_reached | ( | Db * | db, |
int | iech, | ||
int | jech, | ||
double | maxdist | ||
) |
Checks if the maximum variogram distance has been passed
[in] | db | Db descriptor |
[in] | iech | Rank of the first sample |
[in] | jech | Rank of the second sample |
[in] | maxdist | Maximum distance |
int variogram_mlayers | ( | Db * | db, |
int * | seltab, | ||
Vario * | vario, | ||
Vario_Order * | vorder | ||
) |
Determine the samples used for a variogram in multilayers framework
[in] | db | Db description |
[in] | seltab | Number of sample definition (0, 1 or 2) |
[in] | vario | Vario structure |
[out] | vorder | Vario_Order struct ure |
void variogram_scale | ( | Vario * | vario, |
int | idir | ||
) |
Scale the variogram calculations
[in] | vario | Vario structure |
[in] | idir | Rank of the Direction |
void variogram_trans_cut | ( | Vario * | vario, |
int | nh, | ||
double | ycut | ||
) |
Calculate the experimental variogram of the completed variable starting from the experimental variogram of the truncated variable
[in,out] | vario | Vario structure |
[in] | nh | Number of Hermite polynomials |
[in] | ycut | Truncation (lowest) value |
Calculate the experimental variogram of the Raw starting from the Model of the Gaussian variable
[in,out] | vario | Experimental variogram |
[in] | anam | Point anamorphosis |
[in] | model | Model of the Punctual Gaussian |
bool variogramKeep | ( | const Vario * | vario, |
int | idir, | ||
SpaceTarget & | T1, | ||
SpaceTarget & | T2, | ||
double * | dist | ||
) |
int vmap_compute | ( | Db * | db, |
DbGrid * | dbmap, | ||
const ECalcVario & | calcul_type, | ||
int | radius, | ||
bool | flag_FFT, | ||
const NamingConvention & | namconv | ||
) |
Calculate the variogram map
[in] | db | Db containing the data |
[in] | dbmap | VMAP grid structure |
[in] | calcul_type | Type of calculation (ECalcVario) |
[in] | radius | Dilation radius (mooth resulting maps) only on points |
[in] | flag_FFT | Use FFT method (only valid on grid) |
[in] | namconv | Naming convention |