GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
oct-convn.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2009-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_oct_convn_h)
27 #define octave_oct_convn_h 1
28 
29 #include "octave-config.h"
30 
31 #include "mx-fwd.h"
32 
33 // The remaining includes can be removed when the global enum
34 // declaration, the convert_enum function, and the deprecated functions
35 // at the end of this file are removed.
36 
37 #include <cstdlib>
38 #include "dMatrix.h"
39 #include "dNDArray.h"
40 #include "CMatrix.h"
41 #include "CNDArray.h"
42 #include "fMatrix.h"
43 #include "fNDArray.h"
44 #include "fCMatrix.h"
45 #include "fCNDArray.h"
46 
47 // FIXME: Is there any sane way to move a global enum to a namespace and
48 // tag the global one as deprecated when it is used as a parameter in
49 // public functions that also need to be tagged as deprecated?
50 
52 {
56 };
57 
59 
61 {
62  convn_full,
63  convn_same,
65 };
66 
67 // double real X double real
68 
69 extern OCTAVE_API NDArray
70 convn (const NDArray& a, const NDArray& b, convn_type ct);
71 
72 extern OCTAVE_API Matrix
73 convn (const Matrix& a, const Matrix& b, convn_type ct);
74 
75 extern OCTAVE_API Matrix
76 convn (const Matrix& a, const ColumnVector& c, const RowVector& r,
77  convn_type ct);
78 
79 // double complex X double real
80 
82 convn (const ComplexNDArray& a, const NDArray& b, convn_type ct);
83 
85 convn (const ComplexMatrix& a, const Matrix& b, convn_type ct);
86 
88 convn (const ComplexMatrix& a, const ColumnVector& c, const RowVector& r,
89  convn_type ct);
90 
91 // double complex X double complex
92 
94 convn (const ComplexNDArray& a, const ComplexNDArray& b, convn_type ct);
95 
97 convn (const ComplexMatrix& a, const ComplexMatrix& b, convn_type ct);
98 
100 convn (const ComplexMatrix& a, const ComplexColumnVector& c,
101  const ComplexRowVector& r, convn_type ct);
102 
103 // float real X float real
104 
106 convn (const FloatNDArray& a, const FloatNDArray& b, convn_type ct);
107 
108 extern OCTAVE_API FloatMatrix
109 convn (const FloatMatrix& a, const FloatMatrix& b, convn_type ct);
110 
111 extern OCTAVE_API FloatMatrix
112 convn (const FloatMatrix& a, const FloatColumnVector& c,
113  const FloatRowVector& r, convn_type ct);
114 
115 // float complex X float real
116 
118 convn (const FloatComplexNDArray& a, const FloatNDArray& b, convn_type ct);
119 
121 convn (const FloatComplexMatrix& a, const FloatMatrix& b, convn_type ct);
122 
124 convn (const FloatComplexMatrix& a, const FloatColumnVector& c,
125  const FloatRowVector& r, convn_type ct);
126 
127 // float complex X float complex
128 
130 convn (const FloatComplexNDArray& a, const FloatComplexNDArray& b,
131  convn_type ct);
132 
134 convn (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
135  convn_type ct);
136 
139  const FloatComplexRowVector& r, convn_type ct);
140 
142 {
143  switch (ct)
144  {
146  return convn_full;
147 
149  return convn_same;
150 
152  return convn_valid;
153 
154  default:
155  abort ();
156  }
157 }
158 
160 
161 #if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS)
162 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
163 inline NDArray
164 convn (const NDArray& a, const NDArray& b, convn_type ct)
165 {
166  return octave::convn (a, b, static_cast<octave::convn_type> (ct));
167 }
168 
169 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
170 inline Matrix
171 convn (const Matrix& a, const Matrix& b, convn_type ct)
172 {
173  return octave::convn (a, b, octave::convert_enum (ct));
174 }
175 
176 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
177 inline Matrix
178 convn (const Matrix& a, const ColumnVector& c, const RowVector& r,
179  convn_type ct)
180 {
181  return octave::convn (a, c, r, octave::convert_enum (ct));
182 }
183 
184 // double complex X double real
185 
186 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
187 inline ComplexNDArray
188 convn (const ComplexNDArray& a, const NDArray& b, convn_type ct)
189 {
190  return octave::convn (a, b, octave::convert_enum (ct));
191 }
192 
193 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
194 inline ComplexMatrix
195 convn (const ComplexMatrix& a, const Matrix& b, convn_type ct)
196 {
197  return octave::convn (a, b, octave::convert_enum (ct));
198 }
199 
200 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
201 inline ComplexMatrix
202 convn (const ComplexMatrix& a, const ColumnVector& c, const RowVector& r,
203  convn_type ct)
204 {
205  return octave::convn (a, c, r, octave::convert_enum (ct));
206 }
207 
208 // double complex X double complex
209 
210 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
211 inline ComplexNDArray
212 convn (const ComplexNDArray& a, const ComplexNDArray& b, convn_type ct)
213 {
214  return octave::convn (a, b, octave::convert_enum (ct));
215 }
216 
217 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
218 inline ComplexMatrix
219 convn (const ComplexMatrix& a, const ComplexMatrix& b, convn_type ct)
220 {
221  return octave::convn (a, b, octave::convert_enum (ct));
222 }
223 
224 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
225 inline ComplexMatrix
226 convn (const ComplexMatrix& a, const ComplexColumnVector& c,
227  const ComplexRowVector& r, convn_type ct)
228 {
229  return octave::convn (a, c, r, octave::convert_enum (ct));
230 }
231 
232 // float real X float real
233 
234 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
235 inline FloatNDArray
236 convn (const FloatNDArray& a, const FloatNDArray& b, convn_type ct)
237 {
238  return octave::convn (a, b, octave::convert_enum (ct));
239 }
240 
241 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
242 inline FloatMatrix
243 convn (const FloatMatrix& a, const FloatMatrix& b, convn_type ct)
244 {
245  return octave::convn (a, b, octave::convert_enum (ct));
246 }
247 
248 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
249 inline FloatMatrix
250 convn (const FloatMatrix& a, const FloatColumnVector& c,
251  const FloatRowVector& r, convn_type ct)
252 {
253  return octave::convn (a, c, r, octave::convert_enum (ct));
254 }
255 
256 // float complex X float real
257 
258 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
259 inline FloatComplexNDArray
260 convn (const FloatComplexNDArray& a, const FloatNDArray& b,
261  convn_type ct)
262 {
263  return octave::convn (a, b, octave::convert_enum (ct));
264 }
265 
266 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
267 inline FloatComplexMatrix
268 convn (const FloatComplexMatrix& a, const FloatMatrix& b,
269  convn_type ct)
270 {
271  return octave::convn (a, b, octave::convert_enum (ct));
272 }
273 
274 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
275 inline FloatComplexMatrix
276 convn (const FloatComplexMatrix& a, const FloatColumnVector& c,
277  const FloatRowVector& r, convn_type ct)
278 {
279  return octave::convn (a, c, r, octave::convert_enum (ct));
280 }
281 
282 // float complex X float complex
283 
284 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
285 inline FloatComplexNDArray
286 convn (const FloatComplexNDArray& a, const FloatComplexNDArray& b,
287  convn_type ct)
288 {
289  return octave::convn (a, b, octave::convert_enum (ct));
290 }
291 
292 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
293 inline FloatComplexMatrix
294 convn (const FloatComplexMatrix& a, const FloatComplexMatrix& b,
295  convn_type ct)
296 {
297  return octave::convn (a, b, octave::convert_enum (ct));
298 }
299 
300 OCTAVE_DEPRECATED (7, "use 'octave::convn' instead")
301 inline FloatComplexMatrix
304 {
305  return octave::convn (a, c, r, octave::convert_enum (ct));
306 }
307 #endif
308 
309 #endif
OCTAVE_END_NAMESPACE(octave)
Definition: dMatrix.h:42
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition: main.in.cc:55
T * r
Definition: mx-inlines.cc:773
OCTAVE_API NDArray convn(const NDArray &a, const NDArray &b, convn_type ct)
Definition: oct-convn.cc:217
convn_type
Definition: oct-convn.h:52
@ convn_same
Definition: oct-convn.h:54
@ convn_valid
Definition: oct-convn.h:55
@ convn_full
Definition: oct-convn.h:53
convn_type convert_enum(::convn_type ct)
Definition: oct-convn.h:141