gslcpp
Modern-C++ Wrapper for GSL
add-constant.hpp
Go to the documentation of this file.
1 /// @file include/gslcpp/wrap/add-constant.hpp
2 /// @copyright 2022 Thomas E. Vaughan, all rights reserved.
3 /// @brief Definition of gsl::add_constant().
4 
5 #pragma once
6 #include "container.hpp" // w_vector
7 
8 namespace gsl {
9 
10 
11 /// Add same constant to every element in place. `add_constant` is overloaded
12 /// to provide the same name for every type of vector.
13 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
14 /// @param u Pointer to vector whose elements are to be modified.
15 /// @param v Constant to add into each element.
16 /// @return TBD: Not specified in GSL's documentation.
17 inline int w_add_constant(w_vector<double> *u, double const &v) {
18  return gsl_vector_add_constant(u, v);
19 }
20 
21 
22 /// Add same constant to every element in place. `add_constant` is overloaded
23 /// to provide the same name for every type of vector.
24 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
25 /// @param u Pointer to vector whose elements are to be modified.
26 /// @param v Constant to add into each element.
27 /// @return TBD: Not specified in GSL's documentation.
28 inline int w_add_constant(w_vector<float> *u, float const &v) {
29  return gsl_vector_float_add_constant(u, v);
30 }
31 
32 
33 /// Add same constant to every element in place. `add_constant` is overloaded
34 /// to provide the same name for every type of vector.
35 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
36 /// @param u Pointer to vector whose elements are to be modified.
37 /// @param v Constant to add into each element.
38 /// @return TBD: Not specified in GSL's documentation.
39 inline int w_add_constant(w_vector<long double> *u, long double const &v) {
40  return gsl_vector_long_double_add_constant(u, v);
41 }
42 
43 
44 /// Add same constant to every element in place. `add_constant` is overloaded
45 /// to provide the same name for every type of vector.
46 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
47 /// @param u Pointer to vector whose elements are to be modified.
48 /// @param v Constant to add into each element.
49 /// @return TBD: Not specified in GSL's documentation.
50 inline int w_add_constant(w_vector<int> *u, int const &v) {
51  return gsl_vector_int_add_constant(u, v);
52 }
53 
54 
55 /// Add same constant to every element in place. `add_constant` is overloaded
56 /// to provide the same name for every type of vector.
57 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
58 /// @param u Pointer to vector whose elements are to be modified.
59 /// @param v Constant to add into each element.
60 /// @return TBD: Not specified in GSL's documentation.
61 inline int w_add_constant(w_vector<unsigned> *u, unsigned const &v) {
62  return gsl_vector_uint_add_constant(u, v);
63 }
64 
65 
66 /// Add same constant to every element in place. `add_constant` is overloaded
67 /// to provide the same name for every type of vector.
68 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
69 /// @param u Pointer to vector whose elements are to be modified.
70 /// @param v Constant to add into each element.
71 /// @return TBD: Not specified in GSL's documentation.
72 inline int w_add_constant(w_vector<long> *u, long const &v) {
73  return gsl_vector_long_add_constant(u, v);
74 }
75 
76 
77 /// Add same constant to every element in place. `add_constant` is overloaded
78 /// to provide the same name for every type of vector.
79 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
80 /// @param u Pointer to vector whose elements are to be modified.
81 /// @param v Constant to add into each element.
82 /// @return TBD: Not specified in GSL's documentation.
83 inline int w_add_constant(w_vector<unsigned long> *u, unsigned long const &v) {
84  return gsl_vector_ulong_add_constant(u, v);
85 }
86 
87 
88 /// Add same constant to every element in place. `add_constant` is overloaded
89 /// to provide the same name for every type of vector.
90 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
91 /// @param u Pointer to vector whose elements are to be modified.
92 /// @param v Constant to add into each element.
93 /// @return TBD: Not specified in GSL's documentation.
94 inline int w_add_constant(w_vector<short> *u, short const &v) {
95  return gsl_vector_short_add_constant(u, v);
96 }
97 
98 
99 /// Add same constant to every element in place. `add_constant` is overloaded
100 /// to provide the same name for every type of vector.
101 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
102 /// @param u Pointer to vector whose elements are to be modified.
103 /// @param v Constant to add into each element.
104 /// @return TBD: Not specified in GSL's documentation.
105 inline int
106 w_add_constant(w_vector<unsigned short> *u, unsigned short const &v) {
107  return gsl_vector_ushort_add_constant(u, v);
108 }
109 
110 
111 /// Add same constant to every element in place. `add_constant` is overloaded
112 /// to provide the same name for every type of vector.
113 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
114 /// @param u Pointer to vector whose elements are to be modified.
115 /// @param v Constant to add into each element.
116 /// @return TBD: Not specified in GSL's documentation.
117 inline int w_add_constant(w_vector<char> *u, char const &v) {
118  return gsl_vector_char_add_constant(u, v);
119 }
120 
121 
122 /// Add same constant to every element in place. `add_constant` is overloaded
123 /// to provide the same name for every type of vector.
124 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
125 /// @param u Pointer to vector whose elements are to be modified.
126 /// @param v Constant to add into each element.
127 /// @return TBD: Not specified in GSL's documentation.
128 inline int w_add_constant(w_vector<unsigned char> *u, unsigned char const &v) {
129  return gsl_vector_uchar_add_constant(u, v);
130 }
131 
132 
133 /// Add same constant to every element in place. `add_constant` is overloaded
134 /// to provide the same name for every type of vector.
135 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
136 /// @param u Pointer to vector whose elements are to be modified.
137 /// @param v Constant to add into each element.
138 /// @return TBD: Not specified in GSL's documentation.
139 inline int
140 w_add_constant(w_vector<complex<double>> *u, complex<double> const &v) {
141  return gsl_vector_complex_add_constant(u, v);
142 }
143 
144 
145 /// Add same constant to every element in place. `add_constant` is overloaded
146 /// to provide the same name for every type of vector.
147 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
148 /// @param u Pointer to vector whose elements are to be modified.
149 /// @param v Constant to add into each element.
150 /// @return TBD: Not specified in GSL's documentation.
151 inline int
152 w_add_constant(w_vector<complex<float>> *u, complex<float> const &v) {
153  return gsl_vector_complex_float_add_constant(u, v);
154 }
155 
156 
157 /// Add same constant to every element in place. `add_constant` is overloaded
158 /// to provide the same name for every type of vector.
159 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_add_constant
160 /// @param u Pointer to vector whose elements are to be modified.
161 /// @param v Constant to add into each element.
162 /// @return TBD: Not specified in GSL's documentation.
163 inline int w_add_constant(
164  w_vector<complex<long double>> *u, complex<long double> const &v) {
165  return gsl_vector_complex_long_double_add_constant(u, v);
166 }
167 
168 
169 } // namespace gsl
170 
171 // EOF
gsl::w_add_constant
int w_add_constant(w_vector< int > *u, int const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:50
gsl::w_add_constant
int w_add_constant(w_vector< short > *u, short const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:94
gsl::w_add_constant
int w_add_constant(w_vector< complex< double >> *u, complex< double > const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:140
gsl::w_add_constant
int w_add_constant(w_vector< long double > *u, long double const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:39
gsl::w_add_constant
int w_add_constant(w_vector< complex< float >> *u, complex< float > const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:152
gsl::w_add_constant
int w_add_constant(w_vector< long > *u, long const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:72
gsl::w_add_constant
int w_add_constant(w_vector< float > *u, float const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:28
gsl::w_add_constant
int w_add_constant(w_vector< char > *u, char const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:117
gsl::w_add_constant
int w_add_constant(w_vector< double > *u, double const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:17
gsl::w_add_constant
int w_add_constant(w_vector< unsigned long > *u, unsigned long const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:83
gsl::w_add_constant
int w_add_constant(w_vector< unsigned > *u, unsigned const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:61
gsl::w_add_constant
int w_add_constant(w_vector< unsigned char > *u, unsigned char const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:128
gsl::w_add_constant
int w_add_constant(w_vector< unsigned short > *u, unsigned short const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:106
gsl::w_add_constant
int w_add_constant(w_vector< complex< long double >> *u, complex< long double > const &v)
Add same constant to every element in place.
Definition: add-constant.hpp:163
gsl
Namespace for C++-interface to GSL.
Definition: v-iface.hpp:51