Mercurial > octave
diff libinterp/corefcn/bsxfun.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 | a4ed2fed7dfa |
line wrap: on
line diff
--- a/libinterp/corefcn/bsxfun.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/bsxfun.cc Tue Apr 05 08:33:58 2022 -0700 @@ -343,16 +343,16 @@ if (args.length () != 3) print_usage (); - octave_value func = args(0); - if (func.is_string ()) + octave_value fcn = args(0); + if (fcn.is_string ()) { - std::string name = func.string_value (); + std::string name = fcn.string_value (); symbol_table& symtab = interp.get_symbol_table (); - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error ("bsxfun: invalid function name: %s", name.c_str ()); } else if (! (args(0).is_function_handle () || args(0).is_inline_function ())) @@ -363,14 +363,14 @@ const octave_value A = args(1); const octave_value B = args(2); - if (func.is_builtin_function () - || (func.is_function_handle () && ! A.isobject () && ! B.isobject ())) + if (fcn.is_builtin_function () + || (fcn.is_function_handle () && ! A.isobject () && ! B.isobject ())) { // This may break if the default behavior is overridden. But if you // override arithmetic operators for builtin classes, you should expect // mayhem anyway (constant folding etc). Querying is_overloaded() may // not be exactly what we need here. - octave_function *fcn_val = func.function_value (); + octave_function *fcn_val = fcn.function_value (); if (fcn_val) { octave_value tmp = maybe_optimized_builtin (fcn_val->name (), A, B); @@ -414,14 +414,14 @@ octave_value_list inputs (2); inputs(0) = A; inputs(1) = B; - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else if (dvc.numel () < 1) { octave_value_list inputs (2); inputs(0) = A.resize (dvc); inputs(1) = B.resize (dvc); - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else { @@ -463,7 +463,7 @@ if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) inputs(1) = Bc; - octave_value_list tmp = feval (func, inputs, 1); + octave_value_list tmp = feval (fcn, inputs, 1); #define BSXINIT(T, CLS, EXTRACTOR) \ (result_type == CLS) \ @@ -756,7 +756,7 @@ ## Test automatic bsxfun % %!test -%! funs = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... +%! fcns = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... %! @rem, @mod, @atan2, @hypot, @eq, @ne, @lt, @le, @gt, @ge, ... %! @and, @or, @xor }; %! @@ -772,28 +772,28 @@ %! x = rand (3) * 10-5; %! y = rand (3,1) * 10-5; %! -%! for i=1:length (funs) +%! for i=1:length (fcns) %! for j = 1:length (float_types) %! for k = 1:length (int_types) %! -%! fun = funs{i}; +%! fcn = fcns{i}; %! f_type = float_types{j}; %! i_type = int_types{k}; %! -%! assert (bsxfun (fun, f_type (x), i_type (y)), ... -%! fun (f_type(x), i_type (y))); -%! assert (bsxfun (fun, f_type (y), i_type (x)), ... -%! fun (f_type(y), i_type (x))); +%! assert (bsxfun (fcn, f_type (x), i_type (y)), ... +%! fcn (f_type(x), i_type (y))); +%! assert (bsxfun (fcn, f_type (y), i_type (x)), ... +%! fcn (f_type(y), i_type (x))); %! -%! assert (bsxfun (fun, i_type (x), i_type (y)), ... -%! fun (i_type (x), i_type (y))); -%! assert (bsxfun (fun, i_type (y), i_type (x)), ... -%! fun (i_type (y), i_type (x))); +%! assert (bsxfun (fcn, i_type (x), i_type (y)), ... +%! fcn (i_type (x), i_type (y))); +%! assert (bsxfun (fcn, i_type (y), i_type (x)), ... +%! fcn (i_type (y), i_type (x))); %! -%! assert (bsxfun (fun, f_type (x), f_type (y)), ... -%! fun (f_type (x), f_type (y))); -%! assert (bsxfun (fun, f_type(y), f_type(x)), ... -%! fun (f_type (y), f_type (x))); +%! assert (bsxfun (fcn, f_type (x), f_type (y)), ... +%! fcn (f_type (x), f_type (y))); +%! assert (bsxfun (fcn, f_type(y), f_type(x)), ... +%! fcn (f_type (y), f_type (x))); %! endfor %! endfor %! endfor