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

#include <Selectivity.hpp>

Inheritance diagram for gstlrn::Selectivity:
gstlrn::AStringable gstlrn::ICloneable

Public Member Functions

 Selectivity (Id ncut=0)
 
 Selectivity (const 1 &zcuts, double zmax=TEST, double proba=TEST, bool flag_tonnage_correct=false)
 
 Selectivity (const Selectivity &m)
 
Selectivityoperator= (const Selectivity &m)
 
virtual ~Selectivity ()
 
String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable interface.
 
Id calculateFromDb (const Db *db, bool autoCuts=false)
 
Id calculateFromArray (const 1 &tab, const 1 &weights=1(), bool autoCuts=false)
 
Id calculateFromAnamorphosis (AAnam *anam)
 
Table eval (const Db *db, bool autoCuts=false)
 
Table evalFromArray (const 1 &tab, const 1 &weights=1(), bool autoCuts=false)
 
Table evalFromAnamorphosis (AAnam *anam)
 
void resetCuts (const 1 &zcuts)
 
Id getNCuts () const
 
Id getNVar () const
 
String getVariableName (const ESelectivity &code, Id icut, Id mode) const
 
String getVariableName (Id rank0) const
 
VectorString getVariableNames () const
 
void setZcut (Id iclass, double zcut)
 
void setBest (Id iclass, double best)
 
void setMest (Id iclass, double mest)
 
void setQest (Id iclass, double qest)
 
void setQstd (Id iclass, double qstd)
 
void setTest (Id iclass, double test)
 
void setTstd (Id iclass, double tstd)
 
double getZcut (Id iclass) const
 
double getBest (Id iclass) const
 
double getMest (Id iclass) const
 
double getQest (Id iclass) const
 
double getQstd (Id iclass) const
 
double getTest (Id iclass) const
 
double getTstd (Id iclass) const
 
const & getZcut () const
 
void calculateBenefitAndGrade ()
 
void dumpGini () const
 
void correctTonnageOrder ()
 
void defineRecoveries (const std::vector< ESelectivity > &codes, bool flag_est, bool flag_std, double proba=TEST, bool verbose=false)
 
bool isUsed (const ESelectivity &code) const
 
bool isUsedEst (const ESelectivity &code) const
 
bool isUsedStD (const ESelectivity &code) const
 
bool isNeededT () const
 
bool isNeededQ () const
 
Id getAddressQTEst (const ESelectivity &code, Id iptr0, Id rank=0) const
 
Id getAddressQTStd (const ESelectivity &code, Id iptr0, Id rank=0) const
 
Id getNQTEst (const ESelectivity &code) const
 
Id getNQTStd (const ESelectivity &code) const
 
 getNQTEst () const
 
 geNQTStd () const
 
void storeInDb (Db *db, Id iech0, Id iptr, double zestim, double zstdev) const
 
void interpolateSelectivity (const Selectivity *selecin)
 
void setFlagTonnageCorrect (bool flagTonnageCorrect)
 
void setZmax (double zmax)
 
bool isFlagTonnageCorrect () const
 
double getZmax () const
 
bool isOnlyZDefined () const
 
Table getStats () const
 
Table getAllStats () const
 
const MatrixIntgetCountQT () const
 
const MatrixIntgetRankQt () 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
 
- Public Member Functions inherited from gstlrn::ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 
std::shared_ptr< ICloneablecloneShared () const
 
std::unique_ptr< ICloneablecloneUnique () const
 

Static Public Member Functions

static Selectivitycreate (Id ncut)
 
static SelectivitycreateByCuts (const 1 &zcut)
 
static SelectivitycreateByCodes (const std::vector< ESelectivity > &codes, const 1 &zcuts=1(), bool flag_est=true, bool flag_std=true, double proba=TEST, bool verbose=false)
 
static SelectivitycreateByKeys (const VectorString &keys, const 1 &zcuts=1(), bool flag_est=true, bool flag_std=true, double zmax=TEST, bool flag_tonnage_correct=false, double proba=TEST, bool verbose=false)
 
static SelectivitycreateInterpolation (const 1 &zcuts, const Selectivity &selecin, bool verbose)
 
static Id getNQT ()
 

Constructor & Destructor Documentation

◆ Selectivity() [1/3]

gstlrn::Selectivity::Selectivity ( Id  ncut = 0)

