1.5.0
CCC
 
NeighMoving Class Reference

Moving Neighborhood definition. More...

#include <NeighMoving.hpp>

Inheritance diagram for NeighMoving:
ANeigh ASpaceObject ASerializable AStringable

Detailed Description

Moving Neighborhood definition.

The Neighborhood is usually meant to select a sub-population from the input Data Base, containing the active samples close to the target.

The Moving Neighborhood selects these active samples based on a series of criteria (the corresponding parameters are given between parentheses), such as:

  • the selected samples should belong to a circle (ellipse) centered on the target sample (circle radius, ellipse orientation and extensions)
  • the minimum and maximum number of selected samples
  • the previous circle can be subdivided into angular sectors: the selected samples are taken regularly per sector (maximum number of samples per sector)

The neighborhood also offers the possibility to suppress any sample which would be too close to (or coincide with) the target: this is the cross-validation option.

Public Member Functions

 NeighMoving (bool flag_xvalid=false, int nmaxi=1000, double radius=TEST, int nmini=1, int nsect=1, int nsmax=ITEST, const VectorDouble &coeffs=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ASpace *space=nullptr)
 
 NeighMoving (const NeighMoving &r)
 
NeighMovingoperator= (const NeighMoving &r)
 
virtual ~NeighMoving ()
 
virtual int attach (const Db *dbin, const Db *dbout=nullptr) override
 Interface for ANeigh. More...
 
virtual void getNeigh (int iech_out, VectorInt &ranks) 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 BiTargetCheckDistancegetBiPtDist () const
 
bool getFlagAniso () const
 
bool getFlagRotation () const
 
double getRadius () const
 
const VectorDoublegetAnisoRotMats () const
 
const VectorDoublegetAnisoCoeffs () const
 
double getAnisoCoeff (int i) const
 
const std::vector< ABiTargetCheck * > & getBipts () const
 
const ABiTargetCheckgetBipts (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
 
- Public Member Functions inherited from ANeigh
 ANeigh (const ASpace *space=nullptr)
 
 ANeigh (const ANeigh &r)
 
ANeighoperator= (const ANeigh &r)
 
virtual ~ANeigh ()
 
virtual bool isConsistent (const ASpace *space) const override
 ASpaceObject Interface. More...
 
void select (int iech_out, VectorInt &ranks)
 
bool isUnchanged () const
 
void setIsChanged (bool status=false)
 
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)
 
void setBallSearch (bool status, int leaf_size=10)
 
void attachBall (double(*dist_function)(const double *x1, const double *x2, int size)=nullptr)
 
- Public Member Functions inherited from ASpaceObject
 ASpaceObject (const ASpace *space=nullptr)
 
 ASpaceObject (const ASpace &space)
 
 ASpaceObject (const ASpaceObject &r)
 
ASpaceObjectoperator= (const ASpaceObject &r)
 
virtual ~ASpaceObject ()
 
const ASpacegetSpace () 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 (int ispace=-1) const
 Shortcuts to ASpace methods. More...
 
const VectorDoublegetOrigin (int ispace=-1) const
 Return the current space context origin coordinates. More...
 
double getDistance (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the distance between two space points for the current space context. More...
 
VectorDouble getDistances (const SpacePoint &p1, const SpacePoint &p2) const
 Return all the distances (space composits) between two space points for the current space context. More...
 
VectorDouble getIncrement (const SpacePoint &p1, const SpacePoint &p2, int ispace=0) const
 Return the increment vector between two space points for the current space context. More...
 
- 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
 

Static Public Member Functions

static NeighMovingcreate (bool flag_xvalid=false, int nmaxi=1000, double radius=TEST, int nmini=1, int nsect=1, int nsmax=ITEST, const VectorDouble &coeffs=VectorDouble(), const VectorDouble &angles=VectorDouble(), const ASpace *space=nullptr)
 
static NeighMovingcreateFromNF (const String &neutralFilename, bool verbose=true)
 
- 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)
 

Constructor & Destructor Documentation

◆ NeighMoving() [1/2]

NeighMoving::NeighMoving ( bool  flag_xvalid = false,
int  nmaxi = 1000,
double  radius = TEST,
int  nmini = 1,
int  nsect = 1,
int  nsmax = ITEST,
const VectorDouble coeffs = VectorDouble(),
const VectorDouble angles = VectorDouble(),
const ASpace space = nullptr 
)

◆ NeighMoving() [2/2]

NeighMoving::NeighMoving ( const NeighMoving r)

◆ ~NeighMoving()

NeighMoving::~NeighMoving ( )
virtual

Member Function Documentation

◆ addBiTargetCheck()

void NeighMoving::addBiTargetCheck ( ABiTargetCheck abpc)

