gstlearn
1.0.0
Geostatistics & Machine Learning toolbox | https://gstlearn.org
|
#include <NeighMoving.hpp>
Public Member Functions | |
NeighMoving (bool flag_xvalid=false, int nmaxi=1000, double radius=TEST, int nmini=1, int nsect=1, int nsmax=ITEST, VectorDouble coeffs=VectorDouble(), VectorDouble angles=VectorDouble(), const ASpace *space=nullptr) | |
NeighMoving (const NeighMoving &r) | |
NeighMoving & | operator= (const NeighMoving &r) |
virtual | ~NeighMoving () |
virtual int | attach (const Db *dbin, const Db *dbout=nullptr) override |
Interface for ANeigh. More... | |
virtual VectorInt | getNeigh (int iech_out) override |
virtual bool | hasChanged (int iech_out) const override |
virtual VectorDouble | summary (int iech_out) override |
virtual int | getMaxSampleNumber (const Db *db) const override |
virtual ENeigh | getType () const override |
virtual bool | getFlagContinuous () const override |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
Interface for AStringable. More... | |
void | addBiTargetCheck (ABiTargetCheck *abpc) |
bool | getFlagSector () const |
int | getNMaxi () const |
int | getNMini () const |
int | getNSect () const |
int | getNSMax () const |
double | getDistCont () const |
const BiTargetCheckDistance * | getBiPtDist () const |
bool | getFlagAniso () const |
bool | getFlagRotation () const |
double | getRadius () const |
const VectorDouble & | getAnisoRotMats () const |
const VectorDouble & | getAnisoCoeffs () const |
double | getAnisoCoeff (int i) const |
const std::vector< ABiTargetCheck * > | getBipts () const |
const ABiTargetCheck * | getBipts (int rank) const |
void | setNMaxi (int nmaxi) |
void | setNMini (int nmini) |
void | setNSect (int nsect) |
void | setNSMax (int nsmax) |
void | setDistCont (double distCont) |
VectorVectorDouble | getEllipsoid (const VectorDouble &target, int count=360) const |
VectorVectorDouble | getSectors (const VectorDouble &target) const |
VectorVectorDouble | getZoomLimits (const VectorDouble &target, double percent=20) const |
![]() | |
ANeigh (const ASpace *space=nullptr) | |
ANeigh (const ANeigh &r) | |
ANeigh & | operator= (const ANeigh &r) |
virtual | ~ANeigh () |
virtual bool | isConsistent (const ASpace *space) const override |
ASpaceObject Interface. More... | |
VectorInt | select (int iech_out) |
bool | isUnchanged () const |
void | setIsChanged () |
void | reset () |
bool | getFlagXvalid () const |
bool | getFlagKFold () const |
void | setFlagXvalid (bool flagXvalid) |
void | setFlagKFold (bool flagKFold) |
void | setFlagSimu (bool flagSimu) |
void | setRankColCok (const VectorInt &rankColCok) |
![]() | |
ASpaceObject (const ASpace *space=nullptr) | |
ASpaceObject (const ASpace &space) | |
ASpaceObject (const ASpaceObject &r) | |
ASpaceObject & | operator= (const ASpaceObject &r) |
virtual | ~ASpaceObject () |
const ASpace * | getSpace () const |
Accessor to the current object space context. More... | |
bool | isConsistent () const |
Indicate if I am consistent with my current space context. More... | |
VectorDouble | getUnitaryVector () const |
Return unitary vector for the current space context. More... | |
unsigned int | getNDim () const |
Shortcuts to ASpace methods. More... | |
const VectorDouble & | getOrigin () const |
Return the current space context origin coordinates. More... | |
double | getDistance (const SpacePoint &p1, const SpacePoint &p2) const |
Return the distance between two space points for the current space context. More... | |
double | getDistance1D (const SpacePoint &p1, const SpacePoint &p2, int idim) const |
Return the distance along one direction between two space points. More... | |
VectorDouble | getIncrement (const SpacePoint &p1, const SpacePoint &p2) const |
Return the increment vector between two space points for the current space context. More... | |
![]() | |
AStringable () | |
AStringable (const AStringable &r) | |
AStringable & | operator= (const AStringable &r) |
virtual | ~AStringable () |
virtual void | display (const AStringFormat *strfmt=nullptr) const final |
virtual void | display (int level) const final |
![]() | |
ASerializable () | |
ASerializable (const ASerializable &r) | |
ASerializable & | operator= (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 |
Static Public Member Functions | |
static NeighMoving * | create (bool flag_xvalid=false, int nmaxi=1000, double radius=TEST, int nmini=1, int nsect=1, int nsmax=ITEST, VectorDouble coeffs=VectorDouble(), VectorDouble angles=VectorDouble(), const ASpace *space=nullptr) |
static NeighMoving * | createFromNF (const String &neutralFilename, bool verbose=true) |
![]() | |
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 String & | getContainerName () |
static const String & | getPrefixName () |
static bool | createDirectory (const String &dir) |
static String | getExecDirectory () |
static String | getDirectory (const String &path) |
Protected Member Functions | |
virtual bool | _deserialize (std::istream &is, bool verbose=false) override |
Interface for ASerializable. More... | |
virtual bool | _serialize (std::ostream &os, bool verbose=false) const override |
String | _getNFName () const override |
![]() | |
bool | _isNbghMemoEmpty () const |
void | _neighCompress (VectorInt &ranks) |
void | _display (const VectorInt &ranks) |
bool | _discardUndefined (int iech) |
int | _xvalid (int iech_in, int iech_out, double eps=EPSILON9) |
bool | _isDimensionValid (int idim) const |
![]() | |
void | setNDim (int ndim) |
Modify the Space dimension of an already created item (To be used only during creation ... in particular when reading NF) More... | |
![]() | |
bool | _fileOpenWrite (const String &filename, std::ofstream &os, bool verbose=false) const |
bool | _fileOpenRead (const String &filename, std::ifstream &is, bool verbose=false) const |
Private Member Functions | |
int | _getBiPtsNumber () const |
int | _moving (int iech_out, VectorInt &ranks, double eps=EPSILON9) |
int | _movingSectorDefine (double dx, double dy) |
void | _movingSectorNsmax (int nsel, VectorInt &ranks) |
void | _movingSelect (int nsel, VectorInt &ranks) |
double | _getRadius () const |
Private Attributes | |
int | _nMini |
int | _nMaxi |
int | _nSect |
int | _nSMax |
double | _distCont |
BiTargetCheckDistance * | _biPtDist |
std::vector< ABiTargetCheck * > | _bipts |
VectorInt | _movingInd |
VectorInt | _movingIsect |
VectorInt | _movingNsect |
VectorDouble | _movingDst |
const DbGrid * | _dbgrid |
SpaceTarget | _T1 |
SpaceTarget | _T2 |
Additional Inherited Members | |
![]() | |
static bool | _commentWrite (std::ostream &os, const String &comment) |
template<typename T > | |
static bool | _recordWrite (std::ostream &os, const String &title, const T &val) |
template<typename T > | |
static bool | _recordWriteVec (std::ostream &os, const String &title, const VectorT< T > &vec) |
template<typename T > | |
static bool | _recordRead (std::istream &is, const String &title, T &val) |
template<typename T > | |
static bool | _recordReadVec (std::istream &is, const String &title, VectorT< T > &vec, int nvalues) |
static bool | _onlyBlanks (char *string) |
static bool | _tableRead (std::istream &is, const String &string, int ntab, double *tab) |
static bool | _tableWrite (std::ostream &os, const String &string, int ntab, const VectorDouble &tab) |
![]() | |
const Db * | _dbin |
const Db * | _dbout |
const DbGrid * | _dbgrid |
VectorInt | _rankColCok |
int | _iechMemo |
bool | _flagSimu |
bool | _flagXvalid |
bool | _flagKFold |
![]() | |
const ASpace * | _space |
Current space context of the object. More... | |
NeighMoving::NeighMoving | ( | bool | flag_xvalid = false , |
int | nmaxi = 1000 , |
||
double | radius = TEST , |
||
int | nmini = 1 , |
||
int | nsect = 1 , |
||
int | nsmax = ITEST , |
||
VectorDouble | coeffs = VectorDouble() , |
||
VectorDouble | angles = VectorDouble() , |
||
const ASpace * | space = nullptr |
||
) |
NeighMoving::NeighMoving | ( | const NeighMoving & | r | ) |
|
virtual |
|
overrideprotectedvirtual |
Interface for ASerializable.
Reimplemented from ANeigh.
|
inlineprivate |
|
inlineprivate |
Moving neighborhood search
[in] | iech_out | Rank of the target in the output Db structure |
[in] | eps | Tolerance |
[out] | ranks | Vector of samples elected in the Neighborhood |
|
private |
Returns the rank of the sector (using the first two coordinates)
[in] | dx | increment along X |
[in] | dy | increment along Y |
|
private |
For each angular sector, select the first samples until the maximum number of samples is reached
[in] | nsel | Number of selected samples |
[out] | ranks | Array of active data point ranks |
|
private |
Select the closest data per sector, until the maximum number neighbors is reached
[in] | nsel | Number of ellegible data points |
[in] | ranks | Rank of the ellegible samples |
|
overrideprotectedvirtual |
Reimplemented from ANeigh.
void NeighMoving::addBiTargetCheck | ( | ABiTargetCheck * | abpc | ) |
|
static |
|
static |
Create a NeighMovingborhood by loading the contents of a Neutral File
neutralFilename | Name of the Neutral File |
verbose | Verbose flag |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
VectorVectorDouble NeighMoving::getEllipsoid | ( | const VectorDouble & | target, |
int | count = 360 |
||
) | const |
|
inline |
|
inlineoverridevirtual |
Reimplemented from ANeigh.
|
inline |
bool NeighMoving::getFlagSector | ( | ) | const |
|
overridevirtual |
|
overridevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
VectorVectorDouble NeighMoving::getSectors | ( | const VectorDouble & | target | ) | const |
Generate the end-points of the sectors. By default, the extension is set to radius
target | Coordinates of the Target |
|
inlineoverridevirtual |
Reimplemented from ANeigh.
VectorVectorDouble NeighMoving::getZoomLimits | ( | const VectorDouble & | target, |
double | percent = 20 |
||
) | const |
|
overridevirtual |
Reimplemented from ANeigh.
NeighMoving & NeighMoving::operator= | ( | const NeighMoving & | r | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Returns the main Neighborhood Parameters for a given target as a vector:
[in] | iech_out | Valid Rank of the sample in the output Db |
Reimplemented from ANeigh.
|
overridevirtual |
Interface for AStringable.
Reimplemented from ASpaceObject.
|
private |
|
private |
|
mutableprivate |
|
private |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |