1.4.1
CCC
 
DbLine Class Reference

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

#include <DbLine.hpp>

Inheritance diagram for DbLine:
Db AStringable ASerializable 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 ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 ICloneable interface. More...
 
bool isLine () const override
 Db Interface. More...
 
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. More...
 
int resetFromSamples (int nech, const ELoadBy &order, const VectorDouble &tab, const VectorInt &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'. More...
 
int resetFromSamplesById (int nech, const ELoadBy &order, const VectorDouble &tab, const VectorInt &lineIds, const VectorInt &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'. More...
 
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. More...
 
int getLineNumber () const
 
int getLineSampleCount (int iline) const
 
double getLineLength (int iline) const
 
int getNTotal () const
 
int getLineBySample (int iech) const
 Returns the rank of the line containing the target address. More...
 
VectorDouble _getHeaderCoordinate (int idim) const
 
VectorDouble getCoordinates (int iline, int idim) const
 
- Public Member Functions inherited from Db
 Db ()
 
 Db (const Db &r)
 
Dboperator= (const Db &r)
 
virtual ~Db ()
 
virtual bool isGrid () const
 Interface for Db. More...
 
virtual bool isMesh () const
 
virtual double getCoordinate (int iech, int idim, bool flag_rotate=true) const
 
virtual void getCoordinatesPerSampleInPlace (int iech, VectorDouble &coor, bool flag_rotate=true) const
 
virtual double getUnit (int idim=0) const
 
virtual int getNDim () const
 
virtual void resetDims (int ncol, int nech)
 
int resetFromSamples (int nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
int resetFromCSV (const String &filename, bool verbose, const CSVformat &csvfmt, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=true)
 
int resetFromBox (int nech, const VectorDouble &coormin, const VectorDouble &coormax, int ndim=2, double extend=0., int seed=321415, bool flagAddSampleRank=true)
 
int resetFromOnePoint (const VectorDouble &tab=VectorDouble(), bool flagAddSampleRank=true)
 
int resetSamplingDb (const Db *dbin, double proportion=0, int number=0, const VectorString &names=VectorString(), int seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
int resetReduce (const Db *dbin, const VectorString &names=VectorString(), const VectorInt &ranks=VectorInt(), bool verbose=false)
 
const VectorDoublegetArrays () const
 
String getNameByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
String getNameByColIdx (int icol) const
 
String getNameByUID (int iuid) const
 
VectorString getName (const String &name) const
 
VectorString getNames (const VectorString &names) const
 
VectorString getNamesByLocator (const ELoc &locatorType) const
 
VectorString getNamesByColIdx (const VectorInt &icols) const
 
VectorString getNamesByUID (const VectorInt &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 (int iuid, const String &name)
 
void setNameByColIdx (int 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
 
int getUIDMaxNumber () const
 
int getColumnNumber () const
 
int getSampleNumber (bool useSel=false) const
 
int getNumberActiveAndDefined (int item) const
 
int getActiveSampleNumber () const
 
int getRankRelativeToAbsolute (int irel) const
 
int getRankAbsoluteToRelative (int iabs) const
 
void clearLocators (const ELoc &locatorType)
 
void clearSelection ()
 
void setLocatorByUID (int iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorByColIdx (int icol, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocator (const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocators (const VectorString &names, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (int number, int iuid, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByUID (const VectorInt &iuids, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void setLocatorsByColIdx (const VectorInt &icols, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool cleanSameLocator=false)
 
void addColumnsByVVD (const VectorVectorDouble &tab, const String &radix, const ELoc &locatorType, int locatorIndex=0, bool useSel=false)
 
int addColumns (const VectorDouble &tab, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool useSel=false, double valinit=0., int nvar=1)
 
int addColumnsByConstant (int nadd=1, double valinit=0., const String &radix="New", const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, int nechInit=0)
 
int addColumnsRandom (int nadd, const String &radix="New", const ELoc &locatorType=ELoc::fromKey("Z"), int locatorIndex=0, int seed=1352, int nechInit=0)
 
int addSelection (const VectorDouble &tab=VectorDouble(), const String &name="NewSel", const String &combine="set")
 
int addSelectionByRanks (const VectorInt &ranks, const String &name="NewSel", const String &combine="set")
 
int addSelectionByLimit (const String &testvar, const Limits &limits=Limits(), const String &name="NewSel", const String &combine="set")
 
int addSelectionFromDbByConvexHull (Db *db, double dilate=0., bool verbose=false, const NamingConvention &namconv=NamingConvention("Hull", true, true, true, ELoc::fromKey("SEL")))
 
int addSelectionRandom (double prop, int seed=138213, const String &name="NewSel", const String &combine="set")
 
int addSamples (int nadd, double valinit=TEST)
 
int deleteSample (int e_del)
 
int deleteSamples (const VectorInt &e_dels)
 
void switchLocator (const ELoc &locatorType_in, const ELoc &locatorType_out)
 
int getLastUID (int number=0) const
 
String getLastName (int number=0) const
 
int getColIdx (const String &name) const
 
int getColIdxByUID (int iuid) const
 
int getColIdxByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
VectorInt getColIdxs (const String &name) const
 
VectorInt getColIdxs (const VectorString &names) const
 
VectorInt getColIdxsByUID (const VectorInt &iuids) const
 
VectorInt getColIdxsByLocator (const ELoc &locatorType) const
 
void setColumn (const VectorDouble &tab, const String &name, const ELoc &locatorType=ELoc::fromKey("UNKNOWN"), int locatorIndex=0, bool useSel=false)
 
void setColumnByUIDOldStyle (const double *tab, int iuid, bool useSel=false)
 
void setColumnByUID (const VectorDouble &tab, int iuid, bool useSel=false)
 
void setColumnByColIdx (const VectorDouble &tab, int icol, bool useSel=false)
 
void setColumnsByColIdx (const VectorDouble &tabs, const VectorInt &icols, bool useSel=false)
 
void setColumnByColIdxOldStyle (const double *tab, int icol, bool useSel=false)
 
void duplicateColumnByUID (int iuid_in, int iuid_out)
 
VectorVectorDouble getItem (const VectorInt &rows, const VectorString &colnames, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorInt &rows, const String &colname, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorInt &rows, const ELoc &locatorType, bool useSel=false) const
 
VectorVectorDouble getItem (const VectorString &colnames, bool useSel=false) const
 
VectorVectorDouble getItem (const String &colname, bool useSel=false) const
 
VectorVectorDouble 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
 
int setItem (const VectorInt &rows, const VectorString &colnames, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorInt &rows, const ELoc &locatorType, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorString &colnames, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const ELoc &locatorType, const VectorVectorDouble &values, bool useSel=false)
 
int setItem (const VectorInt &rows, const String &colname, const VectorDouble &values, bool useSel=false)
 
int setItem (const String &colname, const VectorDouble &values, bool useSel=false)
 
bool getLocator (const String &name, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
bool getLocatorByColIdx (int icol, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
bool getLocatorByUID (int iuid, ELoc *ret_locatorType, int *ret_locatorIndex) const
 
VectorString getLocators (bool anyLocator=true, const ELoc &locatorType=ELoc::fromKey("UNKNOWN")) const
 
int getLocatorNumber (const ELoc &locatorType) const
 
bool isUIDDefined (int iuid) const
 
int getUID (const String &name) const
 
int getUIDByColIdx (int icol) const
 
int getUIDByLocator (const ELoc &locatorType, int locatorIndex=0) const
 
VectorInt getUIDs (const VectorString &names) const
 
VectorInt getUIDsByLocator (const ELoc &locatorType) const
 
VectorInt getUIDsByColIdx (const VectorInt &icols) const
 
VectorInt getAllUIDs () const
 
void copyByUID (int iuidIn, int iuidOut)
 
void copyByCol (int icolIn, int icolOut)
 
int getFaciesNumber (void) const
 
bool hasLocatorDefined (const String &name, const ELoc &locatorType, int locatorIndex=0) const
 
VectorDouble getSampleCoordinates (int iech) const
 
void getSampleAsSPInPlace (int iech, SpacePoint &P) const
 
virtual void getSampleAsSTInPlace (int iech, SpaceTarget &P) const
 
void getSampleCoordinatesInPlace (int iech, VectorDouble &coor) const
 
VectorDouble getSampleLocators (const ELoc &locatorType, int iech) const
 
VectorVectorDouble getIncrements (const VectorInt &iechs, const VectorInt &jechs) const
 
VectorDouble getCoordinates (int idim, bool useSel=false, bool flag_rotate=true) const
 
VectorVectorDouble getAllCoordinates (bool useSel=false) const
 
MatrixRectangular getAllCoordinatesMat () const
 
void setCoordinate (int iech, int idim, double value)
 
void setCoordinates (int idim, const VectorDouble &coor, bool useSel=false)
 
void setSampleCoordinates (int iech, const VectorDouble &coor)
 
double getDistance1D (int iech, int jech, int idim=0, bool flagAbs=false) const
 
double getDistance (int iech, int jech) const
 
int getDistanceVecInPlace (int iech, int jech, VectorDouble &dd, const Db *db2=nullptr) const
 
double getValue (const String &name, int iech) const
 
void setValue (const String &name, int iech, double value)
 
double getArray (int iech, int iuid) const
 
void getArrayVec (const VectorInt &iechs, int iuid, VectorDouble &values) const
 
void setArray (int iech, int iuid, double value)
 
void setArrayVec (const VectorInt &iechs, int iuid, const VectorDouble &values)
 
void updArray (int iech, int iuid, const EOperator &oper, double value)
 
void updArrayVec (const VectorInt &iechs, int iuid, const EOperator &oper, VectorDouble &values)
 
VectorDouble getArrayByUID (int iuid, bool useSel=false) const
 
VectorDouble getArrayBySample (int iech) const
 
void setArrayBySample (int iech, const VectorDouble &vec)
 
std::vector< SpacePointgetSamplesAsSP (bool useSel=false) const
 
bool hasLocator (const ELoc &locatorType) const
 
int getFromLocatorNumber (const ELoc &locatorType) const
 
double getFromLocator (const ELoc &locatorType, int iech, int locatorIndex=0) const
 
void setFromLocator (const ELoc &locatorType, int iech, int locatorIndex, double value)
 
double getValueByColIdx (int iech, int icol) const
 
void setValueByColIdx (int iech, int icol, double value)
 
VectorDouble getValuesByNames (const VectorInt &iechs, const VectorString &names, bool bySample=false) const
 
VectorDouble getValuesByColIdx (const VectorInt &iechs, const VectorInt &icols, bool bySample=false) const
 
void setValuesByNames (const VectorInt &iechs, const VectorString &names, const VectorDouble &values, bool bySample=false)
 
void setValuesByColIdx (const VectorInt &iechs, const VectorInt &icols, const VectorDouble &values, bool bySample=false)
 
int getLocNumber (const ELoc &loctype) const
 
bool hasLocVariable (const ELoc &loctype) const
 
double getLocVariable (const ELoc &loctype, int iech, int item) const
 
void setLocVariable (const ELoc &loctype, int iech, int item, double value)
 
void updLocVariable (const ELoc &loctype, int iech, int item, const EOperator &oper, double value)
 
int getZNumber () const
 
bool hasZVariable () const
 
double getZVariable (int iech, int item) const
 
void setZVariable (int iech, int item, double value)
 
void updZVariable (int iech, int item, const EOperator &oper, double value)
 
VectorDouble getLocVariables (const ELoc &loctype, int iech, int nitemax=0) const
 
void setLocVariables (const ELoc &loctype, int iech, const VectorDouble &values)
 
bool isVariableNumberComparedTo (int nvar, int compare=0) const
 
bool isIsotopic (int iech, int nvar_max=-1) const
 
bool isAllUndefined (int iech) const
 
bool isAllUndefinedByType (const ELoc &loctype, int iech) const
 
bool isAllIsotopic () const
 
void setInterval (int iech, int item, double rklow=TEST, double rkup=TEST)
 
int getIntervalNumber () const
 
void setBound (int iech, int item, double lower=TEST, double upper=TEST)
 
VectorDouble getWithinBounds (int item, bool useSel=false) const
 
VectorDouble getGradient (int item, bool useSel=false) const
 
VectorDouble getTangent (int item, bool useSel=false) const
 
VectorDouble getCodeList (void) const
 
int getSelection (int iech) const
 
VectorDouble getSelections (void) const
 
VectorInt getRanksActive (const VectorInt &nbgh=VectorInt(), int item=-1, bool useSel=true, bool useVerr=false) const
 
VectorVectorInt getMultipleRanksActive (const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt(), bool useSel=true, bool useVerr=false) const
 
VectorDouble getMultipleValuesActive (const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt(), const VectorDouble &means=VectorDouble(), bool useSel=true, bool useVerr=false) const
 
double getWeight (int iech) const
 
VectorDouble getWeights (bool useSel=false) const
 
double getSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar) const
 
void setSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar, double value)
 
void updSimvar (const ELoc &locatorType, int iech, int isimu, int ivar, int icase, int nbsimu, int nvar, const EOperator &oper, double value)
 
bool isActive (int iech) const
 
bool isActiveDomain (int iech) const
 
bool isActiveAndDefined (int iech, int item) const
 
int getActiveAndDefinedNumber (int item) const
 
int getActiveAndDefinedNumber (const String &name) const
 
VectorBool getActiveArray () const
 
VectorInt getSortArray () const
 
double getCosineToDirection (int iech1, int iech2, const VectorDouble &codir) const
 
VectorDouble getColumn (const String &name, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByUID (int iuid, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByLocator (const ELoc &locatorType, int locatorIndex=0, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnByColIdx (int icol, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getAllColumns (bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumns (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorVectorDouble getColumnsAsVVD (const VectorString &names=VectorString(), bool useSel=false, bool flagCompress=true) const
 
MatrixRectangular getColumnsAsMatrix (const VectorString &names, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnsByColIdx (const VectorInt &icols=VectorInt(), bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByColIdxInterval (int icol_beg, int icol_end, bool useSel=false, bool flagCompress=true) const
 
VectorDouble getColumnsActiveAndDefined (const ELoc &locatorType, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByLocator (const ELoc &locatorType, bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByUID (const VectorInt &iuids, bool useSel=false, bool flagCompress=true, const VectorDouble &origins=VectorDouble()) const
 
VectorDouble getColumnsByUIDInterval (int iuid_beg, int iuid_end, bool useSel=false, bool flagCompress=true) const
 
void setAllColumns (const VectorVectorDouble &tabs)
 
void deleteColumn (const String &name)
 
void deleteColumnByUID (int iuid_del)
 
void deleteColumnByColIdx (int icol_del)
 
void deleteColumns (const VectorString &names)
 
void deleteColumnsByLocator (const ELoc &locatorType)
 
void deleteColumnsByUID (const VectorInt &iuids)
 
void deleteColumnsByColIdx (const VectorInt &icols)
 
void deleteColumnsByUIDRange (int i_del, int n_del)
 
VectorDouble getExtrema (int idim, bool useSel=false) const
 
VectorVectorDouble getExtremas (bool useSel=false) const
 
VectorDouble getCoorMinimum (bool useSel=false) const
 
VectorDouble getCoorMaximum (bool useSel=false) const
 
double getExtension (int idim, bool useSel=false) const
 
double getExtensionDiagonal (bool useSel=false) const
 
double getCenter (int idim, bool useSel=false) const
 
VectorDouble getCenters (bool useSel=false) const
 
void getExtensionInPlace (VectorDouble &mini, VectorDouble &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
 
VectorDouble 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 (int icol) const
 
bool isUIDValid (int iuid) const
 
bool isSampleIndexValid (int iech) const
 
bool isSampleIndicesValid (const VectorInt &iechs, bool useSel=false) const
 
bool isLocatorIndexValid (const ELoc &locatorType, int locatorIndex) const
 
bool isDimensionIndexValid (int idim) const
 
void combineSelection (VectorDouble &sel, const String &combine="set") const
 
void generateRank (const String &radix="rank")
 
VectorInt shrinkToValidRows (const VectorInt &rows) const
 
VectorInt shrinkToValidCols (const VectorInt &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"))
 
VectorDouble 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
 
VectorInt filter (const String &name, const Interval &interval, int belowRow=ITEST, int aboveRow=ITEST) const
 
VectorInt getSampleRanks () const
 
Table printOneSample (int iech, const VectorString &names=VectorString(), bool excludeCoordinates=true, bool skipTitle=false) const
 
- 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 DbLinecreateFromSamples (int nech, const ELoadBy &order, const VectorDouble &tab, const VectorInt &lineCounts, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbLinecreateFromSamplesById (int nech, const ELoadBy &order, const VectorDouble &tab, const VectorInt &lineIds, const VectorInt &ranksPerId, const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbLinecreateFromNF (const String &neutralFilename, bool verbose=true)
 
static DbLinecreateFillRandom (int ndim, int nbline, int nperline, double deltaX=5.0, const VectorDouble &delta=VectorDouble(), double unifDelta=0.3, int seed=13422)
 Create a DbLine from the following information provided as input arguments. More...
 
- Static Public Member Functions inherited from Db
static Dbcreate ()
 
static DbcreateFromNF (const String &neutralFilename, bool verbose=true)
 
static DbcreateFromSamples (int nech, const ELoadBy &order=ELoadBy::fromKey("SAMPLE"), const VectorDouble &tab=VectorDouble(), const VectorString &names=VectorString(), const VectorString &locatorNames=VectorString(), bool flagAddSampleRank=true)
 
static DbcreateFromCSV (const String &filename, const CSVformat &csv=CSVformat(), bool verbose=false, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=true)
 
static DbcreateFromBox (int nech, const VectorDouble &coormin, const VectorDouble &coormax, int 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 VectorDouble &tab=VectorDouble(), bool flagAddSampleRank=true)
 
static DbcreateSamplingDb (const Db *dbin, double proportion=0., int number=0, const VectorString &names=VectorString(), int seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
static DbcreateFromDbGrid (int nech, DbGrid *dbgrid, int 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 VectorInt &ranks=VectorInt(), bool verbose=false)
 
static DbcreateFillRandom (int ndat, int ndim=2, int nvar=1, int nfex=0, int ncode=0, double varmax=0., double selRatio=0., const VectorDouble &heteroRatio=VectorDouble(), const VectorDouble &coormin=VectorDouble(), const VectorDouble &coormax=VectorDouble(), int seed=124234, bool flagAddSampleRank=true)
 
static int getNEloc ()
 
static VectorInt getMultipleRanks (const VectorVectorInt &index, const VectorInt &ivars=VectorInt(), const VectorInt &nbgh=VectorInt())
 
static int getSimRank (int isimu, int ivar, int icase, int nbsimu, int nvar)
 
- 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)
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ DbLine() [1/2]

DbLine::DbLine ( )

◆ DbLine() [2/2]

DbLine::DbLine ( const DbLine r)

◆ ~DbLine()

DbLine::~DbLine ( )
virtual

Member Function Documentation

◆ _getHeaderCoordinate()

VectorDouble DbLine::_getHeaderCoordinate ( int  idim) const

◆ createFillRandom()

DbLine * DbLine::createFillRandom ( int  ndim,
int  nbline,
int  nperline,
double  deltaX = 5.0,
const VectorDouble delta = VectorDouble(),
double  unifDelta = 0.3,
int  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 * DbLine::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

Create a Db by loading the contents of a Neutral File

Parameters
neutralFilenameName 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 * DbLine::createFromSamples ( int  nech,
const ELoadBy &  order,
const VectorDouble tab,
const VectorInt lineCounts,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)
static

◆ createFromSamplesById()

DbLine * DbLine::createFromSamplesById ( int  nech,
const ELoadBy &  order,
const VectorDouble tab,
const VectorInt lineIds,
const VectorInt ranksPerId,
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)
static

◆ createStatToHeader()

Db * 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

◆ getCoordinates()

VectorDouble DbLine::getCoordinates ( int  iline,
int  idim 
) const

◆ getLineBySample()

int DbLine::getLineBySample ( int  iech) const

Returns the rank of the line containing the target address.

Parameters
iechTarget address
Returns
int Returne line number

◆ getLineLength()

double DbLine::getLineLength ( int  iline) const

◆ getLineNumber()

int DbLine::getLineNumber ( ) const

◆ getLineSampleCount()

int DbLine::getLineSampleCount ( int  iline) const

◆ getNTotal()

int DbLine::getNTotal ( ) const

◆ isConsistent()

bool 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 Db.

◆ isLine()

bool DbLine::isLine ( ) const
inlineoverridevirtual

Db Interface.

Reimplemented from Db.

◆ mayChangeSampleNumber()

bool DbLine::mayChangeSampleNumber ( ) const
inlineoverridevirtual

Reimplemented from Db.

◆ operator=()

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

◆ resetFromSamples()

int DbLine::resetFromSamples ( int  nech,
const ELoadBy &  order,
const VectorDouble tab,
const VectorInt 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
int 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()

int DbLine::resetFromSamplesById ( int  nech,
const ELoadBy &  order,
const VectorDouble tab,
const VectorInt lineIds,
const VectorInt 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
int 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 DbLine::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

ICloneable interface.

AStringable Interface

Reimplemented from Db.


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