1.2.2
CCC
 
variopgs.cpp File Reference
#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 <math.h>
#include <string.h>

Functions

void set_test_discrete (bool flag_discret)
 
Vario_Ordervario_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_Ordervario_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)
 
Variomodel_pgs (Db *db, const VarioParam *varioparam, const RuleProp *ruleprop, const Model *model1, const Model *model2)
 
Variovariogram_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)
 

Function Documentation

Rule* _rule_auto ( Db db,
const VarioParam varioparam,
const RuleProp ruleprop,
int  ngrfmax,
int  verbose 
)

Find the optimal Truncation Scheme from Variopgs score

Returns
The newly created Rule structure
Parameters
[in]dbDb structure
[in]varioparamVarioParam structure for the GRFs
[in]rulepropRuleProp structure
[in]ngrfmaxMaximum number of underlying GRFs (1 or 2)
[in]verboseVerbose flag
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

Returns
Error return code
Parameters
[in]dbDb descriptor
[in]varioparamVarioParam structure
[in]rulepropRuleProp structure
[in]model1First Model structure
[in]model2Second Model structure (optional)
void set_test_discrete ( bool  flag_discret)
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

Returns
Error return code
Parameters
[in]vorderVario_Order structure
[in]iechRank of the first sample
[in]jechRank of the second sample
[in]aux_iechAuxiliary array for sample 'iech' (or NULL)
[in]aux_jechAuxiliary array for sample 'jech' (or NULL)
[in]ipasRank of the lag
[in]idirRank of the direction (or 0)
[in]distCalculated distance (only stored if flag_dist == 1)
Vario_Order* vario_order_final ( Vario_Order vorder,
int *  npair 
)

Resize the array and sort it

Returns
Pointer to the Vario_Order structure
Parameters
[in]vorderVario_Order structure
[in]npairFinal 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

Parameters
[in]vorderVario_Order structure
[in]ipairRank of the sorted pair
[out]aux_iechArray to auxiliary information for sample 'iech'
[out]aux_jechArray 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

Parameters
[in]vorderVario_Order structure
[in]idirRank of the target direction
[in]ipasRank of the target lag
[out]ifirstRank of the first sample of the lag (included)
[out]ilastRank 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

Parameters
[in]vorderVario_Order structure
[in]ipairRank of the sorted pair
[out]iechRank of the first sample
[out]jechRank of the second sample
[out]distCalculated 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

Returns
Pointer to the Vario_Order structure
Parameters
[in]modeUsage:
  • 1 : to initialize
  • 0 : to clean the geometry
  • -1 : to delete
[in]flag_dist1 if distances are stored; 0 otherwise
[in]size_auxSize (in bytes) of the auxiliary array
[in]vorderVario_Order structure
void vario_order_print ( Vario_Order vorder,
int  idir_target,
int  ipas_target,
int  verbose 
)

Print the Vario_Order structure

Parameters
[in]vorderVario_Order structure
[in]idir_targetRank of the target direction (starting from 0) or -1
[in]ipas_targetRank of the target lag (starting from 0) or -1
[in]verbose1 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

Returns
Error return code
Parameters
[in]dbDb structure
[in]varioparamVarioParam structure for the GRFs
[in]rulepropRuleProp structure
[in]flag_rho1 if the correlation coefficient must be regressed
[in]opt_correl0 full model; 1 symmetrical; 2 residuals
Remarks
This is simply a routine dispatching between the stationary function
and the non-stationary one