Ponca  7d8ac87a7de01d881c9fde3c42e397b44bffb901
Point Cloud Analysis library
Loading...
Searching...
No Matches
indexSquaredDistance.h
1/*
2 This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "./defines.h"
10#include PONCA_MULTIARCH_INCLUDE_CU_STD(limits)
11#include <type_traits>
12
13namespace Ponca
14{
15
17 template <typename Index, typename Scalar>
19 {
21 Index index{-1};
22
24 Scalar squared_distance{PONCA_MULTIARCH_CU_STD_NAMESPACE(numeric_limits) < Scalar > ::max()};
25
27 PONCA_MULTIARCH inline bool operator<(const IndexSquaredDistance& other) const
28 {
29 return squared_distance < other.squared_distance;
30 }
31 };
32
33} // namespace Ponca
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:318
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Associates an index with a distance.
bool operator<(const IndexSquaredDistance &other) const
Comparison operator based on squared_distance.
Scalar squared_distance
Distance to the closest point.