gstlearn  1.0.0
CCC
Model Class Reference

TODO : Create AModel which inherits from ACov ? More...

#include <Model.hpp>

Inheritance diagram for Model:
AStringable ASerializable ICloneable

Public Member Functions

 Model (const CovContext &ctxt=CovContext())
 
 Model (int nvar, int ndim=2)
 
 Model (const Model &m)
 
Modeloperator= (const Model &m)
 
virtual ~Model ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable interface. More...
 
int resetFromDb (const Db *db)
 
void setCovList (const ACovAnisoList *covalist)
 
void addCov (const CovAniso *cov)
 
void addCovFromParam (const ECov &type, double range=0., double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const VectorDouble &sills=VectorDouble(), const VectorDouble &angles=VectorDouble(), bool flagRange=true)
 
void delCova (int icov)
 
void delAllCovas ()
 
void setDriftList (const DriftList *driftlist)
 
void setDriftIRF (int order=0, int nfex=0)
 
void addDrift (const ADrift *drift)
 
void setDrifts (const VectorString &driftSymbols)
 
void delDrift (int rank)
 
void delAllDrifts ()
 
int setAnam (const AAnam *anam, const VectorInt &strcnt=VectorInt())
 
int unsetAnam ()
 
bool isFlagGradient () const
 
bool isFlagGradientNumerical () const
 
bool isFlagGradientFunctional () const
 
bool isFlagLinked () const
 
CovAniso extractCova (int icov) const
 
void switchToGradient ()
 
const ACovAnisoListgetCovAnisoList () const
 TODO : to be removed (encapsulation of ACovAnisoList) More...
 
const CovAnisogetCova (unsigned int icov) const
 
CovAnisogetCova (unsigned int icov)
 
int getCovaNumber () const
 
const ECov & getCovaType (int icov) const
 
const MatrixSquareSymmetric getSillValues (int icov) const
 
double getSill (int icov, int ivar, int jvar) const
 
double getParam (int icov) const
 
bool isCovaFiltered (int icov) const
 
bool isStationary () const
 
String getCovName (int icov) const
 
int getGradParamNumber (int icov) const
 
double getTotalSill (int ivar, int jvar) const
 
double getBallRadius () const
 
const AnamHermitegetAnamHermite () const
 
double getMaximumDistance () const
 
int getCovaMinIRFOrder () const
 
bool hasAnam () const
 
const AAnamgetAnam () const
 
bool isChangeSupportDefined () const
 
void normalize (double sill)
 
bool hasNugget () const
 
VectorInt getActiveCovList () const
 
VectorInt getAllActiveCovList () const
 
void setTapeRange (double range)
 
void setIsOptimEnabled (bool flagOptim)
 
bool isOptimEnabled () const
 
double eval0 (int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral eval0Nvar (const CovCalcMode *mode=nullptr) const
 
void eval0MatInPlace (MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 
double eval (const SpacePoint &p1, const SpacePoint &p2, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalNvarIpas (double step, const VectorDouble &dir=VectorDouble(), const VectorDouble &center=VectorDouble(), const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalMat (const SpacePoint &p1, const SpacePoint &p2, const CovCalcMode *mode=nullptr) const
 
void evalMatInPlace (const SpacePoint &p1, const SpacePoint &p2, MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 
MatrixSquareGeneral evalNvarIpasIncr (const VectorDouble &dincr, const CovCalcMode *mode=nullptr) const
 
VectorDouble evalIvarNpas (const VectorDouble &vec_step, const VectorDouble &dir=VectorDouble(), int ivar=0, int jvar=0, const VectorDouble &center=VectorDouble(), const CovCalcMode *mode=nullptr) const
 
double evalIvarIpas (double step, const VectorDouble &dir=VectorDouble(), int ivar=0, int jvar=0, const VectorDouble &center=VectorDouble(), 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)
 
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)
 
MatrixSquareGeneral evalCxvM (const SpacePoint &p1, const VectorDouble &ext, const VectorInt &ndisc, const VectorDouble &angles=VectorDouble(), const VectorDouble &x0=VectorDouble(), const CovCalcMode *mode=nullptr)
 
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)
 
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, 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)
 
MatrixRectangular evalCovMatrix (const Db *db1, const Db *db2=nullptr, int ivar=0, int jvar=0, const VectorInt &nbgh1=VectorInt(), const VectorInt &nbgh2=VectorInt(), const CovCalcMode *mode=nullptr)
 
void evalMatOptimInPlace (int iech1, int iech2, MatrixSquareGeneral &mat, const CovCalcMode *mode=nullptr) const
 
VectorVectorDouble evalCovMatrixOptim (const Db *db1, const Db *db2=nullptr, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr)
 
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)
 
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 evalZAndGradients (const SpacePoint &p1, const SpacePoint &p2, double &covVal, VectorDouble &covGp, VectorDouble &covGG, const CovCalcMode *mode=nullptr, bool flagGrad=false) const
 
void evalZAndGradients (const VectorDouble &vec, double &covVal, VectorDouble &covGp, VectorDouble &covGG, const CovCalcMode *mode=nullptr, bool flagGrad=false) const
 
void setSill (int icov, int ivar, int jvar, double value)
 
void setCovaFiltered (int icov, bool filtered)
 
void setActiveFactor (int iclass)
 
int getActiveFactor () const
 
int getAnamNClass () const
 
const DriftListgetDriftList () const
 TODO : to be removed (encapsulation of DriftList) More...
 
const ADriftgetDrift (int il) const
 
ADriftgetDrift (int il)
 
int getDriftNumber () const
 
int getExternalDriftNumber () const
 
int getRankFext (int il) const
 
const VectorDoublegetDriftCoefs () const
 
double getDriftCoef (int ivar, int il, int ib) const
 
int getDriftEquationNumber () const
 
bool isDriftFiltered (unsigned int il) const
 
bool isDriftDefined (const VectorInt &powers, int rank_fex=0) const
 
bool isDriftDifferentDefined (const VectorInt &powers, int rank_fex=-1) const
 
int getDriftMaxIRFOrder (void) const
 
void resetDriftCoef ()
 
void setDriftCoef (int ivar, int il, int ib, double coeff)
 
void setDriftFiltered (int il, bool filtered)
 
VectorDouble getDriftByColumn (const Db *db, int ib, bool useSel=true)
 
VectorVectorDouble getDrifts (const Db *db, bool useSel=true)
 
double evalDrift (const Db *db, int iech, int il, const ECalcMember &member=ECalcMember::fromKey("LHS")) const
 
VectorDouble evalDriftVec (const Db *db, int iech, const ECalcMember &member=ECalcMember::fromKey("LHS")) const
 
VectorDouble evalDrifts (const Db *db, const VectorDouble &coeffs, int ivar=0, bool useSel=false) const
 
void evalDriftVecInPlace (const Db *db, int iech, const ECalcMember &member, VectorDouble &drftab) const
 
double _evalDriftCoef (const Db *db, int iech, int ivar, const double *coef) const
 
const CovContextgetContext () const
 TODO : to be removed (encapsulation of Context) More...
 
const VectorDoublegetMeans () const
 
double getMean (int ivar) const
 
const VectorDoublegetCovar0s () const
 
double getCovar0 (int ivar, int jvar) const
 
double getField () const
 
int getDimensionNumber () const
 
void setMeans (const VectorDouble &mean)
 
void setMean (double mean, int ivar=0)
 
void setCovar0s (const VectorDouble &covar0)
 
void setCovar0 (int ivar, int jvar, double covar0)
 
void setField (double field)
 
const ANoStatgetNoStat () const
 Shortcut for Non-stationary. More...
 
int addNoStat (const ANoStat *anostat)
 
int isNoStat () const
 
int getNoStatElemNumber () const
 
int addNoStatElem (int igrf, int icov, const EConsElem &type, int iv1, int iv2)
 
int addNoStatElems (const VectorString &codes)
 
CovParamId getCovParamId (int ipar) const
 
const EModelProperty & getCovMode () const
 
Modelduplicate () const
 
Modelreduce (const VectorInt &validVars) const
 
int getVariableNumber () const
 
int hasExternalCov () const
 
MatrixSquareSymmetric covMatrixM (Db *db1, Db *db2=nullptr, int ivar=-1, int jvar=-1, const CovCalcMode *mode=nullptr)
 
VectorDouble covMatrixV (Db *db1, Db *db2=nullptr, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr)
 
void covMatrix (VectorDouble &covmat, Db *db1, Db *db2=nullptr, int ivar=0, int jvar=0, const CovCalcMode *mode=nullptr)
 
VectorDouble sample (const VectorDouble &hh, int ivar=0, int jvar=0, VectorDouble codir=VectorDouble(), const CovCalcMode *mode=nullptr)
 
VectorDouble sampleUnitary (const VectorDouble &hh, int ivar=0, int jvar=0, VectorDouble codir=VectorDouble(), const CovCalcMode *mode=nullptr)
 
VectorDouble envelop (const VectorDouble &hh, int ivar=0, int jvar=0, int isign=1, VectorDouble codir=VectorDouble(), const CovCalcMode *mode=nullptr)
 
int fitFromCovIndices (Vario *vario, const VectorECov &types=ECov::fromKeys({"EXPONENTIAL"}), const Constraints &constraints=Constraints(), Option_VarioFit optvar=Option_VarioFit(), Option_AutoFit mauto=Option_AutoFit(), bool verbose=false)
 
int fit (Vario *vario, const VectorECov &types=ECov::fromKeys({"SPHERICAL"}), const Constraints &constraints=Constraints(), Option_VarioFit optvar=Option_VarioFit(), Option_AutoFit mauto=Option_AutoFit(), bool verbose=false)
 
int fitFromVMap (DbGrid *dbmap, const VectorECov &types=ECov::fromKeys({"SPHERICAL"}), const Constraints &constraints=Constraints(), Option_VarioFit optvar=Option_VarioFit(), Option_AutoFit mauto=Option_AutoFit(), bool verbose=false)
 
double gofToVario (const Vario *vario, bool verbose=true)
 
void gofDisplay (double gof, bool byValue=true, const VectorDouble &thresholds={2., 5., 10., 100})
 
VectorECov initCovList (const VectorInt &covranks)
 
bool isValid () const
 
- 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 ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
virtual ~ASerializable ()
 
bool deserialize (std::istream &is, bool verbose=true)
 
bool serialize (std::ostream &os, bool verbose=true) const
 
bool dumpToNF (const String &neutralFilename, bool verbose=false) const
 
- Public Member Functions inherited from ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 

Static Public Member Functions

static Modelcreate (const CovContext &ctxt=CovContext())
 
static ModelcreateFromEnvironment (int nvar, int ndim=2)
 
static ModelcreateFromParam (const ECov &type=ECov::fromKey("NUGGET"), double range=1., double sill=1., double param=1., const VectorDouble &ranges=VectorDouble(), const VectorDouble &sills=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ASpace *space=nullptr, bool flagRange=true)
 
static ModelcreateFromDb (const Db *db)
 
static ModelcreateFromNF (const String &neutralFilename, bool verbose=true)
 
- Static Public Member Functions inherited from ASerializable
static String buildFileName (int status, const String &filename, bool ensureDirExist=false)
 
static String getHomeDirectory (const String &sub="")
 
static String getWorkingDirectory ()
 
static String getTestData (const String &subdir, const String &filename)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setContainerName (bool useDefault, const String &containerName="", bool verbose=false)
 
static void unsetContainerName ()
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Protected Member Functions

virtual bool _deserialize (std::istream &is, bool verbose=false) override
 Interface to ASerializable. More...
 
virtual bool _serialize (std::ostream &os, bool verbose=false) const override
 
String _getNFName () const override
 
const ACovAnisoList_castInCovAnisoListConst (int icov=-1) const
 
ACovAnisoList_castInCovAnisoList (int icov=-1)
 
- Protected Member Functions inherited from ASerializable
bool _fileOpenWrite (const String &filename, std::ofstream &os, bool verbose=false) const
 
bool _fileOpenRead (const String &filename, std::ifstream &is, bool verbose=false) const
 

Private Member Functions

void _clear ()
 
void _create ()
 
void _copyCovContext ()
 

Private Attributes

ACov_cova
 
DriftList_driftList
 
CovContext _ctxt
 

Additional Inherited Members

- Static Protected Member Functions inherited from ASerializable
static bool _commentWrite (std::ostream &os, const String &comment)
 
template<typename T >
static bool _recordWrite (std::ostream &os, const String &title, const T &val)
 
template<typename T >
static bool _recordWriteVec (std::ostream &os, const String &title, const VectorT< T > &vec)
 
template<typename T >
static bool _recordRead (std::istream &is, const String &title, T &val)
 
template<typename T >
static bool _recordReadVec (std::istream &is, const String &title, VectorT< T > &vec, int nvalues)
 
static bool _onlyBlanks (char *string)
 
static bool _tableRead (std::istream &is, const String &string, int ntab, double *tab)
 
static bool _tableWrite (std::ostream &os, const String &string, int ntab, const VectorDouble &tab)
 

Detailed Description

TODO : Create AModel which inherits from ACov ?

Constructor & Destructor Documentation

◆ Model() [1/3]

Model::Model ( const CovContext ctxt = CovContext())

◆ Model() [2/3]

Model::Model ( int  nvar,
int  ndim = 2 
)

◆ Model() [3/3]

Model::Model ( const Model m)

◆ ~Model()

Model::~Model ( )
virtual

Member Function Documentation

◆ _castInCovAnisoList()

ACovAnisoList * Model::_castInCovAnisoList ( int  icov = -1)
protected

◆ _castInCovAnisoListConst()

const ACovAnisoList * Model::_castInCovAnisoListConst ( int  icov = -1) const
protected

This internal function tries to cast the member '_cova' into a pointer to ACovAnisoList and checks the validity of the argument 'icov' which gives the rank within this list

Parameters
icovRank of the CovAniso (to be checked if >= 0)
Returns
'nullptr' if not valid cast (the error message is printed internally)

◆ _clear()

void Model::_clear ( )
private

◆ _copyCovContext()

void Model::_copyCovContext ( )
private

◆ _create()

void Model::_create ( )
private

◆ _deserialize()

bool Model::_deserialize ( std::istream &  is,
bool  verbose = false 
)
overrideprotectedvirtual

Interface to ASerializable.

TODO : Force SpaceRN creation (deserialization doesn't know yet how to manage other space types)

Implements ASerializable.

◆ _evalDriftCoef()

double Model::_evalDriftCoef ( const Db db,
int  iech,
int  ivar,
const double *  coef 
) const

Evaluate the drift with a given set of coefficients

Parameters
[in]dbDb structure
[in]iechRank of the sample
[in]ivarRank of the variable
[in]coefArray of coefficients

◆ _getNFName()

String Model::_getNFName ( ) const
inlineoverrideprotectedvirtual

Implements ASerializable.

◆ _serialize()

bool Model::_serialize ( std::ostream &  os,
bool  verbose = false 
) const
overrideprotectedvirtual

Implements ASerializable.

◆ addCov()

void Model::addCov ( const CovAniso cov)

◆ addCovFromParam()

void Model::addCovFromParam ( const ECov &  type,
double  range = 0.,
double  sill = 1.,
double  param = 1.,
const VectorDouble ranges = VectorDouble(),
const VectorDouble sills = VectorDouble(),
const VectorDouble angles = VectorDouble(),
bool  flagRange = true 
)

◆ addDrift()

void Model::addDrift ( const ADrift drift)

◆ addNoStat()

int Model::addNoStat ( const ANoStat anostat)

Define Non-stationary parameters

Parameters
anostatANoStat pointer will be duplicated
Returns
Error return code

◆ addNoStatElem()

int Model::addNoStatElem ( int  igrf,
int  icov,
const EConsElem &  type,
int  iv1,
int  iv2 
)

◆ addNoStatElems()

int Model::addNoStatElems ( const VectorString codes)

◆ coefficientOfVariation()

double Model::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
inline

◆ covMatrix()

void Model::covMatrix ( VectorDouble covmat,
Db db1,
Db db2 = nullptr,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
)

Calculate the covariance matrix between active samples of Db1 and active samples of Db2.

Parameters
covmatReturned matrix (returned as a vector).
db1First Data Base
db2Second Data Base (if not provided, the first Db is provided instead)
ivarRank of the first variable (all variables if not defined)
jvarRank of the second variable (all variables if not defined)
modeCovCalcMode structure
Remarks
The returned argument must have been dimensioned beforehand to (nvar * nechA)^2 where:
-nvar stands for the number of (active) variables
-nechA stands for the number of active samples

◆ covMatrixM()

MatrixSquareSymmetric Model::covMatrixM ( Db db1,
Db db2 = nullptr,
int  ivar = -1,
int  jvar = -1,
const CovCalcMode mode = nullptr 
)

◆ covMatrixV()

VectorDouble Model::covMatrixV ( Db db1,
Db db2 = nullptr,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
)

◆ create()

Model * Model::create ( const CovContext ctxt = CovContext())
static

◆ createFromDb()

Model * Model::createFromDb ( const Db db)
static

◆ createFromEnvironment()

Model * Model::createFromEnvironment ( int  nvar,
int  ndim = 2 
)
static

◆ createFromNF()

Model * Model::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

◆ createFromParam()

Model * Model::createFromParam ( const ECov &  type = ECov::fromKey("NUGGET"),
double  range = 1.,
double  sill = 1.,
double  param = 1.,
const VectorDouble ranges = VectorDouble(),
const VectorDouble sills = VectorDouble(),
const VectorDouble angles = VectorDouble(),
const ASpace space = nullptr,
bool  flagRange = true 
)
static

◆ delAllCovas()

void Model::delAllCovas ( )

◆ delAllDrifts()

void Model::delAllDrifts ( )

◆ delCova()

void Model::delCova ( int  icov)

◆ delDrift()

void Model::delDrift ( int  rank)

◆ duplicate()

Model * Model::duplicate ( ) const

◆ envelop()

VectorDouble Model::envelop ( const VectorDouble hh,
int  ivar = 0,
int  jvar = 0,
int  isign = 1,
VectorDouble  codir = VectorDouble(),
const CovCalcMode mode = nullptr 
)

◆ eval()

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

◆ eval0()

double Model::eval0 ( int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
inline

◆ eval0MatInPlace()

void Model::eval0MatInPlace ( MatrixSquareGeneral mat,
const CovCalcMode mode = nullptr 
) const
inline

◆ eval0Nvar()

MatrixSquareGeneral Model::eval0Nvar ( const CovCalcMode mode = nullptr) const
inline

◆ evalAverageDbToDb()

double Model::evalAverageDbToDb ( const Db db1,
const Db db2,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalAverageIncrToIncr()

double Model::evalAverageIncrToIncr ( const VectorVectorDouble d1,
const VectorVectorDouble d2,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalAveragePointToDb()

double Model::evalAveragePointToDb ( const SpacePoint p1,
const Db db2,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
)
inline

◆ evalCovMatrix()

MatrixRectangular Model::evalCovMatrix ( const Db db1,
const Db db2 = nullptr,
int  ivar = 0,
int  jvar = 0,
const VectorInt nbgh1 = VectorInt(),
const VectorInt nbgh2 = VectorInt(),
const CovCalcMode mode = nullptr 
)
inline

◆ evalCovMatrixOptim()

VectorVectorDouble Model::evalCovMatrixOptim ( const Db db1,
const Db db2 = nullptr,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
)

◆ evalCvv()

double Model::evalCvv ( const VectorDouble ext,
const VectorInt ndisc,
const VectorDouble angles = VectorDouble(),
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalCvvM()

MatrixSquareGeneral Model::evalCvvM ( const VectorDouble ext,
const VectorInt ndisc,
const VectorDouble angles = VectorDouble(),
const CovCalcMode mode = nullptr 
)
inline

◆ evalCvvShift()

double Model::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
inline

◆ evalCxv()

double Model::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 
)
inline

◆ evalCxvM()

MatrixSquareGeneral Model::evalCxvM ( const SpacePoint p1,
const VectorDouble ext,
const VectorInt ndisc,
const VectorDouble angles = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
const CovCalcMode mode = nullptr 
)
inline

◆ evalDrift()

double Model::evalDrift ( const Db db,
int  iech,
int  il,
const ECalcMember &  member = ECalcMember::fromKey("LHS") 
) const

Evaluate a given drift function for a given sample

Parameters
dbDb structure
iechRank of the target sample
ilRank of the drift function
memberMember type (used to check filtering)
Returns

◆ evalDrifts()

VectorDouble Model::evalDrifts ( const Db db,
const VectorDouble coeffs,
int  ivar = 0,
bool  useSel = false 
) const

A vector of the drift evaluation

Parameters
dbDb structure
coeffsVector of drift coefficients
ivarVariable rank (used for constant drift value)
useSelWhen TRUE, only non masked samples are returned
Returns
The vector of values
Remarks
When no drift is defined, a vector is returned filled to mean

◆ evalDriftVec()

VectorDouble Model::evalDriftVec ( const Db db,
int  iech,
const ECalcMember &  member = ECalcMember::fromKey("LHS") 
) const

◆ evalDriftVecInPlace()

void Model::evalDriftVecInPlace ( const Db db,
int  iech,
const ECalcMember &  member,
VectorDouble drftab 
) const

◆ evalIvarIpas()

double Model::evalIvarIpas ( double  step,
const VectorDouble dir = VectorDouble(),
int  ivar = 0,
int  jvar = 0,
const VectorDouble center = VectorDouble(),
const CovCalcMode mode = nullptr 
) const
inline

◆ evalIvarNpas()

VectorDouble Model::evalIvarNpas ( const VectorDouble vec_step,
const VectorDouble dir = VectorDouble(),
int  ivar = 0,
int  jvar = 0,
const VectorDouble center = VectorDouble(),
const CovCalcMode mode = nullptr 
) const
inline

◆ evalMat()

MatrixSquareGeneral Model::evalMat ( const SpacePoint p1,
const SpacePoint p2,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalMatInPlace()

void Model::evalMatInPlace ( const SpacePoint p1,
const SpacePoint p2,
MatrixSquareGeneral mat,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalMatOptimInPlace()

void Model::evalMatOptimInPlace ( int  iech1,
int  iech2,
MatrixSquareGeneral mat,
const CovCalcMode mode = nullptr 
) const

◆ evalNvarIpas()

MatrixSquareGeneral Model::evalNvarIpas ( double  step,
const VectorDouble dir = VectorDouble(),
const VectorDouble center = VectorDouble(),
const CovCalcMode mode = nullptr 
) const
inline

◆ evalNvarIpasIncr()

MatrixSquareGeneral Model::evalNvarIpasIncr ( const VectorDouble dincr,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalPointToDb()

VectorDouble Model::evalPointToDb ( const SpacePoint p1,
const Db db2,
int  ivar = 0,
int  jvar = 0,
bool  useSel = true,
const VectorInt nbgh2 = VectorInt(),
const CovCalcMode mode = nullptr 
)
inline

◆ evalPointToDbAsSP()

VectorDouble Model::evalPointToDbAsSP ( const std::vector< SpacePoint > &  p1s,
const SpacePoint p2,
int  ivar = 0,
int  jvar = 0,
const CovCalcMode mode = nullptr 
) const
inline

◆ evalZAndGradients() [1/2]

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

◆ evalZAndGradients() [2/2]

void Model::evalZAndGradients ( const VectorDouble vec,
double &  covVal,
VectorDouble covGp,
VectorDouble covGG,
const CovCalcMode mode = nullptr,
bool  flagGrad = false 
) const

◆ extensionVariance()

double Model::extensionVariance ( const Db db,
const VectorDouble ext,
const VectorInt ndisc,
const VectorDouble angles = VectorDouble(),
const VectorDouble x0 = VectorDouble(),
int  ivar = 0,
int  jvar = 0 
)
inline

◆ extractCova()

CovAniso Model::extractCova ( int  icov) const

◆ fit()

int Model::fit ( Vario vario,
const VectorECov types = ECov::fromKeys({"SPHERICAL"}),
const Constraints constraints = Constraints(),
Option_VarioFit  optvar = Option_VarioFit(),
Option_AutoFit  mauto = Option_AutoFit(),
bool  verbose = false 
)

Automatic Fitting procedure from an experimental Variogram

Parameters
varioExperimental variogram to be fitted
typesVector of ECov
constraintsSet of Constraints
optvarSet of options
mautoSpecial parameters for Automatic fitting procedure (instance of Option_AutoFit), for exemple wmode (type of weighting function)
verboseVerbose option
Returns
0 if no error, 1 otherwise

TODO : What to do with that ?

◆ fitFromCovIndices()

int Model::fitFromCovIndices ( Vario vario,
const VectorECov types = ECov::fromKeys({"EXPONENTIAL"}),
const Constraints constraints = Constraints(),
Option_VarioFit  optvar = Option_VarioFit(),
Option_AutoFit  mauto = Option_AutoFit(),
bool  verbose = false 
)

Automatic Fitting procedure

Parameters
varioExperimental variogram to be fitted
typesVector of ECov integer values
constraintsSet of Constraints
optvarSet of options
mautoSpecial parameters for Automatic fitting procedure
verboseVerbose option
Returns
0 if no error, 1 otherwise

TODO : What to do with that ?

◆ fitFromVMap()

int Model::fitFromVMap ( DbGrid dbmap,
const VectorECov types = ECov::fromKeys({"SPHERICAL"}),
const Constraints constraints = Constraints(),
Option_VarioFit  optvar = Option_VarioFit(),
Option_AutoFit  mauto = Option_AutoFit(),
bool  verbose = false 
)

Automatic Fitting procedure from A Variogram Map stored on a DbGrid

Parameters
dbmapDbGrid containing the Variogram Map
typesVector of ECov
constraintsSet of Constraints
optvarSet of options
mautoSpecial parameters for Automatic fitting procedure (instance of Option_AutoFit), for exemple wmode (type of weighting function)
verboseVerbose option
Returns
0 if no error, 1 otherwise

◆ getActiveCovList()

VectorInt Model::getActiveCovList ( ) const

◆ getActiveFactor()

int Model::getActiveFactor ( ) const

◆ getAllActiveCovList()

VectorInt Model::getAllActiveCovList ( ) const

◆ getAnam()

const AAnam * Model::getAnam ( ) const

◆ getAnamHermite()

const AnamHermite * Model::getAnamHermite ( ) const

◆ getAnamNClass()

int Model::getAnamNClass ( ) const

◆ getBallRadius()

double Model::getBallRadius ( ) const

Returns the Ball radius (from the first covariance of _covaList)

Returns
Value of the Ball Radius (if defined, i.e. for Numerical Gradient calculation)

◆ getContext()

const CovContext& Model::getContext ( ) const
inline

TODO : to be removed (encapsulation of Context)

◆ getCova() [1/2]

CovAniso * Model::getCova ( unsigned int  icov)

◆ getCova() [2/2]

const CovAniso * Model::getCova ( unsigned int  icov) const

◆ getCovaMinIRFOrder()

int Model::getCovaMinIRFOrder ( ) const

◆ getCovAnisoList()

const ACovAnisoList * Model::getCovAnisoList ( ) const

TODO : to be removed (encapsulation of ACovAnisoList)

◆ getCovaNumber()

int Model::getCovaNumber ( ) const

◆ getCovar0()

double Model::getCovar0 ( int  ivar,
int  jvar 
) const
inline

◆ getCovar0s()

const VectorDouble& Model::getCovar0s ( ) const
inline

◆ getCovaType()

const ECov & Model::getCovaType ( int  icov) const

◆ getCovMode()

const EModelProperty & Model::getCovMode ( ) const

◆ getCovName()

String Model::getCovName ( int  icov) const

◆ getCovParamId()

CovParamId Model::getCovParamId ( int  ipar) const

◆ getDimensionNumber()

int Model::getDimensionNumber ( ) const
inline

◆ getDrift() [1/2]

ADrift * Model::getDrift ( int  il)

◆ getDrift() [2/2]

const ADrift * Model::getDrift ( int  il) const

◆ getDriftByColumn()

VectorDouble Model::getDriftByColumn ( const Db db,
int  ib,
bool  useSel = true 
)

◆ getDriftCoef()

double Model::getDriftCoef ( int  ivar,
int  il,
int  ib 
) const

◆ getDriftCoefs()

const VectorDouble & Model::getDriftCoefs ( ) const

◆ getDriftEquationNumber()

int Model::getDriftEquationNumber ( ) const

◆ getDriftList()

const DriftList * Model::getDriftList ( ) const

TODO : to be removed (encapsulation of DriftList)

◆ getDriftMaxIRFOrder()

int Model::getDriftMaxIRFOrder ( void  ) const

◆ getDriftNumber()

int Model::getDriftNumber ( ) const

◆ getDrifts()

VectorVectorDouble Model::getDrifts ( const Db db,
bool  useSel = true 
)

◆ getExternalDriftNumber()

int Model::getExternalDriftNumber ( ) const

◆ getField()

double Model::getField ( ) const
inline

◆ getGradParamNumber()

int Model::getGradParamNumber ( int  icov) const

◆ getMaximumDistance()

double Model::getMaximumDistance ( ) const

◆ getMean()

double Model::getMean ( int  ivar) const
inline

◆ getMeans()

const VectorDouble& Model::getMeans ( ) const
inline

◆ getNoStat()

const ANoStat * Model::getNoStat ( ) const

Shortcut for Non-stationary.

◆ getNoStatElemNumber()

int Model::getNoStatElemNumber ( ) const

◆ getParam()

double Model::getParam ( int  icov) const

◆ getRankFext()

int Model::getRankFext ( int  il) const

◆ getSill()

double Model::getSill ( int  icov,
int  ivar,
int  jvar 
) const

◆ getSillValues()

const MatrixSquareSymmetric Model::getSillValues ( int  icov) const

◆ getTotalSill()

double Model::getTotalSill ( int  ivar,
int  jvar 
) const

◆ getVariableNumber()

int Model::getVariableNumber ( ) const
inline

◆ gofDisplay()

void Model::gofDisplay ( double  gof,
bool  byValue = true,
const VectorDouble thresholds = {2., 5., 10., 100} 
)

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 Model::gofToVario ( const Vario vario,
bool  verbose = true 
)

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)

◆ hasAnam()

bool Model::hasAnam ( ) const

◆ hasExternalCov()

int Model::hasExternalCov ( ) const

◆ hasNugget()

bool Model::hasNugget ( ) const

◆ initCovList()

VectorECov Model::initCovList ( const VectorInt covranks)

◆ isChangeSupportDefined()

bool Model::isChangeSupportDefined ( ) const

◆ isCovaFiltered()

bool Model::isCovaFiltered ( int  icov) const

◆ isDriftDefined()

bool Model::isDriftDefined ( const VectorInt powers,
int  rank_fex = 0 
) const

◆ isDriftDifferentDefined()

bool Model::isDriftDifferentDefined ( const VectorInt powers,
int  rank_fex = -1 
) const

◆ isDriftFiltered()

bool Model::isDriftFiltered ( unsigned int  il) const

◆ isFlagGradient()

bool Model::isFlagGradient ( ) const

◆ isFlagGradientFunctional()

bool Model::isFlagGradientFunctional ( ) const

◆ isFlagGradientNumerical()

bool Model::isFlagGradientNumerical ( ) const

◆ isFlagLinked()

bool Model::isFlagLinked ( ) const

◆ isNoStat()

int Model::isNoStat ( ) const

◆ isOptimEnabled()

bool Model::isOptimEnabled ( ) const
inline

◆ isStationary()

bool Model::isStationary ( ) const

◆ isValid()

bool Model::isValid ( ) const

◆ normalize()

void Model::normalize ( double  sill)

◆ operator=()

Model & Model::operator= ( const Model m)

◆ reduce()

Model * Model::reduce ( const VectorInt validVars) const

◆ resetDriftCoef()

void Model::resetDriftCoef ( )
inline

◆ resetFromDb()

int Model::resetFromDb ( const Db db)

◆ sample()

VectorDouble Model::sample ( const VectorDouble hh,
int  ivar = 0,
int  jvar = 0,
VectorDouble  codir = VectorDouble(),
const CovCalcMode mode = nullptr 
)

Sample a Model for given variable(s) and given direction

Parameters
hhVector of distances
ivarRank of the first variable
jvarRank of the second variable
codirVector of direction coefficients
modeCovCalMode structure
Returns
The array of variogram evaluated at discretized positions
Note that its dimension is 'nh' (if 'addZero' is false and 'nh+1' otherwise)

◆ sampleUnitary()

VectorDouble Model::sampleUnitary ( const VectorDouble hh,
int  ivar = 0,
int  jvar = 0,
VectorDouble  codir = VectorDouble(),
const CovCalcMode mode = nullptr 
)

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 Model::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
inline

◆ setActiveFactor()

void Model::setActiveFactor ( int  iclass)

◆ setAnam()

int Model::setAnam ( const AAnam anam,
const VectorInt strcnt = VectorInt() 
)

Defining an Anamorphosis information for the Model (in fact, this is added to ACovAnisoList part and transforms it from CovLMC to CovLMCAnamorphosis

Parameters
anamPointer to the anamorphosis
strcntArray of covariance description used for IR case
Returns

◆ setCovaFiltered()

void Model::setCovaFiltered ( int  icov,
bool  filtered 
)

◆ setCovar0()

void Model::setCovar0 ( int  ivar,
int  jvar,
double  covar0 
)

◆ setCovar0s()

void Model::setCovar0s ( const VectorDouble covar0)

◆ setCovList()

void Model::setCovList ( const ACovAnisoList covalist)

Add a list of Covariances. This operation cleans any previously stored covariance

Parameters
covalistList of Covariances to be added

◆ setDriftCoef()

void Model::setDriftCoef ( int  ivar,
int  il,
int  ib,
double  coeff 
)

◆ setDriftFiltered()

void Model::setDriftFiltered ( int  il,
bool  filtered 
)

◆ setDriftIRF()

void Model::setDriftIRF ( int  order = 0,
int  nfex = 0 
)

Define the list of drift functions for:

  • a given degree of the IRF
  • a given number of external drifts
    Parameters
    orderOrder of the IRF
    nfexNumber of External Drifts
    Remarks
    This method deletes any pre-existing drift functions and replaces them by the new definition
    This replacement is performed accounting for information stored in 'model', such as:
  • the space dimension
  • the number of variables

◆ setDriftList()

void Model::setDriftList ( const DriftList driftlist)

Add a list of Drifts. This operation cleans any previously stored drift function

Parameters
driftlistList of Drifts to be added
Remarks
This method deletes any pre-existing drift functions

◆ setDrifts()

void Model::setDrifts ( const VectorString driftSymbols)

◆ setField()

void Model::setField ( double  field)

◆ setIsOptimEnabled()

void Model::setIsOptimEnabled ( bool  flagOptim)
inline

◆ setMean()

void Model::setMean ( double  mean,
int  ivar = 0 
)

◆ setMeans()

void Model::setMeans ( const VectorDouble mean)

◆ setSill()

void Model::setSill ( int  icov,
int  ivar,
int  jvar,
double  value 
)

◆ setTapeRange()

void Model::setTapeRange ( double  range)

◆ specificVolume()

double Model::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
inline

◆ specificVolumeFromCoV()

double Model::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
inline

◆ switchToGradient()

void Model::switchToGradient ( )

Switch to a Model dedicated to Gradients (transforms it from CovLMC to CovLMGradient)

◆ toString()

String Model::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable interface.

AStringable Interface

Reimplemented from AStringable.

◆ unsetAnam()

int Model::unsetAnam ( )

Member Data Documentation

◆ _cova

ACov* Model::_cova
private

◆ _ctxt

CovContext Model::_ctxt
private

◆ _driftList

DriftList* Model::_driftList
private

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