Class containing the Data Information. More...
#include <Db.hpp>
Class containing the Data Information.
This Data Set benefits from the comparison to an Excel spread sheet: it can be considered as a Data Frame with a number of rows and a number of columns. The columns will correspond to variables and the rows to samples.
Notes:
Moreover each variable may be assigned a role (or functionality) in the rest of a script. This role is defined by a locator: for example, a variable can serve as a coordinate, or a target variable. The locators can be viewed in the following list (see ELoc.hpp). Note that a variable which does not play any role in particular may be assigned to an idle role (locator NA); This locator may be modified or cancelled (by the user) at any time.
There are two status for these locators: unique or multiple.
Unique. Only one variable can be assigned this unique locator: this is the case for the selection (SEL) as there may be only one current selection activated at a time.
Multiple. Several variable may be assigned the same locator: this is the case for the coordinates (X). In that case, the locator name is followed by its rank (1-based). Then the first coordinate will correspond to the locator X1, the second coordinate to X2, ... Note that:
Each variable (or column) can be designated:
Public Member Functions | |
Db () | |
Db (const Db &r) | |
Db & | operator= (const Db &r) |
virtual | ~Db () |
String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. | |
virtual bool | isGrid () const |
Interface for Db. | |
virtual bool | isLine () const |
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 bool | mayChangeSampleNumber () const |
virtual void | resetDims (Id ncol, Id nech) |
virtual bool | isConsistent () const |
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 |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (Id level) const final |
![]() | |
ASerializable () | |
ASerializable (const ASerializable &r) | |
ASerializable & | operator= (const ASerializable &r) |
ASerializable (ASerializable &&r) noexcept | |
ASerializable & | operator= (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) |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
std::shared_ptr< ICloneable > | cloneShared () const |
std::unique_ptr< ICloneable > | cloneUnique () const |
Static Public Member Functions | |
static Db * | create () |
static Db * | createFromNF (const String &NFFilename, bool verbose=true) |
static Db * | createFromSamples (Id nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const 1 &tab=1(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true) |
static Db * | createFromCSV (const String &filename, const CSVformat &csv=CSVformat(), bool verbose=false, Id ncol_max=-1, Id nrow_max=-1, bool flagAddSampleRank=true) |
static Db * | createFromBox (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 Db * | createFromOnePoint (const 1 &tab=1(), bool flagAddSampleRank=true) |
static Db * | createSamplingDb (const Db *dbin, double proportion=0., Id number=0, const VectorString &names=VectorString(), Id seed=23241, bool verbose=false, bool flagAddSampleRank=true) |
static Db * | createFromDbGrid (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 Db * | createReduce (const Db *dbin, const VectorString &names=VectorString(), const 1 &ranks=1(), bool verbose=false) |
static Db * | createFillRandom (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 Db * | createEmpty (Id ndat, Id ndim=2, Id nvar=1, Id nfex=0, Id ncode=0, bool flagVerr=false, bool flagSel=false, bool flagAddSampleRank=true) |
static Db * | createFromGridRandomized (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 Db * | coverSeveralDbs (const Db *db1, const Db *db2, bool *isBuilt) |
![]() | |
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 String & | getPrefixName () |
Public Attributes | |
DECLARE_TOTL | |
Has a specific implementation in the Target language. | |
gstlrn::Db::Db | ( | ) |
gstlrn::Db::Db | ( | const Db & | r | ) |
|
virtual |
Id gstlrn::Db::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 |
||
) |
Add one or several columns to an already existing Db. This is performed by providing an array of values 'tab'. Its dimension must be equal to the number of samples (or active samples if 'useSel' is true, times the number of variables 'nvar'.
tab | Array to be loaded |
radix | Generic name for the newly created variables |
locatorType | Generic locator assigned to new variables |
locatorIndex | Locator index (starting from 0) |
useSel | true if the Selection must be taken into account |
valinit | initial value (for unselected samples) |
nvar | Number of variables loaded |
Id gstlrn::Db::addColumnsByConstant | ( | Id | nadd = 1 , |
double | valinit = 0. , |
||
const String & | radix = "New" , |
||
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
Id | nechInit = 0 |
||
) |
Create a set of new variables in an already existing Db and initialize their contents to a constant value
nadd | Number of variables to be added |
valinit | Value to be used for variable initialization |
radix | Generic radix given to the newly created variables |
locatorType | Generic locator assigned to new variables |
locatorIndex | Locator index (starting from 0) |
nechInit | Number of samples (used only if the Db is initially empty) |
void gstlrn::Db::addColumnsByVVD | ( | const 1 & | tab, |
const String & | radix, | ||
const ELoc & | locatorType, | ||
Id | locatorIndex = 0 , |
||
bool | useSel = false |
||
) |
Id gstlrn::Db::addColumnsRandom | ( | Id | nadd, |
const String & | radix = "New" , |
||
const ELoc & | locatorType = ELoc::fromKey("Z") , |
||
Id | locatorIndex = 0 , |
||
Id | seed = 1352 , |
||
Id | nechInit = 0 |
||
) |
Create a set of new variables in an already existing Db and initialize their contents as a random value (from Normal distribution)
nadd | Number of variables to be added |
radix | Generic radix given to the newly created variables |
locatorType | Generic locator assigned to new variables |
locatorIndex | Locator index (starting from 0) |
seed | Seed value |
nechInit | Number of samples (used only if the Db is initially empty) |
Add samples to the Data Base
nadd | Number of samples to be added |
valinit | Default value given to the added samples |
Id gstlrn::Db::addSelection | ( | const 1 & | tab = 1() , |
const String & | name = "NewSel" , |
||
const String & | combine = "set" |
||
) |
Add the contents of the 'tab' as a Selection
tab | Input array |
name | Name given to the newly created Selection variable |
combine | How to combine with an already existing selection (see combineSelection() for details) |
Id gstlrn::Db::addSelectionByLimit | ( | const String & | testvar, |
const Limits & | limits = Limits() , |
||
const String & | name = "NewSel" , |
||
const String & | combine = "set" |
||
) |
Create a selection around the only defined values of the target variable
testvar | Name of the target variable |
limits | Limits defining the Definition Domain to be tested (optional) |
name | Name of the newly created selection |
combine | How to combine with an already existing selection (see combineSelection() for details) |
Id gstlrn::Db::addSelectionByRanks | ( | const 1 & | ranks, |
const String & | name = "NewSel" , |
||
const String & | combine = "set" |
||
) |
Add a Selection by considering the input 'ranks' vector which give the ranks of the active samples (starting from 0)
ranks | Vector of ranks of active samples |
name | Name given to the newly created Selection variable |
combine | How to combine with an already existing selection (see combineSelection() for details) |
Id gstlrn::Db::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'.
varname | Name of the target variable |
lower | Lower bound (included) or TEST for no lower bound |
upper | Upper bound (included) or TEST for no upper bound |
name | Name given to the newly created selection |
oldSelName | If defined, the current selection is combined with the existing one |
Id gstlrn::Db::addSelectionFromDbByConvexHull | ( | Db * | db, |
double | dilate = 0. , |
||
bool | verbose = false , |
||
const NamingConvention & | namconv = NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")) |
||
) |
Create a Selection based on the Convex Hull of the active samples of 'Db'
db | Data Base providing the (active) samples |
dilate | The convex hull can be dilated: this gives the radius |
verbose | Verbose option |
namconv | Naming Convention |
Id gstlrn::Db::addSelectionRandom | ( | double | prop, |
Id | seed = 138213 , |
||
const String & | name = "NewSel" , |
||
const String & | combine = "set" |
||
) |
Create a Selection based on a proportion of active samples
prop | Proportion of active samples (between 0 and 1) |
seed | Seed for the random number generator |
name | Name of the newly created selection |
combine | How to combine with an already existing selection (see combineSelection() for details) |
bool gstlrn::Db::areSame | ( | const String & | name1, |
const String & | name2, | ||
double | eps = EPSILON3 , |
||
bool | useSel = true , |
||
bool | verbose = false |
||
) | const |
void gstlrn::Db::clearLocators | ( | const ELoc & | locatorType | ) |
|
inline |
void gstlrn::Db::combineSelection | ( | 1 & | sel, |
const String & | combine = "set" |
||
) | const |
Combine 'sel' input argument with an already existing selection (if any)
sel | Input selection (only 0 and 1) |
combine | Type of combination: "set", "not", "or", "and", "xor" |
Deleting a sample
e_del | Index of the sample to be deleted |
Id gstlrn::Db::deleteSamples | ( | const 1 & | e_dels | ) |
gstlrn::Db::filter | ( | const String & | name, |
const Interval & | interval, | ||
Id | belowRow = ITEST , |
||
Id | aboveRow = ITEST |
||
) | const |
Find the occurrence of a given range of values for a given variable
name | Name of the Target variable |
interval | Interval definition |
belowRow | If specified, search must be performed below this row |
aboveRow | If specified, search must be performed above this row |
void gstlrn::Db::generateRank | ( | const String & | radix = "rank" | ) |
VectorBool gstlrn::Db::getActiveArray | ( | ) | const |
gstlrn::Db::getAllCoordinates | ( | bool | useSel = false | ) | const |
Constitute a Vector of Vector of coordinates for all (active) samples
useSel |
MatrixDense gstlrn::Db::getAllCoordinatesMat | ( | const MatrixDense & | box = MatrixDense() | ) | const |
Constitute a Matrix of coordinates for all (active) samples
gstlrn::Db::getAllUIDs | ( | ) | const |
void gstlrn::Db::getAllUIDs | ( | 1 & | iuids | ) | const |
Return the value defined by Sample and UID
iech | Sample Index |
iuid | UID Index |
void gstlrn::Db::getArrayBySample | ( | std::vector< double > & | vals, |
Id | iech | ||
) | const |
gstlrn::Db::getArrayByUID | ( | Id | iuid, |
bool | useSel = false |
||
) | const |
|
inline |
void gstlrn::Db::getArrayVec | ( | const 1 & | iechs, |
Id | iuid, | ||
1 & | values | ||
) | const |
Get the values of a series of samples
iechs | List of sample indices |
iuid | Index of the UID |
values | List of values to be written |
gstlrn::Db::getCodeList | ( | void | ) | const |
Returns the list of Unique codes
const double * gstlrn::Db::getColAdressByColIdx | ( | Id | icol | ) | const |
Returns the rank of the Single Column corresponding to 'name'
name | Named for the searched column |
Find Column for a given Locator characteristics
locatorType | Locator type |
locatorIndex | Locator index (starting from 0) |
gstlrn::Db::getColIdxs | ( | const String & | name | ) | const |
gstlrn::Db::getColIdxs | ( | const VectorString & | names | ) | const |
gstlrn::Db::getColIdxsByLocator | ( | const ELoc & | locatorType | ) | const |
gstlrn::Db::getColIdxsByUID | ( | const 1 & | iuids | ) | const |
Return the coordinate of a sample along one Space Dimension
iech | Rank of the sample |
idim | Rank of the Space Dimension |
flag_rotate | Use the rotation (only for Grid) |
Reimplemented in gstlrn::DbGrid.
|
virtual |
Update the vector of coordinates (optimized manner) No check is done with respect to the dimension of the returned vector.
coor | Returned vector of coordinates (should be dimensionned beforehand) |
iech | Rank of the target |
flag_rotate | True if Grid rotation must be taken into account |
Reimplemented in gstlrn::DbGrid.
Calculates the cosine of the angle between a reference direction and the increment between two points in the same Db
[in] | iech1 | rank of the first sample |
[in] | iech2 | rank of the second sample |
[in] | codir | Direction coefficient |
gstlrn::Db::getGradient | ( | Id | item, |
bool | useSel = false |
||
) | const |
gstlrn::Db::getIncrements | ( | const 1 & | iechs, |
const 1 & | jechs | ||
) | const |
gstlrn::Db::getItem | ( | const 1 & | rows, |
const ELoc & | locatorType, | ||
bool | useSel = false |
||
) | const |
gstlrn::Db::getItem | ( | const 1 & | rows, |
const String & | colname, | ||
bool | useSel = false |
||
) | const |
gstlrn::Db::getItem | ( | const 1 & | rows, |
const VectorString & | colnames, | ||
bool | useSel = false |
||
) | const |
gstlrn::Db::getItem | ( | const ELoc & | locatorType, |
bool | useSel = false |
||
) | const |
gstlrn::Db::getItem | ( | const String & | colname, |
bool | useSel = false |
||
) | const |
gstlrn::Db::getItem | ( | const VectorString & | colnames, |
bool | useSel = false |
||
) | const |
VectorString gstlrn::Db::getItemNames | ( | const ELoc & | locatorType | ) | const |
VectorString gstlrn::Db::getItemNames | ( | const String & | colname | ) | const |
VectorString gstlrn::Db::getItemNames | ( | const VectorString & | colnames | ) | const |
Returns the rank of (one of) the lastly added UID in the Db
number | 0 designates the last, 1 the one before last... |
Id gstlrn::Db::getListOfSampleIndicesInPlace | ( | Id | nvar, |
1 & | cumul, | ||
1 & | ranks, | ||
bool | useSel = true |
||
) | const |
Updates (and resizes) the two arguments:
nvar | Number of variables |
cumul | Vector of cumulated number of defined samples per variable |
ranks | Vector of vectors of ranks of defined samples |
useSel | Discard the masked samples (if True) |
Id gstlrn::Db::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',.
ranks | Vector of the (defined) sample indices |
ivar | Index of the variable of interest |
useSel | Discard the masked samples (if True) |
bool gstlrn::Db::getLocator | ( | const String & | name, |
ELoc * | ret_locatorType, | ||
Id * | ret_locatorIndex | ||
) | const |
Return the locator information corresponding to the input variable
name | Input variable name (unique) |
ret_locatorType | Locator Type |
ret_locatorIndex | Locator Index (starting from 0) |
bool gstlrn::Db::getLocatorByColIdx | ( | Id | icol, |
ELoc * | ret_locatorType, | ||
Id * | ret_locatorIndex | ||
) | const |
Find the locator characteristics of a given Column
icol | Index of the target column |
ret_locatorType | Locator type |
ret_locatorIndex | Locator index (starting from 0) |
VectorString gstlrn::Db::getLocators | ( | bool | anyLocator = true , |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") |
||
) | const |
|
static |
Return the vector of the ranks within 'index' of data beloging:
index | Input data information ranks |
ivars | Vector of selection variables |
nbgh | Vector of selection samples |
|
static |
|
inline |
|
virtual |
Reimplemented in gstlrn::DbGrid.
|
static |
Id gstlrn::Db::getNFacies | ( | void | ) | const |
Returns the Number of different facies (labelling starts at 1) The facies variable must be locatorized as ELoc::Z and be unique
Id gstlrn::Db::getNInterval | ( | ) | const |
Id gstlrn::Db::getNSample | ( | bool | useSel = false | ) | const |
Returns the Number of samples
useSel | When FALSE returns the total sample number. When TRUE returns the number of active samples |
GSTLEARN_DEPRECATED Id gstlrn::Db::getNSampleActive | ( | ) | const |
Returns the number of active samples if a Selection is already defined.
If no Selection is currently defined, it returns the total number of samples (see getNSample())
Returns the number of active samples for which the variable 'name' is defined
name | Name of the Target variable |
Returns the number of active samples for which the target variable (ELoc::Z) is defined
item | Rank of the ELoc::Z variable |
|
inline |
Id gstlrn::Db::getNZValues | ( | ) | const |
gstlrn::Db::getOneCoordinate | ( | Id | idim, |
bool | useSel = false , |
||
bool | flag_rotate = true |
||
) | const |
Returns the vector of coordinates along a given Space Dimension
idim | Rank of the Space dimension |
useSel | Use the Data Selection |
flag_rotate | Flag for rotation (only for Grid) |
Return the absolute rank of a sample from its relative rank
irel | Relative rank |
void gstlrn::Db::getSampleAsSPInPlace | ( | SpacePoint & | P, |
Id | iabs | ||
) | const |
In the SpacePoint 'P', define the sample rank and coordinates.
P | SpacePoint reference (output) |
iabs | Rank of the sample |
|
virtual |
Load a Space Target with all possible contents gathered from Db
iech | Rank of the target sample |
P | Space Target (used to store information) |
Reimplemented in gstlrn::DbGrid.
gstlrn::Db::getSampleCoordinates | ( | Id | iech | ) | const |
gstlrn::Db::getSampleLocators | ( | const ELoc & | locatorType, |
Id | iech | ||
) | const |
gstlrn::Db::getSampleRanks | ( | const 1 & | ivars = 1() , |
const 1 & | nbgh = 1() , |
||
bool | useSel = true , |
||
bool | useZ = true , |
||
bool | useVerr = false , |
||
bool | useExtD = true |
||
) | const |
Returns the list of indices 'index' for valid samples for the set of variables 'ivars'. Note: each address is ABSOLUTE to the target set of available samples.
ivars | Vector giving the indices of the variables of interest |
nbgh | Vector giving the ranks of the elligible samples (optional) |
useSel | Discard the masked samples (if True) |
useZ | Discard samples when Z is not defined |
useVerr | Discard the samples where Verr (optional) is not defined |
useExtD | True if the definition of the External Drift must be checked |
void gstlrn::Db::getSampleRanksInPlace | ( | 1 & | sampleRanks, |
const 1 & | ivars = 1() , |
||
const 1 & | nbgh = 1() , |
||
bool | useSel = true , |
||
bool | useZ = true , |
||
bool | useVerr = false , |
||
bool | useExtD = true |
||
) | const |
Compute the list of indices 'index' for valid samples for the set of variables 'ivars'. Note: each address is ABSOLUTE to the target set of available samples.
sampleRanks | Return the list of indices 'index' for valid samples |
ivars | Vector giving the indices of the variables of interest |
nbgh | Vector giving the ranks of the elligible samples (optional) |
useSel | Discard the masked samples (if True) |
useZ | Discard samples when Z is not defined |
useVerr | Discard the samples where Verr (optional) is not defined |
useExtD | True if the definition of the External Drift must be checked |
void gstlrn::Db::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'.
ranks | Vector of elligible sample ranks (Input/Output) |
nbgh | Set of potentiel sample ranks |
ivar | Target variable rank |
useSel | True if the selection must be taken into account |
useZ | True if the definition of the target variable must be checked |
useVerr | True if the definition of the Variance of Measurement Error must be checked |
useExtD | True if the definition of the External Drift must be checked |
void gstlrn::Db::getSamplesAsSP | ( | std::vector< SpacePoint > & | pvec, |
const ASpaceSharedPtr & | space, | ||
bool | useSel = false |
||
) | const |
void gstlrn::Db::getSamplesFromNbghAsSP | ( | std::vector< SpacePoint > & | pvec, |
const 1 & | nbgh | ||
) | const |
Return the Selection value at Sample 'iech'
iech | Sample number |
gstlrn::Db::getSelections | ( | void | ) | const |
gstlrn::Db::getSortArray | ( | ) | const |
Return the vector of ordered samples by increasing coordinate along X
gstlrn::Db::getTangent | ( | Id | item, |
bool | useSel = false |
||
) | const |
Returns the Single UID which corresponds to the searched name
name | Name to be searched for |
gstlrn::Db::getUIDs | ( | const VectorString & | names | ) | const |
gstlrn::Db::getUIDsByColIdx | ( | const 1 & | icols | ) | const |
gstlrn::Db::getUIDsByLocator | ( | const ELoc & | locatorType | ) | const |
|
virtual |
Return a Unit calculated for a Db (in a given Space dimension)
idim | Rank of the Space dimension |
Reimplemented in gstlrn::DbGrid.
Returns the value of the 'iech' sample of the variable 'name'
This function does not use 'ids' mechanism in order to allow referring to a non-existing variable
gstlrn::Db::getValuesByColIdx | ( | const 1 & | iechs, |
const 1 & | icols, | ||
bool | bySample = false |
||
) | const |
gstlrn::Db::getValuesByNames | ( | const 1 & | iechs, |
const VectorString & | names, | ||
bool | bySample = false |
||
) | const |
gstlrn::Db::getValuesByRanks | ( | const 1 & | sampleRanks, |
const 1 & | means = 1() , |
||
bool | subtractMean = true |
||
) | const |
Returns the values of the Z variables for the samples
sampleRanks | Vector of ranks of the samples |
means | Vector of means (optional) |
subtractMean | Subtract the mean from the values |
void gstlrn::Db::getValuesByRanksInPlace | ( | 1 * | values, |
const 1 & | sampleRanks, | ||
const 1 & | means = 1() , |
||
bool | subtractMean = true |
||
) | const |
double gstlrn::Db::getWeight | ( | Id | iech | ) | const |
gstlrn::Db::getWeights | ( | bool | useSel = false | ) | const |
gstlrn::Db::getWithinBounds | ( | Id | item, |
bool | useSel = false |
||
) | const |
bool gstlrn::Db::hasLargerDimension | ( | const Db * | dbaux | ) | const |
Check if the Space Dimension of 'dbaux' is larger (or equal) than the one of 'this'
dbaux | Second Db |
bool gstlrn::Db::hasLocator | ( | const ELoc & | locatorType | ) | const |
bool gstlrn::Db::hasLocatorDefined | ( | const String & | name, |
const ELoc & | locatorType, | ||
Id | locatorIndex = 0 |
||
) | const |
Check if a variable (specified by its name) matches the required locator
name | Name of the target Variable |
locatorType | Characteristics of the required Locator Type |
locatorIndex | Index of the required Locator (or -1) |
bool gstlrn::Db::hasSameDimension | ( | const Db * | dbaux | ) | const |
bool gstlrn::Db::hasZVariable | ( | ) | const |
bool gstlrn::Db::isActive | ( | Id | iech | ) | const |
bool gstlrn::Db::isActiveDomain | ( | Id | iech | ) | const |
bool gstlrn::Db::isAllIsotopic | ( | ) | const |
Check that all the active samples are isotopic
bool gstlrn::Db::isAllUndefined | ( | Id | iech | ) | const |
bool gstlrn::Db::isAllUndefinedByType | ( | const ELoc & | loctype, |
Id | iech | ||
) | const |
|
inlinevirtual |
Reimplemented in gstlrn::DbGraphO, gstlrn::DbGrid, gstlrn::DbLine, gstlrn::DbMeshStandard, and gstlrn::DbMeshTurbo.
|
inlinevirtual |
Interface for Db.
Reimplemented in gstlrn::DbGrid.
Check if the information (ELOC.Z) for a sample is isotopic or not Isotopic says that all variables (for this sample) are defined
iech | Rank of the sample |
nvar_max | Maximum number of variables to be checked (or -1) |
|
inlinevirtual |
Reimplemented in gstlrn::DbGraphO, and gstlrn::DbLine.
|
inlinevirtual |
Reimplemented in gstlrn::DbMeshStandard, and gstlrn::DbMeshTurbo.
Checks the number of variables in 'this' compared to the required 'nvar'
bool gstlrn::Db::isUIDDefined | ( | Id | iuid | ) | const |
|
inlinevirtual |
Reimplemented in gstlrn::DbGraphO, gstlrn::DbGrid, gstlrn::DbLine, gstlrn::DbMeshStandard, and gstlrn::DbMeshTurbo.
Table gstlrn::Db::printOneSample | ( | Id | iech, |
const VectorString & | names = VectorString() , |
||
bool | excludeCoordinates = true , |
||
bool | skipTitle = false |
||
) | const |
Reimplemented in gstlrn::DbGrid.
void gstlrn::Db::setAllColumns | ( | const 1 & | tabs | ) |
Setting the contents of all the Columns of a Db
tabs | Vector of vectors containing the values to be assigned |
Set the value by Sample and UID
iech | Index of the Sample |
iuid | Index of the UID |
value | Value to be assigned |
void gstlrn::Db::setArrayBySample | ( | Id | iech, |
const 1 & | vec | ||
) |
void gstlrn::Db::setArrayByUID | ( | const 1 & | tab, |
Id | iuid | ||
) |
void gstlrn::Db::setArrayVec | ( | const 1 & | iechs, |
Id | iuid, | ||
const 1 & | values | ||
) |
Set the values of a series of samples
iechs | List of sample indices |
iuid | Index of the UID |
values | List of values to be written |
void gstlrn::Db::setColumn | ( | const 1 & | tab, |
const String & | name, | ||
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | useSel = false |
||
) |
Set the values for an already existing Column. Note that, if the Column does not exist, this Column is added beforehand
tab | Array of values to be stored in the target Column |
name | Name of the Column |
locatorType | Locator type |
locatorIndex | Locator index (starting from 0) |
useSel | Should an already existing Selection be taken into account |
void gstlrn::Db::setColumnByColIdx | ( | const 1 & | tab, |
Id | icol, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setColumnByColIdxOldStyle | ( | const double * | tab, |
Id | icol, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setColumnByUID | ( | const 1 & | tab, |
Id | iuid, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setColumnByUIDOldStyle | ( | const double * | tab, |
Id | iuid, | ||
bool | useSel = false |
||
) |
Update the contents of an already existing variable in a Db
tab | Vector containing the values to be written |
iuid | UID of the already existing variable to be written |
useSel | When TRUE, take the Selection into account (seed remarks) |
void gstlrn::Db::setColumnsByColIdx | ( | const 1 & | tabs, |
const 1 & | icols, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setCoordinates | ( | Id | idim, |
const 1 & | coor, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setFromLocator | ( | const ELoc & | locatorType, |
Id | iech, | ||
Id | locatorIndex, | ||
double | value | ||
) |
Id gstlrn::Db::setItem | ( | const 1 & | rows, |
const ELoc & | locatorType, | ||
const 1 & | values, | ||
bool | useSel = false |
||
) |
Id gstlrn::Db::setItem | ( | const 1 & | rows, |
const String & | colname, | ||
const 1 & | values, | ||
bool | useSel = false |
||
) |
Id gstlrn::Db::setItem | ( | const 1 & | rows, |
const VectorString & | colnames, | ||
const 1 & | values, | ||
bool | useSel = false |
||
) |
Id gstlrn::Db::setItem | ( | const ELoc & | locatorType, |
const 1 & | values, | ||
bool | useSel = false |
||
) |
Id gstlrn::Db::setItem | ( | const VectorString & | colnames, |
const 1 & | values, | ||
bool | useSel = false |
||
) |
void gstlrn::Db::setLocator | ( | const String & | name, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
Define the Locator(s) for the given variable(s)
name | Variable name |
locatorType | Locator Type |
locatorIndex | Locator Index (for the first variable) (starting from 0) |
cleanSameLocator | When TRUE, clean variables with same locator beforehand |
void gstlrn::Db::setLocatorByColIdx | ( | Id | icol, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
void gstlrn::Db::setLocatorByUID | ( | Id | iuid, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
Setting the locator for a variable designated by its UID
iuid | Index of the UID |
locatorType | Type of locator (include ELoc::UNKNOWN) |
locatorIndex | Rank in the Locator (starting from 0) |
cleanSameLocator | When TRUE, clean variables with same locator beforehand |
void gstlrn::Db::setLocators | ( | const VectorString & | names, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
Setting the locator for a set of variables designated by their names
names | Vector of variable names |
locatorType | Locator type (include ELoc::UNKNOWN) |
locatorIndex | Starting locator rank (starting from 0) |
cleanSameLocator | When TRUE, clean variables with same locator beforehand |
void gstlrn::Db::setLocatorsByColIdx | ( | const 1 & | icols, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
void gstlrn::Db::setLocatorsByUID | ( | const 1 & | iuids, |
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
void gstlrn::Db::setLocatorsByUID | ( | Id | number, |
Id | iuid, | ||
const ELoc & | locatorType = ELoc::fromKey("UNKNOWN") , |
||
Id | locatorIndex = 0 , |
||
bool | cleanSameLocator = false |
||
) |
Set the Locators for a set of variables identified by their UID
number | Number of variables to be set |
iuid | Index of the first UID |
locatorType | Type of the Locator (include ELoc::UNKNOWN) |
locatorIndex | Rank of the first Locator index (starting from 0) |
cleanSameLocator | When TRUE, clean variables with same locator beforehand |
void gstlrn::Db::setLocVariables | ( | const ELoc & | loctype, |
Id | iech, | ||
const 1 & | values | ||
) |
void gstlrn::Db::setSampleCoordinates | ( | Id | iech, |
const 1 & | coor | ||
) |
Sets the value of the 'iech' sample of the variable 'name'
This function does not use 'ids' mechanism in order to allow referring to a non-existing variable
void gstlrn::Db::setValuesByColIdx | ( | const 1 & | iechs, |
const 1 & | icols, | ||
const 1 & | values, | ||
bool | bySample = false |
||
) |
void gstlrn::Db::setValuesByNames | ( | const 1 & | iechs, |
const VectorString & | names, | ||
const 1 & | values, | ||
bool | bySample = false |
||
) |
gstlrn::Db::shrinkToValidCols | ( | const 1 & | cols | ) | const |
gstlrn::Db::shrinkToValidRows | ( | const 1 & | rows | ) | const |
void gstlrn::Db::switchLocator | ( | const ELoc & | locatorType_in, |
const ELoc & | locatorType_out | ||
) |
|
overridevirtual |
ICloneable interface.
AStringable Interface
Reimplemented from gstlrn::AStringable.
Reimplemented in gstlrn::DbGraphO, gstlrn::DbGrid, gstlrn::DbLine, gstlrn::DbMeshStandard, and gstlrn::DbMeshTurbo.
void gstlrn::Db::updArrayVec | ( | const 1 & | iechs, |
Id | iuid, | ||
const EOperator & | oper, | ||
1 & | values | ||
) |
gstlrn::Db::DECLARE_TOTL |
Has a specific implementation in the Target language.