Mercurial > octave
comparison libinterp/corefcn/bsxfun.cc @ 29961:7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
Files affected: __betainc__.cc, __contourc__.cc, __eigs__.cc,
__expint__.cc, __ftp__.cc, __gammainc__.cc, __ichol__.cc, __ilu__.cc,
__magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, balance.cc,
besselj.cc, bsxfun.cc, call-stack.cc, ccolamd.cc, cellfun.cc, chol.cc,
colamd.cc, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc,
defaults.cc, dirfns.cc, display.cc, dlmread.cc, dmperm.cc, dot.cc,
eig.cc, ellipj.cc, environment.cc, error.cc, event-manager.cc, fft.cc,
fft2.cc, fftn.cc, file-io.cc, find.cc, gcd.cc, getgrent.cc,
getpwent.cc, getrusage.cc, gsvd.cc, hash.cc, help.cc, hess.cc,
hex2num.cc, input.cc, inv.cc, jsondecode.cc, jsonencode.cc,
load-path.cc, load-save.cc, lookup.cc, lsode.cc, lu.cc, max.cc,
mgorth.cc, oct-hist.cc, ordqz.cc, ordschur.cc, pager.cc, pr-output.cc,
psi.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, regexp.cc,
schur.cc, settings.cc, sighandlers.cc, sparse.cc, spparms.cc,
sqrtm.cc, stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc,
symbfact.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc,
tril.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc,
__delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc,
audioread.cc, convhulln.cc, fftw.cc, gzip.cc, ov-cell.cc, ov-class.cc,
ov-classdef.cc, ov-fcn-handle.cc, ov-struct.cc, ov-typeinfo.cc,
ov-usr-fcn.cc, octave.cc, lex.ll, oct-parse.yy, profiler.cc,
andpt-eval.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 14 Aug 2021 22:48:52 -0400 |
parents | 32c3a5805893 |
children | cd7c824f3f22 |
comparison
equal
deleted
inserted
replaced
29960:939bef0b66e0 | 29961:7d6709900da7 |
---|---|
346 octave_value func = args(0); | 346 octave_value func = args(0); |
347 if (func.is_string ()) | 347 if (func.is_string ()) |
348 { | 348 { |
349 std::string name = func.string_value (); | 349 std::string name = func.string_value (); |
350 | 350 |
351 octave::symbol_table& symtab = interp.get_symbol_table (); | 351 symbol_table& symtab = interp.get_symbol_table (); |
352 | 352 |
353 func = symtab.find_function (name); | 353 func = symtab.find_function (name); |
354 | 354 |
355 if (func.is_undefined ()) | 355 if (func.is_undefined ()) |
356 error ("bsxfun: invalid function name: %s", name.c_str ()); | 356 error ("bsxfun: invalid function name: %s", name.c_str ()); |
412 if (dva == dvb || dva.numel () == 1 || dvb.numel () == 1) | 412 if (dva == dvb || dva.numel () == 1 || dvb.numel () == 1) |
413 { | 413 { |
414 octave_value_list inputs (2); | 414 octave_value_list inputs (2); |
415 inputs(0) = A; | 415 inputs(0) = A; |
416 inputs(1) = B; | 416 inputs(1) = B; |
417 retval = octave::feval (func, inputs, 1); | 417 retval = feval (func, inputs, 1); |
418 } | 418 } |
419 else if (dvc.numel () < 1) | 419 else if (dvc.numel () < 1) |
420 { | 420 { |
421 octave_value_list inputs (2); | 421 octave_value_list inputs (2); |
422 inputs(0) = A.resize (dvc); | 422 inputs(0) = A.resize (dvc); |
423 inputs(1) = B.resize (dvc); | 423 inputs(1) = B.resize (dvc); |
424 retval = octave::feval (func, inputs, 1); | 424 retval = feval (func, inputs, 1); |
425 } | 425 } |
426 else | 426 else |
427 { | 427 { |
428 octave_idx_type ncount = 1; | 428 octave_idx_type ncount = 1; |
429 for (octave_idx_type i = 1; i < nd; i++) | 429 for (octave_idx_type i = 1; i < nd; i++) |
461 inputs(0) = Ac; | 461 inputs(0) = Ac; |
462 | 462 |
463 if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) | 463 if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) |
464 inputs(1) = Bc; | 464 inputs(1) = Bc; |
465 | 465 |
466 octave_value_list tmp = octave::feval (func, inputs, 1); | 466 octave_value_list tmp = feval (func, inputs, 1); |
467 | 467 |
468 #define BSXINIT(T, CLS, EXTRACTOR) \ | 468 #define BSXINIT(T, CLS, EXTRACTOR) \ |
469 (result_type == CLS) \ | 469 (result_type == CLS) \ |
470 { \ | 470 { \ |
471 have_ ## T = true; \ | 471 have_ ## T = true; \ |
540 { | 540 { |
541 if (! tmp(0).isfloat ()) | 541 if (! tmp(0).isfloat ()) |
542 { | 542 { |
543 have_NDArray = false; | 543 have_NDArray = false; |
544 C = result_NDArray; | 544 C = result_NDArray; |
545 C = octave::cat_op (C, tmp(0), ra_idx); | 545 C = cat_op (C, tmp(0), ra_idx); |
546 } | 546 } |
547 else if (tmp(0).isreal ()) | 547 else if (tmp(0).isreal ()) |
548 result_NDArray.insert (tmp(0).array_value (), ra_idx); | 548 result_NDArray.insert (tmp(0).array_value (), ra_idx); |
549 else | 549 else |
550 { | 550 { |
560 { | 560 { |
561 if (! tmp(0).isfloat ()) | 561 if (! tmp(0).isfloat ()) |
562 { | 562 { |
563 have_FloatNDArray = false; | 563 have_FloatNDArray = false; |
564 C = result_FloatNDArray; | 564 C = result_FloatNDArray; |
565 C = octave::cat_op (C, tmp(0), ra_idx); | 565 C = cat_op (C, tmp(0), ra_idx); |
566 } | 566 } |
567 else if (tmp(0).isreal ()) | 567 else if (tmp(0).isreal ()) |
568 result_FloatNDArray.insert | 568 result_FloatNDArray.insert |
569 (tmp(0).float_array_value (), ra_idx); | 569 (tmp(0).float_array_value (), ra_idx); |
570 else | 570 else |
583 { \ | 583 { \ |
584 if (tmp(0).class_name () != CLS) \ | 584 if (tmp(0).class_name () != CLS) \ |
585 { \ | 585 { \ |
586 have_ ## T = false; \ | 586 have_ ## T = false; \ |
587 C = result_ ## T; \ | 587 C = result_ ## T; \ |
588 C = octave::cat_op (C, tmp(0), ra_idx); \ | 588 C = cat_op (C, tmp(0), ra_idx); \ |
589 } \ | 589 } \ |
590 else \ | 590 else \ |
591 result_ ## T .insert (tmp(0). EXTRACTOR ## _array_value (), ra_idx); \ | 591 result_ ## T .insert (tmp(0). EXTRACTOR ## _array_value (), ra_idx); \ |
592 } | 592 } |
593 | 593 |
601 else if BSXLOOP(uint8NDArray, "uint8", uint8) | 601 else if BSXLOOP(uint8NDArray, "uint8", uint8) |
602 else if BSXLOOP(uint16NDArray, "uint16", uint16) | 602 else if BSXLOOP(uint16NDArray, "uint16", uint16) |
603 else if BSXLOOP(uint32NDArray, "uint32", uint32) | 603 else if BSXLOOP(uint32NDArray, "uint32", uint32) |
604 else if BSXLOOP(uint64NDArray, "uint64", uint64) | 604 else if BSXLOOP(uint64NDArray, "uint64", uint64) |
605 else | 605 else |
606 C = octave::cat_op (C, tmp(0), ra_idx); | 606 C = cat_op (C, tmp(0), ra_idx); |
607 } | 607 } |
608 } | 608 } |
609 | 609 |
610 #define BSXEND(T) \ | 610 #define BSXEND(T) \ |
611 (have_ ## T) \ | 611 (have_ ## T) \ |