1.8.0
CCC
 
Loading...
Searching...
No Matches
gstlrn::NamingConvention Class Reference

#include <NamingConvention.hpp>

Inheritance diagram for gstlrn::NamingConvention:
gstlrn::AStringable

Detailed Description

Naming Convention facility This class describes the way variables created within the current procedure will be named afterwards and will possibly be assigned a locator.

The generic name is generated as follows: 'prefix'.'varname'.'qualifier'.'rank'

  • prefix: string provided in the constructor of this class
  • varname: name of the (input) variable on which the procedure is performed
  • qualifier: type of element stored in the variable
  • rank: rank of the output variable (if several variables of the same type are generated)

The choice of the 'prefix' is done by the user when launching the procedure the other parameters are usually defined within the procedure.

For example, when running 'kriging' function with several variables defined in the input Db - say "Pb" abd "Zn" (they are assigned a Z-locator), using the following command: kriging( ... namconv = NamingConvention("MyPrefix") )

Then the kriging procedure generates variables such as:

  • MyPrefix.Pb.estim (estimation of Pb by CoKriging)
  • MyPrefix.Zn.estim (estimation of Zn by CoKriging)
  • MyPrefix.Pb.stdev (St. Dev. of estimation error of Pb by CoKriging)
  • MyPrefix.Zn.stdev (St. Dev. of estimation error of Zn by CoKriging)

Then the non-conditional simulation procedure generates variables such as:

  • MyPrefix.1 (for first simulation)
  • MyPrefix.2 (for second simulation) ...

    Then the conditional simulation procedure generates variables such as:

  • MyPrefix.var.1 (for first simulation)
  • MyPrefix.var.2 (for second simulation) ...

Ultimately, the newly created variables are assigned a locator.

Public Member Functions

 NamingConvention (const String &prefix="", bool flag_varname=true, bool flag_qualifier=true, bool flag_locator=true, const ELoc &locatorOutType=ELoc::fromKey("Z"), const String &delim=".", bool cleanSameLocator=true)
 
 NamingConvention (const NamingConvention &m)
 
NamingConventionoperator= (const NamingConvention &m)
 
virtual ~NamingConvention ()
 
String toString (const AStringFormat *strfmt=nullptr) const override
 AStringable Interface.
 
