gslcpp
Modern-C++ Wrapper for GSL
max-index.hpp
Go to the documentation of this file.
1 /// \file include/gslcpp/wrap/max-index.hpp
2 /// \copyright 2022 Thomas E. Vaughan, all rights reserved.
3 /// \brief Definition of gsl::w_max_index().
4 
5 #pragma once
6 #include "container.hpp" // w_vector // vector
7 
8 namespace gsl {
9 
10 
11 /// Index of maximum value in vector `v`.
12 /// When there are several equal maximum elements, lowest index is returned.
13 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
14 /// @param v Pointer to vector.
15 /// @return Index of maximum value in `v`.
16 inline auto w_max_index(w_vector<double const> *v) {
17  return gsl_vector_max_index(v);
18 }
19 
20 
21 /// Index of maximum value in vector `v`.
22 /// When there are several equal maximum elements, lowest index is returned.
23 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
24 /// @param v Pointer to vector.
25 /// @return Index of maximum value in `v`.
26 inline auto w_max_index(w_vector<float const> *v) {
27  return gsl_vector_float_max_index(v);
28 }
29 
30 
31 /// Index of maximum value in vector `v`.
32 /// When there are several equal maximum elements, lowest index is returned.
33 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
34 /// @param v Pointer to vector.
35 /// @return Index of maximum value in `v`.
36 inline auto w_max_index(w_vector<long double const> *v) {
37  return gsl_vector_long_double_max_index(v);
38 }
39 
40 
41 /// Index of maximum value in vector `v`.
42 /// When there are several equal maximum elements, lowest index is returned.
43 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
44 /// @param v Pointer to vector.
45 /// @return Index of maximum value in `v`.
46 inline auto w_max_index(w_vector<int const> *v) {
47  return gsl_vector_int_max_index(v);
48 }
49 
50 
51 /// Index of maximum value in vector `v`.
52 /// When there are several equal maximum elements, lowest index is returned.
53 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
54 /// @param v Pointer to vector.
55 /// @return Index of maximum value in `v`.
56 inline auto w_max_index(w_vector<unsigned const> *v) {
57  return gsl_vector_uint_max_index(v);
58 }
59 
60 
61 /// Index of maximum value in vector `v`.
62 /// When there are several equal maximum elements, lowest index is returned.
63 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
64 /// @param v Pointer to vector.
65 /// @return Index of maximum value in `v`.
66 inline auto w_max_index(w_vector<long const> *v) {
67  return gsl_vector_long_max_index(v);
68 }
69 
70 
71 /// Index of maximum value in vector `v`.
72 /// When there are several equal maximum elements, lowest index is returned.
73 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
74 /// @param v Pointer to vector.
75 /// @return Index of maximum value in `v`.
76 inline auto w_max_index(w_vector<unsigned long const> *v) {
77  return gsl_vector_ulong_max_index(v);
78 }
79 
80 
81 /// Index of maximum value in vector `v`.
82 /// When there are several equal maximum elements, lowest index is returned.
83 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
84 /// @param v Pointer to vector.
85 /// @return Index of maximum value in `v`.
86 inline auto w_max_index(w_vector<short const> *v) {
87  return gsl_vector_short_max_index(v);
88 }
89 
90 
91 /// Index of maximum value in vector `v`.
92 /// When there are several equal maximum elements, lowest index is returned.
93 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
94 /// @param v Pointer to vector.
95 /// @return Index of maximum value in `v`.
96 inline auto w_max_index(w_vector<unsigned short const> *v) {
97  return gsl_vector_ushort_max_index(v);
98 }
99 
100 
101 /// Index of maximum value in vector `v`.
102 /// When there are several equal maximum elements, lowest index is returned.
103 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
104 /// @param v Pointer to vector.
105 /// @return Index of maximum value in `v`.
106 inline auto w_max_index(w_vector<char const> *v) {
107  return gsl_vector_char_max_index(v);
108 }
109 
110 
111 /// Index of maximum value in vector `v`.
112 /// When there are several equal maximum elements, lowest index is returned.
113 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_max_index
114 /// @param v Pointer to vector.
115 /// @return Index of maximum value in `v`.
116 inline auto w_max_index(w_vector<unsigned char const> *v) {
117  return gsl_vector_uchar_max_index(v);
118 }
119 
120 } // namespace gsl
121 
122 // EOF
gsl::w_max_index
auto w_max_index(w_vector< double const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:16
gsl::w_max_index
auto w_max_index(w_vector< short const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:86
gsl::w_max_index
auto w_max_index(w_vector< unsigned short const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:96
gsl::w_max_index
auto w_max_index(w_vector< char const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:106
gsl::w_max_index
auto w_max_index(w_vector< long double const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:36
gsl::w_max_index
auto w_max_index(w_vector< long const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:66
gsl::w_max_index
auto w_max_index(w_vector< int const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:46
gsl::w_max_index
auto w_max_index(w_vector< unsigned const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:56
gsl::w_max_index
auto w_max_index(w_vector< float const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:26
gsl::w_max_index
auto w_max_index(w_vector< unsigned long const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:76
gsl::w_max_index
auto w_max_index(w_vector< unsigned char const > *v)
Index of maximum value in vector v.
Definition: max-index.hpp:116
gsl
Namespace for C++-interface to GSL.
Definition: v-iface.hpp:51