#include "flecsi/util/common.hh"
#include "flecsi/util/dimensioned_array.hh"
#include <array>
#include <cmath>
Go to the source code of this file.
|
| template<typename TYPE , size_t DIMENSION> |
| using | flecsi::util::point = dimensioned_array< TYPE, DIMENSION, 1 > |
| |
|
| template<typename TYPE , size_t DIMENSION> |
| constexpr point< TYPE, DIMENSION > | flecsi::util::operator* (TYPE const val, point< TYPE, DIMENSION > const &p) |
| |
| template<typename TYPE , size_t DIMENSION> |
| TYPE | flecsi::util::distance (point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b) |
| |
| template<typename TYPE , size_t DIMENSION> |
| constexpr point< TYPE, DIMENSION > | flecsi::util::midpoint (point< TYPE, DIMENSION > const &a, point< TYPE, DIMENSION > const &b) |
| |
| template<template< typename... > class CONTAINER, typename TYPE , size_t DIMENSION> |
| constexpr auto | flecsi::util::centroid (CONTAINER< point< TYPE, DIMENSION >> const &points) |
| |
| template<typename TYPE , size_t DIMENSION> |
| constexpr auto | flecsi::util::centroid (std::initializer_list< point< TYPE, DIMENSION >> points) |
| |
◆ point
template<typename TYPE , size_t DIMENSION>
The point type defines an interface for storing and manipulating coordinate data. The point type is implemented using dimensioned_array.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |
◆ centroid() [1/2]
template<template< typename... > class CONTAINER, typename TYPE , size_t DIMENSION>
| constexpr auto flecsi::util::centroid |
( |
CONTAINER< point< TYPE, DIMENSION >> const & |
points | ) |
|
Return the centroid of the given set of points.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |
- Parameters
-
| points | The points for which to find the centroid. |
◆ centroid() [2/2]
template<typename TYPE , size_t DIMENSION>
| constexpr auto flecsi::util::centroid |
( |
std::initializer_list< point< TYPE, DIMENSION >> |
points | ) |
|
Return the centroid of the given set of points.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |
- Parameters
-
| points | The points for which to find the centroid. |
◆ distance()
template<typename TYPE , size_t DIMENSION>
| TYPE flecsi::util::distance |
( |
point< TYPE, DIMENSION > const & |
a, |
|
|
point< TYPE, DIMENSION > const & |
b |
|
) |
| |
Return the distance between the given points.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |
- Parameters
-
| a | The first point. |
| b | The second point. |
◆ midpoint()
template<typename TYPE , size_t DIMENSION>
| constexpr point<TYPE, DIMENSION> flecsi::util::midpoint |
( |
point< TYPE, DIMENSION > const & |
a, |
|
|
point< TYPE, DIMENSION > const & |
b |
|
) |
| |
Return the midpoint between two points.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |
- Parameters
-
| a | The first point. |
| b | The second point. |
◆ operator*()
template<typename TYPE , size_t DIMENSION>
| constexpr point<TYPE, DIMENSION> flecsi::util::operator* |
( |
TYPE const |
val, |
|
|
point< TYPE, DIMENSION > const & |
p |
|
) |
| |
Multiplication operator.
- Template Parameters
-
| TYPE | The type to use to represent coordinate values. |
| DIMENSION | The dimension of the point. |