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 () |
String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. | |
Id | getNVar () const |
Id | getNDrift () const |
bool | hasDrift () const |
void | addDrift (const ADrift *drift) |
void | delDrift (size_t rank) |
void | delAllDrifts () |
const VectorBool & | getFiltered () const |
void | setFiltered (const VectorBool &filtered) |
bool | isDriftFiltered (Id i) const |
void | setFiltered (Id i, bool filter) |
Id | getNDriftEquation () const |
bool | hasExternalDrift () const |
bool | isValid () const |
Id | getNExtDrift () const |
const CovContext & | getContext () const |
const ADrift * | getDrift (Id il) const |
TODO : to be removed (encapsulation) | |
Id | getRankFex (Id il) const |
String | getDriftName (Id il) const |
const & | getBetaHats () const |
void | setDriftCLByPart (Id ivar, Id ib, const 1 &coef) |
void | resetDriftList () |
bool | isDriftSampleDefined (const Db *db, Id ib, Id nech, const 1 &nbgh, const ELoc &loctype) const |
double | computeDrift (const Db *db, Id ib, Id iech) const |
getDrifts (const Db *db, bool useSel=true) const | |
bool | isFlagLinked () const |
bool | isFlagCombined () const |
Id | getDriftMaxIRFOrder () const |
bool | isDriftDefined (const 1 &powers, Id rank_fex=0) const |
bool | isDriftDifferentDefined (const 1 &powers, Id rank_fex=-1) const |
void | copyCovContext (const CovContext &ctxt) |
void | setFlagLinked (bool flagLinked) |
void | setFlagCombined (bool flagCombined) |
void | setBetaHat (const 1 &betaHat) |
double | evalDrift (const Db *db, Id iech, Id il, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
double | evalDriftCoef (const Db *db, Id iech, const 1 &coeffs) const |
evalDriftCoefs (const Db *db, const 1 &coeffs, bool useSel=false) const | |
evalDriftBySample (const Db *db, Id iech, const ECalcMember &member=ECalcMember::fromKey("LHS")) const | |
void | evalDriftBySampleInPlace (const Db *db, Id iech, const ECalcMember &member, 1 &drftab) const |
MatrixDense | evalDriftMat (const Db *db, const 1 &nbgh=1(), const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Id | evalDriftMatInPlace (MatrixDense &mat, const Db *db, const 1 &nbgh=1(), const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Id | evalDriftMatByRanksInPlace (MatrixDense &mat, const Db *db, const 1 &sampleranks=1(), const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Calculate the Drift matrix. | |
MatrixDense | evalDriftMatByRanks (const Db *db, const 1 &sampleRanks=1(), const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
Returns the Matrix of the Drift elements. | |
evalMeanVecByRanks (const Db *db, const 1 &sampleRanks=1()) const | |
Id | evalDriftMatByTargetInPlace (MatrixDense &mat, const Db *db, Id iech2, const KrigOpt &krigopt=KrigOpt()) const |
double | evalDriftValue (const Db *db, Id iech, Id ivar, Id ib, const ECalcMember &member=ECalcMember::fromKey("LHS")) const |
void | setMeans (const 1 &mean) |
void | setMean (const double mean, Id ivar=0) |
double | getMean (Id ivar) const |
const & | getMeans () const |
const DriftList * | createReduce (const 1 &validVars) const |
double | evalDriftVarCoef (const Db *db, Id iech, Id ivar, const 1 &coeffs) const |
evalDriftVarCoefs (const Db *db, const 1 &coeffs, bool useSel=false) const | |
virtual void | appendParams (ListParams &listParams) |
void | updateDriftList () |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (Id level) const final |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
std::shared_ptr< ICloneable > | cloneShared () const |
std::unique_ptr< ICloneable > | cloneUnique () const |
Static Public Member Functions | |
static void | initParams (const MatrixSymmetric &vars, double href=1.) |
gstlrn::DriftList::DriftList | ( | const CovContext & | ctxt = CovContext() | ) |
gstlrn::DriftList::DriftList | ( | const DriftList & | r | ) |
|
virtual |
void gstlrn::DriftList::addDrift | ( | const ADrift * | drift | ) |
|
inlinevirtual |
void gstlrn::DriftList::copyCovContext | ( | const CovContext & | ctxt | ) |
const DriftList * gstlrn::DriftList::createReduce | ( | const 1 & | validVars | ) | const |
void gstlrn::DriftList::delAllDrifts | ( | ) |
void gstlrn::DriftList::delDrift | ( | size_t | rank | ) |
double gstlrn::DriftList::evalDrift | ( | const Db * | db, |
Id | iech, | ||
Id | 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) |
gstlrn::DriftList::evalDriftBySample | ( | const Db * | db, |
Id | iech, | ||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
void gstlrn::DriftList::evalDriftBySampleInPlace | ( | const Db * | db, |
Id | iech, | ||
const ECalcMember & | member, | ||
1 & | drftab | ||
) | const |
gstlrn::DriftList::evalDriftCoefs | ( | const Db * | db, |
const 1 & | coeffs, | ||
bool | useSel = false |
||
) | const |
MatrixDense gstlrn::DriftList::evalDriftMat | ( | const Db * | db, |
const 1 & | nbgh = 1() , |
||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
MatrixDense gstlrn::DriftList::evalDriftMatByRanks | ( | const Db * | db, |
const 1 & | sampleRanks = 1() , |
||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
Id gstlrn::DriftList::evalDriftMatByRanksInPlace | ( | MatrixDense & | mat, |
const Db * | db, | ||
const 1 & | sampleRanks = 1() , |
||
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 |
Id gstlrn::DriftList::evalDriftMatInPlace | ( | MatrixDense & | mat, |
const Db * | db, | ||
const 1 & | nbgh = 1() , |
||
const ECalcMember & | member = ECalcMember::fromKey("LHS") |
||
) | const |
double gstlrn::DriftList::evalDriftValue | ( | const Db * | db, |
Id | iech, | ||
Id | ivar, | ||
Id | 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 gstlrn::DriftList::evalDriftVarCoef | ( | const Db * | db, |
Id | iech, | ||
Id | ivar, | ||
const 1 & | 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 |
gstlrn::DriftList::evalDriftVarCoefs | ( | const Db * | db, |
const 1 & | 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 |
gstlrn::DriftList::evalMeanVecByRanks | ( | const Db * | db, |
const 1 & | sampleRanks = 1() |
||
) | const |
|
inline |
|
inline |
Id gstlrn::DriftList::getDriftMaxIRFOrder | ( | ) | const |
gstlrn::DriftList::getDrifts | ( | const Db * | db, |
bool | useSel = true |
||
) | const |
|
inline |
double gstlrn::DriftList::getMean | ( | Id | ivar | ) | const |
|
inline |
|
inline |
Id gstlrn::DriftList::getNDriftEquation | ( | ) | const |
Id gstlrn::DriftList::getNExtDrift | ( | ) | const |
|
inline |
|
inline |
bool gstlrn::DriftList::hasExternalDrift | ( | ) | const |
|
inlinestatic |
bool gstlrn::DriftList::isDriftDefined | ( | const 1 & | powers, |
Id | 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 gstlrn::DriftList::isDriftDifferentDefined | ( | const 1 & | powers, |
Id | 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 gstlrn::DriftList::isDriftFiltered | ( | Id | i | ) | const |
bool gstlrn::DriftList::isDriftSampleDefined | ( | const Db * | db, |
Id | ib, | ||
Id | nech, | ||
const 1 & | 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 gstlrn::DriftList::isValid | ( | ) | const |
Check that the set of drift functions is valid
void gstlrn::DriftList::resetDriftList | ( | ) |
|
inline |
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 gstlrn::DriftList::setFiltered | ( | Id | i, |
bool | filter | ||
) |
|
inline |
|
inline |
void gstlrn::DriftList::setMean | ( | const double | mean, |
Id | ivar = 0 |
||
) |
Define the Mean for one variable
mean | Value for the mean |
ivar | Rank of the variable (starting from 0) |
void gstlrn::DriftList::setMeans | ( | const 1 & | mean | ) |
|
overridevirtual |
|
inline |