gslcpp
Modern-C++ Wrapper for GSL
set.hpp
Go to the documentation of this file.
1 /// \file include/gslcpp/wrap/set.hpp
2 /// \copyright 2022 Thomas E. Vaughan, all rights reserved.
3 /// \brief Definition of gsl::w_set().
4 
5 #pragma once
6 #include "container.hpp" // w_vector
7 
8 namespace gsl {
9 
10 
11 /// Set to `x` the value of `i`th element of vector `v`.
12 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
13 /// @param v Pointer to vector.
14 /// @param i Offset of element whose value should change.
15 /// @param x New value for element at offset `i`.
16 inline void w_set(w_vector<double> *v, size_t i, double const &x) {
17  return gsl_vector_set(v, i, x);
18 }
19 
20 
21 /// Set to `x` the value of `i`th element of vector `v`.
22 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
23 /// @param v Pointer to vector.
24 /// @param i Offset of element whose value should change.
25 /// @param x New value for element at offset `i`.
26 inline void w_set(w_vector<float> *v, size_t i, float const &x) {
27  return gsl_vector_float_set(v, i, x);
28 }
29 
30 
31 /// Set to `x` the value of `i`th element of vector `v`.
32 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
33 /// @param v Pointer to vector.
34 /// @param i Offset of element whose value should change.
35 /// @param x New value for element at offset `i`.
36 inline void w_set(w_vector<long double> *v, size_t i, long double const &x) {
37  return gsl_vector_long_double_set(v, i, x);
38 }
39 
40 
41 /// Set to `x` the value of `i`th element of vector `v`.
42 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
43 /// @param v Pointer to vector.
44 /// @param i Offset of element whose value should change.
45 /// @param x New value for element at offset `i`.
46 inline void w_set(w_vector<int> *v, size_t i, int const &x) {
47  return gsl_vector_int_set(v, i, x);
48 }
49 
50 
51 /// Set to `x` the value of `i`th element of vector `v`.
52 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
53 /// @param v Pointer to vector.
54 /// @param i Offset of element whose value should change.
55 /// @param x New value for element at offset `i`.
56 inline void w_set(w_vector<unsigned> *v, size_t i, unsigned const &x) {
57  return gsl_vector_uint_set(v, i, x);
58 }
59 
60 
61 /// Set to `x` the value of `i`th element of vector `v`.
62 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
63 /// @param v Pointer to vector.
64 /// @param i Offset of element whose value should change.
65 /// @param x New value for element at offset `i`.
66 inline void w_set(w_vector<long> *v, size_t i, long const &x) {
67  return gsl_vector_long_set(v, i, x);
68 }
69 
70 
71 /// Set to `x` the value of `i`th element of vector `v`.
72 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
73 /// @param v Pointer to vector.
74 /// @param i Offset of element whose value should change.
75 /// @param x New value for element at offset `i`.
76 inline void
77 w_set(w_vector<unsigned long> *v, size_t i, unsigned long const &x) {
78  return gsl_vector_ulong_set(v, i, x);
79 }
80 
81 
82 /// Set to `x` the value of `i`th element of vector `v`.
83 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
84 /// @param v Pointer to vector.
85 /// @param i Offset of element whose value should change.
86 /// @param x New value for element at offset `i`.
87 inline void w_set(w_vector<short> *v, size_t i, short const &x) {
88  return gsl_vector_short_set(v, i, x);
89 }
90 
91 
92 /// Set to `x` the value of `i`th element of vector `v`.
93 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
94 /// @param v Pointer to vector.
95 /// @param i Offset of element whose value should change.
96 /// @param x New value for element at offset `i`.
97 inline void
98 w_set(w_vector<unsigned short> *v, size_t i, unsigned short const &x) {
99  return gsl_vector_ushort_set(v, i, x);
100 }
101 
102 
103 /// Set to `x` the value of `i`th element of vector `v`.
104 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
105 /// @param v Pointer to vector.
106 /// @param i Offset of element whose value should change.
107 /// @param x New value for element at offset `i`.
108 inline void w_set(w_vector<char> *v, size_t i, char const &x) {
109  return gsl_vector_char_set(v, i, x);
110 }
111 
112 
113 /// Set to `x` the value of `i`th element of vector `v`.
114 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
115 /// @param v Pointer to vector.
116 /// @param i Offset of element whose value should change.
117 /// @param x New value for element at offset `i`.
118 inline void
119 w_set(w_vector<unsigned char> *v, size_t i, unsigned char const &x) {
120  return gsl_vector_uchar_set(v, i, x);
121 }
122 
123 
124 /// Set to `x` the value of `i`th element of vector `v`.
125 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
126 /// @param v Pointer to vector.
127 /// @param i Offset of element whose value should change.
128 /// @param x New value for element at offset `i`.
129 inline void
130 w_set(w_vector<complex<double>> *v, size_t i, complex<double> const &x) {
131  return gsl_vector_complex_set(v, i, x);
132 }
133 
134 
135 /// Set to `x` the value of `i`th element of vector `v`.
136 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
137 /// @param v Pointer to vector.
138 /// @param i Offset of element whose value should change.
139 /// @param x New value for element at offset `i`.
140 inline void
141 w_set(w_vector<complex<float>> *v, size_t i, complex<float> const &x) {
142  return gsl_vector_complex_float_set(v, i, x);
143 }
144 
145 
146 /// Set to `x` the value of `i`th element of vector `v`.
147 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_set
148 /// @param v Pointer to vector.
149 /// @param i Offset of element whose value should change.
150 /// @param x New value for element at offset `i`.
151 inline void
152 w_set(w_vector<complex<long double>> *v,
153  size_t i,
154  complex<long double> const &x) {
155  return gsl_vector_complex_long_double_set(v, i, x);
156 }
157 
158 
159 } // namespace gsl
160 
161 // EOF
gsl::w_set
void w_set(w_vector< unsigned char > *v, size_t i, unsigned char const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:119
gsl::w_set
void w_set(w_vector< int > *v, size_t i, int const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:46
gsl::w_set
void w_set(w_vector< complex< double >> *v, size_t i, complex< double > const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:130
gsl::w_set
void w_set(w_vector< unsigned > *v, size_t i, unsigned const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:56
gsl::w_set
void w_set(w_vector< long double > *v, size_t i, long double const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:36
gsl::w_set
void w_set(w_vector< unsigned short > *v, size_t i, unsigned short const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:98
gsl::w_set
void w_set(w_vector< short > *v, size_t i, short const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:87
gsl::w_set
void w_set(w_vector< char > *v, size_t i, char const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:108
gsl::w_set
void w_set(w_vector< float > *v, size_t i, float const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:26
gsl::w_set
void w_set(w_vector< double > *v, size_t i, double const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:16
gsl::w_set
void w_set(w_vector< unsigned long > *v, size_t i, unsigned long const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:77
gsl::w_set
void w_set(w_vector< long > *v, size_t i, long const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:66
gsl
Namespace for C++-interface to GSL.
Definition: v-iface.hpp:51
gsl::w_set
void w_set(w_vector< complex< float >> *v, size_t i, complex< float > const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:141
gsl::w_set
void w_set(w_vector< complex< long double >> *v, size_t i, complex< long double > const &x)
Set to x the value of ith element of vector v.
Definition: set.hpp:152