24 #if defined (HAVE_CONFIG_H) 67 int nargin = args.length ();
73 bool separable =
false;
78 if (args(2).is_string ())
79 shape = args(2).string_value ();
86 shape = args(3).string_value ();
89 if (args(0).ndims () > 2 || args(1).ndims () > 2)
90 error (
"conv2: A and B must be 1-D vectors or 2-D matrices");
94 else if (shape ==
"same")
96 else if (shape ==
"valid")
99 error (
"conv2: SHAPE type not valid");
106 if (! (1 == args(0).rows () || 1 == args(0).columns ())
107 || ! (1 == args(1).rows () || 1 == args(1).columns ()))
108 error (
"conv2: arguments must be vectors for separable option");
110 if (args(0).is_single_type () || args(1).is_single_type ()
111 || args(2).is_single_type ())
113 if (args(0).iscomplex () || args(1).iscomplex ()
114 || args(2).iscomplex ())
117 if (args(1).isreal () && args(2).isreal ())
140 if (args(0).iscomplex () || args(1).iscomplex ()
141 || args(2).iscomplex ())
144 if (args(1).isreal () && args(2).isreal ())
161 Matrix a (args(2).matrix_value ());
168 if (args(0).is_single_type () || args(1).is_single_type ())
170 if (args(0).iscomplex () || args(1).iscomplex ())
173 if (args(1).isreal ())
193 if (args(0).iscomplex () || args(1).iscomplex ())
196 if (args(1).isreal ())
198 Matrix b (args(1).matrix_value ());
209 Matrix a (args(0).matrix_value ());
210 Matrix b (args(1).matrix_value ());
327 int nargin = args.length ();
336 shape = args(2).xstring_value (
"convn: SHAPE must be a string");
340 else if (shape ==
"same")
342 else if (shape ==
"valid")
345 error (
"convn: SHAPE type not valid");
349 if (args(0).is_single_type () || args(1).is_single_type ())
351 if (args(0).iscomplex () || args(1).iscomplex ())
354 if (args(1).isreal ())
374 if (args(0).iscomplex () || args(1).iscomplex ())
377 if (args(1).isreal ())
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
NDArray convn(const NDArray &a, const NDArray &b, convn_type ct)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Array< octave_value > array_value(void) const
const octave_char_matrix & v2
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string