◆ Selectivity() [2/3]

gstlrn::Selectivity::Selectivity ( const 1 &  zcuts,
double  zmax = TEST,
double  proba = TEST,
bool  flag_tonnage_correct = false 
)

◆ Selectivity() [3/3]

gstlrn::Selectivity::Selectivity ( const Selectivity m)

◆ ~Selectivity()

gstlrn::Selectivity::~Selectivity ( )
virtual

Member Function Documentation

◆ calculateBenefitAndGrade()

void gstlrn::Selectivity::calculateBenefitAndGrade ( )

From the cutoff, tonnage and metal quantity, derive the conventional benefit and the average recovered grade

◆ calculateFromAnamorphosis()

Id gstlrn::Selectivity::calculateFromAnamorphosis ( AAnam anam)

◆ calculateFromArray()

Id gstlrn::Selectivity::calculateFromArray ( const 1 &  tab,
const 1 &  weights = 1(),
bool  autoCuts = false 
)

◆ calculateFromDb()

Id gstlrn::Selectivity::calculateFromDb ( const Db db,
bool  autoCuts = false 
)

◆ correctTonnageOrder()

void gstlrn::Selectivity::correctTonnageOrder ( )

Correct the order relationship for Tonnage

◆ create()

Selectivity * gstlrn::Selectivity::create ( Id  ncut)
static

◆ createByCodes()

Selectivity * gstlrn::Selectivity::createByCodes ( const std::vector< ESelectivity > &  codes,
const 1 &  zcuts = 1(),
bool  flag_est = true,
bool  flag_std = true,
double  proba = TEST,
bool  verbose = false 
)
static

◆ createByCuts()

Selectivity * gstlrn::Selectivity::createByCuts ( const 1 &  zcut)
static

◆ createByKeys()

Selectivity * gstlrn::Selectivity::createByKeys ( const VectorString keys,
const 1 &  zcuts = 1(),
bool  flag_est = true,
bool  flag_std = true,
double  zmax = TEST,
bool  flag_tonnage_correct = false,
double  proba = TEST,
bool  verbose = false 
)
static

◆ createInterpolation()

Selectivity * gstlrn::Selectivity::createInterpolation ( const 1 &  zcuts,
const Selectivity selecin,
bool  verbose 
)
static

Interpolate the Grade-Tonnage curves

Parameters
[in]zcutsArray of cutoffs
[in]selecinInput Selectivity
[in]verboseVerbose flag

◆ defineRecoveries()

void gstlrn::Selectivity::defineRecoveries ( const std::vector< ESelectivity > &  codes,
bool  flag_est,
bool  flag_std,
double  proba = TEST,
bool  verbose = false 
)

Analyze the contents of the codes

Parameters
[in]codesArray of selectivity codes
[in]flag_estTrue for estimation
[in]flag_stdTrue for st. dev.
[in]probaProbability value (or TEST)
[in]verboseVerbose flag

◆ dumpGini()

void gstlrn::Selectivity::dumpGini ( ) const

Calculate and print the Gini index

◆ eval()

Table gstlrn::Selectivity::eval ( const Db db,
bool  autoCuts = false 
)

◆ evalFromAnamorphosis()

Table gstlrn::Selectivity::evalFromAnamorphosis ( AAnam anam)

◆ evalFromArray()

Table gstlrn::Selectivity::evalFromArray ( const 1 &  tab,
const 1 &  weights = 1(),
bool  autoCuts = false 
)

◆ geNQTStd()

gstlrn::Selectivity::geNQTStd ( ) const

◆ getAddressQTEst()

Id gstlrn::Selectivity::getAddressQTEst ( const ESelectivity &  code,
Id  iptr0,
Id  rank = 0 
) const

◆ getAddressQTStd()

Id gstlrn::Selectivity::getAddressQTStd ( const ESelectivity &  code,
Id  iptr0,
Id  rank = 0 
) const

◆ getAllStats()

Table gstlrn::Selectivity::getAllStats ( ) const
inline

◆ getBest()

double gstlrn::Selectivity::getBest ( Id  iclass) const

◆ getCountQT()

const MatrixInt & gstlrn::Selectivity::getCountQT ( ) const
inline

◆ getMest()

double gstlrn::Selectivity::getMest ( Id  iclass) const

◆ getNCuts()

Id gstlrn::Selectivity::getNCuts ( ) const
inline

◆ getNQT()

static Id gstlrn::Selectivity::getNQT ( )
inlinestatic

◆ getNQTEst() [1/2]

gstlrn::Selectivity::getNQTEst ( ) const

◆ getNQTEst() [2/2]

Id gstlrn::Selectivity::getNQTEst ( const ESelectivity &  code) const

◆ getNQTStd()

Id gstlrn::Selectivity::getNQTStd ( const ESelectivity &  code) const

◆ getNVar()

Id gstlrn::Selectivity::getNVar ( ) const

◆ getQest()

double gstlrn::Selectivity::getQest ( Id  iclass) const

◆ getQstd()

double gstlrn::Selectivity::getQstd ( Id  iclass) const

◆ getRankQt()

const MatrixInt & gstlrn::Selectivity::getRankQt ( ) const
inline

◆ getStats()

Table gstlrn::Selectivity::getStats ( ) const

◆ getTest()

double gstlrn::Selectivity::getTest ( Id  iclass) const

◆ getTstd()

double gstlrn::Selectivity::getTstd ( Id  iclass) const

◆ getVariableName() [1/2]

String gstlrn::Selectivity::getVariableName ( const ESelectivity &  code,
Id  icut,
Id  mode 
) const

◆ getVariableName() [2/2]

String gstlrn::Selectivity::getVariableName ( Id  rank0) const

◆ getVariableNames()

VectorString gstlrn::Selectivity::getVariableNames ( ) const

◆ getZcut() [1/2]

const & gstlrn::Selectivity::getZcut ( ) const
inline

◆ getZcut() [2/2]

double gstlrn::Selectivity::getZcut ( Id  iclass) const

◆ getZmax()

double gstlrn::Selectivity::getZmax ( ) const
inline

◆ interpolateSelectivity()

void gstlrn::Selectivity::interpolateSelectivity ( const Selectivity selecin)

Interpolate the QT curves (Local estimation)

Parameters
[in]selecinSelectivity

◆ isFlagTonnageCorrect()

bool gstlrn::Selectivity::isFlagTonnageCorrect ( ) const
inline

◆ isNeededQ()

bool gstlrn::Selectivity::isNeededQ ( ) const

◆ isNeededT()

bool gstlrn::Selectivity::isNeededT ( ) const

◆ isOnlyZDefined()

bool gstlrn::Selectivity::isOnlyZDefined ( ) const
inline

◆ isUsed()

bool gstlrn::Selectivity::isUsed ( const ESelectivity &  code) const

◆ isUsedEst()

bool gstlrn::Selectivity::isUsedEst ( const ESelectivity &  code) const

◆ isUsedStD()

bool gstlrn::Selectivity::isUsedStD ( const ESelectivity &  code) const

◆ operator=()

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

◆ resetCuts()

void gstlrn::Selectivity::resetCuts ( const 1 &  zcuts)

◆ setBest()

void gstlrn::Selectivity::setBest ( Id  iclass,
double  best 
)

◆ setFlagTonnageCorrect()

void gstlrn::Selectivity::setFlagTonnageCorrect ( bool  flagTonnageCorrect)
inline

◆ setMest()

void gstlrn::Selectivity::setMest ( Id  iclass,
double  mest 
)

◆ setQest()

void gstlrn::Selectivity::setQest ( Id  iclass,
double  qest 
)

◆ setQstd()

void gstlrn::Selectivity::setQstd ( Id  iclass,
double  qstd 
)

◆ setTest()

void gstlrn::Selectivity::setTest ( Id  iclass,
double  test 
)

◆ setTstd()

void gstlrn::Selectivity::setTstd ( Id  iclass,
double  tstd 
)

◆ setZcut()

void gstlrn::Selectivity::setZcut ( Id  iclass,
double  zcut 
)

◆ setZmax()

void gstlrn::Selectivity::setZmax ( double  zmax)
inline

◆ storeInDb()

void gstlrn::Selectivity::storeInDb ( Db db,
Id  iech0,
Id  iptr,
double  zestim,
double  zstdev 
) const

Store the local results of the recovery

Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]iech0Rank of the target sample
[in]iptrRank for storing the results
[in]zestimEstimated grade
[in]zstdevSt. dev.

◆ toString()

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

ICloneable interface.

AStringable Interface

Reimplemented from gstlrn::AStringable.


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