gstlearn
1.0.0
CCC
|
NoStat is defined as a series of codes. Each code follows the following syntax with three parts: More...
#include <ANoStat.hpp>
Public Member Functions | |
ANoStat () | |
ANoStat (const VectorString &codes) | |
ANoStat (const ANoStat &m) | |
ANoStat & | operator= (const ANoStat &m) |
virtual | ~ANoStat () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
bool | isNotEmpty () const |
bool | isDefinedByCov (int icov=-1, int igrf=-1) const |
bool | isDefinedByType (const EConsElem &type, int igrf=-1) const |
bool | isDefinedByCovType (const EConsElem &type, int icov=-1, int igrf=-1) const |
bool | isDefined (const EConsElem &type, int icov=0, int iv1=-1, int iv2=-1, int igrf=-1) const |
bool | isDefinedforAnisotropy (int icov=-1, int igrf=-1) const |
bool | isDefinedforRotation (int icov=-1, int igrf=-1) const |
virtual double | getValue (const EConsElem &type, int icas, int rank, int icov=0, int iv1=-1, int iv2=-1, int igrf=-1) const =0 |
virtual double | getValueByParam (int ipar, int icas, int rank) const =0 |
virtual int | attachToMesh (const AMesh *mesh, bool verbose=false) const |
virtual void | detachFromMesh () const |
virtual int | attachToDb (Db *db, int icas, bool verbose=false) const |
virtual void | detachFromDb (Db *db, int icas) const |
int | addNoStatElem (int igrf, int icov, const EConsElem &type, int iv1, int iv2) |
int | addNoStatElemByItem (const CovParamId &item) |
int | addNoStatElems (const VectorString &codes) |
void | deleteNoStatElem (int ipar) |
void | deleteAllNoStatElem () |
int | getRank (const EConsElem &type, int icov, int iv1=-1, int iv2=-1, int igrf=-1) const |
int | getIGrf (int ipar) const |
int | getICov (int ipar) const |
const EConsElem & | getType (int ipar) const |
int | getIV1 (int ipar) const |
int | getIV2 (int ipar) const |
int | getNoStatElemNumber () const |
const std::vector< CovParamId > & | getNoStats () const |
const CovParamId | getNoStat (int ipar) const |
int | attachModel (const Model *model) |
bool | matchIGrf (int ipar, int igrf0) const |
bool | matchICov (int ipar, int icov0) const |
bool | matchType (int ipar, const EConsElem &type0) const |
bool | matchIV1 (int ipar, int iv10) const |
bool | matchIV2 (int ipar, int iv20) const |
const std::vector< CovParamId > & | getAllItems () const |
const CovParamId | getItems (int ipar) const |
void | updateModel (Model *model, int icas1, int iech1, int icas2, int iech2) const |
void | updateModelByMesh (Model *model, int imesh) const |
Public Member Functions inherited from AStringable | |
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 |
Public Member Functions inherited from ICloneable | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Protected Member Functions | |
void | _setAmesh (const AMesh *amesh) const |
void | _setDbin (const Db *dbin) const |
void | _setDbout (const Db *dbout) const |
bool | _isValid (int icas, int rank) const |
Protected Attributes | |
const AMesh * | _amesh |
const Db * | _dbin |
const Db * | _dbout |
Private Member Functions | |
int | _understandCode (const String &code, int *igrf, int *icov, EConsElem *type, int *iv1, int *iv2) |
void | _updateFromModel (const Model *model) |
bool | _getInfoFromDb (int ipar, int icas1, int iech1, int icas2, int iech2, double *val1, double *val2) const |
bool | _checkConsistency () const |
Private Attributes | |
std::vector< CovParamId > | _items |
NoStat is defined as a series of codes. Each code follows the following syntax with three parts:
G<igrf>M<icov>R<idir>
Example:
G1M0R2: Range in the third direction, for the first covariance of the second GRF M1A: First anisotropy direction angle, for the second covariance of the first GRF
Notes:
R : Range A : Angle P : Third parameter V : Sill S : Scale T : Tapering range C : Velocity (advection) I : Rotation angle for Sphere H : Anisotropy matrix terms
ANoStat::ANoStat | ( | ) |
ANoStat::ANoStat | ( | const VectorString & | codes | ) |
ANoStat::ANoStat | ( | const ANoStat & | m | ) |
|
virtual |
|
private |
This function is meant to check the consistency of the different non-stationary parameters, i.e:
|
private |
Get the information from the storage in Dbin and/or Dbout
ipar | Rank of the non-stationary parameter |
icas1 | Type of first Db: 1 for Input; 2 for Output |
iech1 | Rank of the first sample (in Dbin) |
icas2 | Type of first Db: 1 for Input; 2 for Output |
iech2 | Rank of the second sample (in Dbout) |
val1 | Returned value at first sample |
val2 | Returned value at the second sample |
|
protected |
This (temporary) function checks the validity between arguments 'icas' and 'rank'
icas | Source definition: 0 : from Meshing (rank: absolute rank to be converted into relative) 1 : from Dbin 2 : from Dbout |
rank | Rank of the target |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
private |
Decoding a NoStat Element code which should follow the following syntax
code | Input code |
igrf | Rank of the GRF |
icov | Rank of the Covariance |
type | Type of parameter ("R","A","P","V","S","T","C","I","H") G : Rank of the GRF M : Rank of the Structure R : Range A : Angle P : Third parameter V : Sill S : Scale T : Tapering range C : Velocity (advection) I : Rotation angle for Sphere H : Anisotropy matrix terms |
iv1 | Rank of the first variable |
iv2 | Rank of the second variable |
|
private |
The Model may contain some non-stationary parameters already initialized that the current structure is not aware of. They are simply duplicated here This temporary patch is applied in the following conditions: 1) the number of stationary elements in current structure is 0 2) the number of stationary elements in Model is positive
model | Input Model |
int ANoStat::addNoStatElem | ( | int | igrf, |
int | icov, | ||
const EConsElem & | type, | ||
int | iv1, | ||
int | iv2 | ||
) |
Add an element to the pile of Non-stationary parameters
igrf | Rank of the Target GRF |
icov | Rank of the target covariance |
type | Type of the non-stationary parameter |
iv1 | Rank of the first designation |
iv2 | Rank of the second designation |
int ANoStat::addNoStatElemByItem | ( | const CovParamId & | item | ) |
int ANoStat::addNoStatElems | ( | const VectorString & | codes | ) |
int ANoStat::attachModel | ( | const Model * | model | ) |
This function tries to attach the current Non-Stationary environment to the model, checking that references to Covariance ranks are valid
model | Model structure |
|
virtual |
Reimplemented in NoStatFunctional, and NoStatArray.
|
virtual |
Reimplemented in NoStatFunctional, and NoStatArray.
void ANoStat::deleteAllNoStatElem | ( | ) |
void ANoStat::deleteNoStatElem | ( | int | ipar | ) |
|
virtual |
Reimplemented in NoStatArray.
|
virtual |
Reimplemented in NoStatArray.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int ANoStat::getRank | ( | const EConsElem & | type, |
int | icov, | ||
int | iv1 = -1 , |
||
int | iv2 = -1 , |
||
int | igrf = -1 |
||
) | const |
Return the rank for a Non-stationary parameter
type | Rank of Target Type (or EConsElem::UNKNOWN for any) |
icov | Rank of the Target Covariance (or -1 for any) |
iv1 | Rank of the first additional element designation (or -1 for any) |
iv2 | Rank of the second additional element designation (or -1 for any) |
igrf | Rank of Target GRF (or -1 for any) |
|
inline |
|
pure virtual |
Implemented in NoStatFunctional, and NoStatArray.
|
pure virtual |
Implemented in NoStatFunctional, and NoStatArray.
bool ANoStat::isDefined | ( | const EConsElem & | type, |
int | icov = 0 , |
||
int | iv1 = -1 , |
||
int | iv2 = -1 , |
||
int | igrf = -1 |
||
) | const |
bool ANoStat::isDefinedByCov | ( | int | icov = -1 , |
int | igrf = -1 |
||
) | const |
Look if a Non-stationary parameter is defined
icov | Rank of Target Covariance (or -1 for any) |
igrf | Rank of Target GRF (or -1 for any) |
bool ANoStat::isDefinedByCovType | ( | const EConsElem & | type, |
int | icov = -1 , |
||
int | igrf = -1 |
||
) | const |
Look if a Non-stationary parameter is defined
type | Rank of Target Type (or EConsElem::UNKNOWN for any) |
icov | Rank of the Target Covariance (or -1 for any) |
igrf | Rank of Target GRF (or -1 for any) |
bool ANoStat::isDefinedByType | ( | const EConsElem & | type, |
int | igrf = -1 |
||
) | const |
Look if a Non-stationary parameter is defined
type | Rank of Target Type (or EConsElem::UNKNOWN for any) |
igrf | Rank of Target GRF (or -1 for any) |
bool ANoStat::isDefinedforAnisotropy | ( | int | icov = -1 , |
int | igrf = -1 |
||
) | const |
Look if a Non-stationary parameter for Anisotropy is defined either by Tensor or by (angle/range/scale)
icov | Rank of the Target Covariance (or -1 for any) |
igrf | Rank of Target GRF (or -1 for any) |
bool ANoStat::isDefinedforRotation | ( | int | icov = -1 , |
int | igrf = -1 |
||
) | const |
Look if a Non-stationary parameter for Anisotropy is defined only by angle / range / scale
icov | Rank of the Target Covariance (or -1 for any) |
igrf | Rank of Target GRF (or -1 for any) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Reimplemented from AStringable.
Reimplemented in NoStatFunctional, and NoStatArray.
void ANoStat::updateModel | ( | Model * | model, |
int | icas1, | ||
int | iech1, | ||
int | icas2, | ||
int | iech2 | ||
) | const |
void ANoStat::updateModelByMesh | ( | Model * | model, |
int | imesh | ||
) | const |
|
mutableprotected |
|
mutableprotected |
|
mutableprotected |
|
private |