gstlearn
1.0.0
CCC
|
#include <Selectivity.hpp>
Public Member Functions | |
Selectivity (int ncut=0) | |
Selectivity (const VectorDouble &zcuts, double zmax=TEST, double proba=TEST, bool flag_tonnage_correct=false) | |
Selectivity (const Selectivity &m) | |
Selectivity & | operator= (const Selectivity &m) |
virtual | ~Selectivity () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. More... | |
int | calculateFromDb (const Db *db, bool autoCuts=false) |
int | calculateFromArray (const VectorDouble &tab, const VectorDouble &weights=VectorDouble(), bool autoCuts=false) |
int | calculateFromAnamorphosis (AAnam *anam) |
const Table | eval (const Db *db, bool autoCuts=false) |
const Table | evalFromArray (const VectorDouble &tab, const VectorDouble &weights=VectorDouble(), bool autoCuts=false) |
const Table | evalFromAnamorphosis (AAnam *anam) |
void | resetCuts (const VectorDouble &zcuts) |
int | getNCuts () const |
int | getNQT () const |
int | getVariableNumber () const |
String | getVariableName (const ESelectivity &code, int icut, int mode) const |
String | getVariableName (int rank0) const |
VectorString | getVariableNames () const |
void | setZcut (int icut, double zcut) |
void | setBest (int icut, double best) |
void | setMest (int icut, double mest) |
void | setQest (int icut, double qest) |
void | setQstd (int icut, double qstd) |
void | setTest (int icut, double test) |
void | setTstd (int icut, double tstd) |
double | getZcut (int icut) const |
double | getBest (int icut) const |
double | getMest (int icut) const |
double | getQest (int icut) const |
double | getQstd (int icut) const |
double | getTest (int icut) const |
double | getTstd (int icut) const |
const VectorDouble & | getZcut () const |
void | calculateBenefitAndGrade () |
void | dumpGini () |
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 |
int | getAddressQTEst (const ESelectivity &code, int iptr0, int rank=0) const |
int | getAddressQTStd (const ESelectivity &code, int iptr0, int rank=0) const |
int | getNumberQTEst (const ESelectivity &code) const |
int | getNumberQTStd (const ESelectivity &code) const |
const VectorInt | getNumberQTEst () const |
const VectorInt | getNumberQTStd () const |
void | storeInDb (Db *db, int iech0, int iptr, double zestim, double zstdev) |
void | interpolateSelectivity (const Selectivity *selecin) |
void | setFlagTonnageCorrect (bool flagTonnageCorrect) |
void | setZmax (double zmax) |
bool | isFlagTonnageCorrect () const |
double | getZmax () const |
bool | isOnlyZDefined () const |
const Table | getStats () const |
const Table | getAllStats () const |
const MatrixInt & | getNumberQt () const |
const MatrixInt & | getRankQt () 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 ICloneable | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Static Public Member Functions | |
static Selectivity * | create (int ncut) |
static Selectivity * | createByCuts (const VectorDouble &zcut) |
static Selectivity * | createByCodes (const std::vector< ESelectivity > &codes, const VectorDouble &zcuts=VectorDouble(), bool flag_est=true, bool flag_std=true, double proba=TEST, bool verbose=false) |
static Selectivity * | createByKeys (const VectorString &keys, const VectorDouble &zcuts=VectorDouble(), bool flag_est=true, bool flag_std=true, double zmax=TEST, bool flag_correct=false, double proba=TEST, bool verbose=false) |
static Selectivity * | createInterpolation (const VectorDouble &zcuts, const Selectivity &selecin, bool verbose) |
Private Member Functions | |
VectorString | _getAllNames () const |
void | _printQTvars (const char *title, int type, int number) const |
void | _defineVariableRanks () |
bool | _isRecoveryDefined () const |
bool | _isValidCut (int icut) const |
void | _interpolateInterval (double zval, double zi0, double zi1, double ti0, double ti1, double qi0, double qi1, double *tval, double *qval, double tol=EPSILON3) |
void | _concatenate (VectorString &names, const ESelectivity &code, int mode) const |
bool | _isMultiplied (const ESelectivity &code) const |
void | _defineAutomaticCutoffs (const VectorDouble &tab, double eps=EPSILON3) |
Private Attributes | |
VectorDouble | _Zcut |
Table | _stats |
double | _zmax |
double | _proba |
bool | _flagTonnageCorrect |
MatrixInt | _numberQT |
MatrixInt | _rankQT |
bool | _flagOnlyZDefined |
Selectivity::Selectivity | ( | int | ncut = 0 | ) |
Selectivity::Selectivity | ( | const VectorDouble & | zcuts, |
double | zmax = TEST , |
||
double | proba = TEST , |
||
bool | flag_tonnage_correct = false |
||
) |
Selectivity::Selectivity | ( | const Selectivity & | m | ) |
|
virtual |
|
private |
|
private |
|
private |
|
private |
|
private |
Interpolate the QT within an interval
[in] | zval | Cutoff value |
[in] | zi0 | Lower cutoff of the interval |
[in] | zi1 | Upper cutoff of the interval |
[in] | ti0 | Lower tonnage of the interval |
[in] | ti1 | Upper tonnage of the interval |
[in] | qi0 | Lower metal quantity of the interval |
[in] | qi1 | Upper metal quantity of the interval |
[in] | tol | Tolerance |
[out] | tval | Tonnage for the current cutoff |
[out] | qval | Metal quantity for the current cutoff |
|
private |
|
private |
|
private |
|
private |
Print the contents of the qtvars structure
[in] | title | Title |
[in] | type | 1 for estimation; 2 for stdev |
[in] | number | Number of cutoffs |
void Selectivity::calculateBenefitAndGrade | ( | ) |
From the cutoff, tonnage and metal quantity, derive the conventional benefit and the average recovered grade
int Selectivity::calculateFromAnamorphosis | ( | AAnam * | anam | ) |
int Selectivity::calculateFromArray | ( | const VectorDouble & | tab, |
const VectorDouble & | weights = VectorDouble() , |
||
bool | autoCuts = false |
||
) |
int Selectivity::calculateFromDb | ( | const Db * | db, |
bool | autoCuts = false |
||
) |
void Selectivity::correctTonnageOrder | ( | ) |
Correct the order relationship for Tonnage
|
static |
|
static |
|
static |
|
static |
|
static |
Interpolate the Grade-Tonnage curves
[in] | zcuts | Array of cutoffs |
[in] | selecin | Input Selectivity |
[in] | verbose | Verbose flag |
void 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
[in] | codes | Array of selectivity codes |
[in] | flag_est | True for estimation |
[in] | flag_std | True for st. dev. |
[in] | proba | Probability value (or TEST) |
[in] | verbose | Verbose flag |
void Selectivity::dumpGini | ( | ) |
Calculate and print the Gini index
const Table Selectivity::evalFromArray | ( | const VectorDouble & | tab, |
const VectorDouble & | weights = VectorDouble() , |
||
bool | autoCuts = false |
||
) |
int Selectivity::getAddressQTEst | ( | const ESelectivity & | code, |
int | iptr0, | ||
int | rank = 0 |
||
) | const |
int Selectivity::getAddressQTStd | ( | const ESelectivity & | code, |
int | iptr0, | ||
int | rank = 0 |
||
) | const |
|
inline |
double Selectivity::getBest | ( | int | icut | ) | const |
double Selectivity::getMest | ( | int | icut | ) | const |
|
inline |
|
inline |
|
inline |
const VectorInt Selectivity::getNumberQTEst | ( | ) | const |
int Selectivity::getNumberQTEst | ( | const ESelectivity & | code | ) | const |
const VectorInt Selectivity::getNumberQTStd | ( | ) | const |
int Selectivity::getNumberQTStd | ( | const ESelectivity & | code | ) | const |
double Selectivity::getQest | ( | int | icut | ) | const |
double Selectivity::getQstd | ( | int | icut | ) | const |
|
inline |
const Table Selectivity::getStats | ( | ) | const |
double Selectivity::getTest | ( | int | icut | ) | const |
double Selectivity::getTstd | ( | int | icut | ) | const |
String Selectivity::getVariableName | ( | const ESelectivity & | code, |
int | icut, | ||
int | mode | ||
) | const |
String Selectivity::getVariableName | ( | int | rank0 | ) | const |
VectorString Selectivity::getVariableNames | ( | ) | const |
int Selectivity::getVariableNumber | ( | ) | const |
|
inline |
double Selectivity::getZcut | ( | int | icut | ) | const |
|
inline |
void Selectivity::interpolateSelectivity | ( | const Selectivity * | selecin | ) |
Interpolate the QT curves (Local estimation)
[in] | selecin | Selectivity |
|
inline |
bool Selectivity::isNeededQ | ( | ) | const |
bool Selectivity::isNeededT | ( | ) | const |
|
inline |
bool Selectivity::isUsed | ( | const ESelectivity & | code | ) | const |
bool Selectivity::isUsedEst | ( | const ESelectivity & | code | ) | const |
bool Selectivity::isUsedStD | ( | const ESelectivity & | code | ) | const |
Selectivity & Selectivity::operator= | ( | const Selectivity & | m | ) |
void Selectivity::resetCuts | ( | const VectorDouble & | zcuts | ) |
void Selectivity::setBest | ( | int | icut, |
double | best | ||
) |
|
inline |
void Selectivity::setMest | ( | int | icut, |
double | mest | ||
) |
void Selectivity::setQest | ( | int | icut, |
double | qest | ||
) |
void Selectivity::setQstd | ( | int | icut, |
double | qstd | ||
) |
void Selectivity::setTest | ( | int | icut, |
double | test | ||
) |
void Selectivity::setTstd | ( | int | icut, |
double | tstd | ||
) |
void Selectivity::setZcut | ( | int | icut, |
double | zcut | ||
) |
|
inline |
void Selectivity::storeInDb | ( | Db * | db, |
int | iech0, | ||
int | iptr, | ||
double | zestim, | ||
double | zstdev | ||
) |
Store the local results of the recovery
[in] | db | Db structure containing the factors (Z-locators) |
[in] | iech0 | Rank of the target sample |
[in] | iptr | Rank for storing the results |
[in] | zestim | Estimated grade |
[in] | zstdev | St. dev. |
|
overridevirtual |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |