gstlearn  1.0.0
CCC
Node Class Reference

#include <Node.hpp>

Inheritance diagram for Node:
AStringable

Public Member Functions

 Node (const String &nodnam, int orient, int facies)
 
 Node (const String &nodnam, const VectorInt &n_type, const VectorInt &n_facs, int *ipos, int *n_fac, int *n_y1, int *n_y2)
 
 Node (bool flagShadow=true)
 
 Node (const Node &r)
 
Nodeoperator= (const Node &r)
 
virtual ~Node ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 
void getStatistics (int *node_tot, int *nfac_tot, int *ny1_tot, int *ny2_tot, double *prop_tot)
 
int isValid (VectorInt &facies)
 
void scaleProp (double scale)
 
int proportionDefine (const VectorDouble &props)
 
int getProportion (int facies, double *prop)
 
int getThresh (int mode, int istop, int *rank, int *facies, double *t1min, double *t1max, double *t2min, double *t2max)
 
void proportionToThresh (double rho, double t1min, double t1max, double t2min, double t2max)
 
int gaussianToFacies (double y1, double y2, double *facies)
 
void getInfo (int *nodes) const
 
String nodePrint (bool flagProp, bool flagThresh) const
 
String nodePrintShadow (bool flagProp, bool flagThresh) const
 
double getT1max () const
 
double getT1min () const
 
double getT2max () const
 
double getT2min () const
 
void setT1max (double t1max)
 
void setT1min (double t1min)
 
void setT2max (double t2max)
 
void setT2min (double t2min)
 
double getCdf1max () const
 
double getCdf1min () const
 
double getCdf2max () const
 
double getCdf2min () const
 
int getFacies () const
 
const StringgetNodnam () const
 
int getOrient () const
 
double getP1 () const
 
double getP2 () const
 
double getProp () const
 
double getAllThresh () const
 
void setProp (double prop)
 
void setCdf1max (double cdf1max)
 
void setCdf1min (double cdf1min)
 
void setCdf2max (double cdf2max)
 
void setCdf2min (double cdf2min)
 
void setAllThresh (double thresh)
 
NodegetR1 () const
 
void setR1 (Node *r1)
 
NodegetR2 () const
 
void setR2 (Node *r2)
 
- 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
 

Private Member Functions

void _getStatistics (int *node_tot, int *nfac_tot, int *ny1_tot, int *ny2_tot, double *prop_tot)
 
void _getInfo (int *nodes, int parent_type, int parent_rank, int parent_vers, int *rank, int *n_fac, int *n_y1, int *n_y2) const
 
double _transform (int mode, double value)
 
double _threshFromPropcum (double rho)
 
double _threshDichotomy (double rho)
 

Private Attributes

String _nodnam
 
Node_r1
 
Node_r2
 
int _orient
 
int _facies
 
double _prop
 
double _thresh
 
double _p1
 
double _p2
 
double _t1min
 
double _t1max
 
double _t2min
 
double _t2max
 
double _cdf1min
 
double _cdf1max
 
double _cdf2min
 
double _cdf2max
 

Constructor & Destructor Documentation

◆ Node() [1/4]

Node::Node ( const String nodnam,
int  orient,
int  facies 
)

◆ Node() [2/4]

Node::Node ( const String nodnam,
const VectorInt n_type,
const VectorInt n_facs,
int *  ipos,
int *  n_fac,
int *  n_y1,
int *  n_y2 
)

◆ Node() [3/4]

Node::Node ( bool  flagShadow = true)

◆ Node() [4/4]

Node::Node ( const Node r)

◆ ~Node()

Node::~Node ( )
virtual

Member Function Documentation

◆ _getInfo()

void Node::_getInfo ( int *  nodes,
int  parent_type,
int  parent_rank,
int  parent_vers,
int *  rank,
int *  n_fac,
int *  n_y1,
int *  n_y2 
) const
private

Recursive call for encoding the node characteristics