void setNamesAndLocators (Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (const VectorString &names, Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (Db *dbout, Id iattout_start, const VectorString &names, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (const String &namin, Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, const VectorString &names, const ELoc &locatorInType, Id nvar, Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, const 1 &iatts, Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setNamesAndLocators (const Db *dbin, Id iatt, Db *dbout, Id iattout_start, const String &qualifier="", Id nitems=1, bool flagSetLocator=true, Id locatorShift=0) const
 
void setDelim (const String &delim)
 
void setLocatorOutType (const ELoc &l)
 
void setPrefix (const String &prefix)
 
void setFlagClean (bool cleanSameLocator)
 
void setLocators (Db *dbout, Id iattout_start, Id nvar, Id nitems=1, Id locatorShift=0) const
 
bool isFlagQualifier () const
 
bool isFlagVarname () const
 
- Public Member Functions inherited from gstlrn::AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (Id level) const final
 

Static Public Member Functions

static NamingConventioncreate (const String &prefix="", bool flag_varname=true, bool flag_qualifier=true, bool flag_locator=true, const ELoc &locatorOutType=ELoc::fromKey("Z"), const String &delim=".", bool cleanSameLocator=true)
 

Constructor & Destructor Documentation

◆ NamingConvention() [1/2]

gstlrn::NamingConvention::NamingConvention ( const String prefix = "",
bool  flag_varname = true,
bool  flag_qualifier = true,
bool  flag_locator = true,
const ELoc &  locatorOutType = ELoc::fromKey("Z"),
const String delim = ".",
bool  cleanSameLocator = true 
)

◆ NamingConvention() [2/2]

gstlrn::NamingConvention::NamingConvention ( const NamingConvention m)

◆ ~NamingConvention()

gstlrn::NamingConvention::~NamingConvention ( )
virtual

Member Function Documentation

◆ create()

NamingConvention * gstlrn::NamingConvention::create ( const String prefix = "",
bool  flag_varname = true,
bool  flag_qualifier = true,
bool  flag_locator = true,
const ELoc &  locatorOutType = ELoc::fromKey("Z"),
const String delim = ".",
bool  cleanSameLocator = true 
)
static

Construct an item of the Naming Convention Class

Parameters
prefixName given to the prefix
flag_varnameWhen TRUE, the 'varname' is included in the output names
flag_qualifierWhen TRUE, the 'qualifier' is included in the output names
flag_locatorWhen TRUE, the output variables receive a 'locator'
locatorOutTypeType of locator assigned to the output variables
delimSymbol used as a delimitor separating the different parts of the output names
cleanSameLocatorWhen TRUE and if 'flag_locator' is TRUE, all variables assigned to the same locator are cancelled beforehand
Returns

◆ isFlagQualifier()

bool gstlrn::NamingConvention::isFlagQualifier ( ) const
inline

◆ isFlagVarname()

bool gstlrn::NamingConvention::isFlagVarname ( ) const
inline

◆ operator=()

NamingConvention & gstlrn::NamingConvention::operator= ( const NamingConvention m)

◆ setDelim()

void gstlrn::NamingConvention::setDelim ( const String delim)
inline

◆ setFlagClean()

void gstlrn::NamingConvention::setFlagClean ( bool  cleanSameLocator)
inline

◆ setLocatorOutType()

void gstlrn::NamingConvention::setLocatorOutType ( const ELoc &  l)
inline

◆ setLocators()

void gstlrn::NamingConvention::setLocators ( Db dbout,
Id  iattout_start,
Id  nvar,
Id  nitems = 1,
Id  locatorShift = 0 
) const

◆ setNamesAndLocators() [1/7]

void gstlrn::NamingConvention::setNamesAndLocators ( const Db dbin,
const 1 &  iatts,
Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'v[i]'.'qualifier'.'item_rank'

where v[i] is the variable with rank 'i' within 'dbin'

Parameters
dbinPointer to the input Db (kept for symmetry)
iattsVector of attribute indices of the variables in Input Db
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [2/7]

void gstlrn::NamingConvention::setNamesAndLocators ( const Db dbin,
const VectorString names,
const ELoc &  locatorInType,
Id  nvar,
Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'name'.'qualifier'.'item_rank'

where 'name' stands for the name of the variable(s) in 'names' or, if absent, the name of the variable with locator 'Loc' in 'dbin'

Parameters
dbinPointer to the input Db (kept for symmetry)
namesVector of names (from 'dbin'). If not defined, use the locator instead
locatorInTypeLocator Type of the variables in Input Db
nvarNumber of items belonging to the locatorType (if -1, all the items available for this locator are used)
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [3/7]

void gstlrn::NamingConvention::setNamesAndLocators ( const Db dbin,
Id  iatt,
Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'v[iatt]'.'qualifier'.'item_rank'

Parameters
dbinPointer to the input Db (kept for symmetry)
iattAttribute index of the variables in Input Db
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [4/7]

void gstlrn::NamingConvention::setNamesAndLocators ( const String namin,
Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follow:

'prefix'.'namin'.'qualifier'.'item_rank'

Parameters
naminvariable name
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [5/7]

void gstlrn::NamingConvention::setNamesAndLocators ( const VectorString names,
Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follows:

'prefix'.'names[i]'.qualifier'.'item_rank'

Parameters
namesVector of variable names
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [6/7]

void gstlrn::NamingConvention::setNamesAndLocators ( Db dbout,
Id  iattout_start,
const String qualifier = "",
Id  nitems = 1,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follows:

'prefix'.'qualifier'.'item_rank'

Parameters
dboutPointer to the output Db
iattout_startStarting attribute index
qualifierOptional qualifier
nitemsNumber of items
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setNamesAndLocators() [7/7]

void gstlrn::NamingConvention::setNamesAndLocators ( Db dbout,
Id  iattout_start,
const VectorString names,
bool  flagSetLocator = true,
Id  locatorShift = 0 
) const

Newly created variables are named as follows:

"names[i]"

Parameters
dboutPointer to the output Db
iattout_startStarting attribute index
namesVector of output variable names
flagSetLocatorTrue if the variable must be assigned the locator
locatorShiftShift to be applied to the locator currently defined

◆ setPrefix()

void gstlrn::NamingConvention::setPrefix ( const String prefix)
inline

◆ toString()

String gstlrn::NamingConvention::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

AStringable Interface.

Reimplemented from gstlrn::AStringable.


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