comparison libinterp/corefcn/max.cc @ 30896:c9788d7f6e65

maint: Use "fcn" as preferred abbreviation for "function" in libinterp/. * __eigs__.cc, bsxfun.cc, cellfun.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, error.cc, graphics.cc, graphics.in.h, gzfstream.h, ls-hdf5.cc, lsode.cc, max.cc, oct-opengl.h, quad.cc, strfns.cc, utils.cc, utils.h, variables.cc, __ode15__.cc, gzip.cc, cdef-manager.cc, ov-fcn-handle.cc, ov-java.cc, ov-usr-fcn.cc, bp-table.cc, bp-table.h, lex.h, lex.ll, oct-parse.yy, pt-eval.cc: Replace "func", "fun", "fn" in documentation and variable names with "fcn".
author Rik <rik@octave.org>
date Tue, 05 Apr 2022 08:33:58 -0700
parents 32d2b6604a9f
children e88a07dec498
comparison
equal deleted inserted replaced
30895:360d330cc30e 30896:c9788d7f6e65
246 if (nargin < 1 || nargin > 3) 246 if (nargin < 1 || nargin > 3)
247 print_usage (); 247 print_usage ();
248 248
249 octave_value_list retval (nargout > 1 ? 2 : 1); 249 octave_value_list retval (nargout > 1 ? 2 : 1);
250 250
251 const char *func = (ismin ? "min" : "max"); 251 const char *fcn = (ismin ? "min" : "max");
252 252
253 if (nargin == 3 || nargin == 1) 253 if (nargin == 3 || nargin == 1)
254 { 254 {
255 octave_value arg = args(0); 255 octave_value arg = args(0);
256 int dim = -1; 256 int dim = -1;
257 if (nargin == 3) 257 if (nargin == 3)
258 { 258 {
259 dim = args(2).int_value (true) - 1; 259 dim = args(2).int_value (true) - 1;
260 260
261 if (dim < 0) 261 if (dim < 0)
262 error ("%s: DIM must be a valid dimension", func); 262 error ("%s: DIM must be a valid dimension", fcn);
263 263
264 if (! args(1).isempty ()) 264 if (! args(1).isempty ())
265 warning ("%s: second argument is ignored", func); 265 warning ("%s: second argument is ignored", fcn);
266 } 266 }
267 267
268 switch (arg.builtin_type ()) 268 switch (arg.builtin_type ())
269 { 269 {
270 case btyp_double: 270 case btyp_double:
346 case btyp_bool: 346 case btyp_bool:
347 retval = do_minmax_red_op<boolNDArray> (arg, nargout, dim, ismin); 347 retval = do_minmax_red_op<boolNDArray> (arg, nargout, dim, ismin);
348 break; 348 break;
349 349
350 default: 350 default:
351 err_wrong_type_arg (func, arg); 351 err_wrong_type_arg (fcn, arg);
352 } 352 }
353 } 353 }
354 else 354 else
355 { 355 {
356 octave_value argx = args(0); 356 octave_value argx = args(0);
423 // case btyp_bool: 423 // case btyp_bool:
424 // retval = do_minmax_bin_op<boolNDArray> (argx, argy, ismin); 424 // retval = do_minmax_bin_op<boolNDArray> (argx, argy, ismin);
425 // break; 425 // break;
426 426
427 default: 427 default:
428 error ("%s: cannot compute %s (%s, %s)", func, func, 428 error ("%s: cannot compute %s (%s, %s)", fcn, fcn,
429 argx.type_name ().c_str (), argy.type_name ().c_str ()); 429 argx.type_name ().c_str (), argy.type_name ().c_str ());
430 } 430 }
431 431
432 // FIXME: Delete when boolNDArray has max() 432 // FIXME: Delete when boolNDArray has max()
433 if (xtyp == btyp_bool && ytyp == btyp_bool) 433 if (xtyp == btyp_bool && ytyp == btyp_bool)
923 int nargin = args.length (); 923 int nargin = args.length ();
924 924
925 if (nargin < 1 || nargin > 2) 925 if (nargin < 1 || nargin > 2)
926 print_usage (); 926 print_usage ();
927 927
928 const char *func = (ismin ? "cummin" : "cummax"); 928 const char *fcn = (ismin ? "cummin" : "cummax");
929 929
930 octave_value arg = args(0); 930 octave_value arg = args(0);
931 int dim = -1; 931 int dim = -1;
932 if (nargin == 2) 932 if (nargin == 2)
933 { 933 {
934 dim = args(1).int_value (true) - 1; 934 dim = args(1).int_value (true) - 1;
935 935
936 if (dim < 0) 936 if (dim < 0)
937 error ("%s: DIM must be a valid dimension", func); 937 error ("%s: DIM must be a valid dimension", fcn);
938 } 938 }
939 939
940 octave_value_list retval; 940 octave_value_list retval;
941 941
942 switch (arg.builtin_type ()) 942 switch (arg.builtin_type ())
983 retval(0) = retval(0).bool_array_value (); 983 retval(0) = retval(0).bool_array_value ();
984 } 984 }
985 break; 985 break;
986 986
987 default: 987 default:
988 err_wrong_type_arg (func, arg); 988 err_wrong_type_arg (fcn, arg);
989 } 989 }
990 990
991 return retval; 991 return retval;
992 } 992 }
993 993