gstlearn
1.0.0
CCC
|
#include <Rule.hpp>
Public Member Functions | |
Rule (double rho=0.) | |
Rule (const Rule &r) | |
Rule & | operator= (const Rule &r) |
virtual | ~Rule () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
int | resetFromNames (const VectorString &nodnames, double rho=0.) |
int | resetFromCodes (const VectorInt &nodes, double rho=0.) |
int | resetFromNumericalCoding (const VectorInt &n_type, const VectorInt &n_facs, double rho=0.) |
int | resetFromFaciesCount (int nfacies, double rho=0.) |
virtual String | displaySpecific () const |
virtual int | particularities (Db *db, const Db *dbprop, Model *model, int flag_grid_check, int flag_stat) const |
virtual bool | checkModel (const Model *model, int nvar=0) const |
virtual int | gaus2facData (PropDef *propdef, Db *dbin, Db *dbout, int *flag_used, int ipgs, int isimu, int nbsimu) |
virtual int | gaus2facResult (PropDef *propdef, Db *dbout, int *flag_used, int ipgs, int isimu, int nbsimu) const |
virtual int | evaluateBounds (PropDef *propdef, Db *dbin, Db *dbout, int isimu, int igrf, int ipgs, int nbsimu) const |
int | getFlagProp () const |
const ERule & | getModeRule () const |
double | getRho () const |
const Node * | getMainNode () const |
void | setFlagProp (int flagProp) |
void | setRho (double rho) const |
void | setModeRule (const ERule &modeRule) |
TODO : Check if mutable is really necessary. More... | |
int | setProportions (const VectorDouble &proportions=VectorDouble()) const |
int | statistics (int verbose, int *node_tot, int *nfac_tot, int *nmax_tot, int *ny1_tot, int *ny2_tot, double *prop_tot) const |
int | getFaciesNumber () const |
int | getGRFNumber () const |
int | getY1Number () const |
int | getY2Number () const |
bool | isYUsed (int igrf) const |
VectorInt | whichGRFUsed () const |
double | getProportion (int facies) |
VectorDouble | getThresh (int facies) const |
VectorDouble | getThreshFromRectangle (int rect, int *facies) |
int | getFaciesFromGaussian (double y1, double y2) const |
void | updateShift () 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 ASerializable | |
ASerializable () | |
ASerializable (const ASerializable &r) | |
ASerializable & | operator= (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 |
Static Public Member Functions | |
static Rule * | create (double rho=0.) |
static Rule * | createFromNF (const String &neutralFilename, bool verbose=true) |
static Rule * | createFromNames (const VectorString &nodnames, double rho=0.) |
static Rule * | createFromCodes (const VectorInt &nodes, double rho=0.) |
static Rule * | createFromNumericalCoding (const VectorInt &n_type, const VectorInt &n_facs, double rho=0.) |
static Rule * | createFromFaciesCount (int nfacies, double rho=0.) |
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 String & | getContainerName () |
static const String & | getPrefixName () |
static bool | createDirectory (const String &dir) |
static String | getExecDirectory () |
static String | getDirectory (const String &path) |
Protected Member Functions | |
virtual bool | _serialize (std::ostream &os, bool verbose=false) const override |
Interface for ASerializable. More... | |
virtual bool | _deserialize (std::istream &is, bool verbose=false) override |
String | _getNFName () const override |
void | setMainNodeFromNodNames (const VectorInt &n_type, const VectorInt &n_facs) |
void | setMainNodeFromNodNames (const VectorString &nodnames) |
int | setMainNodeFromNodNames (const VectorInt &nodes) |
int | replicateInvalid (Db *dbin, Db *dbout, int jech) const |
VectorString | buildNodNames (int nfacies) |
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 | _ruleDefine (std::ostream &os, const Node *node, int from_type, int from_rank, int from_vers, int *rank) const |
void | _nodNamesToIds (const VectorString &nodes, VectorInt &n_type, VectorInt &n_facs) |
void | _clear () |
Private Attributes | |
ERule | _modeRule |
int | _flagProp |
double | _rho |
Node * | _mainNode |
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) |
Rule::Rule | ( | double | rho = 0. | ) |
Rule::Rule | ( | const Rule & | r | ) |
|
virtual |
|
private |
|
overrideprotectedvirtual |
Implements ASerializable.
Reimplemented in RuleShift, and RuleShadow.
|
inlineoverrideprotectedvirtual |
Implements ASerializable.
Reimplemented in RuleShift, and RuleShadow.
|
private |
|
private |
|
overrideprotectedvirtual |
|
protected |
|
virtual |
Reimplemented in RuleShift.
|
static |
|
static |
|
static |
|
static |
|
virtual |
Reimplemented in RuleShift, and RuleShadow.
|
virtual |
Set the bounds and possibly add replicates
[in] | propdef | PropDef structure |
[in] | dbin | Db structure |
[in] | dbout | Db grid structure |
[in] | isimu | Rank of the simulation (if EProcessOper::CONDITIONAL) |
[in] | igrf | Rank of the GRF |
[in] | ipgs | Rank of the GS |
[in] | nbsimu | Number of simulations (if EProcessOper::CONDITIONAL) |
Reimplemented in RuleShift, and RuleShadow.
|
virtual |
Combine the underlying GRF into a facies value at data points
[in] | propdef | Props structure |
[in] | dbin | Db input structure |
[in] | dbout | Db output structure |
[in] | flag_used | 1 if the gaussian is used; 0 otherwise |
[in] | ipgs | Rank of the PGS |
[in] | isimu | Rank of the simulation |
[in] | nbsimu | Number of simulations |
Reimplemented in RuleShadow.
|
virtual |
Combine the underlying GRF into a facies value
[in] | propdef | Props structure |
[in] | dbout | Db output structure |
[in] | flag_used | 1 if the gaussian is used; 0 otherwise |
[in] | ipgs | Rank of the PGS |
[in] | isimu | Rank of the simulation |
[in] | nbsimu | Number of simulations |
Reimplemented in RuleShift, and RuleShadow.
int Rule::getFaciesFromGaussian | ( | double | y1, |
double | y2 | ||
) | const |
Convert the two underlying GRFs into facies
[in] | y1 | Value of the first underlying GRF |
[in] | y2 | Value of the second underlying GRF |
int Rule::getFaciesNumber | ( | ) | const |
|
inline |
int Rule::getGRFNumber | ( | ) | const |
|
inline |
|
inline |
double Rule::getProportion | ( | int | facies | ) |
Returns the proportion of a given facies
facies | Facies rank (starting from 1) |
|
inline |
VectorDouble Rule::getThresh | ( | int | facies | ) | const |
Return the vector of bounds for a given facies
facies | Rank of the target facies (starting from 1) |
VectorDouble Rule::getThreshFromRectangle | ( | int | rect, |
int * | facies | ||
) |
int Rule::getY1Number | ( | ) | const |
int Rule::getY2Number | ( | ) | const |
bool Rule::isYUsed | ( | int | igrf | ) | const |
|
virtual |
Define the particularities of the PGS model
[in] | db | Db structure |
[in] | dbprop | Db structure used for proportions |
[in] | model | Model structure (only used for shift option) |
[in] | flag_grid_check | 1 if grid is compulsory; 0 otherwise (only for SHIFT) |
[in] | flag_stat | 1 for stationary; 0 otherwise |
Reimplemented in RuleShift, and RuleShadow.
int Rule::resetFromCodes | ( | const VectorInt & | nodes, |
double | rho = 0. |
||
) |
int Rule::resetFromFaciesCount | ( | int | nfacies, |
double | rho = 0. |
||
) |
int Rule::resetFromNames | ( | const VectorString & | nodnames, |
double | rho = 0. |
||
) |
int Rule::resetFromNumericalCoding | ( | const VectorInt & | n_type, |
const VectorInt & | n_facs, | ||
double | rho = 0. |
||
) |
This entry is specific for the Rule inference procedure
n_type | Vector of items: 0 for Facies, 1 for G1 threshold; 2 for G2 threshold |
n_facs | Vector of facies: XXX for Facies, 0 for thresholds |
rho | GRFs correlation coefficient |
|
inline |
|
protected |
Initialization of the nodes of the Rule (from the ASCII file).
nodes | Node description (6 * number of nodes) 0 : Type of the parent 1 : Rank of the parent 2 : Orientation of the parent 3 : Information type: 0 (idle) - 1 (Threshold along Y1) - 2 (Threshold along Y2) 4 : Rank of the node (starting from 1) 5 : Rank of the facies |
|
protected |
|
inline |
TODO : Check if mutable is really necessary.
int Rule::setProportions | ( | const VectorDouble & | proportions = VectorDouble() | ) | const |
Define constant proportions
proportions | The vector of constant proportions. It should be dimensioned to the number of facies. If absent, all proportions are considered equal. |
|
inline |
int Rule::statistics | ( | int | verbose, |
int * | node_tot, | ||
int * | nfac_tot, | ||
int * | nmax_tot, | ||
int * | ny1_tot, | ||
int * | ny2_tot, | ||
double * | prop_tot | ||
) | const |
Calculates the statistics from the Lithotype Rule
[in] | verbose | 1 for a verbose output; 0 otherwise |
[out] | node_tot | Number of nodes |
[out] | nfac_tot | Number of facies |
[out] | nmax_tot | Number of (different) facies |
[out] | ny1_tot | Number of thresholds for Y1 |
[out] | ny2_tot | Number of thresholds for Y2 |
[out] | prop_tot | Total proportion |
|
overridevirtual |
Reimplemented from AStringable.
void Rule::updateShift | ( | ) | const |
VectorInt Rule::whichGRFUsed | ( | ) | const |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |