gslcpp
Modern-C++ Wrapper for GSL
fprintf.hpp
Go to the documentation of this file.
1 /// \file include/gslcpp/wrap/fprintf.hpp
2 /// \copyright 2022 Thomas E. Vaughan, all rights reserved.
3 /// \brief Definition of gsl::w_fprintf().
4 
5 #pragma once
6 #include "container.hpp" // w_vector
7 
8 namespace gsl {
9 
10 
11 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
12 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
13 /// @param f Pointer to file-stream.
14 /// @param v Pointer to vector.
15 /// @param fmt Pointer to printf-style specifier of format.
16 /// @return 0 on success or GSL_EFAILED on problem writing to file.
17 inline int w_fprintf(FILE *f, w_vector<double const> *v, char const *fmt) {
18  return gsl_vector_fprintf(f, v, fmt);
19 }
20 
21 
22 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
23 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
24 /// @param f Pointer to file-stream.
25 /// @param v Pointer to vector.
26 /// @param fmt Pointer to printf-style specifier of format.
27 /// @return 0 on success or GSL_EFAILED on problem writing to file.
28 inline int w_fprintf(FILE *f, w_vector<float const> *v, char const *fmt) {
29  return gsl_vector_float_fprintf(f, v, fmt);
30 }
31 
32 
33 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
34 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
35 /// @param f Pointer to file-stream.
36 /// @param v Pointer to vector.
37 /// @param fmt Pointer to printf-style specifier of format.
38 /// @return 0 on success or GSL_EFAILED on problem writing to file.
39 inline int
40 w_fprintf(FILE *f, w_vector<long double const> *v, char const *fmt) {
41  return gsl_vector_long_double_fprintf(f, v, fmt);
42 }
43 
44 
45 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
46 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
47 /// @param f Pointer to file-stream.
48 /// @param v Pointer to vector.
49 /// @param fmt Pointer to printf-style specifier of format.
50 /// @return 0 on success or GSL_EFAILED on problem writing to file.
51 inline int w_fprintf(FILE *f, w_vector<int const> *v, char const *fmt) {
52  return gsl_vector_int_fprintf(f, v, fmt);
53 }
54 
55 
56 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
57 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
58 /// @param f Pointer to file-stream.
59 /// @param v Pointer to vector.
60 /// @param fmt Pointer to printf-style specifier of format.
61 /// @return 0 on success or GSL_EFAILED on problem writing to file.
62 inline int w_fprintf(FILE *f, w_vector<unsigned const> *v, char const *fmt) {
63  return gsl_vector_uint_fprintf(f, v, fmt);
64 }
65 
66 
67 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
68 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
69 /// @param f Pointer to file-stream.
70 /// @param v Pointer to vector.
71 /// @param fmt Pointer to printf-style specifier of format.
72 /// @return 0 on success or GSL_EFAILED on problem writing to file.
73 inline int w_fprintf(FILE *f, w_vector<long const> *v, char const *fmt) {
74  return gsl_vector_long_fprintf(f, v, fmt);
75 }
76 
77 
78 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
79 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
80 /// @param f Pointer to file-stream.
81 /// @param v Pointer to vector.
82 /// @param fmt Pointer to printf-style specifier of format.
83 /// @return 0 on success or GSL_EFAILED on problem writing to file.
84 inline int
85 w_fprintf(FILE *f, w_vector<unsigned long const> *v, char const *fmt) {
86  return gsl_vector_ulong_fprintf(f, v, fmt);
87 }
88 
89 
90 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
91 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
92 /// @param f Pointer to file-stream.
93 /// @param v Pointer to vector.
94 /// @param fmt Pointer to printf-style specifier of format.
95 /// @return 0 on success or GSL_EFAILED on problem writing to file.
96 inline int w_fprintf(FILE *f, w_vector<short const> *v, char const *fmt) {
97  return gsl_vector_short_fprintf(f, v, fmt);
98 }
99 
100 
101 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
102 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
103 /// @param f Pointer to file-stream.
104 /// @param v Pointer to vector.
105 /// @param fmt Pointer to printf-style specifier of format.
106 /// @return 0 on success or GSL_EFAILED on problem writing to file.
107 inline int
108 w_fprintf(FILE *f, w_vector<unsigned short const> *v, char const *fmt) {
109  return gsl_vector_ushort_fprintf(f, v, fmt);
110 }
111 
112 
113 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
114 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
115 /// @param f Pointer to file-stream.
116 /// @param v Pointer to vector.
117 /// @param fmt Pointer to printf-style specifier of format.
118 /// @return 0 on success or GSL_EFAILED on problem writing to file.
119 inline int w_fprintf(FILE *f, w_vector<char const> *v, char const *fmt) {
120  return gsl_vector_char_fprintf(f, v, fmt);
121 }
122 
123 
124 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
125 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
126 /// @param f Pointer to file-stream.
127 /// @param v Pointer to vector.
128 /// @param fmt Pointer to printf-style specifier of format.
129 /// @return 0 on success or GSL_EFAILED on problem writing to file.
130 inline int
131 w_fprintf(FILE *f, w_vector<unsigned char const> *v, char const *fmt) {
132  return gsl_vector_uchar_fprintf(f, v, fmt);
133 }
134 
135 
136 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
137 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
138 /// @param f Pointer to file-stream.
139 /// @param v Pointer to vector.
140 /// @param fmt Pointer to printf-style specifier of format.
141 /// @return 0 on success or GSL_EFAILED on problem writing to file.
142 inline int
143 w_fprintf(FILE *f, w_vector<complex<double> const> *v, char const *fmt) {
144  return gsl_vector_complex_fprintf(f, v, fmt);
145 }
146 
147 
148 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
149 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
150 /// @param f Pointer to file-stream.
151 /// @param v Pointer to vector.
152 /// @param fmt Pointer to printf-style specifier of format.
153 /// @return 0 on success or GSL_EFAILED on problem writing to file.
154 inline int
155 w_fprintf(FILE *f, w_vector<complex<float> const> *v, char const *fmt) {
156  return gsl_vector_complex_float_fprintf(f, v, fmt);
157 }
158 
159 
160 /// Write elements of `v` line by line to stream `f` via specifier `fmt`.
161 /// https://www.gnu.org/software/gsl/doc/html/vectors.html#c.gsl_vector_fprintf
162 /// @param f Pointer to file-stream.
163 /// @param v Pointer to vector.
164 /// @param fmt Pointer to printf-style specifier of format.
165 /// @return 0 on success or GSL_EFAILED on problem writing to file.
166 inline int
167 w_fprintf(FILE *f, w_vector<complex<long double> const> *v, char const *fmt) {
168  return gsl_vector_complex_long_double_fprintf(f, v, fmt);
169 }
170 
171 
172 } // namespace gsl
173 
174 // EOF
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< int const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:51
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< unsigned char const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:131
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< unsigned short const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:108
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< unsigned long const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:85
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< unsigned const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:62
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< char const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:119
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< float const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:28
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< short const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:96
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< double const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:17
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< complex< float > const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:155
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< complex< long double > const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:167
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< long const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:73
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< complex< double > const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:143
gsl
Namespace for C++-interface to GSL.
Definition: v-iface.hpp:51
gsl::w_fprintf
int w_fprintf(FILE *f, w_vector< long double const > *v, char const *fmt)
Write elements of v line by line to stream f via specifier fmt.
Definition: fprintf.hpp:40