RobWorkProject  23.9.11-
Protected Member Functions | List of all members
ManhattanMetric< T > Class Template Reference

Manhattan distance metric for vector types. More...

#include <MetricFactory.hpp>

Inherits Metric< T >.

Protected Member Functions

Metric< T >::scalar_type doDistance (const typename Metric< T >::value_type &q) const
 
Metric< T >::scalar_type doDistance (const typename Metric< T >::value_type &a, const typename Metric< T >::value_type &b) const
 
- Protected Member Functions inherited from Metric< T >
virtual scalar_type doDistance (const value_type &q) const =0
 Subclass implementation of the distance() method.
 
virtual scalar_type doDistance (const value_type &a, const value_type &b) const =0
 Subclass implementation of the distance() method.
 
virtual int doSize () const
 Subclass implementation of the size() method. More...
 
 Metric ()
 Protected constructor called by subclassed.
 
 Metric (const Metric &)
 Disable copying of superclass.
 
Metricoperator= (const Metric &)
 Disable assignment of superclass.
 

Additional Inherited Members

- Public Types inherited from Metric< T >
typedef T value_type
 The type of element on which the metric operates.
 
typedef T::value_type scalar_type
 The type of the scalar.
 
typedef rw::core::Ptr< Metric< T > > Ptr
 A pointer to a Metric<T>.
 
typedef rw::core::Ptr< const Metric< T > > CPtr
 A pointer to a const Metric<T>.
 
- Public Member Functions inherited from Metric< T >
virtual ~Metric ()
 Destructor.
 
scalar_type distance (const value_type &q) const
 The distance from the zero element to q.
 
scalar_type distance (const value_type &a, const value_type &b) const
 The distance from element a to b. More...
 
int size () const
 The dimension of elements on which this metric operates. More...
 

Detailed Description

template<class T>
class rw::math::ManhattanMetric< T >

Manhattan distance metric for vector types.

The ManhattanMetric, also known as the taxicab metric or the 1-norm, is a metric on the Euclidean n-Plane. The Manhattan distance between two points

\( P = (p_1, p_2, ..., p_n) \) and \( Q = (q_1, q_2, ..., q_n) \) is defined as \( \sum_{i=1}^{n} |p_i - q_i| \)


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