Class Distance

Nested Relationships

Nested Types

Inheritance Relationships

Derived Types

Class Documentation

class Distance

Abstract base class for calculating spatial distance.

Subclassed by gwm::CRSDistance, gwm::CRSSTDistance, gwm::DMatDistance, gwm::OneDimDistance

Public Types

enum DistanceType

Types of distance.

Values:

enumerator CRSDistance

Distance according to coordinate reference system.

enumerator MinkwoskiDistance

Minkwoski distance.

enumerator DMatDistance

Distance according to a .dmat file.

enumerator OneDimDistance

Distance for just one dimension.

enumerator CRSSTDistance

Public Functions

inline virtual ~Distance()

Destroy the Distance object.

virtual Distance *clone() const = 0

Clone this Distance object. Newly created pointer.

virtual DistanceType type() = 0

Return the type of this object. Type of distance.

virtual Parameter *parameter() const = delete
virtual void makeParameter(std::initializer_list<DistParamVariant> plist) = 0

Create Parameter for Caclulating Distance. This function is pure virtual. It would never be called directly. A list of parameters.

virtual arma::vec distance(arma::uword focus) = 0

Calculate distance vector for a focus point. Focused point’s index. Require focus < total Distance vector for the focused point.

virtual double maxDistance() = 0

Get maximum distance among all points. Maximum distance.

virtual double minDistance() = 0

Get minimum distance among all points Maximum distance.

Public Static Attributes

static std::unordered_map<DistanceType, std::string> TypeNameMapper

A mapper between types of distance and its names.

struct Parameter

Struct of parameters used in spatial distance calculating. Usually a pointer to object of its derived classes is passed to Distance::distance().

Subclassed by gwm::CRSDistance::Parameter, gwm::DMatDistance::Parameter, gwm::OneDimDistance::Parameter

Public Functions

inline Parameter()

Construct a new DistanceParameter object.

Public Members

arma::uword total

Total data points.