GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
conv2.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1999-2015 Andy Adler
4 Copyright (C) 2010 VZLU Prague
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 #include "oct-convn.h"
29 
30 #include "defun.h"
31 #include "error.h"
32 #include "oct-obj.h"
33 #include "utils.h"
34 
36 
37 DEFUN (conv2, args, ,
38  "-*- texinfo -*-\n\
39 @deftypefn {Built-in Function} {} conv2 (@var{A}, @var{B})\n\
40 @deftypefnx {Built-in Function} {} conv2 (@var{v1}, @var{v2}, @var{m})\n\
41 @deftypefnx {Built-in Function} {} conv2 (@dots{}, @var{shape})\n\
42 Return the 2-D convolution of @var{A} and @var{B}.\n\
43 \n\
44 The size of the result is determined by the optional @var{shape} argument\n\
45 which takes the following values\n\
46 \n\
47 @table @asis\n\
48 @item @var{shape} = @qcode{\"full\"}\n\
49 Return the full convolution. (default)\n\
50 \n\
51 @item @var{shape} = @qcode{\"same\"}\n\
52 Return the central part of the convolution with the same size as @var{A}.\n\
53 The central part of the convolution begins at the indices\n\
54 @code{floor ([size(@var{B})/2] + 1)}.\n\
55 \n\
56 @item @var{shape} = @qcode{\"valid\"}\n\
57 Return only the parts which do not include zero-padded edges.\n\
58 The size of the result is @code{max (size (A) - size (B) + 1, 0)}.\n\
59 @end table\n\
60 \n\
61 When the third argument is a matrix, return the convolution of the matrix\n\
62 @var{m} by the vector @var{v1} in the column direction and by the vector\n\
63 @var{v2} in the row direction.\n\
64 @seealso{conv, convn}\n\
65 @end deftypefn")
66 {
67  octave_value retval;
68  octave_value tmp;
69  int nargin = args.length ();
70  std::string shape = "full"; // default
71  bool separable = false;
72  convn_type ct;
73 
74  if (nargin < 2)
75  {
76  print_usage ();
77  return retval;
78  }
79  else if (nargin == 3)
80  {
81  if (args(2).is_string ())
82  shape = args(2).string_value ();
83  else
84  separable = true;
85  }
86  else if (nargin >= 4)
87  {
88  separable = true;
89  shape = args(3).string_value ();
90  }
91 
92  if (args(0).ndims () > 2 || args(1).ndims () > 2)
93  {
94  error ("conv2: A and B must be 1-D vectors or 2-D matrices");
95  return retval;
96  }
97 
98  if (shape == "full")
99  ct = convn_full;
100  else if (shape == "same")
101  ct = convn_same;
102  else if (shape == "valid")
103  ct = convn_valid;
104  else
105  {
106  error ("conv2: SHAPE type not valid");
107  print_usage ();
108  return retval;
109  }
110 
111  if (separable)
112  {
113  // If user requests separable, check first two params are vectors
114 
115  if (! (1 == args(0).rows () || 1 == args(0).columns ())
116  || ! (1 == args(1).rows () || 1 == args(1).columns ()))
117  {
118  print_usage ();
119  return retval;
120  }
121 
122  if (args(0).is_single_type () || args(1).is_single_type ()
123  || args(2).is_single_type ())
124  {
125  if (args(0).is_complex_type () || args(1).is_complex_type ()
126  || args(2).is_complex_type ())
127  {
128  FloatComplexMatrix a (args(2).float_complex_matrix_value ());
129  if (args(1).is_real_type () && args(2).is_real_type ())
130  {
131  FloatColumnVector v1 (args(0).float_vector_value ());
132  FloatRowVector v2 (args(1).float_vector_value ());
133  retval = convn (a, v1, v2, ct);
134  }
135  else
136  {
137  FloatComplexColumnVector v1 (args(0).float_complex_vector_value ());
138  FloatComplexRowVector v2 (args(1).float_complex_vector_value ());
139  retval = convn (a, v1, v2, ct);
140  }
141  }
142  else
143  {
144  FloatColumnVector v1 (args(0).float_vector_value ());
145  FloatRowVector v2 (args(1).float_vector_value ());
146  FloatMatrix a (args(2).float_matrix_value ());
147  retval = convn (a, v1, v2, ct);
148  }
149  }
150  else
151  {
152  if (args(0).is_complex_type () || args(1).is_complex_type ()
153  || args(2).is_complex_type ())
154  {
155  ComplexMatrix a (args(2).complex_matrix_value ());
156  if (args(1).is_real_type () && args(2).is_real_type ())
157  {
158  ColumnVector v1 (args(0).vector_value ());
159  RowVector v2 (args(1).vector_value ());
160  retval = convn (a, v1, v2, ct);
161  }
162  else
163  {
164  ComplexColumnVector v1 (args(0).complex_vector_value ());
165  ComplexRowVector v2 (args(1).complex_vector_value ());
166  retval = convn (a, v1, v2, ct);
167  }
168  }
169  else
170  {
171  ColumnVector v1 (args(0).vector_value ());
172  RowVector v2 (args(1).vector_value ());
173  Matrix a (args(2).matrix_value ());
174  retval = convn (a, v1, v2, ct);
175  }
176  }
177  } // if (separable)
178  else
179  {
180  if (args(0).is_single_type () || args(1).is_single_type ())
181  {
182  if (args(0).is_complex_type () || args(1).is_complex_type ())
183  {
184  FloatComplexMatrix a (args(0).float_complex_matrix_value ());
185  if (args(1).is_real_type ())
186  {
187  FloatMatrix b (args(1).float_matrix_value ());
188  retval = convn (a, b, ct);
189  }
190  else
191  {
192  FloatComplexMatrix b (args(1).float_complex_matrix_value ());
193  retval = convn (a, b, ct);
194  }
195  }
196  else
197  {
198  FloatMatrix a (args(0).float_matrix_value ());
199  FloatMatrix b (args(1).float_matrix_value ());
200  retval = convn (a, b, ct);
201  }
202  }
203  else
204  {
205  if (args(0).is_complex_type () || args(1).is_complex_type ())
206  {
207  ComplexMatrix a (args(0).complex_matrix_value ());
208  if (args(1).is_real_type ())
209  {
210  Matrix b (args(1).matrix_value ());
211  retval = convn (a, b, ct);
212  }
213  else
214  {
215  ComplexMatrix b (args(1).complex_matrix_value ());
216  retval = convn (a, b, ct);
217  }
218  }
219  else
220  {
221  Matrix a (args(0).matrix_value ());
222  Matrix b (args(1).matrix_value ());
223  retval = convn (a, b, ct);
224  }
225  }
226 
227  } // if (separable)
228 
229  return retval;
230 }
231 
232 /*
233 %!test
234 %! c = [0,1,2,3;1,8,12,12;4,20,24,21;7,22,25,18];
235 %! assert (conv2 ([0,1;1,2], [1,2,3;4,5,6;7,8,9]), c);
236 
237 %!test
238 %! c = single ([0,1,2,3;1,8,12,12;4,20,24,21;7,22,25,18]);
239 %! assert (conv2 (single ([0,1;1,2]), single ([1,2,3;4,5,6;7,8,9])), c);
240 
241 %!test
242 %! c = [1,4,4;5,18,16;14,48,40;19,62,48;15,48,36];
243 %! assert (conv2 (1:3, 1:2, [1,2;3,4;5,6]), c);
244 
245 %!assert (conv2 (1:3, 1:2, [1,2;3,4;5,6], "full"),
246 %! conv2 (1:3, 1:2, [1,2;3,4;5,6]));
247 
248 %% Test shapes
249 %!shared A, B, C
250 %! A = rand (3, 4);
251 %! B = rand (4);
252 %! C = conv2 (A, B);
253 %!assert (conv2 (A,B, "full"), C)
254 %!assert (conv2 (A,B, "same"), C(3:5,3:6))
255 %!assert (conv2 (A,B, "valid"), zeros (0, 1))
256 %!assert (size (conv2 (B,A, "valid")), [2 1])
257 
258 %!test
259 %! B = rand (5);
260 %! C = conv2 (A, B);
261 %!assert (conv2 (A,B, "full"), C)
262 %!assert (conv2 (A,B, "same"), C(3:5,3:6))
263 %!assert (conv2 (A,B, "valid"), zeros (0, 0))
264 %!assert (size (conv2 (B,A, "valid")), [3 2])
265 
266 %% Clear shared variables so they are not reported for tests below
267 %!shared
268 
269 %% Test cases from Bug #34893
270 %!assert (conv2 ([1:5;1:5], [1:2], "same"), [4 7 10 13 10; 4 7 10 13 10])
271 %!assert (conv2 ([1:5;1:5]', [1:2]', "same"), [4 7 10 13 10; 4 7 10 13 10]')
272 %!assert (conv2 ([1:5;1:5], [1:2], "valid"), [4 7 10 13; 4 7 10 13])
273 %!assert (conv2 ([1:5;1:5]', [1:2]', "valid"), [4 7 10 13; 4 7 10 13]')
274 
275 %!test
276 %! rand ("seed", 42);
277 %! x = rand (100);
278 %! y = ones (5);
279 %! A = conv2 (x, y)(5:end-4,5:end-4);
280 %! B = conv2 (x, y, "valid");
281 %! assert (B, A); # Yes, this test is for *exact* equivalence.
282 
283 
284 %% Test input validation
285 %!error conv2 ()
286 %!error conv2 (1)
287 %!error <must be 1-D vectors or 2-D matrices> conv2 (ones (2), ones (2,2,2))
288 %!error <SHAPE type not valid> conv2 (1,2, "NOT_A_SHAPE")
289 %% Test alternate calling form which should be 2 vectors and a matrix
290 %!error conv2 (ones (2), 1, 1)
291 %!error conv2 (1, ones (2), 1)
292 */
293 
294 DEFUN (convn, args, ,
295  "-*- texinfo -*-\n\
296 @deftypefn {Built-in Function} {@var{C} =} convn (@var{A}, @var{B})\n\
297 @deftypefnx {Built-in Function} {@var{C} =} convn (@var{A}, @var{B}, @var{shape})\n\
298 Return the n-D convolution of @var{A} and @var{B}.\n\
299 \n\
300 The size of the result is determined by the optional @var{shape} argument\n\
301 which takes the following values\n\
302 \n\
303 @table @asis\n\
304 @item @var{shape} = @qcode{\"full\"}\n\
305 Return the full convolution. (default)\n\
306 \n\
307 @item @var{shape} = @qcode{\"same\"}\n\
308 Return central part of the convolution with the same size as @var{A}.\n\
309 The central part of the convolution begins at the indices\n\
310 @code{floor ([size(@var{B})/2] + 1)}.\n\
311 \n\
312 @item @var{shape} = @qcode{\"valid\"}\n\
313 Return only the parts which do not include zero-padded edges.\n\
314 The size of the result is @code{max (size (A) - size (B) + 1, 0)}.\n\
315 @end table\n\
316 \n\
317 @seealso{conv2, conv}\n\
318 @end deftypefn")
319 {
320  octave_value retval;
321  octave_value tmp;
322  int nargin = args.length ();
323  std::string shape = "full"; // default
324  convn_type ct;
325 
326  if (nargin < 2 || nargin > 3)
327  {
328  print_usage ();
329  return retval;
330  }
331  else if (nargin == 3)
332  {
333  if (args(2).is_string ())
334  shape = args(2).string_value ();
335  else
336  {
337  error ("convn: SHAPE must be a string");
338  return retval;
339  }
340  }
341 
342  if (shape == "full")
343  ct = convn_full;
344  else if (shape == "same")
345  ct = convn_same;
346  else if (shape == "valid")
347  ct = convn_valid;
348  else
349  {
350  error ("convn: SHAPE type not valid");
351  print_usage ();
352  return retval;
353  }
354 
355  if (args(0).is_single_type () || args(1).is_single_type ())
356  {
357  if (args(0).is_complex_type () || args(1).is_complex_type ())
358  {
359  FloatComplexNDArray a (args(0).float_complex_array_value ());
360  if (args(1).is_real_type ())
361  {
362  FloatNDArray b (args(1).float_array_value ());
363  retval = convn (a, b, ct);
364  }
365  else
366  {
367  FloatComplexNDArray b (args(1).float_complex_array_value ());
368  retval = convn (a, b, ct);
369  }
370  }
371  else
372  {
373  FloatNDArray a (args(0).float_array_value ());
374  FloatNDArray b (args(1).float_array_value ());
375  retval = convn (a, b, ct);
376  }
377  }
378  else
379  {
380  if (args(0).is_complex_type () || args(1).is_complex_type ())
381  {
382  ComplexNDArray a (args(0).complex_array_value ());
383  if (args(1).is_real_type ())
384  {
385  NDArray b (args(1).array_value ());
386  retval = convn (a, b, ct);
387  }
388  else
389  {
390  ComplexNDArray b (args(1).complex_array_value ());
391  retval = convn (a, b, ct);
392  }
393  }
394  else
395  {
396  NDArray a (args(0).array_value ());
397  NDArray b (args(1).array_value ());
398  retval = convn (a, b, ct);
399  }
400  }
401 
402  return retval;
403 }
404 
405 /*
406 ## Check for bug #39314
407 %!test
408 %! v = reshape ([1 2], [1 1 2]);
409 %! assert (convn (v, v), reshape ([1 4 4], [1 1 3]));
410 %! assert (convn (v, v, "same"), reshape ([4 4], [1 1 2]));
411 %! assert (convn (v, v, "valid"), 4);
412 
413 ## The following test may look weird since we are using the output
414 ## of convn to test itself. However, because calculations are done
415 ## differently based on the shape option, it will help to catch some
416 ## bugs. See also bug #39314.
417 ## FIXME: The "valid" option uses an entirely different code path
418 ## through C++ and Fortran to calculate inner convolution.
419 ## The terms in the convolution added in reverse order compared
420 ## to the "full" option. This produces differences on the order
421 ## of tens of eps. This should be fixed, but in the meantime
422 ## the tests will be marked as xtests.
423 %!shared a, b, c
424 %! ## test 3D by 3D
425 %! a = rand (10, 10, 10);
426 %! b = rand (3, 3, 3);
427 %! c = convn (a, b, "full");
428 %!assert (convn (a, b, "same"), c(2:11,2:11,2:11))
429 %!xtest
430 %! assert (convn (a, b, "valid"), c(3:10,3:10,3:10));
431 %!
432 %!test
433 %! ## test 3D by 2D
434 %! a = rand (10, 10, 10);
435 %! b = rand (3, 3);
436 %! c = convn (a, b, "full");
437 %!assert (convn (a, b, "same"), c(2:11,2:11,:))
438 %!xtest
439 %! assert (convn (a, b, "valid"), c(3:10,3:10,:))
440 %!
441 %!test
442 %! ## test 2D by 3D
443 %! a = rand (10, 10);
444 %! b = rand (3, 3, 3);
445 %! c = convn (a, b, "full");
446 %!assert (convn (a, b, "same"), c(2:11,2:11,2))
447 %!assert (convn (a, b, "valid"), c(3:10,3:10,3:2)) # a 7x7x0 matrix
448 %!
449 %!test
450 %! ## test multiple different number of dimensions, with odd and even numbers
451 %! a = rand (10, 15, 7, 8, 10);
452 %! b = rand (4, 3, 2, 3);
453 %! c = convn (a, b, "full");
454 %!assert (convn (a, b, "same"), c(3:12,2:16,2:8,2:9,:))
455 %!xtest
456 %! assert (convn (a, b, "valid"), c(4:10,3:15,2:7,3:8,:))
457 
458 %!test
459 %! a = reshape (floor (magic (16) /10), [4 8 4 2]);
460 %! b = reshape (magic (6), [4 3 3]);
461 %! c = zeros (7, 10, 6, 2);
462 %! c(:,:,1,1) = [
463 %! 875 1415 1215 741 288 264 635 1109 687 171
464 %! 110 467 1551 1790 1891 1651 1165 900 659 568
465 %! 883 1047 1475 1964 2181 2302 2117 1674 579 234
466 %! 940 2330 3099 2573 2306 2207 2442 2918 2272 1004
467 %! 161 500 1564 2066 2355 2270 2099 1621 1144 831
468 %! 644 622 886 1121 1652 1967 1907 1668 529 228
469 %! 160 752 1232 768 360 284 668 1132 1380 864];
470 %! c(:,:,2,1) = [
471 %! 150 1174 1903 1971 2030 1719 1467 1420 1220 472
472 %! 986 2243 2603 2385 2308 2530 2971 3181 2266 768
473 %! 914 2443 3750 3782 3976 3821 3723 3709 2599 1178
474 %! 1922 3374 5198 5472 5563 5853 5794 5543 3578 1820
475 %! 1060 2471 3846 3724 3682 3803 3812 3927 2876 1390
476 %! 470 2078 3283 3225 2701 2265 2165 2261 2324 1124
477 %! 700 1130 1486 1515 1830 2097 2081 2028 1009 348];
478 %! c(:,:,3,1) = [
479 %! 1350 2127 2461 2082 1694 1909 2230 2621 1681 683
480 %! 877 2473 4362 4556 4543 4314 3879 3703 2863 1497
481 %! 1934 4219 5874 6117 5966 6051 5984 5714 3891 1562
482 %! 1927 5997 8573 8456 8517 8025 7957 8101 6121 2500
483 %! 1558 3533 5595 6064 6453 6491 6275 5743 3794 1832
484 %! 1950 2762 3455 3423 4019 4578 4807 4857 2304 907
485 %! 525 1860 2731 2392 1872 1724 1961 2312 2315 1141];
486 %! c(:,:,4,1) = [
487 %! 150 1317 2230 2621 2996 2767 2472 2049 1514 583
488 %! 1429 3056 3879 3703 3756 3964 4394 4570 3111 1250
489 %! 1833 4037 5984 5714 5846 5788 5883 6129 4157 2011
490 %! 3143 5469 7957 8101 8063 8475 8564 8439 5306 2538
491 %! 2001 4514 6275 5743 5391 5389 5578 6110 4473 1953
492 %! 817 3196 4807 4857 4229 3659 3477 3375 3208 1400
493 %! 750 1365 1961 2312 2840 2993 2722 2344 1092 323];
494 %! c(:,:,5,1) = [
495 %! 475 734 1296 1352 1400 1595 1557 1517 960 490
496 %! 751 1977 2831 2746 2607 2665 2733 2833 2186 912
497 %! 1065 3142 4344 4150 3768 3734 3876 4086 3366 1327
498 %! 976 3712 5530 5921 6158 5802 5481 5071 3821 1491
499 %! 1397 2996 3971 4003 4088 4180 4199 4146 2649 985
500 %! 1273 2121 2555 2247 2378 2624 2908 3229 1788 705
501 %! 365 1108 1530 1652 1550 1407 1274 1127 889 264];
502 %! c(:,:,6,1) = [
503 %! 0 133 345 683 982 1058 960 623 310 100
504 %! 437 806 1313 1332 1383 1391 1397 1370 864 495
505 %! 928 1573 2201 1928 1864 1932 2183 2445 1557 855
506 %! 1199 2083 2739 2573 2507 2656 2786 2928 1795 736
507 %! 912 1997 2404 2028 1692 1591 1803 2159 1603 599
508 %! 345 1092 1526 1666 1593 1437 1275 1116 863 253
509 %! 50 235 510 811 998 894 615 318 77 0];
510 %! c(:,:,1,2) = [
511 %! 840 1350 1176 697 293 320 674 1153 717 180
512 %! 142 490 1563 1824 1929 1604 1132 857 624 587
513 %! 890 1084 1539 1979 2238 2333 2072 1610 509 202
514 %! 966 2263 3034 2518 2250 2235 2512 2992 2305 1016
515 %! 200 561 1607 2107 2361 2277 2030 1548 1102 818
516 %! 652 631 922 1128 1670 1997 1895 1665 467 197
517 %! 160 744 1192 692 292 256 708 1208 1448 900];
518 %! c(:,:,2,2) = [
519 %! 179 1199 1886 1987 1997 1716 1479 1383 1215 485
520 %! 988 2213 2552 2358 2304 2615 3011 3210 2246 744
521 %! 921 2483 3747 3768 3960 3835 3712 3698 2588 1183
522 %! 1903 3416 5254 5490 5572 5826 5761 5505 3502 1814
523 %! 1064 2507 3825 3666 3680 3748 3821 3958 2892 1395
524 %! 495 2129 3277 3228 2566 2216 2154 2250 2390 1154
525 %! 700 1105 1472 1524 1856 2113 2059 2019 975 325];
526 %! c(:,:,3,2) = [
527 %! 1302 2104 2439 2006 1723 1931 2280 2685 1678 690
528 %! 877 2507 4408 4580 4523 4233 3852 3647 2850 1516
529 %! 1949 4238 5895 6143 6018 6063 5930 5656 3847 1538
530 %! 1953 5975 8547 8433 8407 8060 7955 8069 6170 2506
531 %! 1621 3536 5624 6117 6459 6456 6180 5666 3735 1815
532 %! 1904 2751 3429 3366 4122 4622 4840 4864 2242 882
533 %! 517 1843 2674 2337 1777 1686 2005 2367 2385 1175];
534 %! c(:,:,4,2) = [
535 %! 198 1346 2280 2685 2980 2759 2396 1982 1497 576
536 %! 1413 2994 3852 3647 3756 4035 4418 4595 3109 1231
537 %! 1873 4025 5930 5656 5792 5772 5909 6152 4185 2035
538 %! 3110 5510 7955 8069 8139 8456 8541 8439 5276 2541
539 %! 1964 4462 6180 5666 5315 5409 5631 6178 4536 1998
540 %! 869 3215 4840 4864 4121 3579 3420 3386 3271 1430
541 %! 725 1361 2005 2367 2925 3006 2667 2297 1054 325];
542 %! c(:,:,5,2) = [
543 %! 462 754 1285 1359 1441 1605 1556 1488 938 488
544 %! 729 1967 2788 2732 2608 2683 2744 2830 2195 912
545 %! 1052 3139 4302 4101 3742 3730 3895 4103 3403 1335
546 %! 1007 3725 5577 5964 6165 5754 5407 5006 3846 1507
547 %! 1375 2969 3951 3990 4144 4183 4200 4150 2661 998
548 %! 1258 2090 2495 2188 2403 2664 2954 3279 1814 723
549 %! 388 1127 1551 1673 1525 1390 1253 1139 912 275];
550 %! c(:,:,6,2) = [
551 %! 19 147 384 716 1016 1059 927 570 276 80
552 %! 441 791 1298 1320 1401 1396 1409 1367 865 500
553 %! 932 1537 2155 1870 1860 1946 2221 2487 1584 874
554 %! 1201 2067 2705 2538 2512 2687 2806 2971 1812 756
555 %! 925 1976 2363 1971 1636 1600 1844 2239 1664 626
556 %! 372 1133 1558 1687 1570 1401 1243 1122 883 264
557 %! 60 270 556 857 1024 870 569 282 66 0];
558 %!assert (convn(a, b, "full"), c)
559 %!assert (convn(a, b, "same"), c(3:6,2:9,2:5,:))
560 %!assert (convn(a, b, "valid"), c(4,3:8,3:4,:))
561 
562 ## test correct class
563 %!assert (class (convn (rand(5), rand(3))), "double")
564 %!assert (class (convn (rand(5, "single"), rand(3))), "single")
565 %!assert (class (convn (rand(5), rand(3, "single"))), "single")
566 %!assert (class (convn (true (5), rand(3))), "double")
567 %!assert (class (convn (true (5), rand(3, "single"))), "single")
568 %!assert (class (convn (ones(5, "uint8"), rand(3))), "double")
569 %!assert (class (convn (rand (3, "single"), ones(5, "uint8"))), "single")
570 
571 %!error convn ()
572 %!error convn (1)
573 %!error <SHAPE type not valid> convn (1,2, "NOT_A_SHAPE")
574 %!error convn (rand (3), 1, 1)
575 */
convn_type
Definition: oct-convn.h:47
OCTINTERP_API void print_usage(void)
Definition: defun.cc:51
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:44
void error(const char *fmt,...)
Definition: error.cc:476
NDArray convn(const NDArray &a, const NDArray &b, convn_type ct)
Definition: oct-convn.cc:171
const octave_base_value const Array< octave_idx_type > &ra_idx octave_int16_scalar & v1
std::string string_value(bool force=false) const
Definition: ov.h:897
octave_idx_type length(void) const
Definition: ov.cc:1525
Definition: dMatrix.h:35
const octave_char_matrix & v2
Array< octave_value > array_value(void) const
Definition: oct-obj.h:79
Shape
Definition: conv2.cc:35