Auxiliary Arithmetic Algorithms
Manhattan Space (L-1)

Functions

template<typename InputIterator , typename T = value_type_i<InputIterator>>
aaa::manhattan::norm (InputIterator first, InputIterator last, T init=T{})
 
template<typename Container , typename T = value_type<Container>>
aaa::manhattan::norm (const Container &a, T init=T{})
 
template<typename InputIterator , typename T = value_type_i<InputIterator>>
aaa::manhattan::squared_norm (InputIterator first, InputIterator last, T init=T{})
 
template<typename Container , typename T = value_type<Container>>
aaa::manhattan::squared_norm (const Container &a, T init=T{})
 
template<typename InputIterator1 , typename InputIterator2 , typename T = value_type_i<InputIterator1>>
aaa::manhattan::distance (InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, T init=T{})
 
template<typename Container1 , typename Container2 , typename T = value_type<Container1>>
aaa::manhattan::distance (const Container1 &left, const Container2 &right, T init=T{})
 
template<typename InputIterator1 , typename InputIterator2 , typename T = value_type_i<InputIterator1>>
aaa::manhattan::squared_distance (InputIterator1 first_left, InputIterator1 last_left, InputIterator2 first_right, T init=T{})
 
template<typename Container1 , typename Container2 , typename T = value_type<Container1>>
aaa::manhattan::squared_distance (const Container1 &left, const Container2 &right, T init=T{})
 

Detailed Description

Manhattan space is also known as taxicab geometry or L-1 space. Manhattan space defines the following functions:

We represent mathematical vectors as either containers, or ranges of iterators. The functions in this module take one or two vectors as input and output a single scalar. This is sometimes refered to as a reduction or fold operation.

Function Documentation

template<typename InputIterator1 , typename InputIterator2 , typename T = value_type_i<InputIterator1>>
T aaa::manhattan::distance ( InputIterator1  first_left,
InputIterator1  last_left,
InputIterator2  first_right,
init = T{} 
)

The manhattan distance of two vectors. Each vector is represented by a range of iterators. The two containers should have the same size.

template<typename Container1 , typename Container2 , typename T = value_type<Container1>>
T aaa::manhattan::distance ( const Container1 &  left,
const Container2 &  right,
init = T{} 
)

The manhattan distance of two vectors. Each vector is represented by a container. The two containers should have the same size.

template<typename InputIterator , typename T = value_type_i<InputIterator>>
T aaa::manhattan::norm ( InputIterator  first,
InputIterator  last,
init = T{} 
)

The manhattan norm of a vector. The vector is represented a range of iterators.

template<typename Container , typename T = value_type<Container>>
T aaa::manhattan::norm ( const Container &  a,
init = T{} 
)

The manhattan norm of a vector. The vector is represented by a container.

template<typename InputIterator1 , typename InputIterator2 , typename T = value_type_i<InputIterator1>>
T aaa::manhattan::squared_distance ( InputIterator1  first_left,
InputIterator1  last_left,
InputIterator2  first_right,
init = T{} 
)

The squared manhattan distance of two vectors. Each vector is represented by a range of iterators.

template<typename Container1 , typename Container2 , typename T = value_type<Container1>>
T aaa::manhattan::squared_distance ( const Container1 &  left,
const Container2 &  right,
init = T{} 
)

The squared manhattan distance of two vectors. Each vector is represented by a container. The two containers should have the same size and value type.

template<typename InputIterator , typename T = value_type_i<InputIterator>>
T aaa::manhattan::squared_norm ( InputIterator  first,
InputIterator  last,
init = T{} 
)

The squared manhattan norm of a vector. The vector is represented by a range of iterators.

template<typename Container , typename T = value_type<Container>>
T aaa::manhattan::squared_norm ( const Container &  a,
init = T{} 
)

The squared manhattan norm of a vector. The vector is represented by a container.