26 #if defined (HAVE_CONFIG_H)
69 int nargin = args.length ();
71 if (nargin < 2 || nargin > 4)
74 std::string shape =
"full";
75 bool separable =
false;
80 if (args(2).is_string ())
81 shape = args(2).string_value ();
88 shape = args(3).string_value ();
91 if (args(0).ndims () > 2 || args(1).ndims () > 2)
92 error (
"conv2: A and B must be 1-D vectors or 2-D matrices");
96 else if (shape ==
"same")
98 else if (shape ==
"valid")
101 error (
"conv2: SHAPE type not valid");
108 if (! (1 == args(0).rows () || 1 == args(0).columns ())
109 || ! (1 == args(1).rows () || 1 == args(1).columns ()))
110 error (
"conv2: arguments must be vectors for separable option");
112 if (args(0).is_single_type () || args(1).is_single_type ()
113 || args(2).is_single_type ())
115 if (args(0).iscomplex () || args(1).iscomplex ()
116 || args(2).iscomplex ())
119 if (args(1).isreal () && args(2).isreal ())
142 if (args(0).iscomplex () || args(1).iscomplex ()
143 || args(2).iscomplex ())
146 if (args(1).isreal () && args(2).isreal ())
163 Matrix a (args(2).matrix_value ());
170 if (args(0).is_single_type () || args(1).is_single_type ())
172 if (args(0).iscomplex () || args(1).iscomplex ())
175 if (args(1).isreal ())
195 if (args(0).iscomplex () || args(1).iscomplex ())
198 if (args(1).isreal ())
200 Matrix b (args(1).matrix_value ());
211 Matrix a (args(0).matrix_value ());
212 Matrix b (args(1).matrix_value ());
329 int nargin = args.length ();
331 if (nargin < 2 || nargin > 3)
334 std::string shape =
"full";
338 shape = args(2).xstring_value (
"convn: SHAPE must be a string");
342 else if (shape ==
"same")
344 else if (shape ==
"valid")
347 error (
"convn: SHAPE type not valid");
351 if (args(0).is_single_type () || args(1).is_single_type ())
353 if (args(0).iscomplex () || args(1).iscomplex ())
356 if (args(1).isreal ())
376 if (args(0).iscomplex () || args(1).iscomplex ())
379 if (args(1).isreal ())
381 NDArray b (args(1).array_value ());
392 NDArray a (args(0).array_value ());
393 NDArray b (args(1).array_value ());
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)
const octave_char_matrix & v2
octave_value::octave_value(const Array< char > &chm, char type) return retval