Parameters
[in]nodesArray for node characteristics
[in]parent_typeType of the parent (THRESH_IDLE, THRESH_Y1 or Y2)
[in]parent_rankRank of the parent
[in]parent_versOrientation for the parent
[in]rankNode number in the node pile
[in]n_facNumber of the facies
[in]n_y1Number of the threshold along Y1
[in]n_y2Number of the threshold along Y2

◆ _getStatistics()

void Node::_getStatistics ( int *  node_tot,
int *  nfac_tot,
int *  ny1_tot,
int *  ny2_tot,
double *  prop_tot 
)
private

◆ _threshDichotomy()

double Node::_threshDichotomy ( double  rho)
private

Find a threshold by dichotomy method This method is restricted to the case of correlated GRFs

Returns
The requested threshold
Parameters
[in]rhoCorrelation between the two GRFs (in ]0,1[)

◆ _threshFromPropcum()

double Node::_threshFromPropcum ( double  rho)
private

Derive a threshold from the bounds and the lower and upper cumulative proportions

return Threshold value or TEST if an error occurs

Parameters
[in]rhoCorrelation between the GRFs

◆ _transform()

double Node::_transform ( int  mode,
double  value 
)
private

Perform the transform between real and gaussian scales

Returns
Returned value
Parameters
[in]mode<0 from gaussian to real; >0 from real to gaussian
[in]valueInput value

◆ gaussianToFacies()

int Node::gaussianToFacies ( double  y1,
double  y2,
double *  facies 
)

Convert the two underlying GRFs into facies

Returns
1 if the facies is found; 0 otherwise
Parameters
[in]y1Value of the first underlying GRF
[in]y2Value of the second underlying GRF
[out]faciesFacies value

◆ getAllThresh()

double Node::getAllThresh ( ) const
inline

◆ getCdf1max()

double Node::getCdf1max ( ) const
inline

◆ getCdf1min()

double Node::getCdf1min ( ) const
inline

◆ getCdf2max()

double Node::getCdf2max ( ) const
inline

◆ getCdf2min()

double Node::getCdf2min ( ) const
inline

◆ getFacies()

int Node::getFacies ( ) const
inline

◆ getInfo()

void Node::getInfo ( int *  nodes) const

◆ getNodnam()

const String& Node::getNodnam ( ) const
inline

◆ getOrient()

int Node::getOrient ( ) const
inline

◆ getP1()

double Node::getP1 ( ) const
inline

◆ getP2()

double Node::getP2 ( ) const
inline

◆ getProp()

double Node::getProp ( ) const
inline

◆ getProportion()

int Node::getProportion ( int  facies,
double *  prop 
)

For a given facies, return the Proportion

Parameters
faciesTarget facies (starting from 1)
propReturned proportion
Returns
1 if the facies is found; 0 otherwise

◆ getR1()

Node* Node::getR1 ( ) const
inline

◆ getR2()

Node* Node::getR2 ( ) const
inline

◆ getStatistics()

void Node::getStatistics ( int *  node_tot,
int *  nfac_tot,
int *  ny1_tot,
int *  ny2_tot,
double *  prop_tot 
)

Calculates the statistics from a given node recursively

Parameters
[in,out]node_totNumber of nodes
[in,out]nfac_totNumber of facies
[in,out]ny1_totNumber of thresholds for Y1
[in,out]ny2_totNumber of thresholds for Y2
[in,out]prop_totTotal proportion
Remarks
The variables 'nfac_tot' and 'prop_tot' must set to zero
as arguments of the call

◆ getT1max()

double Node::getT1max ( ) const
inline

◆ getT1min()

double Node::getT1min ( ) const
inline

◆ getT2max()

double Node::getT2max ( ) const
inline

◆ getT2min()

double Node::getT2min ( ) const
inline

◆ getThresh()

int Node::getThresh ( int  mode,
int  istop,
int *  rank,
int *  facies,
double *  t1min,
double *  t1max,
double *  t2min,
double *  t2max 
)

Get the threshold for a facies

Returns
1 if the facies is found; 0 otherwise
Parameters
[in]modeStopping criterion
  • 1 : when the requested facies is found
  • 2 : when the rectangle rank is reached
[in]istopValue of the stopping criterion
[in]rankIndex of the rectangle (input)
[out]faciesValue of the facies
[out]t1minMinimum threshold along Y1
[out]t1maxMaximum threshold along Y1
[out]t2minMinimum threshold along Y2
[out]t2maxMaximum threshold along Y2
Remarks
Argument 'rank' must be initialized to 0 in the calling function

◆ isValid()

int Node::isValid ( VectorInt facies)

Count the presence of each facies

Returns
Error return code
Parameters
[in]faciesArray for counting the presence of facies

◆ nodePrint()

String Node::nodePrint ( bool  flagProp,
bool  flagThresh 
) const

Recursively print the Node

Parameters
[in]flagProptrue if the Proportions must be printed
[in]flagThreshtrue if the Threshold must be printed

◆ nodePrintShadow()

String Node::nodePrintShadow ( bool  flagProp,
bool  flagThresh 
) const

Recursively print the Node

Parameters
[in]flagProptrue if the Proportions must be printed
[in]flagThreshtrue if the Threshold must be printed

◆ operator=()

Node & Node::operator= ( const Node r)

◆ proportionDefine()

int Node::proportionDefine ( const VectorDouble props)

◆ proportionToThresh()

void Node::proportionToThresh ( double  rho,
double  t1min,
double  t1max,
double  t2min,
double  t2max 
)

Recursively deduce the threshold from cumulative proportions

Parameters
[in]rhoCorrelation between the GRFs
[in]t1minMinimum bound for the first GRF
[in]t1maxMaximum bound for the first GRF
[in]t2minMinimum bound for the second GRF
[in]t2maxMaximum bound for the second GRF

◆ scaleProp()

void Node::scaleProp ( double  scale)

Scale the proportions of all facies new_prop = old_prop / scale

Parameters
[in]scaleScaling factor

◆ setAllThresh()

void Node::setAllThresh ( double  thresh)
inline

◆ setCdf1max()

void Node::setCdf1max ( double  cdf1max)
inline

◆ setCdf1min()

void Node::setCdf1min ( double  cdf1min)
inline

◆ setCdf2max()

void Node::setCdf2max ( double  cdf2max)
inline

◆ setCdf2min()

void Node::setCdf2min ( double  cdf2min)
inline

◆ setProp()

void Node::setProp ( double  prop)
inline

◆ setR1()

void Node::setR1 ( Node r1)
inline

◆ setR2()

void Node::setR2 ( Node r2)
inline

◆ setT1max()

void Node::setT1max ( double  t1max)
inline

◆ setT1min()

void Node::setT1min ( double  t1min)
inline

◆ setT2max()

void Node::setT2max ( double  t2max)
inline

◆ setT2min()

void Node::setT2min ( double  t2min)
inline

◆ toString()

String Node::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Reimplemented from AStringable.

Member Data Documentation

◆ _cdf1max

double Node::_cdf1max
private

◆ _cdf1min

double Node::_cdf1min
private

◆ _cdf2max

double Node::_cdf2max
private

◆ _cdf2min

double Node::_cdf2min
private

◆ _facies

int Node::_facies
private

◆ _nodnam

String Node::_nodnam
private

◆ _orient

int Node::_orient
private

◆ _p1

double Node::_p1
private

◆ _p2

double Node::_p2
private

◆ _prop

double Node::_prop
private

◆ _r1

Node* Node::_r1
private

◆ _r2

Node* Node::_r2
private

◆ _t1max

double Node::_t1max
private

◆ _t1min

double Node::_t1min
private

◆ _t2max

double Node::_t2max
private

◆ _t2min

double Node::_t2min
private

◆ _thresh

double Node::_thresh
private

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