8#include <ArborX_Point.hpp>
9#include <Kokkos_Core.hpp>
24KOKKOS_INLINE_FUNCTION
constexpr bool
25operator==(
const ArborX::Point<Dim, PACMAN::coordinates_t> &lhs,
26 const ArborX::Point<Dim, PACMAN::coordinates_t> &rhs)
noexcept {
27 for (
int i = 0; i < Dim; ++i) {
28 if (lhs[i] != rhs[i] && (lhs[i] == lhs[i] && rhs[i] == rhs[i])) {
43KOKKOS_INLINE_FUNCTION
constexpr bool
44operator!=(
const ArborX::Point<Dim, PACMAN::coordinates_t> &lhs,
45 const ArborX::Point<Dim, PACMAN::coordinates_t> &rhs)
noexcept {
58KOKKOS_INLINE_FUNCTION
bool constexpr
59operator<(
const ArborX::Point<Dim, PACMAN::coordinates_t> &lhs,
60 const ArborX::Point<Dim, PACMAN::coordinates_t> &rhs)
noexcept {
61 const bool is_lhs_nan = lhs[0] != lhs[0];
62 const bool is_rhs_nan = rhs[0] != rhs[0];
63 if (is_lhs_nan != is_rhs_nan) {
66 for (
int axis = 0; axis < Dim; ++axis) {
67 if (lhs[axis] < rhs[axis]) {
70 if (lhs[axis] > rhs[axis]) {
86KOKKOS_INLINE_FUNCTION
bool constexpr
87operator>(
const ArborX::Point<Dim, PACMAN::coordinates_t> &lhs,
88 const ArborX::Point<Dim, PACMAN::coordinates_t> &rhs)
noexcept {
89 return !(lhs == rhs) && !(lhs < rhs);
103 const ArborX::Point<Dim, PACMAN::coordinates_t> &point) {
104 std::ostringstream strs;
106 strs <<
"ArborX::Point(";
107 for (
int i = 0; i < Dim - 1; i++) {
108 strs << point[i] <<
", ";
110 strs << point[Dim - 1] <<
")";
128KOKKOS_INLINE_FUNCTION
fp_t
130 const ::ArborX::Point<Dim, coordinates_t> &rhs)
noexcept {
131 if (rhs[0] != rhs[0] || lhs[0] != lhs[0]) {
135 for (
int_t i = 0; i < Dim; ++i) {
136 acc += (rhs[i] - lhs[i]) * (rhs[i] - lhs[i]);
149KOKKOS_INLINE_FUNCTION
fp_t
150Distance(const ::ArborX::Point<Dim, coordinates_t> &lhs,
151 const ::ArborX::Point<Dim, coordinates_t> &rhs) {
156 return Kokkos::sqrt(d);
166KOKKOS_INLINE_FUNCTION
fp_t
168 const ::ArborX::Point<Dim, coordinates_t> &rhs) {
170 for (
int_t i = 0; i < Dim; ++i) {
171 acc += (rhs[i] - lhs[i]) * (rhs[i] - lhs[i]);
183KOKKOS_INLINE_FUNCTION
fp_t
185 const ::ArborX::Point<Dim, coordinates_t> &rhs) {
205 const bool &
final)
const {
KOKKOS_INLINE_FUNCTION bool constexpr operator<(const ArborX::Point< Dim, PACMAN::coordinates_t > &lhs, const ArborX::Point< Dim, PACMAN::coordinates_t > &rhs) noexcept
Custom operator overload for operator< to compare two ArborX::Point using the values of each point.
std::ostream & operator<<(std::ostream &os, const ArborX::Point< Dim, PACMAN::coordinates_t > &point)
Custom operator overload for operator<< to print a ArborX::Point with a nice format (ArborX::Point(x,...
KOKKOS_INLINE_FUNCTION constexpr bool operator==(const ArborX::Point< Dim, PACMAN::coordinates_t > &lhs, const ArborX::Point< Dim, PACMAN::coordinates_t > &rhs) noexcept
Custom operator overload for operator== to compare two ArborX::Point using the values of each point,...
KOKKOS_INLINE_FUNCTION constexpr bool operator!=(const ArborX::Point< Dim, PACMAN::coordinates_t > &lhs, const ArborX::Point< Dim, PACMAN::coordinates_t > &rhs) noexcept
Custom operator overload for operator!= to compare two ArborX::Point using the values of each point,...
KOKKOS_INLINE_FUNCTION bool constexpr operator>(const ArborX::Point< Dim, PACMAN::coordinates_t > &lhs, const ArborX::Point< Dim, PACMAN::coordinates_t > &rhs) noexcept
Custom operator overload for operator> to compare two ArborX::Point using the values of each point.
KOKKOS_INLINE_FUNCTION fp_t SquaredDifference(const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs) noexcept
Returns the squared distance between two points, and check for NaN values.
KOKKOS_INLINE_FUNCTION fp_t Distance(const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
Returns the euclidian norm between two points by performing a square root operation on the SquaredDif...
KOKKOS_INLINE_FUNCTION fp_t DistanceNoCheck(const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
Returns the euclidian norm between two points by performing a square root operation on the SquaredDif...
KOKKOS_INLINE_FUNCTION fp_t SquaredDifferenceNoCheck(const ::ArborX::Point< Dim, coordinates_t > &lhs, const ::ArborX::Point< Dim, coordinates_t > &rhs)
Returns the squared distance between two points, and don't check for NaN values.
KOKKOS_INLINE_FUNCTION consteval fp_t zero(void)
KOKKOS_INLINE_FUNCTION consteval fp_t one(void)
Struct used to build multiple matrices access offsets with one scan loop only, during the systems sol...
Kokkos::View< offset_t *, ExecSpace > targetOffsets
KOKKOS_FUNCTION void operator()(const int &i, OffsetsScanPair &pair, const bool &final) const
Kokkos::View< offset_t *, ExecSpace > sourceOffsets
Kokkos::View< offset_t *, ExecSpace > evalMatOffsets
Kokkos::View< offset_t *, ExecSpace > rbfMatOffsets
KOKKOS_FUNCTION void init(OffsetsScanPair &pair) const
KOKKOS_FUNCTION void join(OffsetsScanPair &dest, const OffsetsScanPair &src) const