#include "geoslib_define.h"
#include "geoslib_f_private.h"
#include "geoslib_old_f.h"
#include "Enum/ELoadBy.hpp"
#include "Matrix/MatrixFactory.hpp"
#include "Matrix/MatrixSquareGeneral.hpp"
#include "Matrix/MatrixSparse.hpp"
#include "Matrix/LinkMatrixSparse.hpp"
#include "Matrix/NF_Triplet.hpp"
#include "LinearOp/ProjMatrix.hpp"
#include "Mesh/MeshEStandard.hpp"
#include "Covariances/CovAniso.hpp"
#include "Covariances/ACovAnisoList.hpp"
#include "Covariances/CovFactory.hpp"
#include "Basic/AException.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/Law.hpp"
#include "Basic/MathFunc.hpp"
#include "Basic/String.hpp"
#include "Basic/VectorHelper.hpp"
#include "Db/Db.hpp"
#include "Model/Model.hpp"
#include "Mesh/AMesh.hpp"
#include "Mesh/MeshETurbo.hpp"
#include "Calculators/CalcMigrate.hpp"
#include "Space/SpaceSN.hpp"
#include "Geometry/GeometryHelper.hpp"
#include "Basic/Memory.hpp"
#include "Core/Keypair.hpp"
#include <math.h>
#include <string.h>
Macros | |
#define | NBLIN_TERMS 10 |
#define | SPDE_MAX_NGRF 2 |
Functions | |
static int | st_get_rank (int ivar, int jvar) |
static void | st_matelem_print (int icov) |
void | spde_option_update (SPDE_Option &s_option, const String &triswitch) |
SPDE_Option | spde_option_alloc (void) |
SPDE_Matelem & | spde_get_current_matelem (int icov) |
static void | st_title (int flag_igrf, int flag_icov, int rank, const char *title) |
static Model * | st_get_model (void) |
static int | st_get_number_grf (void) |
static void | st_environ_init (void) |
static cs_MGS * | st_mgs_manage (int mode, cs_MGS *mgs) |
void | simu_define_func_transf (void(*st_simu_transf)(Db *, int, int, int)) |
void | simu_define_func_update (void(*st_simu_update)(Db *, int, int, int)) |
void | simu_define_func_scale (void(*st_simu_scale)(Db *, int, int)) |
static bool | st_is_model_nugget (void) |
static CovAniso * | st_get_nugget (void) |
static CovAniso * | st_get_cova (void) |
static void | st_set_model (Model *model) |
static int | st_get_nvs2 (void) |
static int | st_get_filnug (void) |
static void | st_set_filnug (int flag_filnug) |
static double | st_get_isill (int icov, int ivar, int jvar) |
static void | st_clean_Bhetero (void) |
static void | st_clean_Bnugget (void) |
static void | st_print_status (int auth) |
static void | st_qchol_filter (const char *title, int auth) |
static void | st_qchol_print (const char *title, QChol *QC) |
static MatrixSparse * | st_extract_Q_from_Q (MatrixSparse *Q_in, int row_auth, int col_auth) |
static QChol * | st_extract_QC_from_Q (const char *title, QChol *QC_in, int row_auth, int col_auth) |
static QSimu * | st_qsimu_manage (int mode, QSimu *qsimu) |
QChol * | qchol_manage (int mode, QChol *QC) |
static double | st_get_nugget_sill (int ivar, int jvar) |
static double | st_get_cova_sill (int ivar, int jvar) |
static double | st_get_cova_param (void) |
static int | st_get_ncova_max (void) |
static int | st_get_ncova (void) |
static int | st_get_nvertex (int icov) |
static int | st_get_nvertex_max (void) |
static int | st_get_dimension (void) |
static double | st_get_model_mean (int ivar) |
static double | st_get_cova_range (void) |
static double | st_get_sill_total (int ivar, int jvar) |
static void | st_keypair_array (const char *name, int iter, double *tab) |
static void | st_print_all (const char *title) |
static void | st_compute_correc (void) |
double | spde_compute_correc (int ndim, double param) |
static void | st_compute_blin (void) |
static void | st_compute_hh () |
static void | st_calcul_init (int ndim) |
static void | st_calcul_update (void) |
static void | st_convert_exponential2matern (CovAniso *cova) |
int | spde_attach_model (Model *model) |
static int | st_check_model (const Db *dbin, const Db *dbout, Model *model) |
static int | st_identify_nostat_param (const EConsElem &type0, int icov0=-1, int ivar0=-1, int jvar0=-1) |
static double | st_get_data_constraints (Db *db, int igrf, int iech) |
static double | st_simu_constraints (Db *db, int igrf, int iech, int iter, int ngibbs_burn, double yk, double sk) |
static void | st_gibbs (int igrf, int nout, int ngibbs_int, int iter0, int ngibbs_burn, Db *dbin, Db *dbout, double *zcur) |
static void | st_save_result (double *z, Db *dbout, const ELoc &locatorType, int iatt_simu) |
static void | st_merge (int ncur, double *z, double *zperm) |
static void | st_copy (int ncur, double *z, double *zperm) |
static void | st_simu_add_vertices (int number, const double *zsnc, double *zcur) |
static void | st_load_array (int number, const double *aux, double *perm) |
static void | st_init_array (int ncova, int nvar, int ncur, int flag_var, double *zperm) |
static int | st_simu_subtract_data (int ncur, const double *zsnc, const double *data, double *zerr) |
static void | st_kriging_one_rhs (QChol *QCtd, double *data, int ntarget, double *rhs) |
static int | st_kriging_cholesky (QChol *QC, double *rhs, VectorDouble &work, double *z) |
static int | st_filter (double *work, double *y) |
double * | _spde_get_mesh_dimension (AMesh *amesh) |
static void | st_calcul_update_nostat (AMesh *amesh, int imesh0) |
static int | st_fill_Isill (void) |
static int | st_fill_Csill (void) |
static int | st_fill_Bnugget (Db *dbin) |
static int * | st_get_vertex_ranks (AMesh *amesh, Db *dbin, Db *dbout) |
static int | st_fill_Bhetero (Db *dbin, Db *dbout) |
static void | st_triangle_center (AMesh *amesh, int ncorner, int imesh, double center[3], double xyz[3][3]) |
static void | st_project_plane (double center[3], double axes[2][3], double xyz[3], double coeff[2]) |
static void | st_tangent_calculate (double center[3], const double srot[2], double axes[2][3]) |
MatrixSparse * | _spde_fill_S (AMesh *amesh, Model *model, const double *units) |
VectorDouble | _spde_fill_TildeC (AMesh *amesh, const double *units) |
VectorDouble | _spde_fill_Lambda (Model *model, AMesh *amesh, const VectorDouble &TildeC) |
static MatrixSparse * | st_extract_Q1_nugget (int row_var, int col_var, int *nrows, int *ncols) |
static MatrixSparse * | st_extract_Q1_hetero (int row_var, int col_var, int row_oper, int col_oper, int *nrows, int *ncols) |
static int | st_build_QCov (SPDE_Matelem &Matelem) |
MatrixSparse * | _spde_build_Q (MatrixSparse *S, const VectorDouble &Lambda, int nblin, double *blin) |
static int | st_build_Q (SPDE_Matelem &Matelem) |
int | spde_build_matrices (Model *model, int verbose) |
static void | st_load_data (AMesh *amesh, Db *dbin, Db *dbout, SPDE_Option &, int ivar0, double *data, double *zcur) |
static double | st_chebychev_function (double x, double power, const VectorDouble &blin) |
static int | st_chebychev_calculate_coeffs (Cheb_Elem *cheb_elem, int verbose, const VectorDouble &blin) |
static void | st_simulate_nugget (int ncur, VectorDouble &zsnc) |
static int | st_simulate_cholesky (QChol *QC, VectorDouble &work, VectorDouble &zsnc) |
int | spde_chebychev_operate (MatrixSparse *S, Cheb_Elem *cheb_elem, const VectorDouble &lambda, const VectorDouble &x, VectorDouble &y) |
static int | st_simulate_chebychev (VectorDouble &zsnc) |
static int | st_kriging_multigrid (QChol *QC, double *rhs, VectorDouble &work, double *z) |
static int | st_solve (QChol *QC, double *rhs, VectorDouble &work, double *z) |
static int | st_kriging_one (double *data, double *rhs, VectorDouble &work, double *z) |
static int | st_kriging_several_rhs (double *data, double *rhs, VectorDouble &work, double *ss_arg) |
static int | st_kriging_several_loop (int flag_crit, VectorDouble &work, double *rhscur, double *rhsloc, double *xcur, const double *rhs, double *crit) |
static int | st_kriging_several_results (const double *xcur, double *z) |
static int | st_kriging_several (double *data, double *rhs, VectorDouble &work, double *z) |
static int | st_kriging (AMesh *amesh, double *data, double *zkrig) |
Cheb_Elem * | spde_cheb_manage (int mode, int verbose, double power, const VectorDouble &blin, MatrixSparse *S, Cheb_Elem *cheb_old) |
Cheb_Elem * | _spde_cheb_duplicate (Cheb_Elem *cheb_in) |
static void | st_matelem_manage (int mode) |
static int | st_simulate (QChol *QC, double *zsnc) |
int | spde_process (Db *dbin, Db *dbout, SPDE_Option &s_option, int nbsimu, int ngibbs_nburn, int ngibbs_niter, int ngibbs_int) |
static AMesh * | st_create_meshes (Db *dbin, Db *dbout, const VectorDouble &gext, SPDE_Option &s_option) |
static int | st_is_external_AQ_defined (int icov0) |
int | spde_external_copy (SPDE_Matelem &matelem, int icov0) |
AMesh * | spde_mesh_load (Db *dbin, Db *dbout, const VectorDouble &gext, SPDE_Option &s_option, bool verbose) |
void | spde_external_mesh_define (int icov0, AMesh *mesh) |
void | spde_external_mesh_undefine (int icov0) |
MatrixSparse * | spde_external_A_define (int icov0, MatrixSparse *A) |
MatrixSparse * | spde_external_A_undefine (int icov0) |
MatrixSparse * | spde_external_Q_define (int icov0, MatrixSparse *Q) |
MatrixSparse * | spde_external_Q_undefine (int icov0) |
void | spde_mesh_assign (AMesh *amesh, int ndim, int ncorner, int nvertex, int nmesh, const VectorInt &arg_meshes, const VectorDouble &arg_points, int verbose) |
int | spde_prepar (Db *dbin, Db *dbout, const VectorDouble &gext, SPDE_Option &s_option) |
int | spde_posterior () |
static void | st_environ_print (const Db *dbout, const VectorDouble &gext) |
static bool | is_in_mesh_neigh (AMesh *amesh, double *coor, double *caux, int ndim, int imesh, double radius) |
static VectorDouble | st_get_coords_3D (AMesh *amesh, const double *zcur) |
void | spde_free_all (void) |
int | spde_check (const Db *dbin, const Db *dbout, Model *model1, Model *model2, bool verbose, const VectorDouble &gext, bool mesh_dbin, bool mesh_dbout, bool flag_advanced, bool flag_est, bool flag_std, bool flag_gibbs, bool flag_modif) |
int | kriging2D_spde (Db *dbin, Model *model, SPDE_Option &s_option, int verbose, int *nmesh_arg, int *nvertex_arg, VectorInt &meshes_arg, VectorDouble &points_arg) |
static void | st_product_Q (const VectorDouble &blin, MatrixSparse *S, const VectorDouble &Lambda, const VectorDouble &TildeC, const VectorDouble &x, VectorDouble &y) |
int | spde_eval (const VectorDouble &blin, MatrixSparse *S, const VectorDouble &Lambda, const VectorDouble &TildeC, double power, VectorDouble &x, VectorDouble &y) |
static int | st_m2d_check_pinchout (Db *dbgrid, int icol_pinch) |
static double | st_m2d_draw_elevation (M2D_Environ *m2denv, int, int, double lower, double upper) |
static void | st_print_concatenate_interval (const char *title, double lower, double upper, int tail) |
static void | st_print_constraints_per_point (int ilayer, int iech, double value, double drift, double vgaus, double lower, double upper) |
static int | st_check_validity_MS (Db *db, int ilayer, int iech, int flag_positive, int flag_verbose, double M, double S) |
static double | st_m2d_get_M (M2D_Environ *m2denv, Db *db, int type, int ilayer, int iech) |
static double | st_m2d_get_S (M2D_Environ *m2denv, Db *, int, int, int) |
static double | st_m2d_external_drift_increment (M2D_Environ *m2denv, Db *db, int ilayer0, int iech0) |
static double | st_m2d_get_drift (M2D_Environ *m2denv, Db *db, int ilayer0, int iech0) |
static void | st_m2d_set_M (M2D_Environ *m2denv, int nlayer, int icol_pinch, Db *db, int iatt) |
static int | st_m2d_migrate_pinch_to_point (Db *dbout, Db *dbc, int icol_pinch) |
static int | st_m2d_drift_inc_manage (M2D_Environ *m2denv, int mode, int nlayer, int icol_pinch, Db *dbc, Db *dbout) |
static void | st_m2d_stats_init (M2D_Environ *m2denv, Db *dbin, int nlayer, int verbose) |
static void | st_m2d_stats_updt (M2D_Environ *m2denv, Db *dbc, int nlayer, int verbose) |
static int | st_m2d_initial_elevations (M2D_Environ *m2denv, Db *dbc, int nlayer, VectorDouble &work) |
static int | st_m2d_drift_manage (M2D_Environ *m2denv, Db *dbin, Db *dbout, int nlayer, int verbose, int *iatt_f) |
static void | st_print_details (Db *dbc, int nech, int ilayer) |
static int | st_m2d_drift_fitting (M2D_Environ *m2denv, Db *dbc, int nlayer, int number_hard, int verbose) |
static void | st_m2d_drift_save (M2D_Environ *m2denv, Db *dbout, int nlayer, double *gwork) |
static int | st_active_sample (Db *db, int ndim, int nlayer, int iech, int bypass) |
static int | st_record_sample (M2D_Environ *m2denv, Db *db, int iech, int ndim, int natt, int nlayer, int bypass, int *number_arg, double *tab) |
static void | st_define_locators (M2D_Environ *m2denv, Db *db, int ndim, int nvar, int nlayer) |
static void | st_m2d_print_environ (const char *title, M2D_Environ *m2denv) |
static Db * | st_m2d_create_constraints (M2D_Environ *m2denv, Db *dbin, Db *dbout, int ndim, int nlayer, int *number_hard) |
static QChol * | st_derive_Qc (double s2, QChol *Qc, SPDE_Matelem &Matelem) |
MatrixSparse * | db_mesh_neigh (const Db *db, AMesh *amesh, double radius, int flag_exact, bool, int *nactive_arg, int **ranks_arg) |
static double | st_m2d_draw_gaussian (M2D_Environ *m2denv, Db *dbc, int verbose, int iter, int ilayer, int iech, double Zval, double Zcum, double Zmin, double Zmax, double Ymean, double Ysigma) |
static void | st_convert_Z2Y (M2D_Environ *m2denv, Db *dbc, int nlayer, int type, int iech, VectorDouble &tab) |
static void | st_convert_Y2Z (M2D_Environ *m2denv, Db *db, int nlayer, int type, int iech, VectorDouble &tab) |
static void | st_print_sample (const char *title, M2D_Environ *, Db *dbc, int nlayer, int iech, VectorDouble &work) |
static int | st_global_gibbs (M2D_Environ *m2denv, Db *dbc, int verbose, int iter, int nlayer, double sigma, VectorDouble &ymean, VectorDouble &ydat, VectorDouble &work) |
static int | st_check_gibbs_data (const char *title, M2D_Environ *m2denv, Db *dbc, int nlayer, int verbose, VectorDouble &ydat, VectorDouble &work) |
static M2D_Environ * | m2denv_manage (int mode, int flag_ed, double ystdv, M2D_Environ *m2denv_old) |
static void | st_m2d_vector_extract (M2D_Environ *m2denv, Db *dbc, int nlayer, VectorDouble &ydat, VectorDouble &work) |
static void | st_print_db_constraints (const char *title, Db *db, const VectorDouble &ydat, int nlayer, int verbose) |
static void | st_m2d_stats_gaus (const char *title, int nlayer, int nech, double *ydat) |
int | m2d_gibbs_spde (Db *dbin, Db *dbout, Model *model, int flag_ed, int nlayer, int niter, int seed, int nbsimu, int icol_pinch, int flag_drift, int flag_ce, int flag_cstd, int verbose) |
Variables | |
static int | DEBUG = 0 |
static int | VERBOSE = 0 |
static int | FLAG_KEYPAIR = 0 |
static double | FACDIM [] = { 0., 1., 2., 6. } |
static int | SPDE_CURRENT_IGRF = 0 |
static int | SPDE_CURRENT_ICOV = 0 |
static Db * | MEM_DBIN |
static Db * | MEM_DBOUT |
static AMesh * | S_EXTERNAL_MESH [3] = { NULL, NULL, NULL } |
static MatrixSparse * | S_EXTERNAL_Q [3] = { NULL, NULL, NULL } |
static MatrixSparse * | S_EXTERNAL_A [3] = { NULL, NULL, NULL } |
static SPDE_Environ | S_ENV |
static SPDE_Decision | S_DECIDE |
static char | NAME [100] |
static char | string_encode [100] |
static SPDE_Calcul | Calcul |
#define NBLIN_TERMS 10 |
#define SPDE_MAX_NGRF 2 |
MatrixSparse* _spde_build_Q | ( | MatrixSparse * | S, |
const VectorDouble & | Lambda, | ||
int | nblin, | ||
double * | blin | ||
) |
Duplicate a Cheb_Elem structure
[in] | cheb_in | Input Cheb_Eleme structure |
VectorDouble _spde_fill_Lambda | ( | Model * | model, |
AMesh * | amesh, | ||
const VectorDouble & | TildeC | ||
) |
Fill the vector for sill correction factors Works for both stationary and non-stationary cases
[in] | model | Model structure |
[in] | amesh | MeshEStandard structure |
[in] | TildeC | Vector TildeC |
MatrixSparse* _spde_fill_S | ( | AMesh * | amesh, |
Model * | model, | ||
const double * | units | ||
) |
VectorDouble _spde_fill_TildeC | ( | AMesh * | amesh, |
const double * | units | ||
) |
Fill the vector TildeC (Dimension: nvertex)
[in] | amesh | MeshEStandard structure |
[in] | units | Array containing the element units |
double* _spde_get_mesh_dimension | ( | AMesh * | amesh | ) |
Calculate the array of dimensions of the meshes
[in] | amesh | MeshEStandard structure |
MatrixSparse* db_mesh_neigh | ( | const Db * | db, |
AMesh * | amesh, | ||
double | radius, | ||
int | flag_exact, | ||
bool | , | ||
int * | nactive_arg, | ||
int ** | ranks_arg | ||
) |
Returns the projection matrix of a set of points (contained in a Db) onto a meshing
[in] | db | Db structure |
[in] | amesh | AMesh structure |
[in] | flag_exact | Type of test for intersection (See remarks) |
[in] | radius | Neighborhood radius |
[out] | nactive_arg | Number of active samples from the Db |
[out] | ranks_arg | Ranks of the active samples |
|
static |
True if a (dilated) point intersects a mesh
[in] | amesh | AMesh structure |
[in] | coor | Point coordinates (Dimension: ndim) |
[in] | caux | Working array (Dimension: ndim) |
[in] | ndim | Comon space dimension between coor and s_mesh |
[in] | imesh | Mesh Index |
[in] | radius | Dilation radius |
int kriging2D_spde | ( | Db * | dbin, |
Model * | model, | ||
SPDE_Option & | s_option, | ||
int | verbose, | ||
int * | nmesh_arg, | ||
int * | nvertex_arg, | ||
VectorInt & | meshes_arg, | ||
VectorDouble & | points_arg | ||
) |
Perform Kriging using SPDE on the set of constructed 2-D triangles
[in] | dbin | Db input structure |
[in] | model | Model structure |
[in] | s_option | SPDE_Option structure |
[in] | verbose | Verbose option |
[out] | nmesh_arg | Number of triangles generated |
[out] | nvertex_arg | Number of vertices |
[out] | meshes_arg | Array of triangulate vertex indices |
[out] | points_arg | Array containing the 2-D vertices |
int m2d_gibbs_spde | ( | Db * | dbin, |
Db * | dbout, | ||
Model * | model, | ||
int | flag_ed, | ||
int | nlayer, | ||
int | niter, | ||
int | seed, | ||
int | nbsimu, | ||
int | icol_pinch, | ||
int | flag_drift, | ||
int | flag_ce, | ||
int | flag_cstd, | ||
int | verbose | ||
) |
Perform Gibbs on a multilayer setup
[in] | dbin | Db input structure |
[in] | dbout | Db output structure |
[in] | model | Model structure |
[in] | flag_ed | 1 if External Drit is used |
[in] | nlayer | Number of layers |
[in] | niter | Number of iterations |
[in] | seed | Seed for random number generator |
[in] | nbsimu | Number of simulaations |
[in] | icol_pinch | Address of the variable containing the pinchout |
[in] | flag_drift | 1 to return the drift only 0 the simulations |
[in] | flag_ce | 1 if the conditional expectation should be returned instead of simulations |
[in] | flag_cstd | 1 if the conditional standard deviation should be returned instead of simulations |
[in] | verbose | Verbose option |
|
static |
Manage the M2D_Environ structure
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | flag_ed | 1 if external drift is used; 0 otherwise |
[in] | ystdv | Stamdard deviation of the Gaussian Transformed |
[in] | m2denv_old | Pointer to the already existing M2D_Environ (only used when mode==-1) |
void simu_define_func_scale | ( | void(*)(Db *, int, int) | st_simu_scale | ) |
Define the function to scale the Modification arrays
[in] | st_simu_scale | Pointer to the scaling function |
void simu_define_func_transf | ( | void(*)(Db *, int, int, int) | st_simu_transf | ) |
Define the function to transform a simulation
[in] | st_simu_transf | Pointer to the transformation function |
void simu_define_func_update | ( | void(*)(Db *, int, int, int) | st_simu_update | ) |
Define the function to account for the current simulation outcome in the calculation of the Modification arrays
[in] | st_simu_update | Pointer to the update function |
int spde_attach_model | ( | Model * | model | ) |
int spde_build_matrices | ( | Model * | model, |
int | verbose | ||
) |
Build all matrices needed for establishing the Q sparse matrix
[in] | model | Model structure |
[in] | verbose | Verbose option |
Cheb_Elem* spde_cheb_manage | ( | int | mode, |
int | verbose, | ||
double | power, | ||
const VectorDouble & | blin, | ||
MatrixSparse * | S, | ||
Cheb_Elem * | cheb_old | ||
) |
Manage Cheb_Elem structure
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | verbose | Verbose flag |
[in] | power | Parameter passed to Chebychev function |
[in] | blin | Array of coefficients for Linear combinaison |
[in] | S | Shift operator |
[in] | cheb_old | Cheb_Elem to be freed (only for mode=-1) |
int spde_chebychev_operate | ( | MatrixSparse * | S, |
Cheb_Elem * | cheb_elem, | ||
const VectorDouble & | lambda, | ||
const VectorDouble & | x, | ||
VectorDouble & | y | ||
) |
int spde_check | ( | const Db * | dbin, |
const Db * | dbout, | ||
Model * | model1, | ||
Model * | model2, | ||
bool | verbose, | ||
const VectorDouble & | gext, | ||
bool | mesh_dbin, | ||
bool | mesh_dbout, | ||
bool | flag_advanced, | ||
bool | flag_est, | ||
bool | flag_std, | ||
bool | flag_gibbs, | ||
bool | flag_modif | ||
) |
Define the main options
[in] | dbin | Pointer to the input Db |
[in] | dbout | Pointer to the output Db |
[in] | model1 | Model structure (first) |
[in] | model2 | Model structure (second) |
[in] | verbose | Verbose flag |
[in] | gext | Array of domain dilation |
[in] | mesh_dbin | True if Input points must participate to meshing |
[in] | mesh_dbout | True if Output points must participate to meshing |
[in] | flag_advanced | True for advanced calculus (estimation or simulation) False if only matrices are required |
[in] | flag_est | True for estimation |
[in] | flag_std | True for standard deviation |
[in] | flag_gibbs | True for Gibbs sampler |
[in] | flag_modif | True for post-processing simulations |
double spde_compute_correc | ( | int | ndim, |
double | param | ||
) |
int spde_eval | ( | const VectorDouble & | blin, |
MatrixSparse * | S, | ||
const VectorDouble & | Lambda, | ||
const VectorDouble & | TildeC, | ||
double | power, | ||
VectorDouble & | x, | ||
VectorDouble & | y | ||
) |
Perform the product of a vector by the inverse of the power of a sparse matrix using the Chebychev Polynomial procedure
MatrixSparse* spde_external_A_define | ( | int | icov0, |
MatrixSparse * | A | ||
) |
MatrixSparse* spde_external_A_undefine | ( | int | icov0 | ) |
int spde_external_copy | ( | SPDE_Matelem & | matelem, |
int | icov0 | ||
) |
Copy the contents of the internal S_EXTERNAL_AQ into an output Matelem
Error return code
[in] | matelem | Output SPDE_Matelem structure |
[in] | icov0 | Rank of the current Covariance |
void spde_external_mesh_define | ( | int | icov0, |
AMesh * | mesh | ||
) |
void spde_external_mesh_undefine | ( | int | icov0 | ) |
MatrixSparse* spde_external_Q_define | ( | int | icov0, |
MatrixSparse * | Q | ||
) |
MatrixSparse* spde_external_Q_undefine | ( | int | icov0 | ) |
void spde_free_all | ( | void | ) |
Free all memory used in SPDE
SPDE_Matelem& spde_get_current_matelem | ( | int | icov | ) |
Get the pointer to the current SPDE_Matelem structure
[in] | icov | Rank of the target Covariance (or -1)typedef struct |
void spde_mesh_assign | ( | AMesh * | amesh, |
int | ndim, | ||
int | ncorner, | ||
int | nvertex, | ||
int | nmesh, | ||
const VectorInt & | arg_meshes, | ||
const VectorDouble & | arg_points, | ||
int | verbose | ||
) |
Assign fields of the AMesh structure which would have been calculated elsewhere
AMesh* spde_mesh_load | ( | Db * | dbin, |
Db * | dbout, | ||
const VectorDouble & | gext, | ||
SPDE_Option & | s_option, | ||
bool | verbose | ||
) |
SPDE_Option spde_option_alloc | ( | void | ) |
Manage the SPDE_Option structure
void spde_option_update | ( | SPDE_Option & | s_option, |
const String & | triswitch | ||
) |
Add a new option item for an additional covariance structure
[in] | s_option | Pointer to SPDE_Option to be freed (if mode<0) |
[in] | triswitch | String defining the meshing characteristics |
int spde_posterior | ( | ) |
Cleaning operation after SPDE
int spde_prepar | ( | Db * | dbin, |
Db * | dbout, | ||
const VectorDouble & | gext, | ||
SPDE_Option & | s_option | ||
) |
Preparation using SPDE (for all GRF and COV)
[in] | dbin | Db structure for the conditioning data |
[in] | dbout | Db structure of the grid |
[in] | gext | Array of domain dilation |
[in] | s_option | SPDE_Option structure |
int spde_process | ( | Db * | dbin, |
Db * | dbout, | ||
SPDE_Option & | s_option, | ||
int | nbsimu, | ||
int | ngibbs_nburn, | ||
int | ngibbs_niter, | ||
int | ngibbs_int | ||
) |
Perform the main Simulations steps after Q has been constructed
[in] | dbin | Input Db grid structure (optional) |
[in] | dbout | Output Db grid structure |
[in] | s_option | SPDE_Option structure |
[in] | nbsimu | Number of simulations |
[in] | ngibbs_nburn | Number of iterations (Burning step) |
[in] | ngibbs_niter | Number of iterations |
[in] | ngibbs_int | Number of iterations internal to Gibbs (SPDE) |
|
static |
Check if a sample must be considered as an active constraint
[in] | db | Db input structure |
[in] | ndim | Space dimension |
[in] | nlayer | Number of layers |
[in] | iech | Rank of the sample |
[in] | bypass | 1 to bypass check that at least one bound is defined |
|
static |
Construct the final sparse matrix Q from the Model
[in] | Matelem | SPDE_Matelem structure |
|
static |
Construct the sparse matrix QCov (used in multistructure - multivariable)
[in] | Matelem | SPDE_Matelem structure |
|
static |
Initialize the contents of SPDE_Calcul structure
|
static |
Update the contents of SPDE_Calcul structure
|
static |
Update parameters in S_ENV structure in non-stationary case
[in] | amesh | MeshEStandard structure |
[in] | imesh0 | Rank of the current mesh |
|
static |
|
static |
|
static |
Check that the Gibbs constraints are fullfilled at datum locations
|
static |
Check the validity of the Mean and Variance values
[in] | db | Db structure containing the constraints |
[in] | ilayer | Rank of the layer of interest |
[in] | iech | Rank of the sample of interest |
[in] | flag_positive | Positivity check |
[in] | flag_verbose | Verbose output |
[in] | M | Value for the Mean |
[in] | S | Value for the Variance |
|
static |
Clean the Bhetero sparse matrices
|
static |
Clean the Bnugget sparse matrices
|
static |
Compute the coefficients of the linear combination
|
static |
Compute the variance correction term Store in the SPDE_Calcul structure
|
static |
Compute H matrix for anisotropic case and the square root of determinant Requires the knowledge of the actual parameters of the current Covariance Fills the SPDE_Calcul structure
|
static |
Modify the Exponential into a Matern
[in] | cova | Covariance sructure |
|
static |
Convert a layer-pile at a datum from the true to the working domain
|
static |
Convert a layer-pile at a datum from the working to the true domain
|
static |
Copy an auxiliary array into an permanent array
[in] | ncur | Number of elements per variable |
[in] | z | Array of values to be merged |
[out] | zperm | Permanent array |
|
static |
Load the meshes
[in] | dbin | Db structure for the conditioning data |
[in] | dbout | Db structure of the grid |
[in] | gext | Array of domain dilation |
[in] | s_option | SPDE_Option structure |
|
static |
|
static |
Calculate the inverse of (s2 * Q + B %*% Bt) and store it into a new QChol object
[in] | s2 | Nugget effect value |
[in] | Qc | Qc structure (already existing) |
[in] | Matelem | Matelem structure |
|
static |
Initialize the S_ENV Environment structure
|
static |
|
static |
Extract the sparse matrix from the Q matrix (coninuous structure)
[in] | row_var | Rank of the variable for the row |
[in] | col_var | Rank of the variable for the column |
[in] | row_oper | Operator type for row (1:Data or 2:Target) |
[in] | col_oper | Operator type for column (1:Data or 2:Target) |
[out] | nrows | Number of rows |
[out] | ncols | Number of columns |
|
static |
Extract the sparse matrix from the Q matrix (case of nugget effect)
[in] | row_var | Rank of the variable for the row |
[in] | col_var | Rank of the variable for the column |
[out] | nrows | Number of rows |
[out] | ncols | Number of columns |
|
static |
Construct the sparse matrix Q from another sparse matrix
[in] | Q_in | Input sparse matrix |
[in] | row_auth | Specification for rows extraction |
[in] | col_auth | Specification for columns extraction |
|
static |
Fill the Bnugget sparse matrix linked to nugget effect
[in] | dbin | Db structure |
|
static |
|
static |
Fill the Isill matrix linked to the covariance of the Model
|
static |
Perform the Filtering of Nugget Effect
[out] | work | Working array (Dimension: nvertex) |
[in] | y | Output Array (Dimension: nvertex) |
|
static |
|
static |
Returns the pointer to the structure
|
static |
Return the param of the model
|
static |
Get the normalized range
|
static |
Return the sill of the model (or TEST)
[in] | ivar | Rank of the first variable |
[in] | jvar | Rank of the second variable |
|
static |
|
static |
Return the dimension for array allocation This dimension is the aximum of the maximum number of vertices and the number of data
|
static |
Return if a nugget effect component must be filtered
|
static |
Get the value of the Inverse of the sill for a given covariance and a pair of variables
|
static |
Return the global non-stationary characteristics
|
static |
Return the mean of the model
[in] | ivar | Rank of the target variable (for its mean) |
|
static |
Returns the number of structures in the Model (nugget excluded)
|
static |
Return the maximum number of covariances in the different Models for all GRFS (nugget included)
|
static |
Returns the pointer to structure containing the Nugget Effect (or NULL)
|
static |
Return the sill of the Nugget Effect (or TEST)
[in] | ivar | Rank of the first variable |
[in] | jvar | Rank of the second variable |
|
static |
Returns the number of GRFs of the environment
|
static |
Return the number of vertices for the current Matelem
[in] | icov | Rank of the target Covariance (or -1) |
|
static |
Return the maximum number of vertices for all meshes for all GRFs
|
static |
Return the number of variables of the environment
|
static |
Returns the index of a pair of variable ranks within the triangle
[in] | ivar | Rank of the first variable |
[in] | jvar | Rank of the second variable |
|
static |
Return the total sill of the model
[in] | ivar | Rank of the first variable |
[in] | jvar | Rank of the second variable |
Return the list of (target+data) indices for a given mesh
[in] | amesh | AMesh structure |
[in] | dbin | Db structure for input (optional) |
[in] | dbout | Db structure for the output |
|
static |
Perform one iteration of the Gibbs sampler
[in] | igrf | Rank of the GRF |
[in] | nout | Number of samples on which Gibbs should be run |
[in] | ngibbs_int | Number of internal Gibbs iterations |
[in] | iter0 | Gibbs iteration rank (starting from 0) |
[in] | ngibbs_burn | Number of iterations (Burning step) |
[in] | dbin | Input Db |
[in] | dbout | Output Db |
[out] | zcur | Vector of simulation (VT_FREE|VT_GIBBS|VT_HARD) |
|
static |
Perform the Gibbs iterations
[in] | m2denv | M2D_Environ structure |
[in] | dbc | Db structure containing the constraints |
[in] | verbose | Verbose flag |
[in] | iter | Rank of the iteration |
[in] | nlayer | Number of layers |
[in] | sigma | Standard deviation of the nugget value |
[in] | ymean | Array of mean values at constraints |
[in,out] | ydat | Array of values at constraints samples |
[out] | work | Array of tentative values (Dimension: nlayer) |
|
static |
Identify a parameter among the non-stationary ones
[in] | type0 | Type of parameter (EConsElem) |
[in] | icov0 | Rank of the target covariance |
[in] | ivar0 | Rank of the target variable (only when type=EConsElem::SILL) |
[in] | jvar0 | Rank of the target variable (only when type=EConsElem::SILL) |
|
static |
Initialize an array with a constant mean value
[in] | ncova | Number of structures |
[in] | nvar | Number of variables |
[in] | ncur | Number of terms in arrays 'perm' and 'aux' |
[in] | flag_var | 1 : to initialize a variable; 0 : to initialize variance |
[out] | zperm | Output array |
|
static |
Check if External Q has been defined
[in] | icov0 | Rank of the (non-nugget) covariance |
|
static |
Checks if there is a nugget component in the Model
|
static |
Use the keypair mechanism to output some arrays
[in] | name | Name of the output |
[in] | iter | Concatenated in name if >= 0; ignored otherwise |
[in] | tab | Tab to be output |
|
static |
|
static |
Perform the Calculation of the Kriging estimate
[in] | QC | Pointer to QChol structure |
[in] | rhs | R.H.S. array (Dimension: ntarget) |
[out] | work | Working array (Dimension: ntarget) |
[out] | z | Output array (Dimension: ntarget) |
|
static |
Perform the Calculation of the Kriging estimate (Multigrid case)
[in] | QC | Pointer to QChol structure (target-target)(finalized) |
[in] | rhs | R.H.S. array (Dimension: ntarget) |
[out] | work | Working array (Dimension: ntarget) |
[out] | z | Output array (Dimension: ntarget) |
|
static |
Perform the Kriging operation (monovariate - monostructure)
[in] | data | Vector of data |
[out] | rhs | R.H.S. |
[out] | work | Working array |
[out] | z | Output Array |
|
static |
Prepare the RHS for Kriging
[in] | QCtd | Pointer to QChol structure (target-data) |
[in] | data | Input array (Dimension: ndata) |
[in] | ntarget | Number of target values |
[out] | rhs | Output array (Dimension: ntarget) |
|
static |
Perform the Kriging operation (multivariate and/or multistructure)
[in] | data | Vector of data |
[out] | rhs | R.H.S. |
[out] | work | Working array |
[out] | z | Output Array |
|
static |
Perform the Loop for the Kriging operation (several)
[in] | flag_crit | 1 if used for criterion evaluation; 0 when used for calculation loop |
[out] | work | Working array |
[out] | rhscur | Working array |
[out] | rhsloc | Working array |
[in,out] | xcur | Current solution vector |
[in,out] | rhs | R.H.S. |
[in,out] | crit | Criterion |
|
static |
Perform the final reconstitution for multivariate or multistructure Kriging
[in] | xcur | Solution vector (Dimension: ncur * ncova * nvar) |
[out] | z | Output Array |
|
static |
Prepare the R.H.S. for the Kriging operation (several)
[in] | data | Vector of data |
[out] | rhs | R.H.S. |
[out] | work | Working array |
[out] | ss_arg | Global returned criterion |
|
static |
Load an auxiliary array into a permanent array: perm <- aux
[in] | number | : Number of terms in arrays 'perm' and 'aux' |
[in] | aux | : Auxiliary array |
[in,out] | perm | : Input/Output array |
|
static |
Load the data information within the complete output array
[in] | amesh | AMesh structure |
[in] | dbin | Db input structure |
[in] | dbout | Db output structure |
[in] | ivar0 | Rank of the variable or -1 |
[out] | data | Vector of active data |
[out] | zcur | Output array (Dimension: number of meshes) |
|
static |
Check the pinchout variable
[in] | dbgrid | Grid structure |
[in] | icol_pinch | Pointer to the pinchout variabe |
|
static |
Create a Db containing all the constraining information
[in] | m2denv | M2D_Environ structure |
[in] | dbin | Db input structure |
[in] | dbout | Db output structure |
[in] | ndim | Space dimension |
[in] | nlayer | Number of layers |
[out] | number_hard | Number of hard data which will serve for seting the optimal drift |
|
static |
Get the elevation within bounds
[in] | m2denv | M2D_Environ structure |
[in] | lower | Lower bound |
[in] | upper | Upper bound |
|
static |
Draw a Z-value within bounds
[in] | m2denv | M2D_Environ structure |
[in] | dbc | Db structure |
[in] | verbose | Verbose flag |
[in] | iter | Rank of the iteration |
[in] | ilayer | Rank of the layer |
[in] | iech | Rank of the sample |
[in] | Zval | Input value |
[in] | Zcum | Cumulated Z value of layers above |
[in] | Zmin | Lower bound in Z |
[in] | Zmax | Upper bound in Z |
[in] | Ymean | Mean of the Y Law |
[in] | Ysigma | Standard deviation of the Y Law |
|
static |
Fit the coefficients of the trend terms for each layer
[in] | m2denv | M2D_Environ structure |
[in] | dbc | Db structure for constraints |
[in] | nlayer | Number of layers |
[in] | number_hard | Number of hard data used to fit the drift |
[in] | verbose | Verbose flag |
|
static |
Calculate and store drift value per point in constraints and output Db Check the validity of the drift at points
|
static |
Fit the coefficients of the trend terms for each layer
[in] | m2denv | M2D_Environ structure |
[in] | dbin | Db input structure |
[in] | dbout | Db output structure |
[in] | nlayer | Number of layers |
[in] | verbose | Verbose flag |
[out] | iatt_f | Pointer in dbin to the added variables ELoc::F |
|
static |
Save the drift at the grid nodes
[in] | m2denv | M2D_Environ structure |
[in] | dbout | Db otput structure |
[in] | nlayer | Number of layers |
[out] | gwork | Working array |
|
static |
At a point, returns the external drift increment from previous layer
[in] | m2denv | M2D_Environ structure |
[in] | db | Db structure containing the constraints |
[in] | ilayer0 | Rank of the layer of interest |
[in] | iech0 | Rank of the sample of interest |
|
static |
Returns the value of the drift contribution at a sample This value is a weighted combinaison of constant and external drift term
[in] | m2denv | M2D_Environ structure |
[in] | db | Db structure containing the constraints |
[in] | ilayer0 | Rank of the layer of interest |
[in] | iech0 | Rank of the sample of interest |
|
static |
Returns the value of the drift increment at a sample (mean)
|
static |
Returns the value of the gaussian standard deviation
[in] | m2denv | M2D_Environ structure |
|
static |
Set the initial elevations at the constraining information
[in] | m2denv | M2D_Environ structure |
[in] | dbc | Db structure for constraints |
[in] | nlayer | Number of layers |
[out] | work | Array of tentative values (Dimension: nlayer) |
|
static |
Print the Environnement
|
static |
|
static |
Print the statistics on the current array
[in] | title | Title attache to the printou |
[in] | nlayer | Number of layers |
[in] | nech | Number of samples per layer in the target array |
[in] | ydat | Target (generic) array |
|
static |
Calculate global statistics on elevations
[in] | m2denv | M2D_Environ structure |
[in] | dbin | Db input structure |
[in] | nlayer | Number of layers |
[in] | verbose | Verbose flag |
|
static |
Update global statistics on the raw information
[in] | m2denv | M2D_Environ structure |
[in] | dbc | Db structure for constraints |
[in] | nlayer | Number of layers |
[in] | verbose | Verbose flag |
|
static |
|
static |
Initialize one SP_Mat structure
[in] | mode | Type of the action 1 for allocation; 0 for partial deallocation (of current Matelem) -1 for deallocation |
|
static |
Print the contents of one SP_Mat structure
[in] | icov | Rank of the covariance |
|
static |
Merge an auxiliary array into an permanent array
[in] | ncur | Number of elements per variable |
[in] | z | Array of values to be merged |
[out] | zperm | Fill permanent array |
Manage the Multigrid solving operations
[in] | mode | 1 for allocation; -1 for deallocation |
[in] | mgs | cs_MGS to be freed (only for mode=-1) |
|
static |
Print the Matelem characteristics (for given GRF and COV)
[in] | title | Title to be printed |
|
static |
Print (concatenate) the printout of an interval
[in] | title | Optional title |
[in] | lower | Lower bound or FFFF |
[in] | upper | Upper bound or FFFF |
[in] | tail | 0: blank character; 1: "\n" character |
|
static |
Print the constraints information for a single point
[in] | ilayer | Rank of the layer |
[in] | iech | Rank of the sample |
[in] | value | Current value |
[in] | drift | Drift value (or TEST) |
[in] | vgaus | Current Gaussian value (or TEST) |
[in] | lower | Lower bound or FFFF |
[in] | upper | Upper bound or FFFF |
|
static |
Print the set of constraints
[in] | title | Title |
[in] | db | Db constraints structure |
[in] | ydat | Array of gaussian values at constraints (optional) |
[in] | nlayer | Number of layers |
[in] | verbose | Verbose flag |
|
static |
Print the details of the constraints
[in] | dbc | Db structure for constraints |
[in] | nech | Number of hard data |
[in] | ilayer | Rank of the target layer |
|
static |
|
static |
Encode the status of the variable
[in] | auth | Status option |
|
static |
Perform the product of x by Q using the blin decomposition
[in] | blin | Array of coefficients for Linear combinaison |
[in] | S | Shift operator |
[in] | Lambda | Vector Lambda |
[in] | TildeC | Vector TildeC |
[in] | x | Input array |
[out] | y | Output array |
|
static |
Project a point on the tangent plane
[in] | center | Coordinates of the reference point (Dimension: 3) |
[in] | axes | Coordinates of the endpoints (Dimension: 2 * 3) |
[in] | xyz | Coordinates of the target point (Dimension: 3) |
[out] | coeff | Coordinate of point in the local system (Dimension: 2) |
|
static |
Print information on the Filter
[in] | title | Optional title |
[in] | auth | Filter option |
|
static |
Print information on the Sparse matrix and its cholesky decomposition
[in] | title | Optional title |
[in] | QC | Pointer to the QChol structure |
|
static |
Record a new active point
|
static |
|
static |
Defines if a nugget effect component must be filtered
[in] | flag_filnug | Flag to define if a nugget effect must be filtered |
|
static |
Set the pointer to the model of the environment
[in] | model | Pointer to the Model structure |
|
static |
|
static |
Return the simulated value under constraints
[in] | db | Db structure |
[in] | igrf | Rank of the GRF |
[in] | iech | Rank of the sample |
[in] | iter | Gibbs iteration rank (starting from 0) |
[in] | ngibbs_burn | Number of iterations (Burning step) |
[in] | yk | Kriged value |
[in] | sk | Standard deviation of the kriged error |
|
static |
|
static |
Perform the Simulations
[in] | QC | Pointer to the QChol structure (finalized) |
[out] | zsnc | Output simulation array (Dimension: nvertex * nvar) |
|
static |
Perform the basic non-conditional Simulation using the Chebychev Polynomial procedure
[out] | zsnc | Output array (Dimension: nvertex) |
|
static |
Perform the basic non-conditional Simulation using the Cholesky decomposition method
[in] | QC | Pointer to the QChol structure (finalized) |
[out] | work | Working array (Dimension: nvertex) |
[out] | zsnc | Output array (Dimension: nvertex) |
|
static |
Simulate the nugget effect component
[in] | ncur | Number of target to be simulated |
[out] | zsnc | Output array (Dimension: nvertex) |
|
static |
Solve the linear system (either using Cholesky or Multigrid)
[in] | QC | Qchol structure |
[in] | rhs | R.H.S. |
[out] | work | Working array (Dimension: ntarget) |
[out] | z | Output Array (Dimension: ntarget) |
|
static |
Get the coordinates of the axis endpoints in the tangent plane
[in] | center | Coordinates of the reference point (Dimension: 3) |
[in] | srot | Rotation angles on sphere (Dimension: 2) |
[out] | axes | Coordinates of the endpoints (Dimension: 2 * 3) |
|
static |
Update a string to include the rank of the current GRF and Covariance
[in] | flag_igrf | To add current GRF |
[in] | flag_icov | To add current COV |
[in] | rank | Rank of the highlight (see mestitle or -1) |
[in] | title | Input title |
|
static |
Get the 3-D coordinates of the center of a triangle on the sphere
[in] | amesh | MeshEStandard structure |
[in] | ncorner | Number of vertices per element |
[in] | imesh | Rank of the current mesh |
[out] | center | Coordinates of the center point (Dimension: 3) |
[out] | xyz | Coordinate of the point (Dimension: 3x3) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |