26 #include "../../algorithm.h"
27 #include "../matrix.h"
37 template <
typename Item, std::
size_t N >
62 *points_.rbegin() = item;
64 std::sort( points_.begin(), points_.end() );
68 : points_( std::move(
data ) )
70 std::sort( points_.begin(), points_.end() );
73 template <
typename... Ts >
75 : points_( { ts... } )
78 sizeof...( Ts ) ==
N + 1,
"Number of parameters for simplex has to be N+1" );
83 return points_.begin();
91 [[nodiscard]] constexpr Item
const&
operator[]( std::size_t index )
const
93 return points_[index];
96 [[nodiscard]] constexpr std::size_t
size()
const
98 return points_.size();
102 template < std::
size_t N, std::
size_t U >
112 template < std::
size_t N >
118 std::copy( diff.begin(), diff.end(), &m[i][0] );
121 return std::abs( ( 1 / std::tgammaf(
N + 1 ) ) * determinant( m ) );
124 template <
typename Item, std::
size_t N >
129 return lh[j] != rh[j];
131 return lh[i] < rh[i];
134 template <
typename Item, std::
size_t N >
140 template <
typename Item, std::
size_t N >
146 template <
typename Item, std::
size_t N >
152 template <
typename Item, std::
size_t N >
155 return equal( lh, rh );
158 template <
typename Item, std::
size_t N >
161 return !( lh == rh );
Class implementing multidimensional point in coordinate system of dimension N.
Definition: point.h:36
constexpr simplex(Item item)
Definition: simplex.h:53
constexpr simplex()=default
std::array< Item, N+1 > container
Definition: simplex.h:41
constexpr const_iterator end() const
Definition: simplex.h:86
constexpr simplex(std::array< Item, N+1 > data)
Definition: simplex.h:67
typename container::const_iterator const_iterator
Definition: simplex.h:49
constexpr std::size_t size() const
Definition: simplex.h:96
constexpr Item const & operator[](std::size_t index) const
Definition: simplex.h:91
constexpr simplex(simplex< Item, N - 1 > const &sub, Item item)
Definition: simplex.h:58
constexpr simplex(Ts... ts)
Definition: simplex.h:74
typename container::iterator iterator
Definition: simplex.h:48
constexpr const_iterator begin() const
Definition: simplex.h:81
Item value_type
Definition: simplex.h:47
MIT License.
Definition: impl.h:31
constexpr point< N > point_cast(vector< N > const &v)
Definition: point.h:61
constexpr bool operator>(simplex< Item, N > const &lh, simplex< Item, N > const &rh)
Definition: simplex.h:135
constexpr pointer data() noexcept
Returns pointer to first item of the storage.
Definition: static_storage.h:108
constexpr float volume_of(simplex< point< N >, N > const &simplex)
Definition: simplex.h:113
constexpr T sum(Container &&cont, UnaryCallable &&f=std::identity(), T init={})
Applies f(x) to each item of container 'cont', returns the sum of all the return values of each call ...
Definition: algorithm.h:250
constexpr bool equal(LhContainer &&lh, RhContainer &&rh, BinaryPredicateCallable &&f=std::equal_to< void >{})
Returns true if containers 'lh' and 'rh' has same size and calls to predicate f - f(lh[i],...
Definition: algorithm.h:356
constexpr T avg(Container &&cont, UnaryCallable &&f=std::identity())
Applies callable 'f(x)' to each element of container 'cont' and returns the average value of each cal...
Definition: algorithm.h:275
void copy(Container &&cont, Iterator iter)
Definition: algorithm.h:455
constexpr Derived abs(vec_point_base< Derived, N > const &a)
Creates absolute version of A - removing signs on all dimensions.
Definition: vec_point_base.h:219
constexpr bool operator<=(simplex< Item, N > const &lh, simplex< Item, N > const &rh)
Definition: simplex.h:141
constexpr bool operator<(pose const &x, pose const &y)
Definition: pose.h:85
constexpr vector< N > vector_cast(point< N > const &p)
Definition: point.h:67
constexpr bool operator>=(simplex< Item, N > const &lh, simplex< Item, N > const &rh)
Definition: simplex.h:147
constexpr point< N > center_of(simplex< point< N >, U > const &s)
Definition: simplex.h:103
constexpr view< iterators::numeric_iterator< Numeric > > range(Numeric from, Numeric to)
Builds numeric view over interval [from, to)
Definition: range.h:34
constexpr auto find_if(Container &&cont, PredicateCallable &&f=std::identity())
Returns iterator for first item, for which call to predicate f(*iter) holds true.
Definition: algorithm.h:112
constexpr bool operator!=(pose const &x, pose const &y)
negation of operator== between poses
Definition: pose.h:99
N
Definition: static_storage.h:97
constexpr bool operator==(pose const &x, pose const &y)
compares poses on their position and orientation
Definition: pose.h:93