◆ attach()

int NeighMoving::attach ( const Db dbin,
const Db dbout = nullptr 
)
overridevirtual

Interface for ANeigh.

Initialize the neighborhood search

Parameters
[in]dbininput Db structure
[in]dboutoutput Db structure (optional)

Reimplemented from ANeigh.

◆ create()

NeighMoving * NeighMoving::create ( bool  flag_xvalid = false,
int  nmaxi = 1000,
double  radius = TEST,
int  nmini = 1,
int  nsect = 1,
int  nsmax = ITEST,
const VectorDouble coeffs = VectorDouble(),
const VectorDouble angles = VectorDouble(),
const ASpace space = nullptr 
)
static

◆ createFromNF()

NeighMoving * NeighMoving::createFromNF ( const String neutralFilename,
bool  verbose = true 
)
static

Create a NeighMovingborhood by loading the contents of a Neutral File

Parameters
neutralFilenameName of the Neutral File
verboseVerbose flag
Returns

◆ getAnisoCoeff()

double NeighMoving::getAnisoCoeff ( int  i) const
inline

◆ getAnisoCoeffs()

const VectorDouble& NeighMoving::getAnisoCoeffs ( ) const
inline

◆ getAnisoRotMats()

const VectorDouble& NeighMoving::getAnisoRotMats ( ) const
inline

◆ getBiPtDist()

const BiTargetCheckDistance* NeighMoving::getBiPtDist ( ) const
inline

◆ getBipts() [1/2]

const std::vector<ABiTargetCheck*>& NeighMoving::getBipts ( ) const
inline

◆ getBipts() [2/2]

const ABiTargetCheck* NeighMoving::getBipts ( int  rank) const
inline

◆ getDistCont()

double NeighMoving::getDistCont ( ) const
inline

◆ getEllipsoid()

VectorVectorDouble NeighMoving::getEllipsoid ( const VectorDouble target,
int  count = 360 
) const

◆ getFlagAniso()

bool NeighMoving::getFlagAniso ( ) const
inline

◆ getFlagContinuous()

virtual bool NeighMoving::getFlagContinuous ( ) const
inlineoverridevirtual

Reimplemented from ANeigh.

◆ getFlagRotation()

bool NeighMoving::getFlagRotation ( ) const
inline

◆ getFlagSector()

bool NeighMoving::getFlagSector ( ) const

◆ getMaxSampleNumber()

int NeighMoving::getMaxSampleNumber ( const Db db) const
overridevirtual

Given a Db, returns the maximum number of samples per NeighMovingborhood

Parameters
dbPointer to the target Db
Returns

Implements ANeigh.

◆ getNeigh()

void NeighMoving::getNeigh ( int  iech_out,
VectorInt ranks 
)
overridevirtual

Select the neighborhood

Parameters
iech_outValid Rank of the sample in the output Db
ranksVector of sample ranks in neighborhood (empty when error)

Implements ANeigh.

◆ getNMaxi()

int NeighMoving::getNMaxi ( ) const
inline

◆ getNMini()

int NeighMoving::getNMini ( ) const
inline

◆ getNSect()

int NeighMoving::getNSect ( ) const
inline

◆ getNSMax()

int NeighMoving::getNSMax ( ) const
inline

◆ getRadius()

double NeighMoving::getRadius ( ) const
inline

◆ getSectors()

VectorVectorDouble NeighMoving::getSectors ( const VectorDouble target) const

Generate the end-points of the sectors. By default, the extension is set to radius

Parameters
targetCoordinates of the Target
Returns

◆ getType()

virtual ENeigh NeighMoving::getType ( ) const
inlineoverridevirtual

Reimplemented from ANeigh.

◆ getZoomLimits()

VectorVectorDouble NeighMoving::getZoomLimits ( const VectorDouble target,
double  percent = 20 
) const

◆ hasChanged()

bool NeighMoving::hasChanged ( int  iech_out) const
overridevirtual

Reimplemented from ANeigh.

◆ operator=()

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

◆ setDistCont()

void NeighMoving::setDistCont ( double  distCont)
inline

◆ setNMaxi()

void NeighMoving::setNMaxi ( int  nmaxi)
inline

◆ setNMini()

void NeighMoving::setNMini ( int  nmini)
inline

◆ setNSect()

void NeighMoving::setNSect ( int  nsect)
inline

◆ setNSMax()

void NeighMoving::setNSMax ( int  nsmax)
inline

◆ summary()

VectorDouble NeighMoving::summary ( int  iech_out)
overridevirtual

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]iech_outValid Rank of the sample in the output Db

Reimplemented from ANeigh.

◆ toString()

String NeighMoving::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface for AStringable.

Reimplemented from ASpaceObject.


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