#include "geoslib_f.h"
#include "geoslib_old_f.h"
#include "geoslib_define.h"
#include "geoslib_f_private.h"
#include "Variogram/Vario.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/Law.hpp"
#include "Basic/MathFunc.hpp"
#include "Stats/Classical.hpp"
#include "Basic/AException.hpp"
#include "Basic/OptDbg.hpp"
#include "LithoRule/Rule.hpp"
#include "LithoRule/RuleShift.hpp"
#include "LithoRule/RuleProp.hpp"
#include "LithoRule/PropDef.hpp"
#include "Db/Db.hpp"
#include "Model/Model.hpp"
#include "Matrix/MatrixSquareSymmetric.hpp"
#include "Matrix/MatrixFactory.hpp"
#include "Enum/EOperator.hpp"
#include "Basic/Memory.hpp"
#include "Core/Keypair.hpp"
#include "Core/CTables.hpp"
#include <math.h>
#include <string.h>
Functions | |
void | set_test_discrete (bool flag_discret) |
static Relem * | st_relem_alloc (Split *old_split) |
static Split * | st_split_alloc (Relem *old_relem) |
static int | st_define_fipos (int oper, int side) |
static void | st_relem_define (Relem *relem, int nfacies, const VectorInt &facies, int side, const int *poss) |
static void | st_rule_print (int rank, int nbyrule, const int *rules, int *fipos, bool flag_rank, int flag_similar, int flag_igrf, double score) |
static void | st_rules_print (const char *title, int nrule, int nbyrule, int *rules, int *fipos) |
static void | st_relem_subdivide (Relem *relem0, int half, int noper) |
static Split * | st_split_free (Split *split) |
static Relem * | st_relem_free (Relem *relem) |
static void | st_variogram_define_vars (Vario *vario, const Rule *rule, int ngrf) |
static void | st_set_bounds (Db *db, int flag_one, int ngrf, int nfacies, int ifac, int iech, double t1min, double t1max, double t2min, double t2max) |
static void | st_set_rho (double rho, Local_Pgs *local_pgs) |
static double | st_get_proba_ind (double correl, double *low, double *up, int iconf) |
static int | st_calculate_thresh_stat (Local_Pgs *local_pgs) |
static int | st_vario_pgs_variable (int mode, int ngrf, int nfacies, int flag_one, int flag_prop, Db *db, PropDef *propdef, const Rule *rule) |
static Rule * | st_rule_encode (const int *string) |
static double | st_extract_trace (Local_Pgs *local_pgs) |
static void | st_variogram_patch_C00 (Local_Pgs *local_pgs, Vario *vario, int idir, double rho) |
static void | trace_add_row (Local_Pgs *local_pgs) |
static double | st_func_search_stat (double correl, void *user_data) |
static double | st_func_search_nostat (double correl, void *user_data) |
static void | trace_define (Local_Pgs *local_pgs, double value0, double value1, int origin, int number, const double *values) |
static int | st_varcalc_from_vario_stat (Vario *vario, Local_Pgs *local_pgs, int ngrf) |
static void | st_define_trace (int flag_rho, int flag_correl, Local_Pgs *local_pgs) |
static void | st_retrace_define (Local_Pgs *local_pgs) |
static void | st_varcalc_uncorrelated_grf (Local_Pgs *local_pgs, int idir) |
static double | st_rule_calcul (Local_Pgs *local_pgs, int *string) |
static int | st_permut (int value, int igrf) |
static int | st_fipos_encode (VectorInt &fgrf) |
static void | st_fipos_decode (int fipos, VectorInt &fgrf) |
static int | st_update_orientation (int fac0, int igrf_cas, VectorInt &fgrf) |
static int | st_same_score (Relem *relem, int ir0, int igrf_cas, VectorInt &fgrf, VectorInt &fcmp) |
static VectorDouble | st_relem_evaluate (Relem *relem, int verbose, VectorInt &fgrf, VectorInt &fcmp, Local_Pgs *local_pgs, int *nscore, int *r_opt) |
static void | st_rule_glue (Relem *relem, int nrule1, int nbyrule1, const int *rules1, const int *fipos1) |
static void | st_rule_product (Split *split, int nprod, int nrule1, int nbyrule1, int *rules1, int *fipos1, int nrule2, int nbyrule2, int *rules2, int *fipos2) |
static void | st_split_collapse (Split *split, int verbose) |
static void | st_relem_explore (Relem *relem, int verbose) |
Vario_Order * | vario_order_manage (int mode, int flag_dist, int size_aux, Vario_Order *vorder) |
int | vario_order_add (Vario_Order *vorder, int iech, int jech, void *aux_iech, void *aux_jech, int ipas, int idir, double dist) |
void | vario_order_print (Vario_Order *vorder, int idir_target, int ipas_target, int verbose) |
Vario_Order * | vario_order_final (Vario_Order *vorder, int *npair) |
void | vario_order_get_indices (Vario_Order *vorder, int ipair, int *iech, int *jech, double *dist) |
void | vario_order_get_auxiliary (Vario_Order *vorder, int ipair, char *aux_iech, char *aux_jech) |
void | vario_order_get_bounds (Vario_Order *vorder, int idir, int ipas, int *ifirst, int *ilast) |
static int | invgen (MatrixSquareSymmetric &a, MatrixSquareSymmetric &tabout) |
static int | st_index (int i, int j) |
static VectorDouble | st_compute_params (Local_CorPgs *corpgs, VectorDouble ¶ms_in) |
static void | st_build_correl (Local_CorPgs *corpgs, VectorDouble ¶ms_in, MatrixSquareSymmetric &correl) |
static void | st_update_constraints (Local_CorPgs *corpgs, VectorDouble &Grad, MatrixSquareSymmetric &Hess) |
static void | st_update_constraints_with_JJ (Local_CorPgs *corpgs, VectorDouble &Grad, MatrixSquareSymmetric &Hess, MatrixSquareSymmetric &JJ) |
static void | st_deriv_eigen (Local_CorPgs *corpgs, double eigval, const MatrixSquareGeneral *ev, VectorDouble &d1, MatrixSquareSymmetric &d2) |
static double | st_param_expand (Local_Pgs *local_pgs, int igrf, int jgrf, int idir) |
static void | st_set_modif (Local_CorPgs *corpgs) |
static void | st_define_corpgs (int option, int flag_rho, double rho, Local_Pgs *local_pgs) |
static int | st_get_count (Local_Pgs *local_pgs, int ifac1, int ifac2) |
static double | st_rkl (int maxpts, double x, double y, VectorDouble &lower, VectorDouble &upper, MatrixSquareSymmetric &corr1, MatrixSquareGeneral &covar, MatrixSquareGeneral &temp) |
static double | st_ikl (int maxpts, int index1, int index2, VectorDouble &lower, VectorDouble &upper, MatrixSquareSymmetric &correl) |
static double | st_nkl (VectorDouble &u, double lower, double upper, VectorDouble &invvari, int index2, double meanj, double varj, double stdj) |
static double | st_d2_dkldkl (int maxpts, int index1, int index2, VectorDouble &lower, VectorDouble &upper, MatrixSquareSymmetric &correl) |
static double | st_d2_dkldij (VectorDouble &lower, VectorDouble &upper, MatrixSquareSymmetric &correl) |
static double | st_d2_dkldkj (int index1, int index2, VectorDouble &lower, VectorDouble &upper, MatrixSquareSymmetric &correl) |
static double | st_calcul_stat (Local_Pgs *local_pgs, int flag_deriv, int flag_reset, MatrixSquareSymmetric &correl, VectorDouble &Grad, MatrixSquareSymmetric &Hess, MatrixSquareSymmetric &JJ) |
static double | st_calcul_nostat (Local_Pgs *local_pgs, int flag_deriv, int flag_reset, MatrixSquareSymmetric &correl, VectorDouble &Grad, MatrixSquareSymmetric &Hess, MatrixSquareSymmetric &JJ) |
static double | st_calcul (Local_Pgs *local_pgs, int flag_deriv, int flag_reset, VectorDouble ¶ms, VectorDouble &Grad, MatrixSquareSymmetric &Hess, MatrixSquareSymmetric &JJ) |
static void | st_initialize_params (Local_CorPgs *corpgs) |
static double | st_optim_onelag_pgs (Local_Pgs *local_pgs, double tolsort, int new_val) |
static int | st_discard_point (Local_Pgs *local_pgs, int iech) |
static int | st_variogram_geometry_pgs_final (Local_Pgs *local_pgs) |
static void | st_variogram_geometry_pgs_correct (Local_Pgs *local_pgs, Vario *vario, int idir) |
static int | st_variogram_geometry_pgs_calcul (Local_Pgs *local_pgs, Vario *vario, int idir) |
static void | st_set_opt_correl (int opt, Local_CorPgs *corpgs) |
static double | st_varcalc_correlated_grf (Local_Pgs *local_pgs, int idir) |
static void | st_manage_corpgs (Local_CorPgs *local_corpgs) |
static void | st_manage_trace (Local_TracePgs *local_tracepgs) |
static void | st_manage_pgs (int mode, Local_Pgs *local_pgs, Db *db=nullptr, const Rule *rule=nullptr, Vario *vario=nullptr, Vario *varioind=nullptr, Model *model=nullptr, PropDef *propdef=nullptr, int flag_stat=0, int flag_facies=0, int flag_dist=0, int ngrf=0, int nfacies=0, const ECalcVario &calcul_type=ECalcVario::UNDEFINED) |
static int | st_variopgs_calcul_norho (Vario *vario, const Rule *rule, Local_Pgs *local_pgs, int ngrf, int opt_correl, int flag_geometry) |
static void | st_make_some_lags_inactive (Vario *vario) |
static void | st_make_all_lags_active (Vario *vario) |
static double | st_rho_search (double rho, void *user_data) |
static int | st_variopgs_calcul_rho (Vario *vario, const Rule *rule, Local_Pgs *local_pgs, int ngrf, int opt_correl) |
static int | st_check_test_discret (const ERule &mode, int flag_rho) |
static int | st_vario_pgs_check (int flag_db, int flag_rule, int flag_varioind, Db *db, const Db *dbprop, const Vario *vario, Vario *varioind, const Rule *rule) |
static int | st_variogram_pgs_nostat (Db *db, const Db *dbprop, Vario *vario, const Rule *rule, const VectorDouble &propcst, int flag_rho, int opt_correl) |
static void | st_calcul_covmatrix (Local_Pgs *local_pgs, int *flag_ind, int *iconf, double *cov) |
static double | st_get_proba (Local_Pgs *local_pgs, int flag_ind, double *low, double *up, int *iconf, double *cov) |
static void | st_define_bounds (Local_Pgs *local_pgs, int iech1, int iech2, int ifac1, int ifac2, double *low, double *up, double *ploc) |
static double | st_get_value (Local_Pgs *local_pgs, int flag_ind, int iech1, int iech2, int ifac1, int ifac2, int *iconf, double *cov) |
static void | st_variogram_scale (Vario *vario, int idir) |
static int | st_vario_indic_model_nostat (Local_Pgs *local_pgs) |
static int | st_copy_swhh (const Vario *vario1, Vario *vario2, bool flagSw, bool flagHh, bool flagGg) |
static int | st_vario_indic_model_stat (Local_Pgs *local_pgs) |
static void | st_update_variance_stat (Local_Pgs *local_pgs) |
static void | st_update_variance_nostat (Local_Pgs *local_pgs) |
Vario * | model_pgs (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, const Model *model1, const Model *model2) |
static int | st_variogram_pgs_stat (Db *db, Vario *vario, Vario *varioind, const Rule *rule, const VectorDouble &propcst) |
Vario * | variogram_pgs (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, int flag_rho, int opt_correl) |
Rule * | _rule_auto (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, int ngrfmax, int verbose) |
Rule* _rule_auto | ( | Db * | db, |
const VarioParam * | varioparam, | ||
const RuleProp * | ruleprop, | ||
int | ngrfmax, | ||
int | verbose | ||
) |
Find the optimal Truncation Scheme from Variopgs score
[in] | db | Db structure |
[in] | varioparam | VarioParam structure for the GRFs |
[in] | ruleprop | RuleProp structure |
[in] | ngrfmax | Maximum number of underlying GRFs (1 or 2) |
[in] | verbose | Verbose flag |
|
static |
Calculate the generalized inverse of a square symmetric matrix
[in] | a | Matrix to be inverted |
[out] | tabout | Inverted matrix |
Vario* model_pgs | ( | Db * | db, |
const VarioParam * | varioparam, | ||
const RuleProp * | ruleprop, | ||
const Model * | model1, | ||
const Model * | model2 | ||
) |
Evaluate the experimental variogram of indicators in PluriGaussian case
[in] | db | Db descriptor |
[in] | varioparam | VarioParam structure |
[in] | ruleprop | RuleProp structure |
[in] | model1 | First Model structure |
[in] | model2 | Second Model structure (optional) |
void set_test_discrete | ( | bool | flag_discret | ) |
|
static |
Establish the correlation for C1(h), C12(h), C21(h), C2(h)
[in] | corpgs | Local_CorPgs structure |
[in] | params_in | Array of parameters |
[out] | correl | Correlation matrix (Dimension = 4*4) |
|
static |
Global calculation
[in] | local_pgs | Local_Pgs structure |
[in] | flag_deriv | 1 if the derivatives must be calculated |
[in] | flag_reset | 1 to update the probability calculations |
[in] | params | Array of parameters |
[out] | Grad | Vector of cumulated gradients (Dimension= 4) |
[out] | Hess | Matrix of cumulated Hessian (Dimension= 4*4) |
[out] | JJ | Matrix of cumulated JJ (Dimension= 4*4) |
|
static |
Calculate the covariance matrix
[in] | local_pgs | Local_Pgs structure |
[out] | flag_ind | 1 if the two GRF are independent |
[out] | iconf | Array of ranks of the discretized covariance |
[out] | cov | Matrix of covariance |
|
static |
Global calculation in the non-stationary case
[in] | local_pgs | Local_Pgs structure |
[in] | flag_deriv | 1 if the derivatives must be calculated |
[in] | flag_reset | 1 to update the probability calculations |
[in] | correl | Correlation matrix updated |
[out] | Grad | Vector of cumulated gradients (Dimension= 4) |
[out] | Hess | Matrix of cumulated Hessian (Dimension= 4*4) |
[out] | JJ | Matrix of cumulated JJ (Dimension= 4*4) |
|
static |
Global calculation in the stationary case
[in] | local_pgs | Local_Pgs structure |
[in] | flag_deriv | 1 if the derivatives must be calculated |
[in] | flag_reset | 1 to update the probability calculations |
[in] | correl | Correlation matrix updated |
[out] | Grad | Vector of cumulated gradients (Dimension= 4) |
[out] | Hess | Matrix of cumulated Hessian (Dimension= 4*4) |
[out] | JJ | Matrix of cumulated JJ (Dimension= 4*4) |
|
static |
Calculate the thresholds in the stationary case
[in] | local_pgs | Local_Pgs structure |
|
static |
Check if the Discrete Calculations make sens or not
[in] | mode | Lithotype mode (ENUM_RULES) |
[in] | flag_rho | 1 if rho has to be calculated, 0 otherwise |
|
static |
Establish the total vector C1(h), C12(h), C21(h), C2(h)
[in] | corpgs | Local_CorPgs structure |
[in] | params_in | Parameters (Dimension corpgs.npar) |
|
static |
Duplicate the information from the input variogram to the output variogram This operation considers (Sw, Hh, Gg) and replicates this information for all directions. Per direction, the information of the first simple input variogram is replicated to all simple and cross-variograms outputs
[in] | vario1 | Input Variogram |
[out] | vario2 | Output Variogram |
[in] | flagSw | True if Sw must be replicated |
[in] | flagHh | True if Hh must be replicated |
[in] | flagGg | True if Gg must be replicated |
|
static |
|
static |
|
static |
|
static |
Define the thresholds of the GRF(s)
[in] | local_pgs | Local_Pgs structure |
[in] | iech1 | Rank of the first sample |
[in] | iech2 | Rank of the second sample |
[in] | ifac1 | Rank of the first facies |
[in] | ifac2 | Rank of the second facies |
[out] | low | Array of lower thresholds (Dimension: 4) |
[out] | up | Array of upper thresholds (Dimension: 4) |
[out] | ploc | Array of proportions (Dimension: 2) |
REMARKS: Warning: in the case of TEST_DISCRET, the returned arguments REMARKS: 'low' and 'up' return the ranks in the discretized covariance
|
static |
Define the correlation option
[in] | option | Correlation option
|
[in] | flag_rho | 1 if rho has to be calculated, 0 otherwise |
[in] | rho | Correlation between GRFs |
[in,out] | local_pgs | Local_Pgs structure |
|
static |
|
static |
Define the trace
[in] | flag_rho | 1 if rho has to be calculated, 0 otherwise |
[in] | flag_correl | 1 for the correlated case; 0 otherwise |
[in,out] | local_pgs | Local_Pgs structure |
|
static |
Compute the derivatives (first and second) of the smallest eigenvalue
[in] | corpgs | Local_CorPgs structure |
[in] | eigval | Current eigen value |
[out] | ev | Output array |
[out] | d1 | First order derivative |
[out] | d2 | Second order derivative |
|
static |
Discard a data if:
[in] | local_pgs | Local_Pgs structure |
[in] | iech | Rank of the sample |
|
static |
Extract the information of the Trace
[in] | local_pgs | Local_Pgs structure |
|
static |
|
static |
|
static |
Local searching function
[in] | correl | Correlation parameter |
[in] | user_data | User Data |
|
static |
Local searching function
[in] | correl | Correlation parameter |
[in] | user_data | User Data |
|
static |
Count the number of pairs with the target facies
[in] | local_pgs | Local_Pgs structure |
[in] | ifac1 | First target facies (starting from 1) |
[in] | ifac2 | Second target facies (starting from 1) |
|
static |
Calculate the probability
|
static |
|
static |
Calculate the variogram or covariance contribution
[in] | local_pgs | Local_Pgs structure |
[in] | flag_ind | 1 if the GRFs are independent |
[in] | iech1 | Rank of the first sample |
[in] | iech2 | Rank of the second sample |
[in] | ifac1 | Rank of the first facies |
[in] | ifac2 | Rank of the second facies |
[in] | iconf | Array of ranks of the discretized covariance |
[in] | cov | Covariance matrix |
|
static |
|
static |
Calculate the indexes of each parameter
[in] | i | Index |
[in] | j | Index |
|
static |
Initialize the parameters
[out] | corpgs | Local_CorPgs Structure |
|
static |
Make all lags active
[out] | vario | Vario structure |
|
static |
Make some lags inactive
[out] | vario | Vario structure |
|
static |
Manage the Local_CorPgs structure
[in,out] | local_corpgs | Local_CorPgs structure |
|
static |
Manage the Local_Pgs structure
[in] | mode | 0 initialization; 1 allocation; -1 deallocation |
[in,out] | local_pgs | Local_Pgs structure |
[in] | db | Db structure |
[in] | rule | Lithotype Rule definition |
[in] | vario | Vario structure |
[in] | varioind | Indicator Vario structure |
[in] | model | Model structure |
[in] | propdef | PropDef structure |
[in] | flag_stat | 1 for stationary; 0 otherwise |
[in] | flag_facies | 1 when processed on facies; 0 otherwise |
[in] | flag_dist | 1 if distances are stored; 0 otherwise |
[in] | ngrf | Number of GRFs |
[in] | nfacies | Number of facies |
[in] | calcul_type | Type of the calculation (covariance, variogram, ...) |
|
static |
Manage the Local_TracePgs structure
[in,out] | local_tracepgs | Local_TracePgs structure |
|
static |
|
static |
Optimize the lag
[in] | local_pgs | Local_Pgs structure |
[in] | tolsort | Tolerance value |
[in] | new_val | Flag indicating if parameters must be initialized |
|
static |
Expand the vector of parameters into C1, C12, C21 and C2 according to the constraints
[in] | local_pgs | Local_Pgs structure |
[in] | igrf | Rank of the first variable |
[in] | jgrf | Rank of the second variable |
[in] | idir | positive (1) or negative (-1) distance |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Reset the Local_TracePgs structure
[in,out] | local_pgs | Local_TracePgs structure |
|
static |
Local searching function for rho
[in] | rho | rho parameter |
[in] | user_data | User Data |
|
static |
PRUPOSE: Internal function
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Define the bounds for Gaussian integrals and store them in relevant variables
|
static |
Compute the modif matrix
[out] | corpgs | Local_CorPgs structure |
|
static |
Set the model-type (opt_correl)
[in] | opt | The model-type to set |
[out] | corpgs | Local_CorPgs structure |
|
static |
Modify rho where it is needed
[in] | rho | Rho value |
[out] | local_pgs | Local_Pgs structure |
|
static |
|
static |
Update the following matrices according to constraints on model
[in] | corpgs | Local_CorPgs structure |
[in,out] | Grad | Vector of gradients (Dimension = npar) |
[in,out] | Hess | Matrix of Hessian (Dimension = npar * npar) |
|
static |
Update the following matrices according to constraints on model
[in] | corpgs | Local_CorPgs structure |
[in,out] | Grad | Vector of gradients (Dimension = npar) |
[in,out] | Hess | Matrix of Hessian (Dimension = npar * npar) |
[in,out] | JJ | Matrix of t(JJ) * JJ (Dimension = npar * npar) |
|
static |
|
static |
Establish the theoretical variance of the simple and cross-variograms of the indicators in the non-stationary case
[in] | local_pgs | Local_Pgs structure |
|
static |
Establish the theoretical variance of the simple and cross-variograms of the indicators in the stationary case
[in] | local_pgs | Local_Pgs structure |
|
static |
Evaluate the variogram of the underlying GRFs (assuming the two GRFs of the PGS model are correlated)
[in] | local_pgs | Local_Pgs structure |
[in] | idir | Rank of the direction |
|
static |
Performing the variogram calculations (stationary case)
[in] | vario | Vario structure for the GRFs to be filled |
[in] | local_pgs | Local_Pgs structure |
[in] | ngrf | Number of GRFs |
|
static |
Evaluate the variogram of one underlying GRF
[in] | local_pgs | Local_Pgs structure |
[in] | idir | Rank of the direction |
|
static |
Performing the variogram calculations in the non-stationary case
[in] | local_pgs | Local_Pgs structure |
|
static |
Performing the variogram calculations in the stationary case
[in] | local_pgs | Local_Pgs structure |
|
static |
Check that the arguments are correct
[in] | flag_db | 1 if the input Db must be provided -1 if it is optional 0 if the Db is not tested |
[in] | flag_rule | 1 if the Rule must be defined |
[in] | flag_varioind | 1 if the Indicator Variogram must be defined |
[in] | db | Db structure |
[in] | dbprop | Db Grid used for proportions (non-stationary) |
[in] | vario | Vario structure for the GRFs to be filled |
[in] | varioind | Vario structure for Indicator |
[in] | rule | Lithotype Rule definition |
|
static |
Manage local variables for variopgs calculation (Non-stationary case)
[in] | mode | Type of usage 1 for allocation 0 for valuation (rule dependent) -1 for deallocation |
[in] | ngrf | Number of grfs |
[in] | nfacies | Number of facies |
[in] | flag_one | 1 for considering only the Facies at data point 0 for considering all facies |
[in] | flag_prop | 1 for allocating variable for proportions |
[in] | db | Db structure |
[in] | propdef | PropDef structure |
[in] | rule | Lithotype Rule definition |
|
static |
Determine the Geometry of all pairs
[in] | local_pgs | Local_Pgs structure |
[in] | vario | Vario structure |
[in] | idir | Rank of the direction |
|
static |
Correct the experimental variogram for GRFs
[in] | local_pgs | Local_Pgs structure |
[in] | vario | Vario structure |
[in] | idir | Rank of the direction |
|
static |
Compress the Geometry of all pairs
[in] | local_pgs | Local_Pgs structure |
|
static |
Patch the central value (dist=0) of the covariances
[in] | local_pgs | Local_Pgs structure |
[in] | vario | Vario structure for the GRFs to be filled |
[in] | idir | Rank of the direction |
[in] | rho | Correlation coefficient |
|
static |
Calculate the gaussian variograms
[in] | db | Db structure |
[in] | dbprop | Db Grid used for proportions (non-stationary) |
[in] | vario | Vario structure for the GRFs to be filled |
[in] | rule | Lithotype Rule definition |
[in] | propcst | Array of proportions for the facies |
[in] | flag_rho | 1 if the correlation coefficient must be regressed |
[in] | opt_correl | 0 full model; 1 symmetrical; 2 residuals |
|
static |
Calculate the gaussian variograms in the stationary case
|
static |
Scale the variogram calculations
[in] | vario | Vario structure |
[in] | idir | Rank of the Direction |
|
static |
Performing the variogram calculations
[in] | vario | Vario structure for the GRFs to be filled |
[in] | rule | Lithotype Rule definition |
[in] | local_pgs | Local_Pgs structure |
[in] | ngrf | Number of GRFs |
[in] | opt_correl | 0 full model; 1 symetrical; 2 residuals |
[out] | flag_geometry | 1 if Geometry must be established per direction 0 if Geometry is already calculated before calling this function |
|
static |
Add a new row to the trace
[in] | local_pgs | Local_Pgs structure |
|
static |
Update the Trace array
[in] | local_pgs | Local_Pgs structure |
[in] | value0 | First value in a Trace row |
[in] | value1 | Second value in a Trace row |
[in] | origin | Origin for values in record (after 2 heading values) |
[in] | number | Number of values assigned |
[in] | values | Array of values assigned |
int vario_order_add | ( | Vario_Order * | vorder, |
int | iech, | ||
int | jech, | ||
void * | aux_iech, | ||
void * | aux_jech, | ||
int | ipas, | ||
int | idir, | ||
double | dist | ||
) |
Add a record to the Variogram Order structure
[in] | vorder | Vario_Order structure |
[in] | iech | Rank of the first sample |
[in] | jech | Rank of the second sample |
[in] | aux_iech | Auxiliary array for sample 'iech' (or NULL) |
[in] | aux_jech | Auxiliary array for sample 'jech' (or NULL) |
[in] | ipas | Rank of the lag |
[in] | idir | Rank of the direction (or 0) |
[in] | dist | Calculated distance (only stored if flag_dist == 1) |
Vario_Order* vario_order_final | ( | Vario_Order * | vorder, |
int * | npair | ||
) |
Resize the array and sort it
[in] | vorder | Vario_Order structure |
[in] | npair | Final number of pairs |
void vario_order_get_auxiliary | ( | Vario_Order * | vorder, |
int | ipair, | ||
char * | aux_iech, | ||
char * | aux_jech | ||
) |
Returns the two auxiliary arrays for a given (ordered) pair
[in] | vorder | Vario_Order structure |
[in] | ipair | Rank of the sorted pair |
[out] | aux_iech | Array to auxiliary information for sample 'iech' |
[out] | aux_jech | Array to auxiliary information for sample 'jech' |
void vario_order_get_bounds | ( | Vario_Order * | vorder, |
int | idir, | ||
int | ipas, | ||
int * | ifirst, | ||
int * | ilast | ||
) |
Returns the first and last indices matching a target lag
[in] | vorder | Vario_Order structure |
[in] | idir | Rank of the target direction |
[in] | ipas | Rank of the target lag |
[out] | ifirst | Rank of the first sample of the lag (included) |
[out] | ilast | Rank of the last sample of the lag (excluded) |
void vario_order_get_indices | ( | Vario_Order * | vorder, |
int | ipair, | ||
int * | iech, | ||
int * | jech, | ||
double * | dist | ||
) |
Returns the two samples for a given (ordered) pair
[in] | vorder | Vario_Order structure |
[in] | ipair | Rank of the sorted pair |
[out] | iech | Rank of the first sample |
[out] | jech | Rank of the second sample |
[out] | dist | Calculated distance or TEST (if flag_dist == 0) |
Vario_Order* vario_order_manage | ( | int | mode, |
int | flag_dist, | ||
int | size_aux, | ||
Vario_Order * | vorder | ||
) |
Manage the Variogram Order structure
[in] | mode | Usage:
|
[in] | flag_dist | 1 if distances are stored; 0 otherwise |
[in] | size_aux | Size (in bytes) of the auxiliary array |
[in] | vorder | Vario_Order structure |
void vario_order_print | ( | Vario_Order * | vorder, |
int | idir_target, | ||
int | ipas_target, | ||
int | verbose | ||
) |
Print the Vario_Order structure
[in] | vorder | Vario_Order structure |
[in] | idir_target | Rank of the target direction (starting from 0) or -1 |
[in] | ipas_target | Rank of the target lag (starting from 0) or -1 |
[in] | verbose | 1 for a complete printout |
Vario* variogram_pgs | ( | Db * | db, |
const VarioParam * | varioparam, | ||
const RuleProp * | ruleprop, | ||
int | flag_rho, | ||
int | opt_correl | ||
) |
Calculate the Gaussian variograms
[in] | db | Db structure |
[in] | varioparam | VarioParam structure for the GRFs |
[in] | ruleprop | RuleProp structure |
[in] | flag_rho | 1 if the correlation coefficient must be regressed |
[in] | opt_correl | 0 full model; 1 symmetrical; 2 residuals |