Interface Documentation
Version: invalid
Namespaces | Typedefs | Functions
point.hh File Reference
#include "flecsi/util/common.hh"
#include "flecsi/util/dimensioned_array.hh"
#include <array>
#include <cmath>
Include dependency graph for point.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 flecsi
 

Typedefs

template<typename TYPE , size_t DIMENSION>
using flecsi::util::point = dimensioned_array< TYPE, DIMENSION, 1 >
 

Functions

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)
 

Typedef Documentation

◆ point

template<typename TYPE , size_t DIMENSION>
using flecsi::util::point = typedef dimensioned_array<TYPE, DIMENSION, 1>

The point type defines an interface for storing and manipulating coordinate data. The point type is implemented using dimensioned_array.

Template Parameters
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.

Function Documentation

◆ 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
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.
Parameters
pointsThe 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
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.
Parameters
pointsThe 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
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.
Parameters
aThe first point.
bThe 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
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.
Parameters
aThe first point.
bThe 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
TYPEThe type to use to represent coordinate values.
DIMENSIONThe dimension of the point.