Mercurial > octave
comparison libinterp/corefcn/matrix_type.cc @ 32598:2f3b54f81947
avoid dim_vector copies in more places where possible (bug #64962)
Where possible, use const reference to capture temporary dim_vector
objects instead of making copies.
Affected files: variable-editor-model.cc, besselj.cc, bitfcns.cc,
cellfun.cc, data.cc, ellipj.cc, filter.cc, find.cc, gl-render.cc,
graphics.cc, graphics.in.h, jsondecode.cc, jsonencode.cc, ls-mat5.cc,
matrix_type.cc, mex.cc, oct-map.cc, pr-output.cc, sub2ind.cc, tril.cc,
xpow.cc, ov-base-diag.cc, ov-base-int.cc, ov-base-mat.cc,
ov-base-sparse.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-cell.cc,
ov-class.cc, ov-class.h, ov-classdef.cc, ov-cx-mat.cc,
ov-cx-sparse.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-intx.h,
ov-java.cc, ov-perm.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-str-mat.cc,
ov-struct.cc, ovl.cc, op-int.h, op-str-str.cc, op-struct.cc,
pt-eval.cc, pt-tm-const.cc, Array-base.cc, Array-util.cc, CNDArray.cc,
CSparse.cc, Sparse.cc, dNDArray.cc, dSparse.cc, fCNDArray.cc,
fNDArray.cc, bsxfun-defs.cc, lo-specfun.cc, mx-inlines.cc,
oct-binmap.h.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 13 Dec 2023 15:48:06 -0500 |
parents | 597f3ee61a48 |
children | 4b601ca024d5 |
comparison
equal
deleted
inserted
replaced
32597:2c3808f6155b | 32598:2f3b54f81947 |
---|---|
272 && (str_typ == "upper" || str_typ == "lower")) | 272 && (str_typ == "upper" || str_typ == "lower")) |
273 { | 273 { |
274 const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM"); | 274 const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM"); |
275 | 275 |
276 octave_idx_type len = perm.numel (); | 276 octave_idx_type len = perm.numel (); |
277 dim_vector dv = args(0).dims (); | 277 const dim_vector& dv = args(0).dims (); |
278 | 278 |
279 if (len != dv(0)) | 279 if (len != dv(0)) |
280 error ("matrix_type: Invalid permutation vector PERM"); | 280 error ("matrix_type: Invalid permutation vector PERM"); |
281 | 281 |
282 OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); | 282 OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); |
409 if (nargin == 3 && (str_typ == "upper" || str_typ == "lower")) | 409 if (nargin == 3 && (str_typ == "upper" || str_typ == "lower")) |
410 { | 410 { |
411 const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM"); | 411 const ColumnVector perm = args(2).xvector_value ("matrix_type: Invalid permutation vector PERM"); |
412 | 412 |
413 octave_idx_type len = perm.numel (); | 413 octave_idx_type len = perm.numel (); |
414 dim_vector dv = args(0).dims (); | 414 const dim_vector& dv = args(0).dims (); |
415 | 415 |
416 if (len != dv(0)) | 416 if (len != dv(0)) |
417 error ("matrix_type: Invalid permutation vector PERM"); | 417 error ("matrix_type: Invalid permutation vector PERM"); |
418 | 418 |
419 OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); | 419 OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); |