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

Class containing the Data Information organized as a set of Lines. More...

#include <DbLine.hpp>

Inheritance diagram for gstlrn::DbLine:
gstlrn::Db gstlrn::AStringable gstlrn::ASerializable gstlrn::ICloneable

Detailed Description

Class containing the Data Information organized as a set of Lines.

This class is derived from the Db class, with a specific decoration: samples within the Db are organized sequenially along lines.

Note that this particular Db does not allow the modification of the sample number by addition or deletion.

The Line decoration provides a vector giving the number of samples per line. Within one line, samples are ordered sequentailly (the order must not be modified).

Public Member Functions

 DbLine ()
 
 DbLine (const DbLine &r)
 
DbLineoperator= (const DbLine &r)
 
virtual ~DbLine ()
 
String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable interface.
 
bool isLine () const override
 Db Interface.
 
bool mayChangeSampleNumber () const override
 
bool isConsistent () const override
 Check if the contents of private member of this class is compatible with the number of samples stored in the Db.
 
Id resetFromSamples (Id nech, const ELoadBy &order, const 1 &tab, const 1 &lineCounts, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 Reset the contents of a DbLine from arguments (previous contents is cleared beforehand). The line contents is provided in 'lineCounts'.
 
Id resetFromSamplesById (Id nech, const ELoadBy &order, const 1 &tab, const 1 &lineIds, const 1 &ranksPerId, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 Reset the contents of a DbLine from arguments (previous contents is cleared beforehand). The line contents is provided in 'lineIds' and 'ranksPerId'.
 
DbcreateStatToHeader () const
 This is an example for a future more sophisticated method which will collect statistics calculated per line, and store them into a newly created Db. In the current version, the statistics only concerns the number of samples per Line.
 
Id getNLine () const
 
Id getNSamplePerLine (Id iline) const
 
double getLineLength (Id iline) const
 
Id getNTotal () const
 
Id getLineBySample (Id iech) const
 Returns the rank of the line containing the target address.
 
 _getHeaderCoordinate (Id idim) const
 
 getCoordinatesPerLine (Id iline, Id idim) const
 
 getLineLengths () const
 
Id getLineSampleRank (Id iline, Id isample) const
 Returns the absolute rank of the sample 'isample' or the line 'iline' within the Db structure (ir -1 if an error occurs)
 
- Public Member Functions inherited from gstlrn::Db
 Db ()
 
 Db (const Db &r)
 
Dboperator= (const Db &r)
 
virtual ~Db ()
 
virtual bool isGrid () const
 Interface for Db.
 
virtual bool isMesh () const
 
virtual double getCoordinate (Id iech, Id idim, bool flag_rotate=true) const
 
virtual void getCoordinatesInPlace (1 &coor, Id iech, bool flag_rotate=true) const
 Update the vector of coordinates (optimized manner) No check is done with respect to the dimension of the returned vector.
 
virtual double getUnit (Id idim=0) const
 
virtual Id getNDim () const
 
virtual void resetDims (Id ncol, Id nech)
 
Id resetFromSamples (Id nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const 1 &tab=1(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
Id resetFromCSV (const String &filename, bool verbose, const CSVformat &csvfmt, Id ncol_max=-1, Id nrow_max=-1, bool flagAddSampleRank=true)
 
Id resetFromBox (Id nech, const 1 &coormin, const 1 &coormax, Id ndim=2, double extend=0., Id seed=321415, bool flagAddSampleRank=true)
 
Id resetFromOnePoint (const 1 &tab=1(), bool flagAddSampleRank=true)
 
Id resetSamplingDb (const Db *dbin, double proportion=0, Id number=0, const VectorString &names=VectorString(), Id seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
Id resetReduce (const Db *dbin, const VectorString &names=VectorString(), const 1 &ranks=1(), bool verbose=false)
 
Id resetFromGridRandomized (const DbGrid *dbin, double randperc=0., bool flagAddSampleRank=true)
 
const std::vector< double > & getArrays () const
 
String getNameByLocator (const ELoc &locatorType, Id locatorIndex=0) const
 
String getNameByColIdx (Id icol) const
 
String getNameByUID (Id iuid) const
 
virtual void initThread () const
 
VectorString getName (const String &name) const
 
VectorString getNames (const VectorString &names) const
 
VectorString getNamesByLocator (const ELoc &locatorType) const
 
VectorString getNamesByColIdx (const 1 &icols) const
 
VectorString getNamesByUID (const 1 &iuids) const
 
VectorString getAllNames (bool excludeRankAndCoordinates=false, bool verbose=false) const
 
void setName (const String &old_name, const String &name)
 
void setName (const VectorString &list, const String &name)
 
void setNameByUID (Id iuid, const String &name)
 
void setNameByColIdx (Id icol, const String &name)
 
void setNameByLocator (const ELoc &locatorType, const String &name)
 
VectorString expandNameList (const VectorString &names) const
 
VectorString expandNameList (const String &names) const
 
VectorString identifyNames (const VectorString &names) const
 
Id getNUIDMax () const
 
Id getNColumn () const
 
Id getNSample (bool useSel=false) const
 
Id getNSampleActiveAndDefined (Id item) const
 
Id getNSampleActiveAndDefined (const String &name) const
 
Id getNSampleActive () const
 
Id getRankRelativeToAbsolute (Id irel) const
 
Id getRankAbsoluteToRelative (Id iabs) const
 
void clearLocators (const ELoc &locatorType)
 
void clearSelection ()
 
void setLocatorByUID (Id iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorByColIdx (Id icol, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocator (const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocators (const VectorString &names, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (Id number, Id iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (const 1 &iuids, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByColIdx (const 1 &icols, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool cleanSameLocator=false)
 
void addColumnsByVVD (const 1 &tab, const String &radix, const ELoc &locatorType, Id locatorIndex=0, bool useSel=false)
 
Id addColumns (const 1 &tab, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool useSel=false, double valinit=0., Id nvar=1)
 
Id addColumnsByConstant (Id nadd=1, double valinit=0., const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, Id nechInit=0)
 
Id addColumnsRandom (Id nadd, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("Z"), Id locatorIndex=0, Id seed=1352, Id nechInit=0)
 
Id addSelection (const 1 &tab=1(), const String &name="NewSel", const String &combine="set")
 
Id addSelectionByVariable (const String &varname, double lower=TEST, double upper=TEST, const String &name="NewSel", const String &oldSelName="")
 Create a selection by testing a target variable against 'lower' and 'upper'.
 
Id addSelectionByRanks (const 1 &ranks, const String &name="NewSel", const String &combine="set")
 
Id addSelectionByLimit (const String &testvar, const Limits &limits=Limits(), const String &name="NewSel", const String &combine="set")
 
Id addSelectionFromDbByConvexHull (Db *db, double dilate=0., bool verbose=false, const NamingConvention &namconv=NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")))
 
Id addSelectionRandom (double prop, Id seed=138213, const String &name="NewSel", const String &combine="set")
 
Id addSamples (Id nadd, double valinit=TEST)
 
Id deleteSample (Id e_del)
 
Id deleteSamples (const 1 &e_dels)
 
void switchLocator (const ELoc &locatorType_in, const ELoc &locatorType_out)
 
Id getLastUID (Id number=0) const
 
String getLastName (Id number=0) const
 
Id getColIdx (const String &name) const
 
Id getColIdxByUID (Id iuid) const
 
Id getColIdxByLocator (const ELoc &locatorType, Id locatorIndex=0) const
 
 getColIdxs (const String &name) const
 
 getColIdxs (const VectorString &names) const
 
 getColIdxsByUID (const 1 &iuids) const
 
 getColIdxsByLocator (const ELoc &locatorType) const
 
void setColumn (const 1 &tab, const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), Id locatorIndex=0, bool useSel=false)
 
void setColumnByUIDOldStyle (const double *tab, Id iuid, bool useSel=false)
 
void setColumnByUID (const 1 &tab, Id iuid, bool useSel=false)
 
void setColumnByColIdx (const 1 &tab, Id icol, bool useSel=false)
 
void setColumnsByColIdx (const 1 &tabs, const 1 &icols, bool useSel=false)
 
void setColumnByColIdxOldStyle (const double *tab, Id icol, bool useSel=false)
 
void duplicateColumnByUID (Id iuid_in, Id iuid_out)
 
 getItem (const 1 &rows, const VectorString &colnames, bool useSel=false) const
 
 getItem (const 1 &rows, const String &colname, bool useSel=false) const
 
 getItem (const 1 &rows, const ELoc &locatorType, bool useSel=false) const
 
 getItem (const VectorString &colnames, bool useSel=false) const
 
 getItem (const String &colname, bool useSel=false) const
 
 getItem (const ELoc &locatorType, bool useSel=false) const
 
VectorString getItemNames (const VectorString &colnames) const
 
VectorString getItemNames (const String &colname) const
 
VectorString getItemNames (const ELoc &locatorType) const
 
Id setItem (const 1 &rows, const VectorString &colnames, const 1 &values, bool useSel=false)
 
Id setItem (const 1 &rows, const ELoc &locatorType, const 1 &values, bool useSel=false)
 
Id setItem (const VectorString &colnames, const 1 &values, bool useSel=false)
 
Id setItem (const ELoc &locatorType, const 1 &values, bool useSel=false)
 
Id setItem (const 1 &rows, const String &colname, const 1 &values, bool useSel=false)
 
Id setItem (const String &colname, const 1 &values, bool useSel=false)
 
bool getLocator (const String &name, ELoc *ret_locatorType, Id *ret_locatorIndex) const
 
bool getLocatorByColIdx (Id icol, ELoc *ret_locatorType, Id *ret_locatorIndex) const
 
bool getLocatorByUID (Id iuid, ELoc *ret_locatorType, Id *ret_locatorIndex) const
 
VectorString getLocators (bool anyLocator=true, const ELoc &locatorType=ELoc::fromKey("UNKNOWN")) const
 
bool isUIDDefined (Id iuid) const
 
Id getUID (const String &name) const
 
Id getUIDByColIdx (Id icol) const
 
Id getUIDByLocator (const ELoc &locatorType, Id locatorIndex=0) const
 
 getUIDs (const VectorString &names) const
 
 getUIDsByLocator (const ELoc &locatorType) const
 
 getUIDsByColIdx (const 1 &icols) const
 
 getAllUIDs () const
 
void getAllUIDs (1 &iuids) const
 
void copyByUID (Id iuidIn, Id iuidOut)
 
void copyByCol (Id icolIn, Id icolOut)
 
Id getNFacies (void) const
 
bool hasLocatorDefined (const String &name, const ELoc &locatorType, Id locatorIndex=0) const
 
 getSampleCoordinates (Id iech) const
 
void getSampleAsSPInPlace (SpacePoint &P, Id iabs) const
 In the SpacePoint 'P', define the sample rank and coordinates.
 
virtual void getSampleAsSTInPlace (Id iech, SpaceTarget &P) const
 
 getSampleLocators (const ELoc &locatorType, Id iech) const
 
 getIncrements (const 1 &iechs, const 1 &jechs) const
 
 getOneCoordinate (Id idim, bool useSel=false, bool flag_rotate=true) const
 
 getAllCoordinates (bool useSel=false) const
 
MatrixDense getAllCoordinatesMat (const MatrixDense &box=MatrixDense()) const
 
void setCoordinate (Id iech, Id idim, double value)
 
void setCoordinates (Id idim, const 1 &coor, bool useSel=false)
 
void setSampleCoordinates (Id iech, const 1 &coor)
 
double getDistance1D (Id iech, Id jech, Id idim=0, bool flagAbs=false) const
 
double getDistance (Id iech, Id jech) const
 
Id getDistanceVecInPlace (Id iech, Id jech, 1 &dd, const Db *db2=nullptr) const
 
double getValue (const String &name, Id iech) const
 
void setValue (const String &name, Id iech, double value)
 
double getArray (Id iech, Id iuid) const
 
void getArrayVec (const 1 &iechs, Id iuid, 1 &values) const
 
void setArray (Id iech, Id iuid, double value)
 
void setArrayVec (const 1 &iechs, Id iuid, const 1 &values)
 
void updArray (Id iech, Id iuid, const EOperator &oper, double value)
 
void updArrayVec (const 1 &iechs, Id iuid, const EOperator &oper, 1 &values)
 
 getArrayByUID (Id iuid, bool useSel=false) const
 
void setArrayByUID (const 1 &tab, Id iuid)
 
void getArrayBySample (std::vector< double > &vals, Id iech) const
 
void setArrayBySample (Id iech, const 1 &vec)
 
void getSamplesAsSP (std::vector< SpacePoint > &pvec, const ASpaceSharedPtr &space, bool useSel=false) const
 
void getSamplesFromNbghAsSP (std::vector< SpacePoint > &pvec, const 1 &nbgh) const
 
bool hasLocator (const ELoc &locatorType) const
 
double getFromLocator (const ELoc &locatorType, Id iech, Id locatorIndex=0) const
 
void setFromLocator (const ELoc &locatorType, Id iech, Id locatorIndex, double value)
 
double getValueByColIdx (Id iech, Id icol, bool flagCheck=true) const
 
const double * getColAdressByColIdx (Id icol) const
 
void setValueByColIdx (Id iech, Id icol, double value, bool flagCheck=true)
 
 getValuesByNames (const 1 &iechs, const VectorString &names, bool bySample=false) const
 
 getValuesByColIdx (const 1 &iechs, const 1 &icols, bool bySample=false) const
 
void setValuesByNames (const 1 &iechs, const VectorString &names, const 1 &values, bool bySample=false)
 
void setValuesByColIdx (const 1 &iechs, const 1 &icols, const 1 &values, bool bySample=false)
 
Id getNLoc (const ELoc &loctype) const
 
bool hasLocVariable (const ELoc &loctype) const
 
double getLocVariable (const ELoc &loctype, Id iech, Id item) const
 
void setLocVariable (const ELoc &loctype, Id iech, Id item, double value)
 
void updLocVariable (const ELoc &loctype, Id iech, Id item, const EOperator &oper, double value)
 
Id getNZValues () const
 
bool hasZVariable () const
 
double getZVariable (Id iech, Id item) const
 
void setZVariable (Id iech, Id item, double value)
 
void updZVariable (Id iech, Id item, const EOperator &oper, double value)
 
 getLocVariables (const ELoc &loctype, Id iech, Id nitemax=0) const
 
void setLocVariables (const ELoc &loctype, Id iech, const 1 &values)
 
bool isNVarComparedTo (Id nvar, Id compare=0) const
 
bool isIsotopic (Id iech, Id nvar_max=-1) const
 
bool isAllUndefined (Id iech) const
 
bool isAllUndefinedByType (const ELoc &loctype, Id iech) const
 
bool isAllIsotopic () const
 
void setInterval (Id iech, Id item, double rklow=TEST, double rkup=TEST)
 
Id getNInterval () const
 
void setBound (Id iech, Id item, double lower=TEST, double upper=TEST)
 
 getWithinBounds (Id item, bool useSel=false) const
 
 getGradient (Id item, bool useSel=false) const
 
 getTangent (Id item, bool useSel=false) const
 
 getCodeList (void) const
 
Id getSelection (Id iech) const
 
 getSelections (void) const
 
void getSampleRanksPerVariable (1 &ranks, const 1 &nbgh=1(), Id ivar=-1, bool useSel=true, bool useZ=true, bool useVerr=false, bool useExtD=true) const
 Create the vector of elligible sample ranks for the variable 'ivar'.
 
 getSampleRanks (const 1 &ivars=1(), const 1 &nbgh=1(), bool useSel=true, bool useZ=true, bool useVerr=false, bool useExtD=true) const
 
void getSampleRanksInPlace (1 &sampleRanks, const 1 &ivars=1(), const 1 &nbgh=1(), bool useSel=true, bool useZ=true, bool useVerr=false, bool useExtD=true) const
 
 getValuesByRanks (const 1 &sampleRanks, const 1 &means=1(), bool subtractMean=true) const
 
void getValuesByRanksInPlace (1 *values, const 1 &sampleRanks, const 1 &means=1(), bool subtractMean=true) const
 
Id getListOfSampleIndicesPerVariableInPlace (1 &ranks, Id ivar=0, bool useSel=true) const
 Returns the vector of indices for samples with variable 'ivar' defined For the target variable 'ivar' and for sample 'iech',.
 
Id getListOfSampleIndicesInPlace (Id nvar, 1 &cumul, 1 &ranks, bool useSel=true) const
 Updates (and resizes) the two arguments:
 
double getWeight (Id iech) const
 
 getWeights (bool useSel=false) const
 
double getSimvar (const ELoc &locatorType, Id iech, Id isimu, Id ivar, Id icase, Id nbsimu, Id nvar) const
 
void setSimvar (const ELoc &locatorType, Id iech, Id isimu, Id ivar, Id icase, Id nbsimu, Id nvar, double value)
 
void updSimvar (const ELoc &locatorType, Id iech, Id isimu, Id ivar, Id icase, Id nbsimu, Id nvar, const EOperator &oper, double value)
 
bool isActive (Id iech) const
 
bool isActiveDomain (Id iech) const
 
bool isActiveAndDefined (Id iech, Id item) const
 
VectorBool getActiveArray () const
 
 getSortArray () const
 
double getCosineToDirection (Id iech1, Id iech2, const 1 &codir) const
 
 getColumn (const String &name, bool useSel=false, bool flagCompress=true) const
 
 getColumnByUID (Id iuid, bool useSel=false, bool flagCompress=true) const
 
 getColumnByLocator (const ELoc &locatorType, Id locatorIndex=0, bool useSel=false, bool flagCompress=true) const
 
 getColumnByColIdx (Id icol, bool useSel=false, bool flagCompress=true) const
 
 getAllColumns (bool useSel=false, bool flagCompress=true) const
 
 getColumns (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true, const 1 &origins=1()) const
 
 getColumnsAsVVD (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true) const
 
MatrixDense getColumnsAsMatrix (const VectorString &names, bool useSel=false, bool flagCompress=true) const
 
 getColumnsByColIdx (const 1 &icols=1(), bool useSel=false, bool flagCompress=true, const 1 &origins=1()) const
 
 getColumnsByColIdxInterval (Id icol_beg, Id icol_end, bool useSel=false, bool flagCompress=true) const
 
 getColumnsActiveAndDefined (const ELoc &locatorType, const 1 &origins=1()) const
 
 getColumnsByLocator (const ELoc &locatorType, bool useSel=false, bool flagCompress=true, const 1 &origins=1()) const
 
 getColumnsByUID (const 1 &iuids, bool useSel=false, bool flagCompress=true, const 1 &origins=1()) const
 
 getColumnsByUIDInterval (Id iuid_beg, Id iuid_end, bool useSel=false, bool flagCompress=true) const
 
void setAllColumns (const 1 &tabs)
 
void deleteColumn (const String &name)
 
void deleteColumnByUID (Id iuid_del)
 
void deleteColumnByColIdx (Id icol_del)
 
void deleteColumns (const VectorString &names)
 
void deleteColumnsByLocator (const ELoc &locatorType)
 
void deleteColumnsByUID (const 1 &iuids)
 
void deleteColumnsByColIdx (const 1 &icols)
 
void deleteColumnsByUIDRange (Id i_del, Id n_del)
 
 getExtrema (Id idim, bool useSel=false) const
 
 getExtremas (bool useSel=false) const
 
 getExtends (bool useSel=false) const
 
 getCoorMinimum (bool useSel=false) const
 
 getCoorMaximum (bool useSel=false) const
 
double getExtension (Id idim, bool useSel=false) const
 
double getExtensionDiagonal (bool useSel=false) const
 
double getCenter (Id idim, bool useSel=false) const
 
 getCenters (bool useSel=false) const
 
void getExtensionInPlace (1 &mini, 1 &maxi, bool flagPreserve=false, bool useSel=false) const
 
double getMinimum (const String &name, bool useSel=false) const
 
double getMaximum (const String &name, bool useSel=false) const
 
 getRange (const String &name, bool useSel=false) const
 
double getMean (const String &name, bool useSel=false) const
 
double getVariance (const String &name, bool useSel=false) const
 
double getStdv (const String &name, bool useSel=false) const
 
double getCorrelation (const String &name1, const String &name2, bool useSel=false) const
 
bool hasSameDimension (const Db *dbaux) const
 
bool hasLargerDimension (const Db *dbaux) const
 
bool isColIdxValid (Id icol) const
 
bool isUIDValid (Id iuid) const
 
bool isSampleIndexValid (Id iech) const
 
bool isSampleIndicesValid (const 1 &iechs, bool useSel=false) const
 
bool isLocatorIndexValid (const ELoc &locatorType, Id locatorIndex) const
 
bool isDimensionIndexValid (Id idim) const
 
void combineSelection (1 &sel, const String &combine="set") const
 
void generateRank (const String &radix="rank")
 
 shrinkToValidRows (const 1 &rows) const
 
 shrinkToValidCols (const 1 &cols) const
 
void statisticsBySample (const VectorString &names, const std::vector< EStatOption > &opers=EStatOption::fromKeys({"MEAN"}), bool flagIso=true, double proba=TEST, double vmin=TEST, double vmax=TEST, const NamingConvention &namconv=NamingConvention("Stats"))
 
 statisticsMulti (const VectorString &names, bool flagIso=true, bool verbose=false, const String &title="")
 
bool areSame (const String &name1, const String &name2, double eps=EPSILON3, bool useSel=true, bool verbose=false) const
 
 filter (const String &name, const Interval &interval, Id belowRow=ITEST, Id aboveRow=ITEST) const
 
Table printOneSample (Id iech, const VectorString &names=VectorString(), bool excludeCoordinates=true, bool skipTitle=false) const
 
void dumpGeometry (Id iech, Id jech) 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::ASerializable
 ASerializable ()
 
 ASerializable (const ASerializable &r)
 
ASerializableoperator= (const ASerializable &r)
 
 ASerializable (ASerializable &&r) noexcept
 
ASerializableoperator= (ASerializable &&r) noexcept
 
virtual ~ASerializable ()
 
bool dumpToNF (const String &NFFilename, const EFormatNF &format=EFormatNF::fromKey("DEFAULT"), bool verbose=false) const
 Dump the contents of an object into an Output File using a given Output NF Format.
 
void setDefaultFormatNF (const EFormatNF &format)
 
- 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 DbLinecreateFromSamples (Id nech, const ELoadBy &order, const 1 &tab, const 1 &lineCounts, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbLinecreateFromSamplesById (Id nech, const ELoadBy &order, const 1 &tab, const 1 &lineIds, const 1 &ranksPerId, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbLinecreateFromNF (const String &NFFilename, bool verbose=true)
 
static DbLinecreateFillRandom (Id ndim, Id nbline, Id nperline, double deltaX=5.0, const 1 &delta=1(), double unifDelta=0.3, Id seed=13422)
 Create a DbLine from the following information provided as input arguments.
 
static DbLinecreateVerticalFromGrid (const DbGrid &grid, const VectorString &names, const 1 &xranks, const 1 &yranks, Id byZ=1)
 
static DbLinecreateMarkersFromGrid (const DbGrid &grid, const String &name, const 1 &xranks, const 1 &yranks, const 1 &cuts)
 
- Static Public Member Functions inherited from gstlrn::Db
static Dbcreate ()
 
static DbcreateFromNF (const String &NFFilename, bool verbose=true)
 
static DbcreateFromSamples (Id nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const 1 &tab=1(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbcreateFromCSV (const String &filename, const CSVformat &csv=CSVformat(), bool verbose=false, Id ncol_max=-1, Id nrow_max=-1, bool flagAddSampleRank=true)
 
static DbcreateFromBox (Id nech, const 1 &coormin, const 1 &coormax, Id seed=43241, bool flag_exact=true, bool flag_repulsion=false, double range=0., double beta=0., double extend=0., bool flagAddSampleRank=true)
 
static DbcreateFromOnePoint (const 1 &tab=1(), bool flagAddSampleRank=true)
 
static DbcreateSamplingDb (const Db *dbin, double proportion=0., Id number=0, const VectorString &names=VectorString(), Id seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
static DbcreateFromDbGrid (Id nech, DbGrid *dbgrid, Id seed=432423, bool flag_exact=true, bool flag_repulsion=false, double range=0., double beta=0., bool flagAddSampleRank=true)
 
static DbcreateReduce (const Db *dbin, const VectorString &names=VectorString(), const 1 &ranks=1(), bool verbose=false)
 
static DbcreateFillRandom (Id ndat, Id ndim=2, Id nvar=1, Id nfex=0, Id ncode=0, double varmax=0., double selRatio=0., const 1 &heteroRatio=1(), const 1 &coormin=1(), const 1 &coormax=1(), Id seed=124234, bool flagAddSampleRank=true)
 
static DbcreateEmpty (Id ndat, Id ndim=2, Id nvar=1, Id nfex=0, Id ncode=0, bool flagVerr=false, bool flagSel=false, bool flagAddSampleRank=true)
 
static DbcreateFromGridRandomized (DbGrid *dbgrid, double randperc=0., bool flagAddSampleRank=true)
 
static Id getNEloc ()
 
static getMultipleSelectedRanks (const 1 &index, const 1 &ivars=1(), const 1 &nbgh=1())
 Return the vector of the ranks within 'index' of data beloging:
 
static getMultipleSelectedVariables (const 1 &index, const 1 &ivars=1(), const 1 &nbgh=1())
 
static Id getSimRank (Id isimu, Id ivar, Id icase, Id nbsimu, Id nvar)
 
static const DbcoverSeveralDbs (const Db *db1, const Db *db2, bool *isBuilt)
 
- Static Public Member Functions inherited from gstlrn::ASerializable
static String buildFileName (Id status, const String &filename, bool ensureDirExist=false)
 
static String getFileIdentity (const String &filename, bool verbose=false)
 
static void setPrefixName (const String &prefixName)
 
static void unsetPrefixName ()
 
static const StringgetPrefixName ()
 

Additional Inherited Members

- Public Attributes inherited from gstlrn::Db
 DECLARE_TOTL
 Has a specific implementation in the Target language.
 

Constructor & Destructor Documentation

◆ DbLine() [1/2]

gstlrn::DbLine::DbLine ( )

◆ DbLine() [2/2]

gstlrn::DbLine::DbLine ( const DbLine r)

◆ ~DbLine()

gstlrn::DbLine::~DbLine ( )
virtual

Member Function Documentation

◆ _getHeaderCoordinate()

gstlrn::DbLine::_getHeaderCoordinate ( Id  idim) const

◆ createFillRandom()

DbLine * gstlrn::DbLine::createFillRandom ( Id  ndim,
Id  nbline,
Id  nperline,
double  deltaX = 5.0,
const 1 &  delta = 1(),
double  unifDelta = 0.3,
Id  seed = 13422 
)
static

Create a DbLine from the following information provided as input arguments.

Parameters
ndimSpace dimension
nblineNumber of Lines
nperlineAverage number of samples per line
deltaXAverage distance between Lines along first space dimension
deltaAverage distances between samples along each line (in all directions)
unifDelta5half-) width of uniform distribution
seedSeed used for the random number generator
Returns
DbLine* Pointer to the newly created DbLine structure

◆ createFromNF()

DbLine * gstlrn::DbLine::createFromNF ( const String NFFilename,
bool  verbose = true 
)
static

Create a Db by loading the contents of a Neutral File

Parameters
NFFilenameName of the Neutral File (Db format)
verboseVerbose
Remarks
The name does not need to be completed in particular when defined by absolute path
or read from the Data Directory (in the gstlearn distribution)

◆ createFromSamples()

DbLine * gstlrn::DbLine::createFromSamples ( Id  nech,
const ELoadBy &  order,
const 1 &  tab,
const 1 &  lineCounts,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)
static

◆ createFromSamplesById()

DbLine * gstlrn::DbLine::createFromSamplesById ( Id  nech,
const ELoadBy &  order,
const 1 &  tab,
const 1 &  lineIds,
const 1 &  ranksPerId,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)
static

◆ createMarkersFromGrid()

DbLine * gstlrn::DbLine::createMarkersFromGrid ( const DbGrid grid,
const String name,
const 1 &  xranks,
const 1 &  yranks,
const 1 &  cuts 
)
static

◆ createStatToHeader()

Db * gstlrn::DbLine::createStatToHeader ( ) const

This is an example for a future more sophisticated method which will collect statistics calculated per line, and store them into a newly created Db. In the current version, the statistics only concerns the number of samples per Line.

Returns
Db* Resulting Db

◆ createVerticalFromGrid()

DbLine * gstlrn::DbLine::createVerticalFromGrid ( const DbGrid grid,
const VectorString names,
const 1 &  xranks,
const 1 &  yranks,
Id  byZ = 1 
)
static

◆ getCoordinatesPerLine()

gstlrn::DbLine::getCoordinatesPerLine ( Id  iline,
Id  idim 
) const

◆ getLineBySample()

Id gstlrn::DbLine::getLineBySample ( Id  iech) const

Returns the rank of the line containing the target address.

Parameters
iechTarget address
Returns
Id Returne line number

◆ getLineLength()

double gstlrn::DbLine::getLineLength ( Id  iline) const

◆ getLineLengths()

gstlrn::DbLine::getLineLengths ( ) const

◆ getLineSampleRank()

Id gstlrn::DbLine::getLineSampleRank ( Id  iline,
Id  isample 
) const

Returns the absolute rank of the sample 'isample' or the line 'iline' within the Db structure (ir -1 if an error occurs)

Parameters
ilineTarget line number
isampleTarget sample number within line
Returns
Rank of the sample

◆ getNLine()

Id gstlrn::DbLine::getNLine ( ) const

◆ getNSamplePerLine()

Id gstlrn::DbLine::getNSamplePerLine ( Id  iline) const

◆ getNTotal()

Id gstlrn::DbLine::getNTotal ( ) const

◆ isConsistent()

bool gstlrn::DbLine::isConsistent ( ) const
overridevirtual

Check if the contents of private member of this class is compatible with the number of samples stored in the Db.

Returns
true if everything is OK; false if a problem occurs

Reimplemented from gstlrn::Db.

◆ isLine()

bool gstlrn::DbLine::isLine ( ) const
inlineoverridevirtual

Db Interface.

Reimplemented from gstlrn::Db.

◆ mayChangeSampleNumber()

bool gstlrn::DbLine::mayChangeSampleNumber ( ) const
inlineoverridevirtual

Reimplemented from gstlrn::Db.

◆ operator=()

DbLine & gstlrn::DbLine::operator= ( const DbLine r)

◆ resetFromSamples()

Id gstlrn::DbLine::resetFromSamples ( Id  nech,
const ELoadBy &  order,
const 1 &  tab,
const 1 &  lineCounts,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)

Reset the contents of a DbLine from arguments (previous contents is cleared beforehand). The line contents is provided in 'lineCounts'.

Parameters
nechNumber of samples to be loaded
orderOrdering mode used for storing in 'tab' (by column or by sample)
tabVector containing the values to be imported
lineCountsVector giving the number of samples per Line (see details)
namesNames given to the output variables
locatorNamesName of the locators given to the output variables
flagAddSampleRankWhen TRUE, the 'rank' variable is added
Returns
Id Error returned code

: Argument 'lineCounts' give the number of samples per Line.

: This assumes that samples of per line are ordered sequentially

and that samples of Line 'j' are followed by those of Line 'j+1'.

◆ resetFromSamplesById()

Id gstlrn::DbLine::resetFromSamplesById ( Id  nech,
const ELoadBy &  order,
const 1 &  tab,
const 1 &  lineIds,
const 1 &  ranksPerId,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)

Reset the contents of a DbLine from arguments (previous contents is cleared beforehand). The line contents is provided in 'lineIds' and 'ranksPerId'.

Parameters
nechNumber of samples to be loaded
orderOrdering mode used for storing in 'tab' (by column or by sample)
tabVector containing the values to be imported
lineIdsVector giving the LineId to which each sample belongs (see details)
ranksPerIdVector giving the ordering of samples within Line (see details)
namesNames given to the output variables
locatorNamesName of the locators given to the output variables
flagAddSampleRankWhen TRUE, the 'rank' variable is added
Returns
Id Error returned code

: Argument 'lineIds' is dimensioned to the total number of samples.

: For each sample, it gives Id of Line to which the sample belongs.

: LineId must be numeric: equzl for samples of the same line and

: different for samples of different lines

: Argument 'ranksPerId' is dimensionned to total number of samples.

: Along the samples belonging to one line (sharing the same LineId)

: it should provide the ordering of the samples.

: For one line, the values of 'ranksPerId' must be numeric:

: they do not need to be consecutive ... simply ordered.

◆ toString()

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

ICloneable interface.

AStringable Interface

Reimplemented from gstlrn::Db.


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