Mercurial > octave
comparison libinterp/corefcn/data.cc @ 28631:70cdf8de553d
move non-member octave_value operator functions to octave namespace
* ov.h, ov.cc (unary_op, binary_op, cat_op, colon_op): New functions
in octave namespace that replace do_unary_op, do_binary_op, do_cat_op,
and do_colon_op, respectively.
(do_unary_op, do_binary_op, do_cat_op, do_colon_op):
Deprecate global functions. Forward to corresponding new functions in
octave namespace.
* bsxfun.cc, cellfun.cc, data.cc, dot.cc, fft.cc, oct-stream.cc,
stack-frame.h, tril.cc, ov-base-diag.cc, ov-bool.cc, ov-class.cc,
ov-complex.cc, ov-float.cc, ov-flt-complex.cc, ov-intx.h,
ov-lazy-idx.h, ov-magic-int.cc, ov-perm.cc, ov-range.cc, ov-scalar.cc,
oct-lvalue.cc, oct-lvalue.h, pt-binop.cc, pt-cbinop.cc, pt-colon.cc,
pt-eval.cc, pt-tm-const.cc, pt-unop.cc: Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 30 Jul 2020 16:16:04 -0400 |
parents | de2c73ae450f |
children | a3db48e66ef8 |
comparison
equal
deleted
inserted
replaced
28630:35f974bab4c8 | 28631:70cdf8de553d |
---|---|
1953 for (int j = 0; j < n_args; j++) | 1953 for (int j = 0; j < n_args; j++) |
1954 { | 1954 { |
1955 // Can't fast return here to skip empty matrices as something | 1955 // Can't fast return here to skip empty matrices as something |
1956 // like cat (1,[],single ([])) must return an empty matrix of | 1956 // like cat (1,[],single ([])) must return an empty matrix of |
1957 // the right type. | 1957 // the right type. |
1958 tmp = do_cat_op (tmp, args(j), ra_idx); | 1958 tmp = octave::cat_op (tmp, args(j), ra_idx); |
1959 | 1959 |
1960 dim_vector dv_tmp = args(j).dims (); | 1960 dim_vector dv_tmp = args(j).dims (); |
1961 | 1961 |
1962 if (dim >= dv_len) | 1962 if (dim >= dv_len) |
1963 { | 1963 { |
5953 const octave_value_list& args) | 5953 const octave_value_list& args) |
5954 { | 5954 { |
5955 if (args.length () != 1) | 5955 if (args.length () != 1) |
5956 print_usage (); | 5956 print_usage (); |
5957 | 5957 |
5958 return do_unary_op (op, args(0)); | 5958 return octave::unary_op (op, args(0)); |
5959 } | 5959 } |
5960 | 5960 |
5961 DEFUN (not, args, , | 5961 DEFUN (not, args, , |
5962 doc: /* -*- texinfo -*- | 5962 doc: /* -*- texinfo -*- |
5963 @deftypefn {} {@var{z} =} not (@var{x}) | 5963 @deftypefn {} {@var{z} =} not (@var{x}) |
6059 const octave_value_list& args) | 6059 const octave_value_list& args) |
6060 { | 6060 { |
6061 if (args.length () != 2) | 6061 if (args.length () != 2) |
6062 print_usage (); | 6062 print_usage (); |
6063 | 6063 |
6064 return do_binary_op (op, args(0), args(1)); | 6064 return octave::binary_op (op, args(0), args(1)); |
6065 } | 6065 } |
6066 | 6066 |
6067 static octave_value | 6067 static octave_value |
6068 binary_assoc_op_defun_body (octave_value::binary_op op, | 6068 binary_assoc_op_defun_body (octave_value::binary_op op, |
6069 octave_value::assign_op aop, | 6069 octave_value::assign_op aop, |
6075 print_usage (); | 6075 print_usage (); |
6076 | 6076 |
6077 octave_value retval; | 6077 octave_value retval; |
6078 | 6078 |
6079 if (nargin == 2) | 6079 if (nargin == 2) |
6080 retval = do_binary_op (op, args(0), args(1)); | 6080 retval = octave::binary_op (op, args(0), args(1)); |
6081 else | 6081 else |
6082 { | 6082 { |
6083 retval = do_binary_op (op, args(0), args(1)); | 6083 retval = octave::binary_op (op, args(0), args(1)); |
6084 | 6084 |
6085 for (int i = 2; i < nargin; i++) | 6085 for (int i = 2; i < nargin; i++) |
6086 retval.assign (aop, args(i)); | 6086 retval.assign (aop, args(i)); |
6087 } | 6087 } |
6088 | 6088 |
6373 int nargin = args.length (); | 6373 int nargin = args.length (); |
6374 | 6374 |
6375 if (nargin < 2 || nargin > 3) | 6375 if (nargin < 2 || nargin > 3) |
6376 print_usage (); | 6376 print_usage (); |
6377 | 6377 |
6378 return (nargin == 2 ? do_colon_op (args(0), args(1)) | 6378 return (nargin == 2 |
6379 : do_colon_op (args(0), args(1), args(2))); | 6379 ? octave::colon_op (args(0), args(1)) |
6380 : octave::colon_op (args(0), args(1), args(2))); | |
6380 } | 6381 } |
6381 | 6382 |
6382 static double tic_toc_timestamp = -1.0; | 6383 static double tic_toc_timestamp = -1.0; |
6383 | 6384 |
6384 DEFUN (tic, args, nargout, | 6385 DEFUN (tic, args, nargout, |