1.3.1
CCC
 
Reset the contents of an already existing Db

Functions

int Db::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 Db::resetFromCSV (const String &filename, bool verbose, const CSVformat &csvfmt, int ncol_max=-1, int nrow_max=-1, bool flagAddSampleRank=true)
 
int Db::resetFromBox (int nech, const VectorDouble &coormin, const VectorDouble &coormax, int ndim=2, double extend=0., int seed=321415, bool flagAddSampleRank=true)
 
int Db::resetFromOnePoint (const VectorDouble &tab=VectorDouble(), bool flagAddSampleRank=true)
 
int Db::resetSamplingDb (const Db *dbin, double proportion=0, int number=0, const VectorString &names=VectorString(), int seed=23241, bool verbose=false, bool flagAddSampleRank=true)
 
int Db::resetReduce (const Db *dbin, const VectorString &names=VectorString(), const VectorInt &ranks=VectorInt(), bool verbose=false)
 

Detailed Description

All methods enabling to Reset the contents of an already existing Db.

They clean the initial contents and replace it by the new one.

Function Documentation

◆ resetFromBox()

int Db::resetFromBox ( int  nech,
const VectorDouble coormin,
const VectorDouble coormax,
int  ndim = 2,
double  extend = 0.,
int  seed = 321415,
bool  flagAddSampleRank = true 
)

Create a Db generating samples randomly

Parameters
nechNumber of samples to be generated
coorminVector giving the smallest values of the coordinates
coormaxVector giving the largest values for the coordinates
ndimSpace dimension (used if 'coormin' and 'coormax' are empty)
extendExtension of the bounding box (if positive)
seedSeed for the random number generator
flagAddSampleRanktrue if the Sample ranks must be generated

◆ resetFromCSV()

int Db::resetFromCSV ( const String filename,
bool  verbose,
const CSVformat csvfmt,
int  ncol_max = -1,
int  nrow_max = -1,
bool  flagAddSampleRank = true 
)

Creating a Db by reading a CSV file

Parameters
filenameName of the CSV file
verboseVerbose flag
csvfmtDescription of the CSV format
ncol_maxMaximum number of columns
nrow_maxMaximum number of rows
flagAddSampleRanktrue if the sample rank must be generated

◆ resetFromOnePoint()

int Db::resetFromOnePoint ( const VectorDouble tab = VectorDouble(),
bool  flagAddSampleRank = true 
)

Create a Db from a single sample whose coordinates are provided in 'tab'

Parameters
tabArray containing the coordinates of the single sample
flagAddSampleRanktrue if the Sample ranks must be generated

◆ resetFromSamples()

int Db::resetFromSamples ( int  nech,
const ELoadBy &  order = ELoadBy::fromKey("SAMPLE"),
const VectorDouble tab = VectorDouble(),
const VectorString names = VectorString(),
const VectorString locatorNames = VectorString(),
bool  flagAddSampleRank = true 
)

◆ resetReduce()

int Db::resetReduce ( const Db dbin,
const VectorString names = VectorString(),
const VectorInt ranks = VectorInt(),
bool  verbose = false 
)

◆ resetSamplingDb()

int Db::resetSamplingDb ( const Db dbin,
double  proportion = 0,
int  number = 0,
const VectorString names = VectorString(),
int  seed = 23241,
bool  verbose = false,
bool  flagAddSampleRank = true 
)

Sampling an input Db to create the output Db by selecting a subset of samples

Parameters
dbinPointer to the input Db
proportionProportion of samples to be retained
numberNumber of samples to be retained
namesVector of Names to be copied (empty: all names)
seedSeed used for the random number generator
verboseVerbose flag
flagAddSampleRanktrue if the sample rank must be generated
Remarks
A possible selection in 'dbin' will not be taken into account
You can use either 'proportion' or 'number'