
The Manhattan distance (city block distance,
norm, rectilinear distance or taxi cab metric ) is a special case of general Minkowski metric and computes the absolute differences between the feature dimensions of two data points.
Definition at line 34 of file ManhattanMetric.h.
Public Member Functions | |
| CManhattanMetric () | |
| CManhattanMetric (CRealFeatures *l, CRealFeatures *r) | |
| virtual | ~CManhattanMetric () |
| virtual bool | init (CFeatures *l, CFeatures *r) |
| virtual void | cleanup () |
| virtual bool | load_init (FILE *src) |
| virtual bool | save_init (FILE *dest) |
| virtual EDistanceType | get_distance_type () |
| virtual const char * | get_name () |
Protected Member Functions | |
| virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
| CManhattanMetric::CManhattanMetric | ( | ) |
default constructor
Definition at line 18 of file ManhattanMetric.cpp.
| CManhattanMetric::CManhattanMetric | ( | CRealFeatures * | l, | |
| CRealFeatures * | r | |||
| ) |
constructor
| l | features of left-hand side | |
| r | features of right-hand side |
Definition at line 23 of file ManhattanMetric.cpp.
| CManhattanMetric::~CManhattanMetric | ( | ) | [virtual] |
Definition at line 29 of file ManhattanMetric.cpp.
init distance
| l | features of left-hand side | |
| r | features of right-hand side |
Reimplemented from CSimpleDistance< ST >.
Definition at line 34 of file ManhattanMetric.cpp.
| void CManhattanMetric::cleanup | ( | ) | [virtual] |
| bool CManhattanMetric::load_init | ( | FILE * | src | ) | [virtual] |
load init data from file
| src | file to load from |
Implements CDistance.
Definition at line 45 of file ManhattanMetric.cpp.
| bool CManhattanMetric::save_init | ( | FILE * | dest | ) | [virtual] |
save init data to file
| dest | file to save to |
Implements CDistance.
Definition at line 50 of file ManhattanMetric.cpp.
| virtual EDistanceType CManhattanMetric::get_distance_type | ( | ) | [virtual] |
get distance type we are
Implements CDistance.
Definition at line 77 of file ManhattanMetric.h.
| virtual const char* CManhattanMetric::get_name | ( | ) | [virtual] |
get name of the distance
Implements CDistance.
Definition at line 83 of file ManhattanMetric.h.
| float64_t CManhattanMetric::compute | ( | int32_t | idx_a, | |
| int32_t | idx_b | |||
| ) | [protected, virtual] |
compute distance for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
Implements CDistance.
Definition at line 55 of file ManhattanMetric.cpp.