Debian Codegraph @

include/core/hist/distance_calculator/detail/TemplateHelperBase.h

raw
1 // SPDX-License-Identifier: LGPL-3.0-or-later
2 // Author: Kristian Lytje
3
4 #pragma once
5
6 #include <hist/detail/CompactCoordinates.h>
7 #include <hist/detail/CompactCoordinatesFF.h>
8
9 #include <span>
10 #include <type_traits>
11
12 namespace ausaxs::hist::detail {
13 namespace add16 {
14 //### CompactCoordinates overloads ###//
15 template<bool variable_bin_width, bool explicit_ff = false>
16 inline hist::detail::xyzw::HexaEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
17 return data_i[i].evaluate_16(std::span<std::remove_reference_t<decltype(data_j[j])>, 16>(&data_j[j], 16));
18 }
19
20 template<bool variable_bin_width, bool explicit_ff = false>
21 inline hist::detail::xyzw::HexaEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
22 return data_i[i].evaluate_rounded_16(std::span<std::remove_reference_t<decltype(data_j[j])>, 16>(&data_j[j], 16));
23 }
24
25 //### CompactCoordinatesFF overloads ###//
26 template<bool variable_bin_width, bool explicit_ff = false>
27 inline hist::detail::xyzff::HexaEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
28 return data_i[i].evaluate_16(std::span<std::remove_reference_t<decltype(data_j[j])>, 16>(&data_j[j], 16));
29 }
30
31 template<bool variable_bin_width, bool explicit_ff = false>
32 inline hist::detail::xyzff::HexaEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
33 return data_i[i].evaluate_rounded_16(std::span<std::remove_reference_t<decltype(data_j[j])>, 16>(&data_j[j], 16));
34 }
35 }
36
37 namespace add8 {
38 //### CompactCoordinates overloads ###//
39 template<bool variable_bin_width, bool explicit_ff = false>
40 inline hist::detail::xyzw::OctoEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
41 return data_i[i].evaluate_8(std::span<std::remove_reference_t<decltype(data_j[j])>, 8>(&data_j[j], 8));
42 }
43
44 template<bool variable_bin_width, bool explicit_ff = false>
45 inline hist::detail::xyzw::OctoEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
46 return data_i[i].evaluate_rounded_8(std::span<std::remove_reference_t<decltype(data_j[j])>, 8>(&data_j[j], 8));
47 }
48
49 //### CompactCoordinatesFF overloads ###//
50 template<bool variable_bin_width, bool explicit_ff = false>
51 inline hist::detail::xyzff::OctoEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
52 return data_i[i].evaluate_8(std::span<std::remove_reference_t<decltype(data_j[j])>, 8>(&data_j[j], 8));
53 }
54
55 template<bool variable_bin_width, bool explicit_ff = false>
56 inline hist::detail::xyzff::OctoEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
57 return data_i[i].evaluate_rounded_8(std::span<std::remove_reference_t<decltype(data_j[j])>, 8>(&data_j[j], 8));
58 }
59 }
60
61 namespace add4 {
62 //### CompactCoordinates overloads ###//
63 template<bool variable_bin_width, bool explicit_ff = false>
64 inline hist::detail::xyzw::QuadEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
65 return data_i[i].evaluate_4(std::span<std::remove_reference_t<decltype(data_j[j])>, 4>(&data_j[j], 4));
66 }
67
68 template<bool variable_bin_width, bool explicit_ff = false>
69 inline hist::detail::xyzw::QuadEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
70 return data_i[i].evaluate_rounded_4(std::span<std::remove_reference_t<decltype(data_j[j])>, 4>(&data_j[j], 4));
71 }
72
73 //### CompactCoordinatesFF overloads ###//
74 template<bool variable_bin_width, bool explicit_ff = false>
75 inline hist::detail::xyzff::QuadEvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
76 return data_i[i].evaluate_4(std::span<std::remove_reference_t<decltype(data_j[j])>, 4>(&data_j[j], 4));
77 }
78
79 template<bool variable_bin_width, bool explicit_ff = false>
80 inline hist::detail::xyzff::QuadEvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
81 return data_i[i].evaluate_rounded_4(std::span<std::remove_reference_t<decltype(data_j[j])>, 4>(&data_j[j], 4));
82 }
83 }
84
85 namespace add1 {
86 //### CompactCoordinates overloads ###//
87 template<bool variable_bin_width, bool explicit_ff = false>
88 inline hist::detail::xyzw::EvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
89 return data_i[i].evaluate(data_j[j]);
90 }
91
92 template<bool variable_bin_width, bool explicit_ff = false>
93 inline hist::detail::xyzw::EvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinates<variable_bin_width>& data_i, const hist::detail::CompactCoordinates<variable_bin_width>& data_j, int i, int j) {
94 return data_i[i].evaluate_rounded(data_j[j]);
95 }
96
97 //### CompactCoordinatesFF overloads ###//
98 template<bool variable_bin_width, bool explicit_ff = false>
99 inline hist::detail::xyzff::EvaluatedResult evaluate_weighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
100 return data_i[i].evaluate(data_j[j]);
101 }
102
103 template<bool variable_bin_width, bool explicit_ff = false>
104 inline hist::detail::xyzff::EvaluatedResultRounded evaluate_unweighted(const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_i, const hist::detail::CompactCoordinatesFF<variable_bin_width, explicit_ff>& data_j, int i, int j) {
105 return data_i[i].evaluate_rounded(data_j[j]);
106 }
107 }
108 }