#include <NeighWork.hpp>
|
void | _unique (Db *dbout, int iech_out, VectorInt &ranks) |
|
void | _bench (Db *dbout, int iech_out, VectorInt &ranks) |
|
int | _moving (Db *dbout, int iech_out, VectorInt &ranks, double eps=EPSILON9) |
|
bool | _discardUndefined (int iech) |
|
int | _xvalid (Db *dbout, int iech_in, int iech_out, double eps=EPSILON9) |
|
int | _movingSectorDefine (double dx, double dy) |
|
void | _movingSectorNsmax (int nsel, VectorInt &ranks) |
|
void | _movingSelect (int nsel, VectorInt &ranks) |
|
void | _display (const VectorInt &ranks) |
|
double | _movingDist (Db *dbout, int iech_in, int iech_out) |
|
bool | _belongsToCell (Db *dbout, int iech, int iech_out) |
|
void | _checkUnchanged (const Db *dbout, int iech_out, const VectorInt &ranks) |
|
void | _clearMemory () |
|
void | _resetFromMemory (bool flagSame, VectorInt &ranks, bool verbose) |
|
bool | _isSameTarget (const Db *dbout, int iech_out, VectorInt &ranks, bool verbose=false) |
|
bool | _isSameTargetBench (const Db *dbout, int iech_out, VectorInt &ranks, bool verbose=false) |
|
bool | _isSameTargetUnique (const Db *dbout, int iech_out, VectorInt &ranks, bool verbose=false) |
|
void | _updateColCok (const VectorInt &rankColCok, VectorInt &ranks, int iech_out) |
|
bool | _hiddenByFault (Db *dbout, int iech, int iech_out) const |
|
◆ NeighWork() [1/2]
NeighWork::NeighWork |
( |
const Db * |
dbin = nullptr , |
|
|
const ANeighParam * |
neighparam = nullptr |
|
) |
| |
◆ NeighWork() [2/2]
◆ ~NeighWork()
NeighWork::~NeighWork |
( |
| ) |
|
|
virtual |
◆ _belongsToCell()
bool NeighWork::_belongsToCell |
( |
Db * |
dbout, |
|
|
int |
iech, |
|
|
int |
iech_out |
|
) |
| |
|
private |
◆ _bench()
void NeighWork::_bench |
( |
Db * |
dbout, |
|
|
int |
iech_out, |
|
|
VectorInt & |
ranks |
|
) |
| |
|
private |
Search for the bench neighborhood, according to the last coordinate
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_out | rank of the output sample |
[out] | ranks | Vector of samples elected in the Neighborhood |
◆ _checkUnchanged()
void NeighWork::_checkUnchanged |
( |
const Db * |
dbout, |
|
|
int |
iech_out, |
|
|
const VectorInt & |
ranks |
|
) |
| |
|
private |
◆ _clearMemory()
void NeighWork::_clearMemory |
( |
| ) |
|
|
private |
◆ _discardUndefined()
bool NeighWork::_discardUndefined |
( |
int |
iech | ) |
|
|
private |
Discard a sample for which all variables are undefined
Returns 1 if all variables are undefined; 0 otherwise
- Parameters
-
[in] | iech | Rank of the sample |
◆ _display()
void NeighWork::_display |
( |
const VectorInt & |
ranks | ) |
|
|
private |
Print the information selected in the neighborhood
- Parameters
-
[in] | ranks | Array of the data ranks
- -1 if not selected
- >=0 gives the angular sector in ENeigh::MOVING
|
◆ _hiddenByFault()
bool NeighWork::_hiddenByFault |
( |
Db * |
dbout, |
|
|
int |
iech, |
|
|
int |
iech_out |
|
) |
| const |
|
private |
◆ _isSameTarget()
bool NeighWork::_isSameTarget |
( |
const Db * |
dbout, |
|
|
int |
iech_out, |
|
|
VectorInt & |
ranks, |
|
|
bool |
verbose = false |
|
) |
| |
|
private |
Checks if the current target matches the target previously treated in the same procedure. If match is reached, then there is no need to compute a new neighborhood: use the previous Vector of sample ranks. Store the references of the new 'dbout' and 'iech_out' for next optimizations
- Parameters
-
dbout | Current 'Db' structure for output |
iech_out | Rank of the current target sample |
ranks | Vector of selected samples |
verbose | Verbose option |
- Returns
◆ _isSameTargetBench()
bool NeighWork::_isSameTargetBench |
( |
const Db * |
dbout, |
|
|
int |
iech_out, |
|
|
VectorInt & |
ranks, |
|
|
bool |
verbose = false |
|
) |
| |
|
private |
◆ _isSameTargetUnique()
bool NeighWork::_isSameTargetUnique |
( |
const Db * |
dbout, |
|
|
int |
iech_out, |
|
|
VectorInt & |
ranks, |
|
|
bool |
verbose = false |
|
) |
| |
|
private |
◆ _moving()
Moving neighborhood search
- Returns
- Error return code
-
0 : No error
-
1 : The number of data is smaller than the minimum number of
-
data in Moving Neighborhood
- Parameters
-
[in] | dbout | Output Db structure |
[in] | iech_out | Rank of the target in the output Db structure |
[in] | eps | Tolerance |
[out] | ranks | Vector of samples elected in the Neighborhood |
◆ _movingDist()
double NeighWork::_movingDist |
( |
Db * |
dbout, |
|
|
int |
iech_in, |
|
|
int |
iech_out |
|
) |
| |
|
private |
Calculates the distance between an input sample and the target
- Returns
- Distance
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_in | Rank of the sample in the input Db structure |
[in] | iech_out | Rank of the sample in the output Db structure |
◆ _movingSectorDefine()
int NeighWork::_movingSectorDefine |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| |
|
private |
Returns the rank of the sector (using the first two coordinates)
- Returns
- Sector index
- Parameters
-
[in] | dx | increment along X |
[in] | dy | increment along Y |
◆ _movingSectorNsmax()
void NeighWork::_movingSectorNsmax |
( |
int |
nsel, |
|
|
VectorInt & |
ranks |
|
) |
| |
|
private |
For each angular sector, select the first samples until the maximum number of samples is reached
- Parameters
-
[in] | nsel | Number of selected samples |
[out] | ranks | Array of active data point ranks |
◆ _movingSelect()
void NeighWork::_movingSelect |
( |
int |
nsel, |
|
|
VectorInt & |
ranks |
|
) |
| |
|
private |
Select the closest data per sector, until the maximum number neighbors is reached
- Parameters
-
[in] | nsel | Number of ellegible data points |
[in] | ranks | Rank of the ellegible samples |
◆ _resetFromMemory()
void NeighWork::_resetFromMemory |
( |
bool |
flagSame, |
|
|
VectorInt & |
ranks, |
|
|
bool |
verbose |
|
) |
| |
|
private |
◆ _unique()
void NeighWork::_unique |
( |
Db * |
dbout, |
|
|
int |
iech_out, |
|
|
VectorInt & |
ranks |
|
) |
| |
|
private |
Select the unique neighborhood (or Image Neighborhood)
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_out | rank of the output sample |
[out] | ranks | Vector of samples elected in the Neighborhood |
◆ _updateColCok()
void NeighWork::_updateColCok |
( |
const VectorInt & |
rankColCok, |
|
|
VectorInt & |
ranks, |
|
|
int |
iech_out |
|
) |
| |
|
private |
Update the set of selected samples in case of colocated option This is done only if:
- the colocation option is ON (vector of colocated variable is defined)
- at least one of the colocated variables at the target is valid
- the target does not coincide with a sample already selected If the colocation option is validated, an additional member is added to 'ranks': it value is conventionally set to -1.
- Parameters
-
rankColCok | Vector of Colocated Variables |
ranks | Vector of samples already selected |
iech_out | Rank of the targt site (in dbout) |
◆ _xvalid()
int NeighWork::_xvalid |
( |
Db * |
dbout, |
|
|
int |
iech_in, |
|
|
int |
iech_out, |
|
|
double |
eps = EPSILON9 |
|
) |
| |
|
private |
Mask the data sample in the case of cross-validation
- Returns
- 1 if the sample is masked; 0 otherwise
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_in | Rank in the input Db structure |
[in] | iech_out | Rank in the output Db structure |
[in] | eps | Tolerance |
◆ clear()
void NeighWork::clear |
( |
| ) |
|
Clear all the local storage in the NeighWork structure
◆ initialize()
void NeighWork::initialize |
( |
const Db * |
dbin, |
|
|
const ANeighParam * |
neighparam |
|
) |
| |
Initialize the neighborhood search
- Parameters
-
[in] | dbin | input Db structure |
[in] | neighparam | Description of the ANeighParam parameters |
◆ isUnchanged()
bool NeighWork::isUnchanged |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ select()
Select the neighborhood
- Returns
- Vector of sample ranks in neighborhood (empty when error)
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_out | Valid Rank of the sample in the output Db |
[in] | rankColCok | Vector of Colcok information (optional) |
[in] | verbose | Verbose option |
◆ setFlagSimu()
void NeighWork::setFlagSimu |
( |
bool |
flagSimu | ) |
|
|
inline |
◆ setIsChanged()
void NeighWork::setIsChanged |
( |
| ) |
|
◆ summary()
Returns the main Neighborhood Parameters for a given target as a vector:
- 0 : Number of active samples
- 1 : Minimum distance
- 2 : Maximum distance
- 3 : Number of non-empty sectors
- 4 : Number of consecutive empty sectors
- Parameters
-
[in] | dbout | output Db structure |
[in] | iech_out | Valid Rank of the sample in the output Db |
[in] | rankColCok | Vector of ColCok information (optional) |
◆ _dbin
const Db* NeighWork::_dbin |
|
private |
◆ _dbout
const Db* NeighWork::_dbout |
|
private |
◆ _flagInitialized
bool NeighWork::_flagInitialized |
|
private |
◆ _flagIsUnchanged
bool NeighWork::_flagIsUnchanged |
|
private |
◆ _flagSimu
bool NeighWork::_flagSimu |
|
private |
◆ _iechOut
◆ _movingDst
◆ _movingInd
◆ _movingIsect
◆ _movingNsect
◆ _movingX1
◆ _movingX2
◆ _nbghMemo
◆ _neighParam
The documentation for this class was generated from the following files: