1.6.0
CCC
 
Loading...
Searching...
No Matches
CovBase Class Reference

#include <CovBase.hpp>

Inheritance diagram for CovBase:
ACov ASpaceObject AStringable CovAniso ACovGradient CovGradientFunctional CovGradientNumerical

Public Member Functions

 CovBase (ACor *cor=nullptr, const MatrixSquareSymmetric &sills=MatrixSquareSymmetric())
 
 CovBase (const CovBase &r)=delete
 
CovBaseoperator= (const CovBase &r)=delete
 
virtual ~CovBase ()
 
virtual bool isConsistent (const ASpace *space) const override
 Indicate if I am consistent with the provided space.
 
virtual int getNVariables () const override
 ACov Interface.
 
bool isOptimizationInitialized (const Db *db=nullptr) const
 
void _optimizationPreProcess (const std::vector< SpacePoint > &p) const override
 
void optimizationSetTargetByIndex (int iech) const override
 
void setContext (const CovContext &ctxt)
 
void copyCovContext (const CovContext &ctxt)
 
void setSill (double sill) const
 
void setSill (const MatrixSquareSymmetric &sill) const
 Only valid when there is only one variable (in the context)
 
void setSill (const VectorDouble &sill) const
 
void setSill (int ivar, int jvar, double sill) const
 
void initSill (double value=0.)
 
const MatrixSquareSymmetricgetSill () const
 
void setCor (ACor *cor)
 
ACorgetCor ()
 
double getSill (int ivar, int jvar) const
 
void attachNoStatDb (const Db *db)
 
void makeSillNoStatDb (const String &namecol, int ivar=0, int jvar=0, const Db *db=nullptr)
 
void makeSillStationary (int ivar=0, int jvar=0)
 
void makeSillNoStatFunctional (const AFunctional *func, int ivar=0, int jvar=0)
 
void makeStationary ()
 
int getNSills () const
 
bool isNoStatForVariance () const
 
void informMeshByMesh (const AMesh *amesh) const
 
void informMeshByApex (const AMesh *amesh) const
 
VectorDouble informCoords (const VectorVectorDouble &coords, const EConsElem &econs, int iv1=0, int iv2=0) const
 
void informDbIn (const Db *dbin) const
 
void informDbOut (const Db *dbout) const
 
void informMeshByMeshForSills (const AMesh *amesh) const
 
void informMeshByApexForSills (const AMesh *amesh) const
 
void informDbInForSills (const Db *dbin) const
 
void informDbOutForSills (const Db *dbout) const
 
void updateCovByPoints (int icas1, int iech1, int icas2, int iech2) const override
 Tell if the use of Optimization is enabled or not.
 
void updateCovByMesh (int imesh, bool aniso=true) const
 
double getValue (const EConsElem &econs, int iv1, int iv2) const
 
void nostatUpdate (CovInternal *covint)
 
- Public Member Functions inherited from ACov
 ACov (const ASpace *space=nullptr)
 
 ACov (const ACov &r)
 
ACovoperator= (const ACov &r)
 
virtual ~ACov ()
 
virtual bool isIndexable () const
 
virtual bool isNoStat () const
 
virtual double eval0 (int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 Calculate the covariance between two variables for 0-distance (stationary case)
 
virtual void eval0CovMatBiPointInPlace (MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 Calculate the matrix of covariances for 0-distance (stationary case)
 
virtual void addEval0CovMatBiPointInPlace (MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 
virtual double eval (const SpacePoint &p1, const SpacePoint &p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const =0
 Calculate the covariance between two variables and two points (general case)
 
virtual void evalCovMatBiPointInPlace (MatrixSquareGeneral &mat, const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr) const
 Calculate the matrix of covariances between two points (general case)
 
virtual void addEvalCovMatBiPointInPlace (MatrixSquareGeneral &mat, const SpacePoint &pwork1, const SpacePoint &pwork2, const CovCalcMode *mode) const
 
void evalCovKriging (MatrixSquareGeneral &mat, SpacePoint &pwork1, SpacePoint &pout, const CovCalcMode *mode=nullptr) const
 
virtual double evalCovOnSphere (double alpha, int degree=50, bool flagScaleDistance=false, const CovCalcMode *mode=nullptr) const
 
virtual VectorDouble evalSpectrumOnSphere (int n, bool flagNormDistance=false, bool flagCumul=false) const
 
virtual double evalSpectrum (const VectorDouble &freq, int ivar, int jvar) const
 
void optimizationSetTarget (const SpacePoint &pt) const
 
void optimizationPreProcess (const Db *db) const
 
void optimizationPreProcess (const std::vector< SpacePoint > &p) const
 
void optimizationPostProcess () const
 
virtual bool isOptimEnabled () const
 
VectorDouble eval (const std::vector< SpacePoint > &vec_p1, const std::vector< SpacePoint > &vec_p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral eval0Mat (const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalMat (const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr) const
 
virtual MatrixRectangular evalCovMatrixOptim (const Db *db1, const Db *db2, int ivar0=-1, int jvar0=-1, const VectorInt &nbgh1=VectorInt(), const VectorInt &nbgh2=VectorInt(), const CovCalcMode *mode=nullptr) const
 
virtual MatrixSquareSymmetric evalCovMatrixSymmetricOptim (const Db *db1, int ivar0=-1, const VectorInt &nbgh1=VectorInt(), const CovCalcMode *mode=nullptr) const
 
double evalIvarIpas (double step, const VectorDouble &dir=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalIvarIpasIncr (const VectorDouble &dincr, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
VectorDouble evalIvarNpas (const VectorDouble &vec_step, const VectorDouble &dir=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalNvarIpas (double step, const VectorDouble &dir=VectorDouble(), const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalNvarIpasIncr (const VectorDouble &dincr, const CovCalcMode *mode=nullptr) const
 
double evalIsoIvarIpas (double step, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
VectorDouble evalIsoIvarNpas (const VectorDouble &vec_step, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalIsoNvarIpas (double step, const CovCalcMode *mode=nullptr) const
 
double evalCvv (const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalCvvShift (const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &shift, const VectorDouble &angles=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalCvvM (const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const CovCalcMode *mode=nullptr) const
 
double evalCxv (const SpacePoint &p1, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalCxv (const Db *db, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalCxvM (const SpacePoint &p1, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), const CovCalcMode *mode=nullptr) const
 
VectorDouble evalPointToDb (const SpacePoint &p1, const Db *db2, int ivar=0, int jvar=0, bool useSel=true, const VectorInt &nbgh2=VectorInt(), const CovCalcMode *mode=nullptr) const
 
VectorDouble evalPointToDbAsSP (const std::vector< SpacePoint > &p1s, const SpacePoint &p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalAverageDbToDb (const Db *db1, const Db *db2, int ivar=0, int jvar=0, double eps=0., int seed=434132, const CovCalcMode *mode=nullptr) const
 
double evalAverageIncrToIncr (const VectorVectorDouble &d1, const VectorVectorDouble &d2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
double evalAveragePointToDb (const SpacePoint &p1, const Db *db2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixRectangular evalCovMatrix (const Db *db1_arg, const Db *db2_arg=nullptr, int ivar0=-1, int jvar0=-1, const VectorInt &nbgh1=VectorInt(), const VectorInt &nbgh2=VectorInt(), const CovCalcMode *mode=nullptr) const
 
MatrixSquareSymmetric evalCovMatrixSymmetric (const Db *db1, int ivar0, const VectorInt &nbgh1, const CovCalcMode *mode) const
 
MatrixSparseevalCovMatrixSparse (const Db *db1_arg, const Db *db2_arg=nullptr, int ivar0=-1, int jvar0=-1, const VectorInt &nbgh1=VectorInt(), const VectorInt &nbgh2=VectorInt(), const CovCalcMode *mode=nullptr, double eps=EPSILON3)
 
double extensionVariance (const Db *db, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0) const
 
double samplingDensityVariance (const Db *db, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0) const
 
double specificVolume (const Db *db, double mean, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0) const
 
double coefficientOfVariation (const Db *db, double volume, double mean, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0) const
 
double specificVolumeFromCoV (Db *db, double cov, double mean, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), int ivar=0, int jvar=0) const
 
void manage (const Db *db1, const Db *db2) const
 
void load (const SpacePoint &p, bool case1) const
 
void loadAndAddEvalCovMatBiPointInPlace (MatrixSquareGeneral &mat, const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr) const
 
double loadAndEval (const SpacePoint &p1, const SpacePoint &p2, int ivar, int jvar, const CovCalcMode *mode) const
 
- Public Member Functions inherited from ASpaceObject
 ASpaceObject (const ASpace *space=nullptr)
 
 ASpaceObject (const ASpace &space)
 
 ASpaceObject (const ASpaceObject &r)
 
ASpaceObjectoperator= (const ASpaceObject &r)
 
virtual ~ASpaceObject ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 AStringable interface.
 
const ASpacegetSpace () const
 Accessor to the current object space context.
 
bool isConsistent () const
 Indicate if I am consistent with my current space context.
 
VectorDouble getUnitaryVector () const
 Return unitary vector for the current space context.
 
unsigned int getNDim (int ispace=-1) const
 Shortcuts to ASpace methods.
 
const VectorDoublegetOrigin (int ispace=-1) const
 Return the current space context origin coordinates.
 
double getDistance (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the distance between two space points for the current space context.
 
VectorDouble getDistances (const SpacePoint &p1, const SpacePoint &p2) const
 Return all the distances (space composits) between two space points for the current space context.
 
VectorDouble getIncrement (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the increment vector between two space points for the current space context.
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 

Constructor & Destructor Documentation

◆ CovBase() [1/2]

CovBase::CovBase ( ACor cor = nullptr,
const MatrixSquareSymmetric sills = MatrixSquareSymmetric() 
)

◆ CovBase() [2/2]

CovBase::CovBase ( const CovBase r)
delete

◆ ~CovBase()

CovBase::~CovBase ( )
virtual

Member Function Documentation

◆ _optimizationPreProcess()

void CovBase::_optimizationPreProcess ( const std::vector< SpacePoint > &  p) const
overridevirtual

Transform a set of Space Points using the anisotropy tensor The set of resulting Space Points are stored as private member of this. Note that ALL samples are processed, independently from the presence of a selection or checking for heterotopy.

Parameters
pvector of SpacePoints

Reimplemented from ACov.

◆ attachNoStatDb()

void CovBase::attachNoStatDb ( const Db db)

◆ copyCovContext()

void CovBase::copyCovContext ( const CovContext ctxt)

◆ getCor()

ACor * CovBase::getCor ( )
inline

◆ getNSills()

int CovBase::getNSills ( ) const
inline

◆ getNVariables()

virtual int CovBase::getNVariables ( ) const
inlineoverridevirtual

ACov Interface.

Implements ACov.

◆ getSill() [1/2]

const MatrixSquareSymmetric & CovBase::getSill ( ) const
inline

◆ getSill() [2/2]

double CovBase::getSill ( int  ivar,
int  jvar 
) const

◆ getValue()

double CovBase::getValue ( const EConsElem &  econs,
int  iv1,
int  iv2 
) const

◆ informCoords()

VectorDouble CovBase::informCoords ( const VectorVectorDouble coords,
const EConsElem &  econs,
int  iv1 = 0,
int  iv2 = 0 
) const

◆ informDbIn()

void CovBase::informDbIn ( const Db dbin) const

◆ informDbInForSills()

void CovBase::informDbInForSills ( const Db dbin) const

◆ informDbOut()

void CovBase::informDbOut ( const Db dbout) const

◆ informDbOutForSills()

void CovBase::informDbOutForSills ( const Db dbout) const

◆ informMeshByApex()

void CovBase::informMeshByApex ( const AMesh amesh) const

◆ informMeshByApexForSills()

void CovBase::informMeshByApexForSills ( const AMesh amesh) const

◆ informMeshByMesh()

void CovBase::informMeshByMesh ( const AMesh amesh) const

◆ informMeshByMeshForSills()

void CovBase::informMeshByMeshForSills ( const AMesh amesh) const

◆ initSill()

void CovBase::initSill ( double  value = 0.)

◆ isConsistent()

bool CovBase::isConsistent ( const ASpace space) const
overridevirtual

Indicate if I am consistent with the provided space.

Implements ASpaceObject.

◆ isNoStatForVariance()

bool CovBase::isNoStatForVariance ( ) const
inline

◆ isOptimizationInitialized()

bool CovBase::isOptimizationInitialized ( const Db db = nullptr) const

Checks that the Optimization has already been initiated, by:

  • checking that the storage (for Sample Points projected in the Covariance rotation system) is already allocated
  • checking that the dimension of this storage is correct (only if 'db' is provided): in particular, this check is not necessary when freeing this storage.

◆ makeSillNoStatDb()

void CovBase::makeSillNoStatDb ( const String namecol,
int  ivar = 0,
int  jvar = 0,
const Db db = nullptr 
)

◆ makeSillNoStatFunctional()

void CovBase::makeSillNoStatFunctional ( const AFunctional func,
int  ivar = 0,
int  jvar = 0 
)

◆ makeSillStationary()

void CovBase::makeSillStationary ( int  ivar = 0,
int  jvar = 0 
)

◆ makeStationary()

void CovBase::makeStationary ( )

◆ nostatUpdate()

void CovBase::nostatUpdate ( CovInternal covint)

Update the Model in the case of Non-stationary parameters This requires the knowledge of the two end-points

Parameters
[in]covintInternal structure for non-stationarity or NULL (for stationary case)

◆ operator=()

CovBase & CovBase::operator= ( const CovBase r)
delete

◆ optimizationSetTargetByIndex()

void CovBase::optimizationSetTargetByIndex ( int  iech) const
overridevirtual

Define the Second Space Point as coinciding with the Input Space Point 'iech'. Note that, as the Input Space Points are already transformed in the basis of the current structure, it is just an assignment.

Parameters
iechRank of the sample among the recorded Space Points

Reimplemented from ACov.

◆ setContext()

void CovBase::setContext ( const CovContext ctxt)

◆ setCor()

void CovBase::setCor ( ACor cor)

◆ setSill() [1/4]

void CovBase::setSill ( const MatrixSquareSymmetric sill) const

Only valid when there is only one variable (in the context)

◆ setSill() [2/4]

void CovBase::setSill ( const VectorDouble sill) const

◆ setSill() [3/4]

void CovBase::setSill ( double  sill) const

◆ setSill() [4/4]

void CovBase::setSill ( int  ivar,
int  jvar,
double  sill 
) const

TODO : Test if sill matrix is positive definite (if not, generate a warning)

◆ updateCovByMesh()

void CovBase::updateCovByMesh ( int  imesh,
bool  aniso = true 
) const

◆ updateCovByPoints()

void CovBase::updateCovByPoints ( int  icas1,
int  iech1,
int  icas2,
int  iech2 
) const
overridevirtual

Tell if the use of Optimization is enabled or not.

Update the Model according to the Non-stationary parameters

Parameters
icas1Type of first Db: 1 for Input; 2 for Output
iech1Rank of the target within Db1 (or -1)
icas2Type of first Db: 1 for Input; 2 for Output
iech2Rank of the target within Dbout (or -2)

Reimplemented from ACov.


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