1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::ACov Class Referenceabstract

Class containing the Covariance part of the Model. More...

#include <ACov.hpp>

Inheritance diagram for gstlrn::ACov:
gstlrn::ICloneable gstlrn::AStringable gstlrn::CorAniso gstlrn::CorGneiting gstlrn::CorMatern gstlrn::CovBase gstlrn::CovGradientGeneric gstlrn::CovList gstlrn::CovProportional gstlrn::CovAnisoList gstlrn::CovAniso gstlrn::CovLMCAnamorphosis gstlrn::CovLMCConvolution gstlrn::CovLMCTapering gstlrn::CovLMGradient gstlrn::ACovGradient gstlrn::CovGradientFunctional gstlrn::CovGradientNumerical

Detailed Description

Class containing the Covariance part of the Model.

It is the uppermost class of the Covariance Tree and is conceived as simple as possible on purpose (in order to let the user defined its own version if necessary): it must simply be able to return its value between two end-point (see eval method).

It is mainly implemented in CovAniso.hpp or CovAnisoList.hpp

Public Member Functions

 ACov (const CovContext &ctxt=CovContext())
 
 ACov (const ACov &r)
 
ACovoperator= (const ACov &r)
 
virtual ~ACov ()
 
virtual Id getNVar () const
 ACov Interface.
 
virtual bool isIndexable () const
 
bool isNoStat () const
 
const CovContextgetContext () const
 
void setContext (const CovContext &ctxt)
 
void updateFromContext ()
 
virtual void copyCovContext (const CovContext &ctxt)
 
void initFromContext ()
 
CovContext getContextCopy () const
 
