1.5.0
CCC
 
CovGradientNumerical Class Reference

#include <CovGradientNumerical.hpp>

Inheritance diagram for CovGradientNumerical:
ACovGradient CovAniso ACov ICloneable ASpaceObject AStringable

Detailed Description

Class dedicated to manipulating a variables and its derivatives. This feature is limited to the monovariate case

Public Member Functions

 CovGradientNumerical (const ECov &type, double ballRadius, const CovContext &ctxt)
 
 CovGradientNumerical (const CovGradientNumerical &r)
 
CovGradientNumericaloperator= (const CovGradientNumerical &r)
 
virtual ~CovGradientNumerical ()
 
virtual double eval0 (int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const override
 ICloneable interface. More...
 
virtual double eval (const SpacePoint &p1, const SpacePoint &p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const override
 
virtual double getBallRadius () const override
 
void evalZAndGradients (const SpacePoint &p1, const SpacePoint &p2, double &covVal, VectorDouble &covGp, VectorDouble &covGG, const CovCalcMode *mode=nullptr, bool flagGrad=false) const override
 
- Public Member Functions inherited from ACovGradient
 ACovGradient (const ECov &type, const CovContext &ctxt)
 
 ACovGradient (const ACovGradient &r)
 
 ACovGradient (const CovAniso &r)
 
ACovGradientoperator= (const ACovGradient &r)
 
virtual ~ACovGradient ()
 
- Public Member Functions inherited from CovAniso
 CovAniso (const ECov &type, const CovContext &ctxt)
 
 CovAniso (const String &symbol, const CovContext &ctxt)
 
 CovAniso (const ECov &type, double range, double param, double sill, const CovContext &ctxt, bool flagRange=true)
 
 CovAniso (const CovAniso &r)
 
CovAnisooperator= (const CovAniso &r)
 
virtual ~CovAniso ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable Interface. More...
 
virtual bool isConsistent (const ASpace *space) const override
 ASpaceObject Interface. More...
 
virtual int getNVariables () const override
 ACov Interface. More...
 
double evalCor (const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr, int ivar=0, int jvar=0) const
 
virtual void addEval0CovMatBiPointInPlace (MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const override
 
virtual double evalCovOnSphere (double alpha, int degree=50, bool flagScaleDistance=true, const CovCalcMode *mode=nullptr) const override
 
virtual VectorDouble evalSpectrumOnSphere (int n, bool flagNormDistance=false, bool flagCumul=false) const override
 
virtual double evalSpectrum (const VectorDouble &freq, int ivar=0, int jvar=0) const override
 
virtual double getIntegralRange (int ndisc, double hmax) const
 
virtual String getFormula () const
 
bool isOptimizationInitialized (const Db *db=nullptr) const
 
void _optimizationPreProcess (const std::vector< SpacePoint > &p) const override
 
void optimizationSetTargetByIndex (int iech) const override
 
void evalOptimInPlace (MatrixRectangular &res, const VectorInt &ivars, const VectorVectorInt &index, int ivar2=0, int icol=0, const CovCalcMode *mode=nullptr, bool flagSym=false) const
 
bool isValidForTurningBand () const
 
double simulateTurningBand (double t0, TurningBandOperate &operTB) const
 
bool isValidForSpectral () const
 
MatrixRectangular simulateSpectralOmega (int nb) const
 
void setContext (const CovContext &ctxt)
 
void setParam (double param)
 
void copyCovContext (const CovContext &ctxt)
 
void setNoStatFactor (double noStatFactor)
 
void setSill (double sill)
 
void setSill (const MatrixSquareSymmetric &sill)
 Only valid when there is only one variable (in the context) More...
 
void setSill (const VectorDouble &sill)
 
void setSill (int ivar, int jvar, double sill)
 
void initSill (double value=0.)
 
void setRangeIsotropic (double range)
 Practical range. More...
 
void setRange (int idim, double range)
 
void setRanges (const VectorDouble &ranges)
 
void setScale (double scale)
 
void setScale (int idim, double scale)
 Make the covariance isotropic. More...
 
void setScales (const VectorDouble &scales)
 
void setAnisoRotation (const Rotation &rot)
 
void setAnisoRotation (const VectorDouble &rot)
 
void setAnisoAngles (const VectorDouble &angles)
 
void setAnisoAngle (int idim, double angle)
 
void setRotationAnglesAndRadius (const VectorDouble &angles=VectorDouble(), const VectorDouble &ranges=VectorDouble(), const VectorDouble &scales=VectorDouble())
 
const MatrixSquareSymmetricgetSill () const
 
double getSill (int ivar, int jvar) const
 
double getSlope (int ivar, int jvar) const
 
VectorDouble getRanges () const
 
const RotationgetAnisoRotation () const
 
const VectorDoublegetScales () const
 
void setType (const ECov &type)
 
double getRange () const
 
double getScale () const
 
bool getFlagAniso () const
 
bool getFlagRotation () const
 
double getRange (int idim) const
 
double getScale (int idim) const
 
VectorDouble getAnisoAngles () const
 
const MatrixSquareGeneralgetAnisoRotMat () const
 
const MatrixSquareGeneralgetAnisoInvMat () const
 
VectorDouble getAnisoCoeffs () const
 
double getAnisoAngles (int idim) const
 
double getAnisoRotMat (int idim, int jdim) const
 
double getAnisoCoeffs (int idim) const
 
const CovContextgetContext () const
 
const ECov & getType () const
 
double getParam () const
 
double getScadef () const
 
double getParMax () const
 
int getMaxNDim () const
 
int getMinOrder () const
 
bool hasInt1D () const
 
bool hasInt2D () const
 
int hasRange () const
 
int hasParam () const
 
String getCovName () const
 
bool isIsotropic () const
 
bool isAsymptotic () const
 
bool hasRotation () const
 
const TensorgetAniso () const
 
void setAniso (const Tensor &aniso)
 
const ACovFuncgetCova () const
 
int getGradParamNumber () const
 
bool hasCovDerivative () const
 
bool hasCovOnSphere () const
 
bool hasSpectrumOnSphere () const
 
bool hasMarkovCoeffs () const
 
bool hasSpectrumOnRn () const
 
double normalizeOnSphere (int n=50) const
 
void attachNoStatDb (const Db *db)
 
void makeRangeNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr)
 
void makeScaleNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr)
 
void makeAngleNoStatDb (const String &namecol, int idim=0, const Db *db=nullptr)
 
void makeSillNoStatDb (const String &namecol, int ivar=0, int jvar=0, const Db *db=nullptr)
 
void makeTensorNoStatDb (const String &namecol, int idim=0, int jdim=0, const Db *db=nullptr)
 
void makeParamNoStatDb (const String &namecol, const Db *db=nullptr)
 
void makeRangeNoStatFunctional (const AFunctional *func, int idim=0)
 
void makeScaleNoStatFunctional (const AFunctional *func, int idim=0)
 
void makeAngleNoStatFunctional (const AFunctional *func, int idim=0)
 
void makeSillNoStatFunctional (const AFunctional *func, int ivar=0, int jvar=0)
 
void makeTensorNoStatFunctional (const AFunctional *func, int idim=0, int jdim=0)
 
void makeParamNoStatFunctional (const AFunctional *func)
 
void makeRangeStationary (int idim=0)
 
void makeScaleStationary (int idim=0)
 
void makeAngleStationary (int idim=0)
 
void makeSillStationary (int ivar=0, int jvar=0)
 
void makeTensorStationary (int idim, int jdim)
 
void makeParamStationary ()
 
void makeStationary ()
 
int getNAngles () const
 
int getNRanges () const
 
int getNScales () const
 
int getNSills () const
 
bool isNoStatForParam () const
 
bool isNoStatForTensor () const
 
bool isNoStatForAnisotropy () const
 
bool isNoStatForVariance () const
 
bool isNoStatForRotation () const
 
VectorDouble evalCovOnSphereVec (const VectorDouble &alpha, int degree=50, bool flagScaleDistance=false, const CovCalcMode *mode=nullptr) const
 
Array evalCovFFT (const VectorDouble &hmax, int N=128, int ivar=0, int jvar=0) const
 
VectorDouble getMarkovCoeffs () const
 
void setMarkovCoeffs (const VectorDouble &coeffs)
 
void setMarkovCoeffsBySquaredPolynomials (VectorDouble coeffs1, VectorDouble coeffs2, double eps=0)
 
void computeMarkovCoeffs ()
 
double getCorrec () const
 
double getFullCorrec () const
 
int getDimensionNumber () const
 
void nostatUpdate (CovInternal *covint)
 
CovAnisocreateReduce (const VectorInt &validVars) const
 
bool isNoStat () const override
 
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 informMeshByMeshForAnisotropy (const AMesh *amesh) const
 
void informMeshByApexForAnisotropy (const AMesh *amesh) const
 
void informDbInForAnisotropy (const Db *dbin) const
 
void informDbOutForAnisotropy (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) override
 Tell if the use of Optimization is enabled or not. More...
 
void updateCovByMesh (int imesh, bool aniso=true)
 
double getValue (const EConsElem &econs, int iv1, int iv2) const
 
void setOptimEnabled (bool flag) const
 
- 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 void eval0CovMatBiPointInPlace (MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 Calculate the matrix of covariances for 0-distance (stationary case) More...
 
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) More...
 
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
 
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
 
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)
 
MatrixSquareSymmetric evalCovMatrixSymmetric (const Db *db1, int ivar0, const VectorInt &nbgh1, const CovCalcMode *mode)
 
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 ()
 
const ASpacegetSpace () const
 Accessor to the current object space context. More...
 
bool isConsistent () const
 Indicate if I am consistent with my current space context. More...
 
VectorDouble getUnitaryVector () const
 Return unitary vector for the current space context. More...
 
unsigned int getNDim (int ispace=-1) const
 Shortcuts to ASpace methods. More...
 
const VectorDoublegetOrigin (int ispace=-1) const
 Return the current space context origin coordinates. More...
 
double getDistance (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the distance between two space points for the current space context. More...
 
VectorDouble getDistances (const SpacePoint &p1, const SpacePoint &p2) const
 Return all the distances (space composits) between two space points for the current space context. More...
 
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. More...
 
- 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
 
- Public Member Functions inherited from ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from CovAniso
static CovAnisocreateIsotropic (const CovContext &ctxt, const ECov &type, double range, double sill=1., double param=1., bool flagRange=true)
 
static CovAnisocreateAnisotropic (const CovContext &ctxt, const ECov &type, const VectorDouble &ranges, double sill=1., double param=1., const VectorDouble &angles=VectorDouble(), bool flagRange=true)
 
static CovAnisocreateIsotropicMulti (const CovContext &ctxt, const ECov &type, double range, const MatrixSquareSymmetric &sills, double param=1., bool flagRange=true)
 
static CovAnisocreateAnisotropicMulti (const CovContext &ctxt, const ECov &type, const VectorDouble &ranges, const MatrixSquareSymmetric &sills, double param=1., const VectorDouble &angles=VectorDouble(), bool flagRange=true)
 

Constructor & Destructor Documentation

◆ CovGradientNumerical() [1/2]

CovGradientNumerical::CovGradientNumerical ( const ECov &  type,
double  ballRadius,
const CovContext ctxt 
)

◆ CovGradientNumerical() [2/2]

CovGradientNumerical::CovGradientNumerical ( const CovGradientNumerical r)

◆ ~CovGradientNumerical()

CovGradientNumerical::~CovGradientNumerical ( )
virtual

Member Function Documentation

◆ eval()

double CovGradientNumerical::eval ( const SpacePoint p1,
const SpacePoint p2,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
overridevirtual

Calculate the covariance between variable (Z) and a gradient component (Gi)

Parameters
ivar0 for the variable (Z); idim=ivar-1 for the gradient G_idim
jvar0 for the variable (Z); idim=ivar-1 for the gradient G_idim
p1First point
p2Second point
modeCovCalcMode structure
Returns

Reimplemented from CovAniso.

◆ eval0()

double CovGradientNumerical::eval0 ( int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
overridevirtual

ICloneable interface.

Reimplemented from CovAniso.

◆ evalZAndGradients()

void CovGradientNumerical::evalZAndGradients ( const SpacePoint p1,
const SpacePoint p2,
double &  covVal,
VectorDouble covGp,
VectorDouble covGG,
const CovCalcMode mode = nullptr,
bool  flagGrad = false 
) const
overridevirtual

Evaluates the covariance and gradient components This function is restricted to the monovariate case This function is limited to the only functions for which the covariance(Point-Gradient) and covariance(Gradient-Gradient) has been coded: i.e. Cubic or Gaussian, in addition to the nugget effect.

If 'flag_grad' == 0, then the output array 'covGG' is not filled.

Parameters
p1First point of the Increment
p2Second point of the increment
covValCovariance value
covGpCovariance <G[i](x0+x,y0+y,z0+z), P(x0,y0,z0)> (dim=3)
covGGCovariance <G[i](x0+x,y0+y,z0+z), G[j](x0,y0,z0)> (dim=3)
modeCovCalcMode structure
flagGradtrue if the Gradient must be calculated
Remarks
: The returned arguments covVal, covGp and covGG are incremented here.
: They must have been initialized beforehand

Implements ACovGradient.

◆ getBallRadius()

virtual double CovGradientNumerical::getBallRadius ( ) const
inlineoverridevirtual

Reimplemented from CovAniso.

◆ operator=()

CovGradientNumerical & CovGradientNumerical::operator= ( const CovGradientNumerical r)

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