|
gstlearn
1.0.0
CCC
|
#include <CalcSimuTurningBands.hpp>
Public Member Functions | |
| CalcSimuTurningBands (int nbsimu=0, int nbtuba=0, bool flag_check=false, int seed=4324324) | |
| CalcSimuTurningBands (const CalcSimuTurningBands &r)=delete | |
| CalcSimuTurningBands & | operator= (const CalcSimuTurningBands &r)=delete |
| virtual | ~CalcSimuTurningBands () |
| int | getNBtuba () const |
| void | setNBtuba (int nbtuba) |
| int | getNDirs () const |
| int | simulate (Db *dbin, Db *dbout, Model *model, ANeigh *neigh, int icase, int flag_bayes=false, const VectorDouble &dmean=VectorDouble(), const VectorDouble &dcov=VectorDouble(), bool flag_pgs=false, bool flag_gibbs=false, bool flag_dgm=false) |
| int | simulatePotential (Db *dbiso, Db *dbgrd, Db *dbtgt, Db *dbout, Model *model, double delta) |
| const VectorDouble & | getBayesCov () const |
| void | setBayesCov (const VectorDouble &dcov) |
| const VectorDouble & | getBayesMean () const |
| void | setBayesMean (const VectorDouble &dmean) |
| bool | isFlagCheck () const |
| void | setFlagCheck (bool flag_check) |
| bool | isFlagBayes () const |
| void | setFlagBayes (bool flag_bayes) |
| void | setFlagDgm (bool flag_dgm) |
| bool | isFlagGibbs () const |
| void | setFlagGibbs (bool flag_gibbs) |
| bool | isFlagPgs () const |
| void | setFlagPgs (bool flag_pgs) |
| int | getIcase () const |
| void | setIcase (int icase) |
| int | getNbtuba () const |
| void | setNbtuba (int nbtuba) |
Public Member Functions inherited from ACalcSimulation | |
| ACalcSimulation (int nbimu, int seed=4324324) | |
| ACalcSimulation (const ACalcSimulation &r)=delete | |
| ACalcSimulation & | operator= (const ACalcSimulation &r)=delete |
| virtual | ~ACalcSimulation () |
| int | getSeed () const |
| int | getNbSimu () const |
| void | setSeed (int seed) |
| void | setNbSimu (int nbsimu) |
Public Member Functions inherited from ACalcInterpolator | |
| ACalcInterpolator () | |
| ACalcInterpolator (const ACalcInterpolator &r)=delete | |
| ACalcInterpolator & | operator= (const ACalcInterpolator &r)=delete |
| virtual | ~ACalcInterpolator () |
| void | setModel (Model *model) |
| void | setNeigh (ANeigh *neigh) |
| Model * | getModel () const |
| ANeigh * | getNeigh () const |
| bool | hasModel (bool verbose=true) const |
| bool | hasNeigh (bool verbose=true) const |
Public Member Functions inherited from ACalcDbToDb | |
| ACalcDbToDb (bool mustShareSameSpaceDimension=true) | |
| ACalcDbToDb (const ACalcDbToDb &r)=delete | |
| ACalcDbToDb & | operator= (const ACalcDbToDb &r)=delete |
| virtual | ~ACalcDbToDb () |
| void | setDbin (Db *dbin) |
| void | setDbout (Db *dbout) |
| void | setNamingConvention (const NamingConvention &namconv) |
| void | setMustShareSpaceDimension (bool mustShareSpaceDimension) |
| Db * | getDbin () const |
| Db * | getDbout () const |
| DbGrid * | getGridin () const |
| DbGrid * | getGridout () const |
| bool | hasDbin (bool verbose=true) const |
| bool | hasDbout (bool verbose=true) const |
| bool | isGridIn (bool verbose=true) const |
| bool | isGridOut (bool verbose=true) const |
Public Member Functions inherited from ACalculator | |
| ACalculator () | |
| ACalculator (const ACalculator &r)=delete | |
| ACalculator & | operator= (const ACalculator &r)=delete |
| virtual | ~ACalculator () |
| bool | run () |
Static Public Member Functions | |
| static bool | isTurningBandsWorkable (const Model *model) |
Private Member Functions | |
| virtual bool | _check () override |
| virtual bool | _preprocess () override |
| virtual bool | _run () override |
| virtual bool | _postprocess () override |
| virtual void | _rollback () override |
| bool | _resize () |
| void | _simulatePoint (Db *db, const VectorDouble &aic, int icase, int shift) |
| void | _simulateGrid (DbGrid *db, const VectorDouble &aic, int icase, int shift) |
| void | _simulateNugget (Db *db, const VectorDouble &aic, int icase) |
| void | _simulateGradient (Db *dbgrd, const VectorDouble &aic, double delta) |
| void | _simulateTangent (Db *dbtgt, const VectorDouble &aic, double delta) |
| void | _meanCorrect (Db *dbout, int icase) |
| void | _difference (Db *dbin, Model *model, int icase, bool flag_pgs=false, bool flag_gibbs=false, bool flag_dgm=false) |
| void | _updateData2ToTarget (Db *dbin, Db *dbout, int icase, bool flag_pgs=false, bool flag_dgm=false) |
| void | _checkGaussianData2Grid (Db *dbin, Db *dbout, Model *model) const |
| void | _setCodirAng (int ibs, int idir, double value) |
| void | _setCodirTmin (int ibs, double value) |
| void | _setCodirTmax (int ibs, double value) |
| void | _setCodirScale (int ibs, double value) |
| void | _setCodirT00 (int ibs, double value) |
| void | _setCodirDXP (int ibs, double value) |
| void | _setCodirDYP (int ibs, double value) |
| void | _setCodirDZP (int ibs, double value) |
| VectorDouble | _getCodirAng (int ibs) const |
| double | _getCodirAng (int ibs, int idir) const |
| double | _getCodirScale (int ibs) |
| double | _getCodirT00 (int ibs) const |
| double | _getCodirDXP (int ibs) const |
| double | _getCodirDYP (int ibs) const |
| double | _getCodirDZP (int ibs) const |
| double | _getCodirTmin (int ibs) const |
| double | _getCodirTmax (int ibs) const |
| int | _getAddressBand (int ivar, int is, int ib, int isimu) |
| void | _setSeedBand (int ivar, int is, int ib, int isimu, int seed) |
| int | _getSeedBand (int ivar, int is, int ib, int isimu) |
| void | _rotateDirections (double a[3], double theta) |
| int | _generateDirections (const Db *dbout) |
| void | _minmax (const Db *db) |
| void | _setDensity () |
| ECov | _particularCase (const ECov &type, double param) |
| int | _initializeSeedBands () |
| VectorDouble | _createAIC () |
| double | _getAIC (const VectorDouble &aic, int icov, int ivar, int jvar) |
| double | _computeScale (double alpha, double scale) |
| VectorDouble | _migration (double tmin, double tmax, double scale, double eps=EPSILON5) |
| VectorDouble | _dilution (double tmin, double tmax, double mesh, double *start) |
| void | _spectral (const ECov &type, double scale, double param, double *omega, double *phi) |
| double | _computeScaleKB (double param, double scale) |
| void | _power1D (int ib, double scale, double alpha, double *omega, double *phi, double *theta_3, double *correc0) |
| void | _spline1D (int ib, double scale, int k, double *omega, double *phi, double *xi_3, double *correc0) |
| void | _irfProcess (const ECov &type, const VectorDouble &t, VectorDouble &v0, VectorDouble &v1, VectorDouble &v2) |
| int | _rankInPoisson (int def_rank, double t0, const VectorDouble &t) |
| int | _rankRegular (double t0, double tdeb, double scale) |
| double | _irfCorrec (const ECov &type, double theta1, double scale) |
| double | _irfProcessSample (const ECov &type, int nt0, double t0, const VectorDouble &t, const VectorDouble &v0, const VectorDouble &v1, const VectorDouble &v2) |
| void | _getOmegaPhi (int ibs, double omega, double phi, double *cxp, double *sxp, double *cyp, double *syp, double *czp, double *szp, double *c0z, double *s0z) |
Private Attributes | |
| int | _nbtuba |
| int | _iattOut |
| int | _icase |
| bool | _flagCheck |
| bool | _flagBayes |
| bool | _flagPGS |
| bool | _flagGibbs |
| bool | _flagDGM |
| VectorString | _nameCoord |
| VectorDouble | _bayesMean |
| VectorDouble | _bayesCov |
| int | _npointSimulated |
| double | _field |
| double | _theta |
| VectorInt | _seedBands |
| std::vector< TurningDirection > | _codirs |
Additional Inherited Members | |
Protected Member Functions inherited from ACalcInterpolator | |
| virtual int | _getNDim () const override |
| virtual int | _getNVar () const override |
| virtual int | _getNCova () const |
| int | _centerDataToGrid (DbGrid *dbgrid) |
Protected Member Functions inherited from ACalcDbToDb | |
| int | _addVariableDb (int whichDb, int status, const ELoc &locatorType, int locatorIndex=0, int number=1, double valinit=0.) |
| void | _renameVariable (int whichDb, const VectorString &names, const ELoc &locatorType, int nvar, int iptr, const String &name, int count, bool flagSetLocator=true, int shift=0) |
| void | _storeInVariableList (int whichDb, int status, const VectorInt &iuids) |
| int | _expandInformation (int mode, const ELoc &locatorType) |
| void | _cleanVariableDb (int status) |
| Db * | _whichDb (int whichDb) |
| String | _identifyVariable (int iuid) const |
| CalcSimuTurningBands::CalcSimuTurningBands | ( | int | nbsimu = 0, |
| int | nbtuba = 0, |
||
| bool | flag_check = false, |
||
| int | seed = 4324324 |
||
| ) |
|
delete |
|
virtual |
|
overrideprivatevirtual |
Reimplemented from ACalcSimulation.
|
private |
Calculate the scale for 1D process for the stable model
| [in] | alpha | Third parameter of the stable covariance model |
| [in] | scale | Scale parameter of the model |
|
private |
Calculate the scale for 1D process for the K-Bessel model (param<0.5)
| [in] | param | Third parameter of the K-Bessel covariance model |
| [in] | scale | Scale parameter of the model |
|
private |
Calculate the linear model of coregionalization starting from the coregionalization matrix
|
private |
Generate a dilution process
| [in] | tmin | minimum value |
| [in] | tmax | maximum value |
| [in] | mesh | mesh of the random walk |
| [out] | start | initial time |
|
private |
Generate directions according to Van Der Corput algorithm. The count of directions returned is the product of nbtuba by the number of basic structures
| [in] | dbout | Db structure |
|
private |
|
private |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
|
private |
Initialize the array of seeds for the generation of a simulation using the Turning Bands method
|
private |
Calculate the correction factor for IRF_k models
| [in] | type | type of polynomial generalized covariance |
| [in] | theta1 | Equal to inverse of theta value |
| [in] | scale | Range of the model |
|
private |
Generates the process constituted by independent gaussian variables along a 1D Poisson process. The process consists in the integration(s) of the previous process Perform the core allocation
| [in] | type | degree of the IRF -> number of integrations |
| [in] | t | Vector of Poisson delimitors |
| [out] | v0 | Wiener-Levy process |
| [out] | v1 | First integration of the Wiener-Levy process |
| [out] | v2 | Second integration of the Wiener-Levy process |
|
private |
Sample the Wiener-Levy (integrated) process
| [in] | type | type of polynomial generalized covariance |
| [in] | nt0 | Rank of the Poisson point |
| [in] | t0 | starting time |
| [in] | t | Poisson point process |
| [in] | v0 | Wiener-Levy process |
| [in] | v1 | First integration of the Wiener-Levy process |
| [in] | v2 | Second integration of the Wiener-Levy process |
|
private |
Correct for the mean in the case of non-conditional simulations
| [in] | dbout | Output Db structure |
| [in] | icase | Rank of PGS or GRF |
|
private |
Generate a migration process
| [in] | tmin | minimum value |
| [in] | tmax | maximum value |
| [in] | scale | scale of the exponential |
| [in] | eps | Epsilon value |
|
private |
Calculates the data extension for a set of turning bands
| [in] | db | Db structure |
|
private |
Particular case of the stable model. It must be turned into:
Particular case of the K-Bessel model. It must be turned into:
|
overrideprivatevirtual |
Reimplemented from ACalculator.
|
private |
Generate the 1D stochastic process
| [in] | ib | Rank of the turning band |
| [in] | scale | scale factor |
| [in] | alpha | power of the variogram h^alpha |
| [out] | omega | period = 2piR where R is a second kind beta variable with parameters 1-alpha/2 and alpha/2 |
| [out] | phi | uniform phase lying within [0,2 PI] |
| [out] | theta_3 | value of theta_alpha,3(R) |
| [out] | correc0 | value to substract from Y_alpha,2 in order to avoid numerical problems when R is very small |
|
overrideprivatevirtual |
Reimplemented from ACalcSimulation.
|
private |
Returns the rank of the point t0 in the Poisson point process
| [in] | def_rank | Rank of the Poisson point |
| [in] | t0 | starting time |
| [in] | t | Poisson point process |
|
private |
Returns the rank of the point t0 in a regular pavement
| [in] | t0 | starting time |
| [in] | tdeb | origin on the line |
| [in] | scale | scaling factor |
|
private |
|
overrideprivatevirtual |
Reimplemented from ACalculator.
|
private |
|
overrideprivatevirtual |
Implements ACalculator.
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
private |
Calculate the Poisson intensity for the generation of the Wiener-Levy along the line
|
private |
|
private |
Perform non-conditional simulations on a set of gradient points using Turning Bands method.
|
private |
|
private |
|
private |
|
private |
Perform non-conditional simulations on a set of tangent points using Turning Bands method.
|
private |
Prepare a spectral method
| [in] | type | type of method for generating the period |
| [in] | scale | scale factor |
| [in] | param | factor for the period |
| [out] | omega | resulting period |
| [out] | phi | uniform phase lying within [0,2 PI] |
|
private |
Generate the 1D stochastic process for spline covariance
| [in] | ib | Rank of the turning band |
| [in] | scale | scale factor |
| [in] | k | power of the variogram h^(2k)log(h) |
| [out] | omega | period = 2piR where R is a second kind beta variable with parameters 1/2 and 1/2 |
| [out] | phi | uniform phase lying within [0,2 PI] |
| [out] | xi_3 | value of xi_2k,3(R) |
| [out] | correc0 | value to substract from S_2k,3 in order to avoid numerical problems when R is very small |
|
private |
Update the conditional simulations when the target coincides with a data point
| [in] | dbin | Input Db structure |
| [in] | dbout | Output Db structure |
| [in] | icase | Case for PGS or GRF |
| [in] | flag_pgs | 1 if called from PGS |
| [in] | flag_dgm | 1 for the Discrete Gaussian Model |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| int CalcSimuTurningBands::simulate | ( | Db * | dbin, |
| Db * | dbout, | ||
| Model * | model, | ||
| ANeigh * | neigh, | ||
| int | icase, | ||
| int | flag_bayes = false, |
||
| const VectorDouble & | dmean = VectorDouble(), |
||
| const VectorDouble & | dcov = VectorDouble(), |
||
| bool | flag_pgs = false, |
||
| bool | flag_gibbs = false, |
||
| bool | flag_dgm = false |
||
| ) |
Perform the Simulation Process using the Turning Bands Method
| [in] | dbin | Input Db structure |
| [in] | dbout | Output Db structure |
| [in] | model | Model structure |
| [in] | neigh | ANeigh structure |
| [in] | icase | Case for PGS or -1 |
| [in] | flag_bayes | 1 if the 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] | flag_pgs | 1 if called from PGS |
| [in] | flag_gibbs | 1 if called from Gibbs |
| [in] | flag_dgm | 1 if the Discrete Gaussian Model is used |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |