1.1.0
CCC
 
AnamDiscreteDD Class Reference

#include <AnamDiscreteDD.hpp>

Inheritance diagram for AnamDiscreteDD:
AnamDiscrete AAnam AStringable ASerializable ICloneable

Public Member Functions

 AnamDiscreteDD (double mu=1., double scoef=0.)
 
 AnamDiscreteDD (const AnamDiscreteDD &m)
 
AnamDiscreteDDoperator= (const AnamDiscreteDD &m)
 
virtual ~AnamDiscreteDD ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable Interface. More...
 
const EAnam & getType () const override
 AAnam Interface. More...
 
bool hasFactor () const override
 
int getNFactor () const override
 
VectorDouble z2factor (double z, const VectorInt &ifacs) const override
 
double computeVariance (double sval) const override
 
int updatePointToBlock (double r_coef) override
 
bool allowChangeSupport () const override
 
bool isChangeSupportDefined () const override
 
int fitFromArray (const VectorDouble &tab, const VectorDouble &wt=VectorDouble()) override
 
void calculateMeanAndVariance () override
 AnamDiscrete Interface. More...
 
VectorDouble factors_exp (bool verbose=false)
 
VectorDouble factors_maf (bool verbose=false)
 
VectorDouble factors_mod ()
 
VectorDouble chi2I (const VectorDouble &chi, int mode)
 
AnamDiscreteDDcreate (double mu=1., double scoef=0.)
 
void reset (int ncut, double scoef, double mu, const VectorDouble &zcut, const MatrixSquareGeneral &pcaz2f, const MatrixSquareGeneral &pcaf2z, const VectorDouble &stats)
 
PCAgetMAF ()
 
double getMu () const
 
double getSCoef () const
 
const VectorDoublegetI2Chi () const
 
MatrixSquareGeneral getPcaZ2Fs () const
 
MatrixSquareGeneral getPcaF2Zs () const
 
void setMu (double mu)
 
void setRCoef (double rcoef)
 
void setPcaZ2F (MatrixSquareGeneral pcaz2f)
 
void setPcaF2Z (MatrixSquareGeneral pcaf2z)
 
void setI2Chi (const VectorDouble &i2Chi)
 
int factor2Selectivity (Db *db, Selectivity *selectivity, const VectorInt &cols_est, const VectorInt &cols_std, int iptr0)
 
- Public Member Functions inherited from AnamDiscrete
 AnamDiscrete ()
 
 AnamDiscrete (const AnamDiscrete &m)
 
AnamDiscreteoperator= (const AnamDiscrete &m)
 
virtual ~AnamDiscrete ()
 
bool hasGaussian () const override
 AAnam interface. More...
 
int getNClass () const
 
virtual double getVariance () const override
 
int getNCut () const
 
int getNElem () const
 
const VectorDoublegetZCut () const
 
double getZCut (int i) const
 
double getMean () const
 
void setMean (double mean)
 
void setVariance (double variance)
 
void setNCut (int ncut)
 
void setZCut (const VectorDouble &zcut)
 
void setNElem (int nelem)
 
void setStats (const VectorDouble &stats)
 
double getDDStatProp (int iclass) const
 
double getDDStatZmoy (int iclass) const
 
double getDDStatCnorm (int iclass) const
 
double getDDStatLambda (int iclass) const
 
double getDDStatU (int iclass) const
 
double getDDStatMul (int iclass) const
 
void setDDStatProp (int iclass, double value)
 
void setDDStatZmoy (int iclass, double value)
 
void setDDStatCnorm (int iclass, double value)
 
void setDDStatLambda (int iclass, double value)
 
void setDDStatU (int iclass, double value)
 
void setDDStatMul (int iclass, double value)
 
double getIRStatT (int iclass) const
 
double getIRStatQ (int iclass) const
 
double getIRStatZ (int iclass) const
 
double getIRStatB (int iclass) const
 
double getIRStatR (int iclass) const
 
double getIRStatRV (int iclass) const
 
void setIRStatT (int iclass, double value)
 
void setIRStatQ (int iclass, double value)
 
void setIRStatZ (int iclass, double value)
 
void setIRStatB (int iclass, double value)
 
void setIRStatR (int iclass, double value)
 
void setIRStatRV (int iclass, double value)
 
const MatrixRectangulargetStats () const
 
- Public Member Functions inherited from AAnam
 AAnam ()
 
 AAnam (const AAnam &m)
 
AAnamoperator= (const AAnam &m)
 
virtual ~AAnam ()
 
virtual double rawToTransformValue (double z) const
 
virtual double transformToRawValue (double y) const
 
double invertVariance (double cvv) const
 
VectorDouble rawToTransformVec (const VectorDouble &z) const
 
VectorDouble transformToRawVec (const VectorDouble &z) const
 
int fitFromLocator (Db *db, const ELoc &locatorType=ELoc::fromKey("Z"))
 
int fit (Db *db, const String &name)
 
int rawToGaussianByLocator (Db *db, const NamingConvention &namconv=NamingConvention("Y"))
 