virtual double eval0 (Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 Calculate the covariance between two variables for 0-distance (stationary case)
 
double evalCov (const SpacePoint &p1, const SpacePoint &p2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 Calculate the covariance between two variables and two points (general case)
 
std::vector< double > evalCovGrad (const SpacePoint &p1, const SpacePoint &p2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr)
 
virtual double evalCovOnSphere (double alpha, Id degree=50, bool flagScaleDistance=false, const CovCalcMode *mode=nullptr) const
 
virtual evalSpectrumOnSphere (Id n, bool flagNormDistance=false, bool flagCumul=false) const
 
virtual double evalSpectrum (const 1 &freq, Id ivar, Id jvar) const
 
virtual void updateCovByPoints (Id icas1, Id iech1, Id icas2, Id iech2) const
 
double evalZGNumeric (const SpacePoint &p1, const SpacePoint &p2, Id ivar, Id jvar, Id idim, double radius, const CovCalcMode *mode) const
 
double evalGGNumeric (const SpacePoint &p1, const SpacePoint &p2, Id ivar, Id jvar, Id idim, Id jdim, double radius, const CovCalcMode *mode) const
 
void attachNoStatDb (const Db *db)
 
ASpaceSharedPtr getSpace () const
 
virtual bool isConsistent (const ASpace *space) const
 
virtual bool isOptimEnabled () const
 Functions linked to Optimization during Covariance calculations.
 
void optimizationPreProcess (Id mode, const std::vector< SpacePoint > &ps) const
 
SpacePointoptimizationLoadInPlace (Id iech, Id mode, Id rank) const
 
void optimizationPostProcess () const
 
void optimizationSetTarget (SpacePoint &pt) const
 
 eval (const std::vector< SpacePoint > &vec_p1, const std::vector< SpacePoint > &vec_p2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 Functions for evaluating Covariances.
 
MatrixSymmetric eval0Mat (const CovCalcMode *mode=nullptr) const
 
MatrixSymmetric evalCovMat0 (const Db *db, Id iech, const KrigOpt &krigopt=KrigOpt()) const
 Functions for evaluating Covariance Matrices either in place or not.
 
MatrixDense evalCovMat (const Db *db1, const Db *db2=nullptr, Id ivar0=-1, Id jvar0=-1, const 1 &nbgh1=1(), const 1 &nbgh2=1(), const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
MatrixSymmetric evalCovMatSym (const Db *db1, const 1 &nbgh1=1(), Id ivar0=-1, const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
MatrixSparseevalCovMatSparse (const Db *db1_arg, const Db *db2_arg=nullptr, Id ivar0=-1, Id jvar0=-1, const 1 &nbgh1=1(), const 1 &nbgh2=1(), const CovCalcMode *mode=nullptr, bool cleanOptim=true, double eps=EPSILON3) const
 
Id evalCovMat0InPlace (MatrixSymmetric &mat, const Db *db, Id iech, const KrigOpt &krigopt=KrigOpt()) const
 
Id evalCovMatInPlace (MatrixDense &mat, const Db *db1, const Db *db2=nullptr, Id ivar0=-1, Id jvar0=-1, const 1 &nbgh1=1(), const 1 &nbgh2=1(), const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
Id evalCovMatSymInPlace (MatrixSymmetric &mat, const Db *db1, const 1 &nbgh1=1(), Id ivar0=-1, const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
Id evalCovMatInPlaceFromIdx (MatrixDense &mat, const Db *db1, const Db *db2, const 1 &index1, const 1 &index2, const 1 &nbgh2=1(), const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
Id evalCovMatSymInPlaceFromIdx (MatrixSymmetric &mat, const Db *db1, const 1 &index1, const CovCalcMode *mode=nullptr, bool cleanOptim=true) const
 
Id evalCovMatRHSInPlaceFromIdx (MatrixDense &mat, const Db *db1, const Db *db2, const 1 &index1, const Id iech2=-1, const KrigOpt &krigopt=KrigOpt(), bool cleanOptim=true) const
 
Id evalCovVecRHSInPlace (vect vect, const RankHandler &rank, Id iech2, const KrigOpt &krigopt, SpacePoint &pin, SpacePoint &pout, 1 &tabwork, double lambda=1., const ECalcMember &calcMember=ECalcMember::RHS) const
 
Id evalCovMatOptimInPlace (MatrixDense &mat, const Db *dbin, const RankHandler &rankhandler, const KrigOpt &krigopt, const ECalcMember &calcMember, 1 &tabwork, double lambda=1.) const
 
virtual Id addEvalCovVecRHSInPlace (vect vect, const 1 &index1, const Id iech2, const KrigOpt &krigopt, SpacePoint &pin, SpacePoint &pout, 1 &tabwork, double lambda=1., const ECalcMember &calcMember=ECalcMember::RHS) const
 
void eval0CovMatBiPointInPlace (MatrixSymmetric &mat, const CovCalcMode *mode) const
 
double evalIvarIpas (double step, const 1 &dir=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalIvarIpasIncr (const 1 &dincr, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
 evalIvarNlag (const 1 &vec_step, const 1 &dir=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquare evalNvarIpas (double step, const 1 &dir=1(), const CovCalcMode *mode=nullptr) const
 
MatrixSquare evalNvarIpasIncr (const 1 &dincr, const CovCalcMode *mode=nullptr) const
 
double evalIsoIvarIpas (double step, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
 evalIsoIvarNlag (const 1 &vec_step, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquare evalIsoNvarIpas (double step, const CovCalcMode *mode=nullptr) const
 
double evalCvv (const 1 &ext, const 1 &ndisc, const 1 &angles=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalCvvShift (const 1 &ext, const 1 &ndisc, const 1 &shift, const 1 &angles=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquare evalCvvM (const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const CovCalcMode *mode=nullptr) const
 
double evalCxv (const SpacePoint &p1, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalCxv (const Db *db, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquare evalCxvM (const SpacePoint &p1, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), const CovCalcMode *mode=nullptr) const
 
void evalPointToDb (1 &values, const SpacePoint &p1, const Db *db2, Id ivar=0, Id jvar=0, bool useSel=true, const 1 &nbgh2=1(), const CovCalcMode *mode=nullptr) const
 
void evalPointToDbAsSP (1 &values, const std::vector< SpacePoint > &p1s, const SpacePoint &p2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalAverageDbToDb (const Db *db1, const Db *db2, Id ivar=0, Id jvar=0, double eps=0., Id seed=434132, const CovCalcMode *mode=nullptr) const
 
double evalAverageIncrToIncr (const 1 &d1, const 1 &d2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalAveragePointToDb (const SpacePoint &p1, const Db *db2, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double extensionVariance (const Db *db, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0) const
 
double samplingDensityVariance (const Db *db, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0) const
 
double specificVolume (const Db *db, double mean, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0) const
 
double coefficientOfVariation (const Db *db, double volume, double mean, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0) const
 
double specificVolumeFromCoV (Db *db, double cov, double mean, const 1 &ext, const 1 &ndisc, const 1 &angles=1(), const 1 &x0=1(), Id ivar=0, Id jvar=0) const
 
double evaluateOneGeneric (const CovInternal *covint, const 1 &d1=1(), double weight=1., const CovCalcMode *mode=nullptr) const
 
double calculateStDev (Db *db1, Id iech1, Db *db2, Id iech2, bool verbose=false, double factor=1., const CovCalcMode *mode=nullptr) const
 
void evaluateMatInPlace (const CovInternal *covint, const 1 &d1, MatrixSquare &covtab, bool flag_init=false, double weight=1., const CovCalcMode *mode=nullptr) const
 
 evaluateFromDb (Db *db, Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
double evaluateOneIncr (double hh, const 1 &codir=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr) const
 
 sample (const 1 &h, const 1 &codir=1(), Id ivar=0, Id jvar=0, const CovCalcMode *mode=nullptr, const CovInternal *covint=nullptr) const
 
 sampleUnitary (const 1 &hh, Id ivar=0, Id jvar=0, 1 codir=1(), const CovCalcMode *mode=nullptr) const
 
 envelop (const 1 &hh, Id ivar=0, Id jvar=0, Id isign=1, 1 codir=1(), const CovCalcMode *mode=nullptr) const
 
Id buildVmapOnDbGrid (DbGrid *dbgrid, const NamingConvention &namconv=NamingConvention("VMAP")) const
 
double gofToVario (const Vario *vario, bool verbose=true) const
 
void manage (const Db *db1, const Db *db2) const
 
void load (const SpacePoint &p, bool case1) const
 
virtual void updateCovByMesh (Id imesh, bool aniso=true) const
 
virtual double getValue (const EConsElem &econs, Id iv1, Id iv2) const
 
void makeStationary ()
 
virtual Id makeElemNoStat (const EConsElem &econs, Id iv1, Id iv2, const AFunctional *func=nullptr, const Db *db=nullptr, const String &namecol=String())
 
void createNoStatTab ()
 
void informMeshByMesh (const AMesh *amesh) const
 
void informMeshByApex (const AMesh *amesh) const
 
 informCoords (const 1 &coords, const EConsElem &econs, Id iv1=0, Id iv2=0) const
 
void informDbIn (const Db *dbin) const
 
void informDbOut (const Db *dbout) const
 
virtual void updateCovByPoints (Id icas1, Id iech1, Id icas2, Id iech2)
 
Id getNDim (Id ispace=-1) const
 
void optimizationPreProcessForData (const Db *db1=nullptr) const
 
virtual void setOptimEnabled (bool enabled) const
 
bool checkAndManageNoStatDb (const Db *db, const String &namecol)
 
std::shared_ptr< const DbgetDbNoStat () const
 
const DbgetDbNoStatRaw () const
 
void setNoStatDbIfNecessary (const Db *db)
 
void setNoStatDbIfNecessary (std::shared_ptr< const Db > &db)
 
virtual void appendParams (ListParams &listParams, std::vector< covmaptype > *gradFuncs=nullptr)
 
virtual void updateCov ()
 
virtual void initParams (const MatrixSymmetric &vars, double href=1.)
 
- Public Member Functions inherited from gstlrn::ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 
std::shared_ptr< ICloneablecloneShared () const
 
std::unique_ptr< ICloneablecloneUnique () const
 
- Public Member Functions inherited from gstlrn::AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (Id level) const final
 

Static Public Member Functions

static void gofDisplay (double gof, bool byValue=true, const 1 &thresholds={2., 5., 10., 100})
 

Constructor & Destructor Documentation

◆ ACov() [1/2]

gstlrn::ACov::ACov ( const CovContext ctxt = CovContext())

◆ ACov() [2/2]

gstlrn::ACov::ACov ( const ACov r)

◆ ~ACov()

gstlrn::ACov::~ACov ( )
virtual

Member Function Documentation

◆ addEvalCovVecRHSInPlace()

Id gstlrn::ACov::addEvalCovVecRHSInPlace ( vect  vect,
const 1 &  index1,
const Id  iech2,
const KrigOpt krigopt,
SpacePoint pin,
SpacePoint pout,
1 &  tabwork,
double  lambda = 1.,
const ECalcMember &  calcMember = ECalcMember::RHS 
) const
virtual

◆ appendParams()

virtual void gstlrn::ACov::appendParams ( ListParams listParams,
std::vector< covmaptype > *  gradFuncs = nullptr 
)
inlinevirtual

◆ attachNoStatDb()

void gstlrn::ACov::attachNoStatDb ( const Db db)

◆ buildVmapOnDbGrid()

Id gstlrn::ACov::buildVmapOnDbGrid ( DbGrid dbgrid,
const NamingConvention namconv = NamingConvention("VMAP") 
) const

Calculate the variogram map from a Model (presented as Variogram, not Covariance)

Returns
Error return code
Parameters
[in]dbgridGrid structure
[in]namconvNaming convention

◆ calculateStDev()

double gstlrn::ACov::calculateStDev ( Db db1,
Id  iech1,
Db db2,
Id  iech2,
bool  verbose = false,
double  factor = 1.,
const CovCalcMode mode = nullptr 
) const

Returns the standard deviation at a given increment for a given model between two samples of two Dbs

Parameters
[in]db1First Db
[in]iech1Rank in the first Db
[in]db2Second Db
[in]iech2Rank in the second Db
[in]verboseVerbose flag
[in]factorMultiplicative factor for standard deviation
[in]modeCovCalcMode structure

◆ checkAndManageNoStatDb()

bool gstlrn::ACov::checkAndManageNoStatDb ( const Db db,
const String namecol 
)

◆ coefficientOfVariation()

double gstlrn::ACov::coefficientOfVariation ( const Db db,
double  volume,
double  mean,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0 
) const

Calculate the Coefficient of Variation

Parameters
dbSet of data points
volumeSpecific production volume
meanValue of the Mean
extTarget Block extension
ndiscVector of discretization
anglesOptional rotation angle for block
x0Optional origin of the Block
ivarRank of the first variable
jvarRank of the second variable
Returns

◆ copyCovContext()

virtual void gstlrn::ACov::copyCovContext ( const CovContext ctxt)
inlinevirtual

Reimplemented in gstlrn::CovList.

◆ createNoStatTab()

void gstlrn::ACov::createNoStatTab ( )

◆ envelop()

gstlrn::ACov::envelop ( const 1 &  hh,
Id  ivar = 0,
Id  jvar = 0,
Id  isign = 1,
codir = 1(),
const CovCalcMode mode = nullptr 
) const

◆ eval()

gstlrn::ACov::eval ( const std::vector< SpacePoint > &  vec_p1,
const std::vector< SpacePoint > &  vec_p2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Functions for evaluating Covariances.

◆ eval0()

double gstlrn::ACov::eval0 ( Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const
virtual

Calculate the covariance between two variables for 0-distance (stationary case)

Reimplemented in gstlrn::CovAniso, gstlrn::CovAnisoList, gstlrn::CovGradientNumerical, gstlrn::CovList, gstlrn::CovLMCAnamorphosis, gstlrn::CovLMCConvolution, and gstlrn::CovLMCTapering.

◆ eval0CovMatBiPointInPlace()

void gstlrn::ACov::eval0CovMatBiPointInPlace ( MatrixSymmetric mat,
const CovCalcMode mode 
) const

Calculate the Matrix of covariance for zero distance

Parameters
matCovariance matrix (Dimension: nvar * nvar)
modeCalculation Options
Remarks
: Matrix 'mat' should be dimensioned and initialized beforehand

◆ eval0Mat()

MatrixSymmetric gstlrn::ACov::eval0Mat ( const CovCalcMode mode = nullptr) const

◆ evalAverageDbToDb()

double gstlrn::ACov::evalAverageDbToDb ( const Db db1,
const Db db2,
Id  ivar = 0,
Id  jvar = 0,
double  eps = 0.,
Id  seed = 434132,
const CovCalcMode mode = nullptr 
) const

Calculate the (weighted) average Covariance between samples of two Dbs, for a pair of variables

Parameters
db1Pointer to the first Db
db2Pointer to the second Db
ivarRank of the first variables
jvarRank of the second variable
epsEpsilon used for randomization in calculation of CVV (optional)
seedSeed for the randomization
modeCovCalcMode structure
Returns

◆ evalAverageIncrToIncr()

double gstlrn::ACov::evalAverageIncrToIncr ( const 1 &  d1,
const 1 &  d2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

◆ evalAveragePointToDb()

double gstlrn::ACov::evalAveragePointToDb ( const SpacePoint p1,
const Db db2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Calculate the (weighted) average Covariance between a point and a Db for a pair of variables

Parameters
p1Point location
db2Pointer to the second Db
ivarRank of the first variables
jvarRank of the second variable
modeCovCalcMode structure
Returns

◆ evalCov()

double gstlrn::ACov::evalCov ( const SpacePoint p1,
const SpacePoint p2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Calculate the covariance between two variables and two points (general case)

◆ evalCovGrad()

std::vector< double > gstlrn::ACov::evalCovGrad ( const SpacePoint p1,
const SpacePoint p2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
)

◆ evalCovMat()

MatrixDense gstlrn::ACov::evalCovMat ( const Db db1,
const Db db2 = nullptr,
Id  ivar0 = -1,
Id  jvar0 = -1,
const 1 &  nbgh1 = 1(),
const 1 &  nbgh2 = 1(),
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

Establish the covariance matrix between two Dbs Takes into account selection and heterotopy

Returns
Dense matrix containing the covariance matrix
Parameters
[in]db1First Db
[in]db2Second Db (= db1 if absent)
[in]ivar0Rank of the first variable (-1 for all variables)
[in]jvar0Rank of the second variable (-1 for all variables)
[in]nbgh1Vector of indices of active samples in db1 (optional)
[in]nbgh2Vector of indices of active samples in db2 (optional)
[in]modeCovCalcMode structure
[in]cleanOptimWhen True, clean optimization internal when ended
Remarks
If a Db does not contain any Z-variable defined, the covariance
cannot treat possible heterotopy and therefore uses all samples
The returned matrix if dimension to nrows * ncols where
each term is the product of the number of active samples
by the number of samples where the variable is defined
Note
'dbin' and 'dbout' cannot be made 'const' as they can be updated
due to the presence of 'nostat'

◆ evalCovMat0()

MatrixSymmetric gstlrn::ACov::evalCovMat0 ( const Db db,
Id  iech,
const KrigOpt krigopt = KrigOpt() 
) const

Functions for evaluating Covariance Matrices either in place or not.

◆ evalCovMat0InPlace()

Id gstlrn::ACov::evalCovMat0InPlace ( MatrixSymmetric mat,
const Db db,
Id  iech,
const KrigOpt krigopt = KrigOpt() 
) const

◆ evalCovMatInPlace()

Id gstlrn::ACov::evalCovMatInPlace ( MatrixDense mat,
const Db db1,
const Db db2 = nullptr,
Id  ivar0 = -1,
Id  jvar0 = -1,
const 1 &  nbgh1 = 1(),
const 1 &  nbgh2 = 1(),
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

◆ evalCovMatInPlaceFromIdx()

Id gstlrn::ACov::evalCovMatInPlaceFromIdx ( MatrixDense mat,
const Db db1,
const Db db2,
const 1 &  index1,
const 1 &  index2,
const 1 &  nbgh2 = 1(),
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

◆ evalCovMatOptimInPlace()

Id gstlrn::ACov::evalCovMatOptimInPlace ( MatrixDense mat,
const Db dbin,
const RankHandler rankhandler,
const KrigOpt krigopt,
const ECalcMember &  calcMember,
1 &  tabwork,
double  lambda = 1. 
) const

◆ evalCovMatRHSInPlaceFromIdx()

Id gstlrn::ACov::evalCovMatRHSInPlaceFromIdx ( MatrixDense mat,
const Db db1,
const Db db2,
const 1 &  index1,
const Id  iech2 = -1,
const KrigOpt krigopt = KrigOpt(),
bool  cleanOptim = true 
) const

Establish covariance matrix between one Db and one sample of a Target Db

Returns
Dense matrix containing the covariance matrix
Parameters
[in]matMatrix (possibly resized)
[in]db1First Db
[in]db2Second Db
[in]index1Vector of vector indices of active samples in db1
[in]iech2Sample rank within db2
[in]krigoptKrigOpt structure
[in]cleanOptimWhen True, clean optimization internal when ended
Remarks
If a Db does not contain any Z-variable defined, the covariance
cannot treat possible heterotopy and therefore uses all samples
The returned matrix if dimension to nrows * 1 where
each 'nrows' is the number of active samples
by the number of samples where the variable is defined
Note
'dbin' and 'dbout' cannot be made 'const' as they can be updated
due to the presence of 'nostat'

◆ evalCovMatSparse()

MatrixSparse * gstlrn::ACov::evalCovMatSparse ( const Db db1,
const Db db2 = nullptr,
Id  ivar0 = -1,
Id  jvar0 = -1,
const 1 &  nbgh1 = 1(),
const 1 &  nbgh2 = 1(),
const CovCalcMode mode = nullptr,
bool  cleanOptim = true,
double  eps = EPSILON3 
) const

Establish the covariance matrix between two Dbs where samples are selected by ranks The output is stored in a Sparse Matrix

Returns
Sparse matrix containing the covariance matrix
Parameters
[in]db1First Db
[in]db2Second Db
[in]ivar0Rank of the first variable (-1: all variables)
[in]jvar0Rank of the second variable (-1: all variables)
[in]nbgh1Array giving ranks of selected samples (optional)
[in]nbgh2Array giving ranks of selected samples (optional)
[in]modeCovCalcMode structure
[in]cleanOptimWhen True, clean optimization internal when ended
[in]epsTolerance for discarding a covariance value
Remarks
The covariance matrix (returned) must be freed by calling routine
The covariance matrix is established for the first variable
and returned as a covariance
As the ranks are used, no test is performed on any selection
but only ranks positive or null are considered

◆ evalCovMatSym()

MatrixSymmetric gstlrn::ACov::evalCovMatSym ( const Db db1,
const 1 &  nbgh1 = 1(),
Id  ivar0 = -1,
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

Establish the covariance matrix within a Db Takes into account selection and heterotopy This method takes advantage of calculating covariance between a Db and itself

Returns
Dense matrix containing the covariance matrix
Parameters
[in]db1First Db
[in]ivar0Rank of the first variable (-1 for all variables)
[in]nbgh1Vector of indices of active samples in db1 (optional)
[in]modeCovCalcMode structure
[in]cleanOptimWhen True, clean optimization internal arrays at end
Remarks
If a Db does not contain any Z-variable defined, the covariance
cannot treat possible heterotopy and therefore uses all samples
The returned matrix if dimension to nrows * ncols where
each term is the product of the number of active samples
by the number of samples where the variable is defined

◆ evalCovMatSymInPlace()

Id gstlrn::ACov::evalCovMatSymInPlace ( MatrixSymmetric mat,
const Db db1,
const 1 &  nbgh1 = 1(),
Id  ivar0 = -1,
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

◆ evalCovMatSymInPlaceFromIdx()

Id gstlrn::ACov::evalCovMatSymInPlaceFromIdx ( MatrixSymmetric mat,
const Db db1,
const 1 &  index1,
const CovCalcMode mode = nullptr,
bool  cleanOptim = true 
) const

◆ evalCovOnSphere()

virtual double gstlrn::ACov::evalCovOnSphere ( double  alpha,
Id  degree = 50,
bool  flagScaleDistance = false,
const CovCalcMode mode = nullptr 
) const
inlinevirtual

Reimplemented in gstlrn::CorAniso, and gstlrn::CovAniso.

◆ evalCovVecRHSInPlace()

Id gstlrn::ACov::evalCovVecRHSInPlace ( vect  vect,
const RankHandler rank,
Id  iech2,
const KrigOpt krigopt,
SpacePoint pin,
SpacePoint pout,
1 &  tabwork,
double  lambda = 1.,
const ECalcMember &  calcMember = ECalcMember::RHS 
) const

◆ evalCvv()

double gstlrn::ACov::evalCvv ( const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Average covariance over a block

Parameters
extVector of Block extensions
ndiscVector of Block discretization
anglesVector of rotation angles
ivarRank of the first variable
jvarRank of the second variable
modeCovCalcMode structure
Returns

◆ evalCvvM()

MatrixSquare gstlrn::ACov::evalCvvM ( const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const CovCalcMode mode = nullptr 
) const

◆ evalCvvShift()

double gstlrn::ACov::evalCvvShift ( const 1 &  ext,
const 1 &  ndisc,
const 1 &  shift,
const 1 &  angles = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Average covariance between a block and the same block shifted

Parameters
extVector of Block extensions
ndiscVector of Block discretization
anglesVector of rotation angles
shiftShift between the two blocks
ivarRank of the first variable
jvarRank of the second variable
modeCovCalcMode structure
Returns

◆ evalCxv() [1/2]

double gstlrn::ACov::evalCxv ( const Db db,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

◆ evalCxv() [2/2]

double gstlrn::ACov::evalCxv ( const SpacePoint p1,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Average covariance over a block

Parameters
p1Point location
extVector of Block extensions
ndiscVector of Block discretization
anglesVector of rotation angles
x0Vector for origin of block
ivarRank of the first variable
jvarRank of the second variable
modeCovCalcMode structure
Returns

◆ evalCxvM()

MatrixSquare gstlrn::ACov::evalCxvM ( const SpacePoint p1,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
const CovCalcMode mode = nullptr 
) const

◆ evalGGNumeric()

double gstlrn::ACov::evalGGNumeric ( const SpacePoint p1,
const SpacePoint p2,
Id  ivar,
Id  jvar,
Id  idim,
Id  jdim,
double  radius,
const CovCalcMode mode 
) const

◆ evalIsoIvarIpas()

double gstlrn::ACov::evalIsoIvarIpas ( double  step,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Covariance for a given unit global distance (without anisotropy) for a pair of variables and a single step

Parameters
ivarRank of the first variable
jvarRank of the second variable
stepStep value
modeCovCalcMode structure
Returns

TODO : Not true whatever the space

◆ evalIsoIvarNlag()

gstlrn::ACov::evalIsoIvarNlag ( const 1 &  vec_step,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Covariance for a given unit global distance (without anisotropy) for a pair of variables and a set of steps

Parameters
ivar
jvar
vec_step
mode
Returns

◆ evalIsoNvarIpas()

MatrixSquare gstlrn::ACov::evalIsoNvarIpas ( double  step,
const CovCalcMode mode = nullptr 
) const

Covariance for a given unit global distance (without anisotropy) for a set of variables and a single step

Parameters
stepStep value
modeCovCalcMode structure
Returns

◆ evalIvarIpas()

double gstlrn::ACov::evalIvarIpas ( double  step,
const 1 &  dir = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Covariance from a given point (center) in a given direction (dir *step)

Parameters
ivarRank of the first variable
jvarRank of the second variable
stepStep value
dirDirection definition
modeCovCalcMode structure
Returns

◆ evalIvarIpasIncr()

double gstlrn::ACov::evalIvarIpasIncr ( const 1 &  dincr,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

◆ evalIvarNlag()

gstlrn::ACov::evalIvarNlag ( const 1 &  vec_step,
const 1 &  dir = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Covariance vector from a given point (center) in a given direction (dir * steps) for a pair of variables and a set of steps

Parameters
ivarRank of the first variable
jvarRank of the second variable
vec_stepVector of step values
dirDirection definition
modeCovCalcMode structure
Returns

◆ evalNvarIpas()

MatrixSquare gstlrn::ACov::evalNvarIpas ( double  step,
const 1 &  dir = 1(),
const CovCalcMode mode = nullptr 
) const

Covariance Matrix from a given point (center) in a given direction (dir * step) for a set of variables and a given step

Parameters
stepStep value
dirDirection definition
modeCovCalcMode structure
Returns

◆ evalNvarIpasIncr()

MatrixSquare gstlrn::ACov::evalNvarIpasIncr ( const 1 &  dincr,
const CovCalcMode mode = nullptr 
) const

◆ evalPointToDb()

void gstlrn::ACov::evalPointToDb ( 1 &  values,
const SpacePoint p1,
const Db db2,
Id  ivar = 0,
Id  jvar = 0,
bool  useSel = true,
const 1 &  nbgh2 = 1(),
const CovCalcMode mode = nullptr 
) const

Calculate the Covariance vector between a Point and all the samples of a Db, for a pair of variables

Parameters
valuesArray of returned values (possible resized)
p1Point location
db2Pointer to the second Db
ivarRank of the first variables
jvarRank of the second variable
useSelWhen TRUE, the returned vector is reduced to active samples Otherwise, returns TEST for masked samples
nbgh2Vector of indices of active samples in db2 (optional)
modeCovCalcMode structure

◆ evalPointToDbAsSP()

void gstlrn::ACov::evalPointToDbAsSP ( 1 &  values,
const std::vector< SpacePoint > &  p1s,
const SpacePoint p2,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

◆ evalSpectrum()

virtual double gstlrn::ACov::evalSpectrum ( const 1 &  freq,
Id  ivar,
Id  jvar 
) const
inlinevirtual

Reimplemented in gstlrn::CorAniso, and gstlrn::CovAniso.

◆ evalSpectrumOnSphere()

virtual gstlrn::ACov::evalSpectrumOnSphere ( Id  n,
bool  flagNormDistance = false,
bool  flagCumul = false 
) const
inlinevirtual

Reimplemented in gstlrn::CorAniso, and gstlrn::CovAniso.

◆ evaluateFromDb()

gstlrn::ACov::evaluateFromDb ( Db db,
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Evaluate the model on a Db

Parameters
[in]dbDb structure
[in]ivarRank of the first variable
[in]jvarRank of the second variable
[in]modeCovCalcMode structure

◆ evaluateMatInPlace()

void gstlrn::ACov::evaluateMatInPlace ( const CovInternal covint,
const 1 &  d1,
MatrixSquare covtab,
bool  flag_init = false,
double  weight = 1.,
const CovCalcMode mode = nullptr 
) const

Returns the covariances for an increment This is the generic internal function It can be called for stationary or non-stationary case

Parameters
[in]covintInternal structure for non-stationarityAddress for the next term after the drift or NULL (for stationary case)
[in]modeCovCalcMode structure
[in]flag_initInitialize the array beforehand
[in]weightMultiplicative weight
[in]d1Distance vector
[out]covtabCovariance array

◆ evaluateOneGeneric()

double gstlrn::ACov::evaluateOneGeneric ( const CovInternal covint,
const 1 &  d1 = 1(),
double  weight = 1.,
const CovCalcMode mode = nullptr 
) const

Returns the covariance for an increment This is the generic internal function It can be called for stationary or non-stationary case

Parameters
[in]covintInternal structure for non-stationarityAddress for the next term after the drift or NULL (for stationary case)
[in]modeCovCalcMode structure
[in]weightMultiplicative weight
[in]d1Distance vector

◆ evaluateOneIncr()

double gstlrn::ACov::evaluateOneIncr ( double  hh,
const 1 &  codir = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr 
) const

Calculate the value of the model for a set of distances

Returns
The model value
Parameters
[in]ivarRank of the first variable
[in]jvarRank of the second variable
[in]modeCovCalcMode structure
[in]codirArray giving the direction coefficients (optional)
[in]hhVector of increments

◆ evalZGNumeric()

double gstlrn::ACov::evalZGNumeric ( const SpacePoint p1,
const SpacePoint p2,
Id  ivar,
Id  jvar,
Id  idim,
double  radius,
const CovCalcMode mode 
) const

◆ extensionVariance()

double gstlrn::ACov::extensionVariance ( const Db db,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0 
) const

Variance of Extension of a set of points and the block

Parameters
dbReference Data Base
extVector giving the extensions of the target block
ndiscVector giving the discretization
anglesVector for the rotation angles of the block (optional)
x0Optional origin of the Block
ivarRank of the first variable
jvarRank of the second variable
Returns

◆ getContext()

const CovContext & gstlrn::ACov::getContext ( ) const
inline

◆ getContextCopy()

CovContext gstlrn::ACov::getContextCopy ( ) const
inline

◆ getDbNoStat()

std::shared_ptr< const Db > gstlrn::ACov::getDbNoStat ( ) const

◆ getDbNoStatRaw()

const Db * gstlrn::ACov::getDbNoStatRaw ( ) const

◆ getNDim()

Id gstlrn::ACov::getNDim ( Id  ispace = -1) const
inline

◆ getNVar()

virtual Id gstlrn::ACov::getNVar ( ) const
inlinevirtual

◆ getSpace()

ASpaceSharedPtr gstlrn::ACov::getSpace ( ) const
inline

◆ getValue()

virtual double gstlrn::ACov::getValue ( const EConsElem &  econs,
Id  iv1,
Id  iv2 
) const
inlinevirtual

Reimplemented in gstlrn::CorAniso, and gstlrn::CovBase.

◆ gofDisplay()

void gstlrn::ACov::gofDisplay ( double  gof,
bool  byValue = true,
const 1 &  thresholds = {2., 5., 10., 100} 
)
static

Printout of statement concerning the Quality of the GOF

Parameters
gofValue of the Gof
byValuetrue: display GOF value; false: print its quality level
thresholdsVector giving the Quality thresholds

◆ gofToVario()

double gstlrn::ACov::gofToVario ( const Vario vario,
bool  verbose = true 
) const

Evaluate the Goodness-of_fit of the Model on the Experimental Variogram It is expressed as the average departure between Model and Variogram scaled to the variance. As this variance may be poorly calculated (< gmax / 5), it may be replaced by the largest value (gmax) divided by 2 (highly non_stationary cases).

Parameters
varioExperimental variogram
verboseVerbose flag
Returns
Value for the Goodness-of_fit (as percentage of the total sill)

◆ informCoords()

gstlrn::ACov::informCoords ( const 1 &  coords,
const EConsElem &  econs,
Id  iv1 = 0,
Id  iv2 = 0 
) const

◆ informDbIn()

void gstlrn::ACov::informDbIn ( const Db dbin) const

◆ informDbOut()

void gstlrn::ACov::informDbOut ( const Db dbout) const

◆ informMeshByApex()

void gstlrn::ACov::informMeshByApex ( const AMesh amesh) const

◆ informMeshByMesh()

void gstlrn::ACov::informMeshByMesh ( const AMesh amesh) const

◆ initFromContext()

void gstlrn::ACov::initFromContext ( )

◆ initParams()

virtual void gstlrn::ACov::initParams ( const MatrixSymmetric vars,
double  href = 1. 
)
inlinevirtual

◆ isConsistent()

virtual bool gstlrn::ACov::isConsistent ( const ASpace space) const
inlinevirtual

◆ isIndexable()

virtual bool gstlrn::ACov::isIndexable ( ) const
inlinevirtual

Reimplemented in gstlrn::CovAnisoList, and gstlrn::CovList.

◆ isNoStat()

bool gstlrn::ACov::isNoStat ( ) const
inline

◆ isOptimEnabled()

virtual bool gstlrn::ACov::isOptimEnabled ( ) const
inlinevirtual

Functions linked to Optimization during Covariance calculations.

◆ load()

void gstlrn::ACov::load ( const SpacePoint p,
bool  case1 
) const

◆ makeElemNoStat()

Id gstlrn::ACov::makeElemNoStat ( const EConsElem &  econs,
Id  iv1,
Id  iv2,
const AFunctional func = nullptr,
const Db db = nullptr,
const String namecol = String() 
)
virtual

Reimplemented in gstlrn::CovBase, and gstlrn::CovList.

◆ makeStationary()

void gstlrn::ACov::makeStationary ( )

◆ manage()

void gstlrn::ACov::manage ( const Db db1,
const Db db2 
) const
inline

◆ operator=()

ACov & gstlrn::ACov::operator= ( const ACov r)

◆ optimizationLoadInPlace()

SpacePoint & gstlrn::ACov::optimizationLoadInPlace ( Id  iech,
Id  mode,
Id  rank 
) const

◆ optimizationPostProcess()

void gstlrn::ACov::optimizationPostProcess ( ) const

◆ optimizationPreProcess()

void gstlrn::ACov::optimizationPreProcess ( Id  mode,
const std::vector< SpacePoint > &  ps 
) const

◆ optimizationPreProcessForData()

void gstlrn::ACov::optimizationPreProcessForData ( const Db db1 = nullptr) const

◆ optimizationSetTarget()

void gstlrn::ACov::optimizationSetTarget ( SpacePoint pt) const

◆ sample()

gstlrn::ACov::sample ( const 1 &  h,
const 1 &  codir = 1(),
Id  ivar = 0,
Id  jvar = 0,
const CovCalcMode mode = nullptr,
const CovInternal covint = nullptr 
) const

Calculate the value of the model for a set of distances

Returns
Array containing the model values
Parameters
[in]ivarRank of the first variable
[in]jvarRank of the second variable
[in]codirArray giving the direction coefficients (optional)
[in]hVector of increments
[in]modeCovCalcMode structure
[in]covintNon-stationary parameters

◆ sampleUnitary()

gstlrn::ACov::sampleUnitary ( const 1 &  hh,
Id  ivar = 0,
Id  jvar = 0,
codir = 1(),
const CovCalcMode mode = nullptr 
) const

Returns the value of the normalized covariance (by the variance/covariance value) for a given pair of variables

Parameters
hhVector of distances
ivarRank of the first variable
jvarRank of the second variable
codirDirection coefficients
modeCovCalcMode structure
Returns

◆ samplingDensityVariance()

double gstlrn::ACov::samplingDensityVariance ( const Db db,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0 
) const

Calculate the Sampling Density Variance

Parameters
dbSet of data points
extBlock extension
ndiscDiscretization
anglesOptional rotation angles for the Block
x0Optional origin of the block
ivarRank of the first variable
jvarRank of the second variable
Returns

◆ setContext()

void gstlrn::ACov::setContext ( const CovContext ctxt)

◆ setNoStatDbIfNecessary() [1/2]

void gstlrn::ACov::setNoStatDbIfNecessary ( const Db db)

◆ setNoStatDbIfNecessary() [2/2]

void gstlrn::ACov::setNoStatDbIfNecessary ( std::shared_ptr< const Db > &  db)

◆ setOptimEnabled()

virtual void gstlrn::ACov::setOptimEnabled ( bool  enabled) const
inlinevirtual

Reimplemented in gstlrn::CovBase, and gstlrn::CovList.

◆ specificVolume()

double gstlrn::ACov::specificVolume ( const Db db,
double  mean,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0 
) const

Calculate the Specific Volume

Parameters
dbSet of data points
meanValue of the Mean
extTarget Block extension
ndiscVector of discretization
anglesOptional rotation angle for block
x0Optional origin of the Block
ivarRank of the first variable
jvarRank of the second variable
Returns

◆ specificVolumeFromCoV()

double gstlrn::ACov::specificVolumeFromCoV ( Db db,
double  cov,
double  mean,
const 1 &  ext,
const 1 &  ndisc,
const 1 &  angles = 1(),
const 1 &  x0 = 1(),
Id  ivar = 0,
Id  jvar = 0 
) const

Derive the Specific volume for a given CoV

Parameters
dbSet of data points
covTarget Coefficient of Variation
meanValue of the Mean
extTarget Block extension
ndiscVector of discretization
anglesOptional rotation angle for block
x0Optional origin of the Block
ivarRank of the first variable
jvarRank of the second variable
Returns

◆ updateCov()

virtual void gstlrn::ACov::updateCov ( )
inlinevirtual

◆ updateCovByMesh()

virtual void gstlrn::ACov::updateCovByMesh ( Id  imesh,
bool  aniso = true 
) const
inlinevirtual

Reimplemented in gstlrn::CorAniso, and gstlrn::CovBase.

◆ updateCovByPoints() [1/2]

virtual void gstlrn::ACov::updateCovByPoints ( Id  icas1,
Id  iech1,
Id  icas2,
Id  iech2 
)
inlinevirtual

Reimplemented in gstlrn::CorAniso.

◆ updateCovByPoints() [2/2]

virtual void gstlrn::ACov::updateCovByPoints ( Id  icas1,
Id  iech1,
Id  icas2,
Id  iech2 
) const
inlinevirtual

Reimplemented in gstlrn::CovBase, and gstlrn::CovList.

◆ updateFromContext()

void gstlrn::ACov::updateFromContext ( )
inline

The documentation for this class was generated from the following files: