#include "geoslib_f.h"
#include "geoslib_old_f.h"
#include "geoslib_f_private.h"
#include "geoslib_define.h"
#include "Enum/ECalcMember.hpp"
#include "Db/Db.hpp"
#include "Db/DbGrid.hpp"
#include "Model/Model.hpp"
#include "Model/CovInternal.hpp"
#include "Neigh/NeighMoving.hpp"
#include "Neigh/NeighImage.hpp"
#include "Neigh/NeighUnique.hpp"
#include "Neigh/ANeigh.hpp"
#include "Anamorphosis/AnamDiscreteIR.hpp"
#include "Anamorphosis/AnamHermite.hpp"
#include "Basic/String.hpp"
#include "Basic/NamingConvention.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/Law.hpp"
#include "Basic/File.hpp"
#include "Basic/OptDbg.hpp"
#include "Covariances/CovContext.hpp"
#include "Drifts/DriftList.hpp"
#include "Estimation/KrigingSystem.hpp"
#include "Matrix/MatrixFactory.hpp"
#include "Basic/Memory.hpp"
#include "Core/Keypair.hpp"
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <limits.h>
Classes | |
struct | Disc_Structure |
Functions | |
static double * | st_core (int nli, int nco) |
static int * | st_icore (int nli, int nco) |
static int * | st_relative_position_array (int mode, int neq, int *rel_arg) |
static void | st_global_init (Db *dbin, Db *dbout) |
static double | st_get_idim (int loc_rank, int idim) |
int | is_flag_data_disc_defined (void) |
****************************************************************************/ *! More... | |
void | set_DBIN (Db *dbin) |
void | set_DBOUT (Db *dbout) |
static double | st_get_ivar (int rank, int ivar) |
****************************************************************************/ *! More... | |
static double | st_get_verr (int rank, int ivar) |
static int | st_check_environment (int flag_in, int flag_out, Model *model) |
static int | st_model_manage (int mode, Model *model) |
static int | st_krige_manage_basic (int mode, int nech, int nmax, int nvar, int nfeq) |
static int | st_get_nmax (ANeigh *neigh) |
static int | st_krige_manage (int mode, int nvar, Model *model, ANeigh *neigh) |
static int | st_block_discretize_alloc (int ndim, const VectorInt &ndiscs) |
static void | st_data_discretize_alloc (int ndim) |
static void | st_block_discretize (int mode, int flag_rand, int iech) |
int | krige_koption_manage (int mode, int flag_check, const EKrigOpt &calcul, int flag_rand, const VectorInt &ndiscs) |
void | krige_lhs_print (int nech, int neq, int nred, const int *flag, const double *lhs) |
void | krige_rhs_print (int nvar, int nech, int neq, int nred, const int *flag, double *rhs) |
void | krige_dual_print (int nech, int neq, int nred, const int *flag, double *dual) |
static void | krige_wgt_print (int status, int nvar, int nvar_m, int nfeq, const VectorInt &nbgh_ranks, int nred, int icase, const int *flag, const double *wgt) |
static void | st_result_kriging_print (int flag_xvalid, int nvar, int status) |
int | _krigsim (Db *dbin, Db *dbout, const Model *model, ANeigh *neigh, bool flag_bayes, const VectorDouble &dmean, const MatrixSquareSymmetric &dcov, int icase, int nbsimu, bool flag_dgm) |
int | global_transitive (DbGrid *dbgrid, Model *model, int flag_verbose, int flag_regular, int ndisc, double *abundance, double *sse, double *cvtrans) |
static int | st_get_limits (DbGrid *db, double top, double bot, int *ideb, int *ifin) |
static int | st_get_neigh (int ideb, int ifin, int neigh_radius, int *status, int *nbefore, int *nafter) |
static double | st_cov_exp (int dist, const double *cov, int cov_radius, int flag_sym) |
static void | st_lhs_exp (double *covdd, int cov_radius, int flag_sym, int nfeq, int nbefore, int nafter, int neq) |
static void | st_rhs_exp (double *covd0, int cov_radius, int flag_sym, int nfeq, int nbefore, int nafter, int neq) |
static double | st_estim_exp (Db *db, const double *wgt, int nbefore, int nafter) |
int | anakexp_f (DbGrid *db, double *covdd, double *covd0, double top, double bot, int cov_radius, int neigh_radius, int flag_sym, int nfeq) |
static void | st_calculate_covres (DbGrid *db, Model *model, const double *cov_ref, int cov_radius, int flag_sym, const int cov_ss[3], const int cov_nn[3], double *cov_res) |
static void | st_calculate_covtot (DbGrid *db, int ix0, int iy0, int flag_sym, const int cov_ss[3], const int cov_nn[3], int *num_tot, double *cov_tot) |
static VectorInt | st_neigh_find (DbGrid *db, int ix0, int iy0, int iz0, const int nei_ss[3], const int nei_nn[3], int *nei_cur) |
static int | st_neigh_diff (const int nei_ss[3], const int nei_nn[3], int *nei_ref, const int *nei_cur) |
static void | st_lhs_exp_3D (int nech, int nfeq, const int nei_ss[3], const int nei_nn[3], const int cov_ss[3], const int cov_nn[3], const int *nei_cur, const double *cov_tot, double nugget) |
static void | st_rhs_exp_3D (int nech, int nfeq, const int nei_ss[3], const int nei_nn[3], const int cov_ss[3], const int cov_nn[3], const int *nei_cur, const double *cov_res) |
static double | st_estim_exp_3D (Db *db, const int nei_ss[3], const int nei_nn[3], int *nei_cur, const double *weight) |
static void | st_vario_dump (FILE *file, int ix0, int iy0, const int cov_ss[3], const int cov_nn[3], const int *num_tot, const double *cov_tot) |
int | anakexp_3D (DbGrid *db, double *cov_ref, int cov_radius, int neigh_ver, int neigh_hor, int flag_sym, Model *model, double nugget, int nfeq, int dbg_ix, int dbg_iy) |
int | bayes_simulate (Model *model, int nbsimu, const VectorDouble &rmean, const VectorDouble &rcov, VectorDouble &smean) |
int | krigsum (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, bool flag_positive, const NamingConvention &namconv) |
static VectorInt | st_ranks_other (int nech, const VectorInt &ranks1, const VectorInt &ranks2) |
static int | st_sampling_krige_data (Db *db, Model *model, double beta, VectorInt &ranks1, VectorInt &ranks2, VectorInt &rother, int *ntot_arg, int *nutil_arg, VectorInt &rutil, double **tutil_arg, double **invsig_arg) |
int | st_krige_data (Db *db, Model *model, double beta, VectorInt &ranks1, VectorInt &ranks2, VectorInt &rother, int flag_abs, double *data_est, double *data_var) |
int | st_crit_global (Db *db, Model *model, VectorInt &ranks1, VectorInt &rother, double *crit) |
int | sampling_f (Db *db, Model *model, double beta, int method1, int nsize1_max, VectorInt &ranks1, int method2, int nsize2_max, VectorInt &ranks2, int verbose) |
int | krigsampling_f (Db *dbin, Db *dbout, Model *model, double beta, VectorInt &ranks1, VectorInt &ranks2, bool flag_std, int verbose) |
static void | st_declustering_stats (int mode, int method, Db *db, int iptr) |
static void | st_declustering_truncate_and_rescale (Db *db, int iptr) |
static int | st_declustering_1 (Db *db, int iptr, const VectorDouble &radius) |
static int | st_declustering_2 (Db *db, Model *model, ANeigh *neigh, int iptr) |
static int | st_declustering_3 (Db *db, Db *dbgrid, Model *model, ANeigh *neigh, const VectorInt &ndiscs, int iptr) |
int | declustering (Db *dbin, Model *model, int method, ANeigh *neigh, DbGrid *dbgrid, const VectorDouble &radius, const VectorInt &ndiscs, int flag_sel, bool verbose) |
static double * | st_calcul_covmat (const char *title, Db *db1, int test_def1, Db *db2, int test_def2, Model *model) |
static double * | st_calcul_drfmat (const char *title, Db *db1, int test_def1, Model *model) |
static double * | st_calcul_distmat (const char *title, Db *db1, int test_def1, Db *db2, int test_def2, double power) |
static double * | st_calcul_product (const char *title, int n1, int ns, const double *covss, const double *distgen) |
static double * | st_inhomogeneous_covpp (Db *dbdat, Db *dbsrc, Model *model_dat, const double *distps, const double *prodps) |
static double * | st_inhomogeneous_covgp (Db *dbdat, Db *dbsrc, Db *dbout, int flag_source, Model *model_dat, const double *distps, const double *prodps, const double *prodgs) |
static VectorDouble | st_inhomogeneous_covgg (Db *dbsrc, Db *dbout, int flag_source, Model *model_dat, const double *distgs, const double *prodgs) |
static int | st_drift_prepar (int np, int nbfl, const double *covpp, const double *drftab, double **yloc, double **zloc) |
static void | st_drift_update (int np, int nbfl, const double *covgp, const double *driftg, const double *ymat, double *zmat, double *maux, double *lambda, double *mu) |
int | inhomogeneous_kriging (Db *dbdat, Db *dbsrc, Db *dbout, double power, int flag_source, Model *model_dat, Model *model_src) |
void | _image_smoother (DbGrid *dbgrid, const NeighImage *neigh, int type, double range, int iptr0) |
Variables | |
static VectorDouble | d1_1_global |
static VectorDouble | d1_2_global |
static double * | covaux_global |
static double * | var0_global |
static VectorDouble | d1_global |
static VectorDouble | d1_t_global |
static double * | lhs_global |
static double * | rhs_global |
static double * | wgt_global |
static double * | zam1_global |
static int * | flag_global |
static int | KRIGE_INIT = 0 |
static int | MODEL_INIT = 0 |
static int | IECH_OUT = -1 |
static int | FLAG_COLK |
static int | FLAG_SIMU |
static int | FLAG_EST |
static int | FLAG_STD |
static int | FLAG_VARZ |
static int | FLAG_PROF |
static int | IPTR_EST |
static int | IPTR_STD |
static int | IPTR_VARZ |
static int | IPTR_NBGH |
static int * | RANK_COLCOK |
static Db * | DBIN |
static Db * | DBOUT |
static Koption * | KOPTION |
static int | INH_FLAG_VERBOSE = 0 |
static int | INH_FLAG_LIMIT = 1 |
static char | string [100] |
static CovInternal | COVINT |
void _image_smoother | ( | DbGrid * | dbgrid, |
const NeighImage * | neigh, | ||
int | type, | ||
double | range, | ||
int | iptr0 | ||
) |
Smooth a regular grid
[in] | dbgrid | input and output Db grid structure |
[in] | neigh | Neigh structure |
[in] | type | 1 for Uniform; 2 for Gaussian |
[in] | range | Range (used for Gaussian only) |
[in] | iptr0 | Storage address |
int _krigsim | ( | Db * | dbin, |
Db * | dbout, | ||
const Model * | model, | ||
ANeigh * | neigh, | ||
bool | flag_bayes, | ||
const VectorDouble & | dmean, | ||
const MatrixSquareSymmetric & | dcov, | ||
int | icase, | ||
int | nbsimu, | ||
bool | flag_dgm | ||
) |
Conditioning Kriging
[in] | dbin | input Db structure |
[in] | dbout | output Db structure |
[in] | model | Model structure |
[in] | neigh | ANeigh structure |
[in] | flag_bayes | 1 if Bayes option is switched ON |
[in] | dmean | Array giving the prior means for the drift terms |
[in] | dcov | Array containing the prior covariance matrix for the drift terms |
[in] | icase | Case for PGS and GRF (or -1) |
[in] | nbsimu | Number of simulations |
[in] | flag_dgm | 1 if the DGM version of kriging should be used |
int anakexp_3D | ( | DbGrid * | db, |
double * | cov_ref, | ||
int | cov_radius, | ||
int | neigh_ver, | ||
int | neigh_hor, | ||
int | flag_sym, | ||
Model * | model, | ||
double | nugget, | ||
int | nfeq, | ||
int | dbg_ix, | ||
int | dbg_iy | ||
) |
Factorial Kriging analysis on a grid file using discretized covariances for the target variable. The discretized covariance of the total variable is calculated on the fly
[in] | db | input Db structure |
[in] | cov_ref | Array of discretized covariance for target variable |
[in] | cov_radius | Radius of the covariance array |
[in] | neigh_ver | Radius of the Neighborhood along Vertical |
[in] | neigh_hor | Radius of the Neighborhood along Horizontal |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | model | Model structure (only used for horizontal) |
[in] | nugget | Additional Nugget Effect component |
[in] | nfeq | 0 or 1 drift function(s) |
[in] | dbg_ix | Rank of the trace along X for variogram debug |
[in] | dbg_iy | Rank of the trace along Y for variogram debug |
int anakexp_f | ( | DbGrid * | db, |
double * | covdd, | ||
double * | covd0, | ||
double | top, | ||
double | bot, | ||
int | cov_radius, | ||
int | neigh_radius, | ||
int | flag_sym, | ||
int | nfeq | ||
) |
Factorial Kriging analysis on a 1-D grid file using discretized covariances for total and partial variables
[in] | db | input Db structure |
[in] | covdd | Array of discretized cov. for total variable |
[in] | covd0 | Array of discretized cov. for partial variable |
[in] | top | Elevation of the Top variable |
[in] | bot | Elevation of the bottom variable |
[in] | cov_radius | Radius of the Covariance arrays |
[in] | neigh_radius | Radius of the Neighborhood |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | nfeq | 0 or 1 drift function(s) |
int bayes_simulate | ( | Model * | model, |
int | nbsimu, | ||
const VectorDouble & | rmean, | ||
const VectorDouble & | rcov, | ||
VectorDouble & | smean | ||
) |
Simulate the drift coefficients from the posterior distributions
int declustering | ( | Db * | dbin, |
Model * | model, | ||
int | method, | ||
ANeigh * | neigh, | ||
DbGrid * | dbgrid, | ||
const VectorDouble & | radius, | ||
const VectorInt & | ndiscs, | ||
int | flag_sel, | ||
bool | verbose | ||
) |
Perform the Declustering task
[in] | dbin | input Db structure |
[in] | model | Model structure |
[in] | method | Method for declustering |
[in] | neigh | ANeigh structure |
[in] | dbgrid | Grid auxiliary Db structure |
[in] | radius | Array of neighborhood radius |
[in] | ndiscs | Array of discretization |
[in] | flag_sel | 1 to mask off samples with zero weight |
[in] | verbose | Verbose option |
int global_transitive | ( | DbGrid * | dbgrid, |
Model * | model, | ||
int | flag_verbose, | ||
int | flag_regular, | ||
int | ndisc, | ||
double * | abundance, | ||
double * | sse, | ||
double * | cvtrans | ||
) |
Estimation of the variance by transitive method
[in] | dbgrid | Db structure containing the dicretization grid |
[in] | model | Model structure |
[in] | flag_verbose | 1 for a verbose output |
[in] | flag_regular | 1 for regular; 0 for stratified |
[in] | ndisc | Number of Discretization steps |
[out] | abundance | Global estimated abundance |
[out] | sse | Global standard deviation |
[out] | cvtrans | CV transitive |
int inhomogeneous_kriging | ( | Db * | dbdat, |
Db * | dbsrc, | ||
Db * | dbout, | ||
double | power, | ||
int | flag_source, | ||
Model * | model_dat, | ||
Model * | model_src | ||
) |
Inhomogeneous Kriging with Sources
[in] | dbdat | Db structure containing Data |
[in] | dbsrc | Db structure containing Sources |
[in] | dbout | Output Db structure |
[in] | power | Power of the Distance decay |
[in] | flag_source | If the result is the source, rather than diffusion |
[in] | model_dat | Model structure for the data |
[in] | model_src | Model structure for the sources |
int is_flag_data_disc_defined | ( | void | ) |
****************************************************************************/ *!
****************************************************************************/ *!
void krige_dual_print | ( | int | nech, |
int | neq, | ||
int | nred, | ||
const int * | flag, | ||
double * | dual | ||
) |
Print the Dual matrix
[in] | nech | Number of active points (optional) |
[in] | neq | Number of equations |
[in] | nred | Reduced number of equations |
[in] | flag | Flag array (optional) |
[in] | dual | Kriging Dual matrix |
int krige_koption_manage | ( | int | mode, |
int | flag_check, | ||
const EKrigOpt & | calcul, | ||
int | flag_rand, | ||
const VectorInt & | ndiscs | ||
) |
Management of Kriging option
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | flag_check | 1 if the file should be checked |
[in] | calcul | Type of calculation (EKrigOpt) |
[in] | flag_rand | 0 if the second discretization is regular 1 if the second point must be randomized |
[in] | ndiscs | Discretization parameters (or NULL) |
void krige_lhs_print | ( | int | nech, |
int | neq, | ||
int | nred, | ||
const int * | flag, | ||
const double * | lhs | ||
) |
Print the L.H.S. matrix
[in] | nech | Number of active points (optional) |
[in] | neq | Number of equations |
[in] | nred | Reduced number of equations |
[in] | flag | Flag array (optional) |
[in] | lhs | Kriging L.H.S |
void krige_rhs_print | ( | int | nvar, |
int | nech, | ||
int | neq, | ||
int | nred, | ||
const int * | flag, | ||
double * | rhs | ||
) |
Print the R.H.S. matrix
[in] | nvar | Number of variables |
[in] | nech | Number of active points (optional) |
[in] | neq | Number of equations |
[in] | nred | Reduced number of equations |
[in] | flag | Flag array (optional) |
[in] | rhs | Kriging R.H.S. matrix |
|
static |
Print the kriging weights
[in] | status | Kriging error status |
[in] | nvar | Number of variables (output) |
[in] | nvar_m | Number of variables in the Model |
[in] | nfeq | Number of drift equations |
[in] | nbgh_ranks | Vector of selected samples |
[in] | nred | Reduced number of equations |
[in] | icase | Rank of the PGS or GRF |
[in] | flag | Flag array |
[in] | wgt | Array of Kriging weights |
int krigsampling_f | ( | Db * | dbin, |
Db * | dbout, | ||
Model * | model, | ||
double | beta, | ||
VectorInt & | ranks1, | ||
VectorInt & | ranks2, | ||
bool | flag_std, | ||
int | verbose | ||
) |
Perform the Kriging procedure using the parcimonious search within the whole input data set
int krigsum | ( | Db * | dbin, |
Db * | dbout, | ||
Model * | model, | ||
ANeigh * | neigh, | ||
bool | flag_positive, | ||
const NamingConvention & | namconv | ||
) |
Punctual Multivariate Kriging under a constraint
[in] | dbin | input Db structure |
[in] | dbout | output Db structure |
[in] | model | Model structure (univariate) |
[in] | neigh | ANeigh structure |
[in] | flag_positive | 1 for a positive constraints |
[in] | namconv | Naming convention |
int sampling_f | ( | Db * | db, |
Model * | model, | ||
double | beta, | ||
int | method1, | ||
int | nsize1_max, | ||
VectorInt & | ranks1, | ||
int | method2, | ||
int | nsize2_max, | ||
VectorInt & | ranks2, | ||
int | verbose | ||
) |
Optimize the sampling design
[in] | db | Db structure |
[in] | model | Model structure |
[in] | beta | Thresholding value |
[in] | method1 | Criterion for choosing exact pivots 1 : Local evaluation 2 : Global evaluation |
[in] | nsize1_max | Maximum number of exact pivots |
[in] | ranks1 | Ranks of exact pivots |
[in] | method2 | Criterion for choosing ACP pivots 1 : Local evaluation 2 : Global evaluation |
[in] | nsize2_max | Maximum number of ACP pivots |
[in] | ranks2 | Ranks of ACP pivots |
[in] | verbose | 1 for a verbose output |
void set_DBIN | ( | Db * | dbin | ) |
void set_DBOUT | ( | Db * | dbout | ) |
|
static |
Discretize a block
[in] | mode | 0 if the block extension is read from grid 1 if the block extension is read from variable |
[in] | flag_rand | 0 if the second discretization is regular 1 if the second point must be randomized |
[in] | iech | rank of the variable (used when mode=1) |
|
static |
Allocate the Target discretization
[in] | ndim | Space dimension |
[in] | ndiscs | Discretization parameters (or NULL) |
|
static |
Establish the covariance matrix between two Dbs
[in] | title | Title of the optional printout |
[in] | db1 | First Db structure |
[in] | test_def1 | 1 if the first variable (ELoc::Z) must be checked |
[in] | db2 | Second Db structure |
[in] | test_def2 | 1 if the second variable (ELoc::Z) must be checked |
[in] | model | Model structure |
|
static |
Establish the distance matrix between two Dbs
[in] | title | Title of the optional printout |
[in] | db1 | First Db structure |
[in] | test_def1 | 1 if the first variable (ELoc::Z) must be checked |
[in] | db2 | Second Db structure (sources) |
[in] | test_def2 | 1 if the second variable (ELoc::Z) must be checked |
[in] | power | Power of the Distance decay |
|
static |
Establish the drift matrix for a given Db
[in] | title | Title of the optionla printout |
[in] | db1 | First Db structure |
[in] | test_def1 | 1 if the first variable (ELoc::Z) must be checked |
[in] | model | Model structure |
|
static |
Operate the product of the Distance by the Source covariance matrix
[in] | title | Title of the optionla printout |
[in] | n1 | Number of Data |
[in] | ns | Number of Sources |
[in] | covss | Covariance Matrix between Sources (Dim: ns*ns) |
[in] | distgen | Distance matrix |
|
static |
Calculate the experimental covariance of the residual variable defined on the grid
[in] | db | input Db structure |
[in] | model | Model describing the horizontal structure |
[in] | cov_ref | Array of discretized covariance for target variable |
[in] | cov_radius | Radius of the covariance array |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | cov_ss | Array of dimensions of the Covariance array |
[in] | cov_nn | Array of radius of the Covariance array |
[out] | cov_res | Array containing the covariance of the residual variable |
|
static |
Calculate the experimental covariance of the total variable defined on the grid
[in] | db | input Db structure |
[in] | ix0 | index of the grid index along X |
[in] | iy0 | index of the grid index along Y |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | cov_ss | Array of dimensions of the Covariance array |
[in] | cov_nn | Array of radius of the Covariance array |
[out] | num_tot | Array containing the numb er of pairs |
[out] | cov_tot | Array containing the covariance of the total variable |
|
static |
|
static |
Management of internal array (double)
[in] | nli | Number of lines |
[in] | nco | Number of columns |
|
static |
Calculate the discretized covariance
[in] | dist | Integer distance |
[in] | cov | Array of discretized covariances |
[in] | cov_radius | Radius of the covariance array |
[in] | flag_sym | 1 for symmetrized covariance |
|
static |
Allocate the Data discretization
[in] | ndim | Space dimension |
|
static |
|
static |
Perform the Declustering task as the sum of the weight for Kriging the Cells of a grid
|
static |
Display the statistics of the target variable before or after the Declustering
[in] | mode | 0 before the declustering; 1 after |
[in] | method | Method for declustering |
[in] | db | input Db structure |
[in] | iptr | Rank of the weighting variable |
|
static |
Truncate the negative weights and scale the remaining ones
[in] | db | Db structure |
[in] | iptr | Rank of the Weight variable |
|
static |
Calculate auxiliary arrays when drift is preset
[in] | np | Number of data |
[in] | nbfl | Number of drift functions |
[in] | covpp | Inverse Covariance between Data-Data |
[in] | drftab | Drift matrix at Data |
[out] | yloc | Array: t(F) %*% C^-1 |
[out] | zloc | Array: (t(F) %*% C^-1 %*% F)^-1 |
|
static |
Update the weight vector
[in] | np | Number of data |
[in] | nbfl | Number of drift functions |
[in] | covgp | Covariance matrix between Data and Target |
[in] | driftg | Drift matrix at Target |
[in] | ymat | Auxiliary array |
[in] | zmat | Auxiliary array |
[in] | maux | Auxiliary array (Dimension: nbfl) |
[out] | lambda | Vector of weights |
[out] | mu | Vector of Lagrange parameters |
|
static |
|
static |
|
static |
Returns the coordinate of the data (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)
[in] | loc_rank | Rank of the sample |
[in] | idim | Rank of the coordinate |
|
static |
****************************************************************************/ *!
Returns the value of the variable (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)
[in] | rank | Rank of the sample |
[in] | ivar | Rank of the variable |
|
static |
Returns the limits of the area of interest
[in] | db | input Db structure |
[in] | top | Elevation of the Top variable |
[in] | bot | Elevation of the bottom variable |
[out] | ideb | Index of the starting sample |
[out] | ifin | Index of the ending sample |
|
static |
Definition of the neighborhood
[in] | ideb | Index of the starting sample |
[in] | ifin | Index of the ending sample |
[in] | neigh_radius | Radius of the Neighborhood |
[out] | status | Neighborhood error status |
[out] | nbefore | Number of samples in neighborhood before target |
[out] | nafter | Number of samples in neighborhood after target |
|
static |
Returns the maximum number of points per neighborhood
[in] | neigh | ANeigh structure |
|
static |
Returns the value of the measurement error (at rank if rank >= 0) or of the target (at IECH_OUT if rank < 0)
[in] | rank | Rank of the sample |
[in] | ivar | Rank of the variable |
|
static |
Management of internal array (integer)
[in] | nli | Number of lines |
[in] | nco | Number of columns |
|
static |
Establish the covariance vector at target
[in] | dbsrc | Db structure containing Sources |
[in] | dbout | Db structure for target |
[in] | flag_source | If the result is the source, rather than diffusion |
[in] | model_dat | Model structure for the data |
[in] | distgs | Distance matrix between Target and Sources |
[in] | prodgs | Product of DistGS by CovSS |
|
static |
Establish the R.H.S. for Inhomogeneous Kriging
[in] | dbdat | Db structure containing Data |
[in] | dbsrc | Db structure containing Sources |
[in] | dbout | Db structure containing Targets |
[in] | flag_source | If the result is the source, rather than diffusion |
[in] | model_dat | Model structure for the data |
[in] | distps | Distance matrix between Data and Sources |
[in] | prodps | Product of DistPS by CovSS |
[in] | prodgs | Product of DistGS by CovSS |
int st_krige_data | ( | Db * | db, |
Model * | model, | ||
double | beta, | ||
VectorInt & | ranks1, | ||
VectorInt & | ranks2, | ||
VectorInt & | rother, | ||
int | flag_abs, | ||
double * | data_est, | ||
double * | data_var | ||
) |
Perform the estimation at the data points
[in] | db | Db structure |
[in] | model | Model structure |
[in] | beta | Thresholding value |
[in] | ranks1 | Ranks of exact pivots |
[in] | ranks2 | Ranks of ACP pivots |
[in] | rother | Ranks of the idle samples |
[in] | flag_abs | 1 Modify 'daata_est' to store the estimation error |
[out] | data_est | Array of estimation at samples |
[out] | data_var | Array of estimation variance at samples |
Management of internal arrays used by kriging procedure
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | nvar | Number of variables to be calculated |
[in] | model | Model structure |
[in] | neigh | ANeigh structure |
|
static |
Management of internal arrays used by kriging procedure
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | nech | Number of samples in the Input Db (only used for the neighborhood search, if any) |
[in] | nmax | Maximum number of samples per neighborhood |
[in] | nvar | Number of variables (to be calculated) |
[in] | nfeq | Number of drift equations |
|
static |
Establish the L.H.S. of the Kriging system in the case of the discretized covariances
[in] | covdd | Array of discretized covariance (data-data) |
[in] | cov_radius | Radius of the covariance array |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | nfeq | 0 or 1 drift function(s) |
[in] | nbefore | Number of samples in neighborhood before target |
[in] | nafter | Number of samples in neighborhood after target |
[in] | neq | Number of kriging equations |
|
static |
Establish the kriging L.H.S. using discretized covariances
[in] | nech | Number of samples in the Neighborhood |
[in] | nfeq | Number of drift functions |
[in] | nei_ss | Array of dimensions of the Neighborhood |
[in] | nei_nn | Array of radius of the Neighborhood |
[in] | cov_ss | Array of dimensions of the Covariance array |
[in] | cov_nn | Array of radius of the Covariance array |
[in] | nei_cur | Array containing the current neighborhood |
[in] | cov_tot | Array containing the total variable covariance |
[in] | nugget | Amount of additional Nugget Effect |
|
static |
|
static |
Check if two neighborhood patterns are similar
|
static |
Find the neighborhood of a pixel
|
static |
Allocate a vector of sample ranks excluding already selected pivots
[in] | nech | Number of samples |
[in] | ranks1 | Ranks of exact pivots |
[in] | ranks2 | Ranks of ACP pivots |
|
static |
Manage the relative position array
[in] | mode | 1 for creating, -1 for deleting |
[in] | neq | Number of kriging equations |
[in] | rel_arg | Relative position array (used for deletion) |
|
static |
Print the results
[in] | flag_xvalid | when cross-validation option is switched ON 1: Z*-Z and (Z*-Z)/S* 2: Z* and S* > 0 for ONE Point out < 0 for excluding information with same code |
[in] | nvar | Number of variables |
[in] | status | Kriging error status |
|
static |
Establish the R.H.S. of the Kriging system in the case of the discretized covariances
[in] | covd0 | Array of discretized covariance (data-data) |
[in] | cov_radius | Radius of the covariance array |
[in] | flag_sym | 1 for symmetrized covariance |
[in] | nfeq | 0 or 1 drift function(s) |
[in] | nbefore | Number of samples in neighborhood before target |
[in] | nafter | Number of samples in neighborhood after target |
[in] | neq | Number of equations |
|
static |
Establish the kriging R.H.S. using discretized covariances
[in] | nech | Number of samples in the neighborhood |
[in] | nfeq | Number of drift functions |
[in] | nei_ss | Array of dimensions of the Neighborhood |
[in] | nei_nn | Array of radius of the Neighborhood |
[in] | cov_ss | Array of dimensions of the Covariance array |
[in] | cov_nn | Array of radius of the Covariance array |
[in] | nei_cur | Array containing the current neighborhood |
[in] | cov_res | Array containing the residual variable covariance |
|
static |
Establishing the kriging system with exact and ACP points
[in] | db | Db structure |
[in] | model | Model structure |
[in] | beta | Thresholding value |
[in] | ranks1 | Ranks of samples (exact) |
[in] | ranks2 | Ranks of samples (ACP) |
[in] | rother | Ranks of the idle samples (modified by routine) |
[out] | ntot_arg | Number of pivots |
[out] | nutil_arg | Number of active samples |
[out] | rutil | Rank of the active samples |
[out] | tutil_arg | Returned array for the U array |
[out] | invsig_arg | Returned array for Inverse Sigma |
|
static |
Dump the contents of the covariance maps
[in] | file | FILE structure where the dmp must be produced |
[in] | ix0 | Rank of the trace along X (-1 for the reference) |
[in] | iy0 | Rank of the trace along Y (-1 for the reference) |
[in] | cov_ss | Array of dimensions of the Covariance array |
[in] | cov_nn | Array of radius of the Covariance array |
[out] | num_tot | Array containing the numb er of pairs |
[out] | cov_tot | Array containing the covariance of the total variable |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |