![]() |
1.7.3
Geostatistics & Machine Learning toolbox | https://gstlearn.org
|
![]() |
This class provides the information on Drift part of the Model. The drift plays the role of the average of the target Random Function which may be constant or vary as a function with low frequency variations (by opposition to the complementary part of the Spatial Characteristics which is described by its Covariance) More...
#include <DriftList.hpp>
This class provides the information on Drift part of the Model. The drift plays the role of the average of the target Random Function which may be constant or vary as a function with low frequency variations (by opposition to the complementary part of the Spatial Characteristics which is described by its Covariance)
This class essentially contains a list of basic (active)e drift functions: see ADrift.hpp for details.
This class also carry other important informations:
Public Member Functions | |
DriftList (const CovContext &ctxt=CovContext()) | |
DriftList (const DriftList &r) | |
DriftList & | operator= (const DriftList &r) |
virtual | ~DriftList () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. | |
int | getNVar () const |
int | getNDrift () const |
bool | hasDrift () const |
void | addDrift (const ADrift *drift) |
void | delDrift (unsigned int rank) |
void | delAllDrifts () |
const VectorBool & | getFiltered () const |
void | setFiltered (const VectorBool &filtered) |
bool | isDriftFiltered (int i) const |
void | setFiltered (int i, bool filter) |
int | getNDriftEquation () const |
bool | hasExternalDrift () const |
bool | isValid () const |
int | getNExtDrift () const |
const CovContext & | getContext () const |
const ADrift * | getDrift (int il) const |
TODO : to be removed (encapsulation) | |
int | getRankFex (int il) const |
String | getDriftName (int il) const |
const VectorDouble & | getBetaHats () const |
void | setDriftCLByPart (int ivar, int ib, const VectorDouble &coef) |
void | resetDriftList () |
bool | isDriftSampleDefined (const Db *db, int ib, int nech, const VectorInt &nbgh, const ELoc &loctype) const |
double | computeDrift (const Db *db, int ib, int iech) const |
VectorVectorDouble | getDrifts (const Db *db, bool useSel=true) const |
bool | isFlagLinked () const |
bool | isFlagCombined () const |
int | getDriftMaxIRFOrder () const |
bool | isDriftDefined (const VectorInt &powers, int rank_fex=0) const |
bool | isDriftDifferentDefined (const VectorInt &powers, int rank_fex=-1) const |
void | copyCovContext (const CovContext &ctxt) |
void | setFlagLinked (bool flagLinked) |
void | setFlagCombined (bool flagCombined) |
void | setBetaHat (const VectorDouble &betaHat) |
double | evalDrift (const Db *db, int iech, int il, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
double | evalDriftCoef (const Db *db, int iech, const VectorDouble &coeffs) const |
VectorDouble | evalDriftCoefs (const Db *db, const VectorDouble &coeffs, bool useSel=false) const |
VectorDouble | evalDriftBySample (const Db *db, int iech, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
void | evalDriftBySampleInPlace (const Db *db, int iech, const ECalcMember &member, VectorDouble &drftab) const |
MatrixDense | evalDriftMat (const Db *db, const VectorInt &nbgh=VectorInt(), const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
int | evalDriftMatByRanks (MatrixDense &mat, const Db *db, const VectorVectorInt &sampleranks, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Calculate the Drift matrix. | |
int | evalDriftMatByTarget (MatrixDense &mat, const Db *db, int iech2, const KrigOpt &krigopt=KrigOpt()) const |
double | evalDriftValue (const Db *db, int iech, int ivar, int ib, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
void | setMeans (const VectorDouble &mean) |
void | setMean (const double mean, int ivar=0) |
double | getMean (int ivar) const |
const VectorDouble & | getMeans () const |
const DriftList * | createReduce (const VectorInt &validVars) const |
double | evalDriftVarCoef (const Db *db, int iech, int ivar, const VectorDouble &coeffs) const |
VectorDouble | evalDriftVarCoefs (const Db *db, const VectorDouble &coeffs, bool useSel=false) const |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (int level) const final |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
DriftList::DriftList | ( | const CovContext & | ctxt = CovContext() | ) |
DriftList::DriftList | ( | const DriftList & | r | ) |
|
virtual |
void DriftList::addDrift | ( | const ADrift * | drift | ) |
double DriftList::computeDrift | ( | const Db * | db, |
int | ib, | ||
int | iech | ||
) | const |
void DriftList::copyCovContext | ( | const CovContext & | ctxt | ) |
void DriftList::delAllDrifts | ( | ) |
void DriftList::delDrift | ( | unsigned int | rank | ) |
double DriftList::evalDrift | ( | const Db * | db, |
int | iech, | ||
int | il, | ||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
Evaluate a given drift function for a given sample
db | Db structure |
iech | Rank of the target sample |
il | Rank of the drift function |
member | Member type (used to check filtering) |
VectorDouble DriftList::evalDriftBySample | ( | const Db * | db, |
int | iech, | ||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
void DriftList::evalDriftBySampleInPlace | ( | const Db * | db, |
int | iech, | ||
const ECalcMember & | member, | ||
VectorDouble & | drftab | ||
) | const |
double DriftList::evalDriftCoef | ( | const Db * | db, |
int | iech, | ||
const VectorDouble & | coeffs | ||
) | const |
VectorDouble DriftList::evalDriftCoefs | ( | const Db * | db, |
const VectorDouble & | coeffs, | ||
bool | useSel = false |
||
) | const |
MatrixDense DriftList::evalDriftMat | ( | const Db * | db, |
const VectorInt & | nbgh = VectorInt() , |
||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
int DriftList::evalDriftMatByRanks | ( | MatrixDense & | mat, |
const Db * | db, | ||
const VectorVectorInt & | sampleRanks, | ||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
Calculate the Drift matrix.
mat | Drift matrix (possibly resized) |
db | Data Db |
sampleRanks | Vector of sample ranks in 'db' |
member | CalcMember |
int DriftList::evalDriftMatByTarget | ( | MatrixDense & | mat, |
const Db * | db, | ||
int | iech2, | ||
const KrigOpt & | krigopt = KrigOpt() |
||
) | const |
double DriftList::evalDriftValue | ( | const Db * | db, |
int | iech, | ||
int | ivar, | ||
int | ib, | ||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
Returns the Drift value for a given variable and a given drift function
db | Db structure |
iech | Rank of the sample |
ivar | Rank of the variable |
ib | Rank of the Drift function |
member | ECalcMember characteristics |
double DriftList::evalDriftVarCoef | ( | const Db * | db, |
int | iech, | ||
int | ivar, | ||
const VectorDouble & | coeffs | ||
) | const |
Evaluate the drift with a given sample and a given variable The value is scaled by 'coeffs'
[in] | db | Db structure |
[in] | iech | Rank of the sample |
[in] | ivar | Rank of the variable |
[in] | coeffs | Vector of coefficients |
VectorDouble DriftList::evalDriftVarCoefs | ( | const Db * | db, |
const VectorDouble & | coeffs, | ||
bool | useSel = false |
||
) | const |
A vector of the drift evaluation (for all samples)
db | Db structure |
coeffs | Vector of drift coefficients |
useSel | When TRUE, only non masked samples are returned |
|
inline |
|
inline |
const ADrift * DriftList::getDrift | ( | int | il | ) | const |
TODO : to be removed (encapsulation)
int DriftList::getDriftMaxIRFOrder | ( | ) | const |
String DriftList::getDriftName | ( | int | il | ) | const |
VectorVectorDouble DriftList::getDrifts | ( | const Db * | db, |
bool | useSel = true |
||
) | const |
|
inline |
double DriftList::getMean | ( | int | ivar | ) | const |
|
inline |
|
inline |
int DriftList::getNDriftEquation | ( | ) | const |
int DriftList::getNExtDrift | ( | ) | const |
|
inline |
int DriftList::getRankFex | ( | int | il | ) | const |
|
inline |
bool DriftList::hasExternalDrift | ( | ) | const |
bool DriftList::isDriftDefined | ( | const VectorInt & | powers, |
int | rank_fex = 0 |
||
) | const |
Check if a given drift type is defined among the drift functions
powers | Vector of exponents for monomials |
rank_fex | Rank of the variable for external dift |
bool DriftList::isDriftDifferentDefined | ( | const VectorInt & | powers, |
int | rank_fex = -1 |
||
) | const |
Check if at least one drift function exists whose type is different from the target type
powers | Vector of exponent for monomials of a polynomial drift |
rank_fex | Rank of the variable for external Drift |
bool DriftList::isDriftFiltered | ( | int | i | ) | const |
bool DriftList::isDriftSampleDefined | ( | const Db * | db, |
int | ib, | ||
int | nech, | ||
const VectorInt & | nbgh, | ||
const ELoc & | loctype | ||
) | const |
Check that the drift 'ib' is defined for at least one variable one sample
db | Data file used for reading the drift contents (depends on its type) |
ib | Rank of the drift function |
nech | Number of samples to be checked |
nbgh | Vector of sample indices within the data base |
loctype | Locator to be checked |
|
inline |
|
inline |
bool DriftList::isValid | ( | ) | const |
Check that the set of drift functions is valid
void DriftList::resetDriftList | ( | ) |
|
inline |
void DriftList::setDriftCLByPart | ( | int | ivar, |
int | ib, | ||
const VectorDouble & | coef | ||
) |
Set the values of the internal array 'driftCL' This feature is used when the drift equation does not coincide with a drift function (when working with the gradient of the target variable, for example)
ivar | Rank of the variable (_nVar) |
ib | Rank of the drift equation (_driftEquationNumber) |
coef | Vector of coefficients |
|
inline |
void DriftList::setFiltered | ( | int | i, |
bool | filter | ||
) |
|
inline |
|
inline |
void DriftList::setMean | ( | const double | mean, |
int | ivar = 0 |
||
) |
Define the Mean for one variable
mean | Value for the mean |
ivar | Rank of the variable (starting from 0) |
void DriftList::setMeans | ( | const VectorDouble & | mean | ) |
|
overridevirtual |