-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtiny_reductions.h
154 lines (131 loc) · 3.57 KB
/
tiny_reductions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* *****************************************************
THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT.
*****************************************************
Generated by:
scitbx.source_generators.array_family.generate_reductions
*/
#ifndef SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H
#define SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#include <scitbx/array_family/ref_reductions.h>
#include <scitbx/array_family/tiny_plain.h>
namespace scitbx { namespace af {
template <typename ElementType1, std::size_t N1,
typename ElementType2, std::size_t N2>
int
inline
order(
tiny_plain<ElementType1, N1> const& a1,
tiny_plain<ElementType2, N2> const& a2)
{
return order(a1.const_ref(), a2.const_ref());
}
template <typename ElementType, std::size_t N>
inline
std::size_t
max_index(tiny_plain<ElementType, N> const& a)
{
return max_index(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
std::size_t
min_index(tiny_plain<ElementType, N> const& a)
{
return min_index(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
max(tiny_plain<ElementType, N> const& a)
{
return max(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
min(tiny_plain<ElementType, N> const& a)
{
return min(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
max_absolute(tiny_plain<ElementType, N> const& a)
{
return max_absolute(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
sum(tiny_plain<ElementType, N> const& a)
{
return sum(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
sum_sq(tiny_plain<ElementType, N> const& a)
{
return sum_sq(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
product(tiny_plain<ElementType, N> const& a)
{
return product(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
mean(tiny_plain<ElementType, N> const& a)
{
return mean(a.const_ref());
}
template <typename ElementType, std::size_t N>
inline
ElementType
mean_sq(tiny_plain<ElementType, N> const& a)
{
return mean_sq(a.const_ref());
}
template <typename ElementTypeValues, std::size_t N,
typename ElementTypeWeights>
inline
ElementTypeValues
mean_weighted(
tiny_plain<ElementTypeValues, N> const& values,
tiny_plain<ElementTypeWeights, N> const& weights)
{
return mean_weighted(values.const_ref(), weights.const_ref());
}
template <typename ElementTypeValues, std::size_t N,
typename ElementTypeWeights>
inline
ElementTypeValues
mean_sq_weighted(
tiny_plain<ElementTypeValues, N> const& values,
tiny_plain<ElementTypeWeights, N> const& weights)
{
return mean_sq_weighted(values.const_ref(), weights.const_ref());
}
template <typename ElementType, std::size_t N, class PredicateType>
inline
boost::optional<std::size_t>
first_index(tiny_plain<ElementType, N> const& a,
PredicateType p)
{
return first_index(a.const_ref(), p);
}
template <typename ElementType, std::size_t N, class PredicateType>
inline
boost::optional<std::size_t>
last_index(tiny_plain<ElementType, N> const& a,
PredicateType p)
{
return last_index(a.const_ref(), p);
}
}} // namespace scitbx::af
#endif // DOXYGEN_SHOULD_SKIP_THIS
#endif // SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H