1.1.0
CCC
 
Rule Class Reference

#include <Rule.hpp>

Inheritance diagram for Rule:
AStringable ASerializable RuleShadow RuleShift

Public Member Functions

 Rule (double rho=0.)
 
 Rule (const Rule &r)
 
Ruleoperator= (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 NodegetMainNode () 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)
 
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
 

Static Public Member Functions

static Rulecreate (double rho=0.)
 
static RulecreateFromNF (const String &neutralFilename, bool verbose=true)
 
static RulecreateFromNames (const VectorString &nodnames, double rho=0.)
 
static RulecreateFromCodes (const VectorInt &nodes, double rho=0.)
 
static RulecreateFromNumericalCoding (const VectorInt &n_type, const VectorInt &n_facs, double rho=0.)
 
static RulecreateFromFaciesCount (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 StringgetContainerName ()
 
static const StringgetPrefixName ()
 
static bool createDirectory (const String &dir)
 
static String getExecDirectory ()
 
static String getDirectory (const String &path)
 

Constructor & Destructor Documentation

Rule::Rule ( double  rho = 0.)
Rule::Rule ( const Rule r)
Rule::~Rule ( )
virtual

Member Function Documentation

bool Rule::checkModel ( const Model model,
int  nvar = 0 
) const
virtual

Reimplemented in RuleShift.

Rule * Rule::create ( double  rho = 0.)
static
Rule * Rule::createFromCodes ( const VectorInt nodes,
double  rho = 0. 
)
static
Rule * Rule::createFromFaciesCount ( int  nfacies,
double  rho = 0. 
)
static
Rule * Rule::createFromNames ( const VectorString nodnames,
double  rho = 0. 
)
static
Rule * Rule::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static
Rule * Rule::createFromNumericalCoding ( const VectorInt n_type,
const VectorInt n_facs,
double  rho = 0. 
)
static
String Rule::displaySpecific ( ) const
virtual

Reimplemented in RuleShadow, and RuleShift.

int Rule::evaluateBounds ( PropDef propdef,
Db dbin,
Db dbout,
int  isimu,
int  igrf,
int  ipgs,
int  nbsimu 
) const
virtual

Set the bounds and possibly add replicates

Returns
Error return code
Parameters
[in]propdefPropDef structure
[in]dbinDb structure
[in]dboutDb grid structure
[in]isimuRank of the simulation (if EProcessOper::CONDITIONAL)
[in]igrfRank of the GRF
[in]ipgsRank of the GS
[in]nbsimuNumber of simulations (if EProcessOper::CONDITIONAL)

Reimplemented in RuleShift, and RuleShadow.

int Rule::gaus2facData ( PropDef propdef,
Db dbin,
Db dbout,
int *  flag_used,
int  ipgs,
int  isimu,
int  nbsimu 
)
virtual

Combine the underlying GRF into a facies value at data points

Returns
Error return code
Parameters
[in]propdefProps structure
[in]dbinDb input structure
[in]dboutDb output structure
[in]flag_used1 if the gaussian is used; 0 otherwise
[in]ipgsRank of the PGS
[in]isimuRank of the simulation
[in]nbsimuNumber of simulations
Remarks
Attributes ELoc::GAUSFAC are mandatory
Attributes ELoc::FACIES are mandatory

Reimplemented in RuleShadow.

int Rule::gaus2facResult ( PropDef propdef,
Db dbout,
int *  flag_used,
int  ipgs,
int  isimu,
int  nbsimu 
) const
virtual

Combine the underlying GRF into a facies value

Returns
Error return code
Parameters
[in]propdefProps structure
[in]dboutDb output structure
[in]flag_used1 if the gaussian is used; 0 otherwise
[in]ipgsRank of the PGS
[in]isimuRank of the simulation
[in]nbsimuNumber of simulations
Remarks
Attributes ELoc::FACIES and ELoc::SIMU are mandatory

Reimplemented in RuleShift, and RuleShadow.

int Rule::getFaciesFromGaussian ( double  y1,
double  y2 
) const

Convert the two underlying GRFs into facies

Returns
The facies rank or 0 (facies not found)
Parameters
[in]y1Value of the first underlying GRF
[in]y2Value of the second underlying GRF
Remarks
If one of the two GRF is undefined, the resulting facies is 0
int Rule::getFaciesNumber ( ) const
int Rule::getFlagProp ( ) const
inline
int Rule::getGRFNumber ( ) const
const Node* Rule::getMainNode ( ) const
inline
const ERule& Rule::getModeRule ( ) const
inline
double Rule::getProportion ( int  facies)

Returns the proportion of a given facies

Parameters
faciesFacies rank (starting from 1)
Returns
Proportion of the given Facies
double Rule::getRho ( ) const
inline
VectorDouble Rule::getThresh ( int  facies) const

Return the vector of bounds for a given facies

Parameters
faciesRank of the target facies (starting from 1)
Returns
The vector of bounds organized as [t1min, t1max, t2min, t2max]
VectorDouble Rule::getThreshFromRectangle ( int  rect,
int *  facies 
)
int Rule::getY1Number ( ) const
int Rule::getY2Number ( ) const
bool Rule::isYUsed ( int  igrf) const
Rule & Rule::operator= ( const Rule r)
int Rule::particularities ( Db db,
const Db dbprop,
Model model,
int  flag_grid_check,
int  flag_stat 
) const
virtual

Define the particularities of the PGS model

Returns
Error return code
Parameters
[in]dbDb structure
[in]dbpropDb structure used for proportions
[in]modelModel structure (only used for shift option)
[in]flag_grid_check1 if grid is compulsory; 0 otherwise (only for SHIFT)
[in]flag_stat1 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

Parameters
n_typeVector of items: 0 for Facies, 1 for G1 threshold; 2 for G2 threshold
n_facsVector of facies: XXX for Facies, 0 for thresholds
rhoGRFs correlation coefficient
Returns
void Rule::setFlagProp ( int  flagProp)
inline
void Rule::setModeRule ( const ERule &  modeRule)
inline

TODO : Check if mutable is really necessary.

int Rule::setProportions ( const VectorDouble proportions = VectorDouble()) const

Define constant proportions

Parameters
proportionsThe vector of constant proportions. It should be dimensioned to the number of facies. If absent, all proportions are considered equal.
Returns
void Rule::setRho ( double  rho) const
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

Returns
Error return code
Parameters
[in]verbose1 for a verbose output; 0 otherwise
[out]node_totNumber of nodes
[out]nfac_totNumber of facies
[out]nmax_totNumber of (different) facies
[out]ny1_totNumber of thresholds for Y1
[out]ny2_totNumber of thresholds for Y2
[out]prop_totTotal proportion
Remarks
The tolerance on the sum of the proportions can be defined
using set_keypair("TolSumProportions",newtol)
String Rule::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Reimplemented from AStringable.

void Rule::updateShift ( ) const
VectorInt Rule::whichGRFUsed ( ) const

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