Auxiliary Arithmetic Algorithms
|
Functions | |
template<typename InputIterator , typename T = value_type_i<InputIterator>> | |
T | aaa::manhattan::norm (InputIterator first, InputIterator last, T init=T{}) |
template<typename Container , typename T = value_type<Container>> | |
T | aaa::manhattan::norm (const Container &a, T init=T{}) |
template<typename InputIterator , typename T = value_type_i<InputIterator>> | |
T | aaa::manhattan::squared_norm (InputIterator first, InputIterator last, T init=T{}) |
template<typename Container , typename T = value_type<Container>> | |
T | aaa::manhattan::squared_norm (const Container &a, T init=T{}) |
template<typename InputIterator1 , typename InputIterator2 , typename T = value_type_i<InputIterator1>> | |
T | 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>> | |
T | aaa::manhattan::distance (const Container1 &left, const Container2 &right, T init=T{}) |
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, T init=T{}) |
template<typename Container1 , typename Container2 , typename T = value_type<Container1>> | |
T | aaa::manhattan::squared_distance (const Container1 &left, const Container2 &right, T init=T{}) |
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.
T aaa::manhattan::distance | ( | InputIterator1 | first_left, |
InputIterator1 | last_left, | ||
InputIterator2 | first_right, | ||
T | 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.
T aaa::manhattan::distance | ( | const Container1 & | left, |
const Container2 & | right, | ||
T | init = T{} |
||
) |
The manhattan distance of two vectors. Each vector is represented by a container. The two containers should have the same size.
T aaa::manhattan::norm | ( | InputIterator | first, |
InputIterator | last, | ||
T | init = T{} |
||
) |
The manhattan norm of a vector. The vector is represented a range of iterators.
T aaa::manhattan::norm | ( | const Container & | a, |
T | init = T{} |
||
) |
The manhattan norm of a vector. The vector is represented by a container.
T aaa::manhattan::squared_distance | ( | InputIterator1 | first_left, |
InputIterator1 | last_left, | ||
InputIterator2 | first_right, | ||
T | init = T{} |
||
) |
The squared manhattan distance of two vectors. Each vector is represented by a range of iterators.
T aaa::manhattan::squared_distance | ( | const Container1 & | left, |
const Container2 & | right, | ||
T | 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.
T aaa::manhattan::squared_norm | ( | InputIterator | first, |
InputIterator | last, | ||
T | init = T{} |
||
) |
The squared manhattan norm of a vector. The vector is represented by a range of iterators.
T aaa::manhattan::squared_norm | ( | const Container & | a, |
T | init = T{} |
||
) |
The squared manhattan norm of a vector. The vector is represented by a container.