int rawToGaussian (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Y"))
 
int normalScore (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Gaussian"))
 
int gaussianToRawByLocator (Db *db, const NamingConvention &namconv=NamingConvention("Z"))
 
int gaussianToRaw (Db *db, const String &name, const NamingConvention &namconv=NamingConvention("Z"))
 
int rawToFactorByRanks (Db *db, const VectorInt &ifacs, const NamingConvention &namconv=NamingConvention("Factor"))
 
int rawToFactor (Db *db, int nfactor, const NamingConvention &namconv=NamingConvention("Factor"))
 
- 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
 
- Public Member Functions inherited from ICloneable
 ICloneable ()
 
virtual ~ICloneable ()
 
virtual ICloneableclone () const =0
 

Static Public Member Functions

static AnamDiscreteDDcreateFromNF (const String &neutralFilename, bool verbose=true)
 ASerializable Interface. More...
 
- 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)
 

Friends

class Selectivity
 

Constructor & Destructor Documentation

AnamDiscreteDD::AnamDiscreteDD ( double  mu = 1.,
double  scoef = 0. 
)
AnamDiscreteDD::AnamDiscreteDD ( const AnamDiscreteDD m)
AnamDiscreteDD::~AnamDiscreteDD ( )
virtual

Member Function Documentation

bool AnamDiscreteDD::allowChangeSupport ( ) const
inlineoverridevirtual

Reimplemented from AAnam.

void AnamDiscreteDD::calculateMeanAndVariance ( )
overridevirtual

AnamDiscrete Interface.

Reimplemented from AnamDiscrete.

VectorDouble AnamDiscreteDD::chi2I ( const VectorDouble chi,
int  mode 
)
Parameters
chiChi Matrix
modeType of recovery function
  • 1 : Indicator
  • 2 : Metal quantity
  • 3 : Benefit
Returns
Calculate the transition matrix from factor to a recovery item i.e. Indicator, Metal Quantity or Benefit (according to mode) (Diffusion Discrete)
double AnamDiscreteDD::computeVariance ( double  sval) const
overridevirtual

Calculates the block variance

Returns
Value of the block variance (as a function of support coefficient)

Reimplemented from AAnam.

AnamDiscreteDD * AnamDiscreteDD::create ( double  mu = 1.,
double  scoef = 0. 
)
AnamDiscreteDD * AnamDiscreteDD::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

ASerializable Interface.

int AnamDiscreteDD::factor2Selectivity ( Db db,
Selectivity selectivity,
const VectorInt cols_est,
const VectorInt cols_std,
int  iptr0 
)

Calculate Experimental Grade-Tonnage curves from factors Case of Discrete Diffusion

Returns
Error return code
Parameters
[in]dbDb structure containing the factors (Z-locators)
[in]selectivitySelectivity structure
[in]cols_estArray of UIDs for factor estimation
[in]cols_stdArray of UIDs for factor st. dev.
[in]iptr0Rank for storing the results
VectorDouble AnamDiscreteDD::factors_exp ( bool  verbose = false)
VectorDouble AnamDiscreteDD::factors_maf ( bool  verbose = false)
VectorDouble AnamDiscreteDD::factors_mod ( )
int AnamDiscreteDD::fitFromArray ( const VectorDouble tab,
const VectorDouble wt = VectorDouble() 
)
overridevirtual

Reimplemented from AAnam.

const VectorDouble& AnamDiscreteDD::getI2Chi ( ) const
inline
PCA& AnamDiscreteDD::getMAF ( )
inline
double AnamDiscreteDD::getMu ( ) const
inline
int AnamDiscreteDD::getNFactor ( ) const
inlineoverridevirtual

Reimplemented from AAnam.

MatrixSquareGeneral AnamDiscreteDD::getPcaF2Zs ( ) const
inline
MatrixSquareGeneral AnamDiscreteDD::getPcaZ2Fs ( ) const
inline
double AnamDiscreteDD::getSCoef ( ) const
inline
const EAnam& AnamDiscreteDD::getType ( ) const
inlineoverridevirtual

AAnam Interface.

Implements AAnam.

bool AnamDiscreteDD::hasFactor ( ) const
inlineoverridevirtual

Reimplemented from AAnam.

bool AnamDiscreteDD::isChangeSupportDefined ( ) const
inlineoverridevirtual

Implements AAnam.

AnamDiscreteDD & AnamDiscreteDD::operator= ( const AnamDiscreteDD m)
void AnamDiscreteDD::reset ( int  ncut,
double  scoef,
double  mu,
const VectorDouble zcut,
const MatrixSquareGeneral pcaz2f,
const MatrixSquareGeneral pcaf2z,
const VectorDouble stats 
)
void AnamDiscreteDD::setI2Chi ( const VectorDouble i2Chi)
inline
void AnamDiscreteDD::setMu ( double  mu)
inline
void AnamDiscreteDD::setPcaF2Z ( MatrixSquareGeneral  pcaf2z)
inline
void AnamDiscreteDD::setPcaZ2F ( MatrixSquareGeneral  pcaz2f)
inline
void AnamDiscreteDD::setRCoef ( double  rcoef)
inline
String AnamDiscreteDD::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable Interface.

AStringable Interface

Reimplemented from AnamDiscrete.

int AnamDiscreteDD::updatePointToBlock ( double  r_coef)
overridevirtual

Reimplemented from AAnam.

VectorDouble AnamDiscreteDD::z2factor ( double  z,
const VectorInt ifacs 
) const
overridevirtual

Reimplemented from AAnam.

Friends And Related Function Documentation

friend class Selectivity
friend

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