Mercurial > hg > octave-nkf
changeset 17787:175b392e91fe
Use GNU style coding conventions for code in libinterp/
* libinterp/corefcn/Cell.h, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__dispatch__.cc, libinterp/corefcn/__lin_interpn__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/balance.cc, libinterp/corefcn/besselj.cc,
libinterp/corefcn/betainc.cc, libinterp/corefcn/bitfcns.cc,
libinterp/corefcn/bsxfun.cc, libinterp/corefcn/c-file-ptr-stream.cc,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/cellfun.cc,
libinterp/corefcn/colloc.cc, libinterp/corefcn/comment-list.h,
libinterp/corefcn/conv2.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc,
libinterp/corefcn/defaults.cc, libinterp/corefcn/defaults.in.h,
libinterp/corefcn/defun-int.h, libinterp/corefcn/defun.cc,
libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc,
libinterp/corefcn/display.cc, libinterp/corefcn/dlmread.cc,
libinterp/corefcn/dot.cc, libinterp/corefcn/dynamic-ld.cc,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/eig.cc,
libinterp/corefcn/ellipj.cc, libinterp/corefcn/error.cc,
libinterp/corefcn/error.h, libinterp/corefcn/event-queue.h,
libinterp/corefcn/fft.cc, libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc,
libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc,
libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc,
libinterp/corefcn/givens.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/gl2ps-renderer.h,
libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h,
libinterp/corefcn/gripes.cc, libinterp/corefcn/gripes.h,
libinterp/corefcn/help.cc, libinterp/corefcn/hess.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/input.h, libinterp/corefcn/inv.cc,
libinterp/corefcn/jit-ir.h, libinterp/corefcn/jit-typeinfo.cc,
libinterp/corefcn/jit-typeinfo.h, libinterp/corefcn/jit-util.h,
libinterp/corefcn/kron.cc, libinterp/corefcn/load-path.cc,
libinterp/corefcn/load-path.h, libinterp/corefcn/load-save.cc,
libinterp/corefcn/load-save.h, libinterp/corefcn/lookup.cc,
libinterp/corefcn/ls-ascii-helper.cc, libinterp/corefcn/ls-hdf5.cc,
libinterp/corefcn/ls-hdf5.h, libinterp/corefcn/ls-mat-ascii.cc,
libinterp/corefcn/ls-mat-ascii.h, libinterp/corefcn/ls-mat4.cc,
libinterp/corefcn/ls-mat5.cc, libinterp/corefcn/ls-mat5.h,
libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lsode.cc,
libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc,
libinterp/corefcn/mappers.cc, libinterp/corefcn/matrix_type.cc,
libinterp/corefcn/max.cc, libinterp/corefcn/md5sum.cc,
libinterp/corefcn/mex.cc, libinterp/corefcn/mexproto.h,
libinterp/corefcn/mgorth.cc, libinterp/corefcn/mxarray.in.h,
libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-map.cc,
libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/octave-link.cc, libinterp/corefcn/octave-link.h,
libinterp/corefcn/pager.cc, libinterp/corefcn/pinv.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/procstream.h,
libinterp/corefcn/profiler.cc, libinterp/corefcn/pt-jit.cc,
libinterp/corefcn/pt-jit.h, libinterp/corefcn/quad.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc,
libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sighandlers.h,
libinterp/corefcn/sparse-xdiv.cc, libinterp/corefcn/sparse-xdiv.h,
libinterp/corefcn/sparse-xpow.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/sqrtm.cc,
libinterp/corefcn/str2double.cc, libinterp/corefcn/strfind.cc,
libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc,
libinterp/corefcn/svd.cc, libinterp/corefcn/syl.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc,
libinterp/corefcn/sysdep.h, libinterp/corefcn/time.cc,
libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h,
libinterp/corefcn/tril.cc, libinterp/corefcn/txt-eng-ft.cc,
libinterp/corefcn/txt-eng-ft.h, libinterp/corefcn/txt-eng.h,
libinterp/corefcn/typecast.cc, libinterp/corefcn/urlwrite.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc,
libinterp/corefcn/variables.h, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xdiv.h, libinterp/corefcn/xnorm.h, libinterp/corefcn/xpow.cc,
libinterp/corefcn/xpow.h, libinterp/corefcn/zfstream.cc,
libinterp/corefcn/zfstream.h, libinterp/dldfcn/__delaunayn__.cc,
libinterp/dldfcn/__dsearchn__.cc, libinterp/dldfcn/__eigs__.cc,
libinterp/dldfcn/__fltk_uigetfile__.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__init_gnuplot__.cc,
libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/__voronoi__.cc,
libinterp/dldfcn/amd.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/chol.cc,
libinterp/dldfcn/colamd.cc, libinterp/dldfcn/convhulln.cc,
libinterp/dldfcn/dmperm.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc,
libinterp/dldfcn/symbfact.cc, libinterp/dldfcn/symrcm.cc,
libinterp/dldfcn/tsearch.cc, libinterp/octave-value/ov-base-diag.cc,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.cc,
libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h,
libinterp/octave-value/ov-base-scalar.cc,
libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.cc,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.cc,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.cc,
libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.cc,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.cc,
libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.cc,
libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.cc,
libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-complex.h,
libinterp/octave-value/ov-cx-diag.cc, libinterp/octave-value/ov-cx-diag.h,
libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-cx-sparse.h,
libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-handle.h,
libinterp/octave-value/ov-fcn-inline.cc,
libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-float.h,
libinterp/octave-value/ov-flt-complex.cc,
libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.cc,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.cc,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.cc,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.cc,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int16.cc,
libinterp/octave-value/ov-int32.cc, libinterp/octave-value/ov-int64.cc,
libinterp/octave-value/ov-int8.cc, libinterp/octave-value/ov-intx.h,
libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-mex-fcn.cc, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-null-mat.h,
libinterp/octave-value/ov-oncleanup.cc, libinterp/octave-value/ov-perm.cc,
libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.cc,
libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.cc,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.cc,
libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.cc,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.cc,
libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.cc,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-type-conv.h,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-typeinfo.h,
libinterp/octave-value/ov-uint16.cc, libinterp/octave-value/ov-uint32.cc,
libinterp/octave-value/ov-uint64.cc, libinterp/octave-value/ov-uint8.cc,
libinterp/octave-value/ov-usr-fcn.cc, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.cc, libinterp/octave-value/ov.h, libinterp/octave.cc,
libinterp/operators/op-b-bm.cc, libinterp/operators/op-b-sbm.cc,
libinterp/operators/op-bm-b.cc, libinterp/operators/op-bm-bm.cc,
libinterp/operators/op-cdm-cdm.cc, libinterp/operators/op-chm.cc,
libinterp/operators/op-class.cc, libinterp/operators/op-cm-cm.cc,
libinterp/operators/op-cm-cs.cc, libinterp/operators/op-cm-s.cc,
libinterp/operators/op-cm-scm.cc, libinterp/operators/op-cm-sm.cc,
libinterp/operators/op-cs-cm.cc, libinterp/operators/op-cs-cs.cc,
libinterp/operators/op-cs-scm.cc, libinterp/operators/op-cs-sm.cc,
libinterp/operators/op-dm-dm.cc, libinterp/operators/op-dm-scm.cc,
libinterp/operators/op-double-conv.cc, libinterp/operators/op-fcdm-fcdm.cc,
libinterp/operators/op-fcm-fcm.cc, libinterp/operators/op-fcm-fcs.cc,
libinterp/operators/op-fcm-fm.cc, libinterp/operators/op-fcm-fs.cc,
libinterp/operators/op-fcs-fcm.cc, libinterp/operators/op-fcs-fcs.cc,
libinterp/operators/op-fcs-fm.cc, libinterp/operators/op-fcs-fs.cc,
libinterp/operators/op-fdm-fdm.cc, libinterp/operators/op-float-conv.cc,
libinterp/operators/op-fm-fcm.cc, libinterp/operators/op-fm-fcs.cc,
libinterp/operators/op-fm-fm.cc, libinterp/operators/op-fm-fs.cc,
libinterp/operators/op-fs-fcm.cc, libinterp/operators/op-fs-fcs.cc,
libinterp/operators/op-fs-fm.cc, libinterp/operators/op-fs-fs.cc,
libinterp/operators/op-m-cm.cc, libinterp/operators/op-m-cs.cc,
libinterp/operators/op-m-m.cc, libinterp/operators/op-m-s.cc,
libinterp/operators/op-m-scm.cc, libinterp/operators/op-m-sm.cc,
libinterp/operators/op-pm-scm.cc, libinterp/operators/op-range.cc,
libinterp/operators/op-s-cm.cc, libinterp/operators/op-s-cs.cc,
libinterp/operators/op-s-scm.cc, libinterp/operators/op-sbm-b.cc,
libinterp/operators/op-sbm-bm.cc, libinterp/operators/op-sbm-sbm.cc,
libinterp/operators/op-scm-cm.cc, libinterp/operators/op-scm-cs.cc,
libinterp/operators/op-scm-m.cc, libinterp/operators/op-scm-s.cc,
libinterp/operators/op-scm-scm.cc, libinterp/operators/op-scm-sm.cc,
libinterp/operators/op-sm-cm.cc, libinterp/operators/op-sm-m.cc,
libinterp/operators/op-sm-s.cc, libinterp/operators/op-sm-scm.cc,
libinterp/operators/op-sm-sm.cc, libinterp/operators/op-str-m.cc,
libinterp/operators/op-str-s.cc, libinterp/operators/op-str-str.cc,
libinterp/operators/ops.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/parse.h, libinterp/parse-tree/pt-arg-list.cc,
libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-assign.cc,
libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.cc,
libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h,
libinterp/parse-tree/pt-cbinop.cc, libinterp/parse-tree/pt-check.cc,
libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-colon.h,
libinterp/parse-tree/pt-const.cc, libinterp/parse-tree/pt-decl.cc,
libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h,
libinterp/parse-tree/pt-fcn-handle.cc, libinterp/parse-tree/pt-id.cc,
libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.cc,
libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-loop.h,
libinterp/parse-tree/pt-mat.cc, libinterp/parse-tree/pt-misc.cc,
libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.cc,
libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h,
libinterp/parse-tree/token.h, libinterp/version.cc:
Use GNU style coding conventions for code in libinterp/
line wrap: on
line diff
--- a/libinterp/corefcn/Cell.h +++ b/libinterp/corefcn/Cell.h @@ -89,7 +89,7 @@ const octave_value& fill_val = Matrix ()); Cell reshape (const dim_vector& new_dims) const - { return Array<octave_value>::reshape (new_dims); } + { return Array<octave_value>::reshape (new_dims); } octave_idx_type nnz (void) const; @@ -145,6 +145,6 @@ template<> inline Cell octave_value_extract<Cell> (const octave_value& v) - { return v.cell_value (); } +{ return v.cell_value (); } #endif
--- a/libinterp/corefcn/__contourc__.cc +++ b/libinterp/corefcn/__contourc__.cc @@ -164,7 +164,7 @@ } // Find stop edge. - // FIXME -- perhaps this should use a while loop? + // FIXME: perhaps this should use a while loop? for (unsigned int k = 1; k <= 4; k++) { if (start_edge == 0 || start_edge == 2) @@ -298,7 +298,7 @@ } DEFUN (__contourc__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __contourc__ (@var{x}, @var{y}, @var{z}, @var{levels})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/__dispatch__.cc +++ b/libinterp/corefcn/__dispatch__.cc @@ -40,7 +40,7 @@ #include "variables.h" DEFUN (__dispatch__, args, nargout, - "Undocumented internal function") + "Undocumented internal function") { octave_value retval;
--- a/libinterp/corefcn/__lin_interpn__.cc +++ b/libinterp/corefcn/__lin_interpn__.cc @@ -268,7 +268,7 @@ //This function only performs linear interpolation. DEFUN (__lin_interpn__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{vi} =} __lin_interpn__ (@var{x1}, @var{x2}, @dots{}, @var{xn}, @var{v}, @var{y1}, @var{y2}, @dots{}, @var{yn})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/__pchip_deriv__.cc +++ b/libinterp/corefcn/__pchip_deriv__.cc @@ -51,7 +51,7 @@ // for piecewise polynomials. DEFUN (__pchip_deriv__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __pchip_deriv__ (@var{x}, @var{y}, @var{dim})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/__qp__.cc +++ b/libinterp/corefcn/__qp__.cc @@ -230,7 +230,7 @@ octave_idx_type dimZ = n - rank; - // FIXME -- still remain to handle the case of + // FIXME: still remain to handle the case of // non-full rank active set matrix. // Computing the Y matrix (orthogonal to Z) @@ -480,7 +480,7 @@ } DEFUN (__qp__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{x}, @var{lambda}, @var{info}, @var{iter}] =} __qp__ (@var{x0}, @var{H}, @var{q}, @var{Aeq}, @var{beq}, @var{Ain}, @var{bin}, @var{maxit})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/balance.cc +++ b/libinterp/corefcn/balance.cc @@ -47,7 +47,7 @@ #include "utils.h" DEFUN (balance, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{AA} =} balance (@var{A})\n\ @deftypefnx {Built-in Function} {@var{AA} =} balance (@var{A}, @var{opt})\n\ @deftypefnx {Built-in Function} {[@var{DD}, @var{AA}] =} balance (@var{A}, @var{opt})\n\ @@ -110,11 +110,11 @@ return retval; } - bool isfloat = args(0).is_single_type () || - (! AEPcase && args(1).is_single_type ()); + bool isfloat = args(0).is_single_type () + || (! AEPcase && args(1).is_single_type ()); - bool complex_case = (args(0).is_complex_type () || - (! AEPcase && args(1).is_complex_type ())); + bool complex_case = args(0).is_complex_type () + || (! AEPcase && args(1).is_complex_type ()); // Extract argument 1 parameter for both AEP and GEP. Matrix aa;
--- a/libinterp/corefcn/besselj.cc +++ b/libinterp/corefcn/besselj.cc @@ -128,7 +128,8 @@ } else { - FloatComplexNDArray x = x_arg.float_complex_array_value (); + FloatComplexNDArray x + = x_arg.float_complex_array_value (); if (! error_state) { @@ -211,7 +212,8 @@ } else { - FloatComplexNDArray x = x_arg.float_complex_array_value (); + FloatComplexNDArray x + = x_arg.float_complex_array_value (); if (! error_state) { @@ -377,7 +379,7 @@ } DEFUN (besselj, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{j}, @var{ierr}] =} besselj (@var{alpha}, @var{x}, @var{opt})\n\ @deftypefnx {Built-in Function} {[@var{y}, @var{ierr}] =} bessely (@var{alpha}, @var{x}, @var{opt})\n\ @deftypefnx {Built-in Function} {[@var{i}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})\n\ @@ -451,7 +453,7 @@ } DEFUN (bessely, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{y}, @var{ierr}] =} bessely (@var{alpha}, @var{x}, @var{opt})\n\ See besselj.\n\ @end deftypefn") @@ -460,7 +462,7 @@ } DEFUN (besseli, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{i}, @var{ierr}] =} besseli (@var{alpha}, @var{x}, @var{opt})\n\ See besselj.\n\ @end deftypefn") @@ -469,7 +471,7 @@ } DEFUN (besselk, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{k}, @var{ierr}] =} besselk (@var{alpha}, @var{x}, @var{opt})\n\ See besselj.\n\ @end deftypefn") @@ -478,7 +480,7 @@ } DEFUN (besselh, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{h}, @var{ierr}] =} besselh (@var{alpha}, @var{k}, @var{x}, @var{opt})\n\ See besselj.\n\ @end deftypefn") @@ -522,7 +524,7 @@ } DEFUN (airy, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{a}, @var{ierr}] =} airy (@var{k}, @var{z}, @var{opt})\n\ Compute Airy functions of the first and second kind, and their\n\ derivatives.\n\
--- a/libinterp/corefcn/betainc.cc +++ b/libinterp/corefcn/betainc.cc @@ -36,7 +36,7 @@ // be placed elsewhere in the Octave code hierarchy. DEFUN (betainc, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} betainc (@var{x}, @var{a}, @var{b})\n\ Return the regularized incomplete Beta function,\n\ @tex\n\ @@ -330,7 +330,7 @@ */ DEFUN (betaincinv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} betaincinv (@var{y}, @var{a}, @var{b})\n\ Compute the inverse of the incomplete Beta function, i.e., @var{x} such that\n\ \n\
--- a/libinterp/corefcn/bitfcns.cc +++ b/libinterp/corefcn/bitfcns.cc @@ -48,26 +48,26 @@ #include <functional> #if !defined (HAVE_CXX_BITWISE_OP_TEMPLATES) -namespace std +namespace std { template <typename T> - struct bit_and + struct bit_and { - public: + public: T operator() (const T & op1, const T & op2) const { return (op1 & op2); } }; template <typename T> - struct bit_or + struct bit_or { - public: + public: T operator() (const T & op1, const T & op2) const { return (op1 | op2); } }; template <typename T> - struct bit_xor + struct bit_xor { - public: + public: T operator() (const T & op1, const T & op2) const { return (op1 ^ op2); } }; } @@ -345,7 +345,7 @@ } DEFUN (bitand, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bitand (@var{x}, @var{y})\n\ Return the bitwise AND of non-negative integers.\n\ @var{x}, @var{y} must be in the range [0,bitmax]\n\ @@ -356,7 +356,7 @@ } DEFUN (bitor, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bitor (@var{x}, @var{y})\n\ Return the bitwise OR of non-negative integers.\n\ @var{x}, @var{y} must be in the range [0,bitmax]\n\ @@ -367,7 +367,7 @@ } DEFUN (bitxor, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bitxor (@var{x}, @var{y})\n\ Return the bitwise XOR of non-negative integers.\n\ @var{x}, @var{y} must be in the range [0,bitmax]\n\ @@ -496,7 +496,7 @@ while (0) DEFUN (bitshift, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bitshift (@var{a}, @var{k})\n\ @deftypefnx {Built-in Function} {} bitshift (@var{a}, @var{k}, @var{n})\n\ Return a @var{k} bit shift of @var{n}-digit unsigned\n\ @@ -543,7 +543,7 @@ { if (nargin == 3) { - // FIXME -- for compatibility, we should accept an array + // FIXME: for compatibility, we should accept an array // or a scalar as the third argument. if (args(2).numel () > 1) error ("bitshift: N must be a scalar integer"); @@ -583,27 +583,32 @@ DO_SBITSHIFT (int64, nbits < 64 ? nbits : 64); else if (cname == "double") { - static const int bits_in_mantissa = std::numeric_limits<double>::digits; + static const int bits_in_mantissa + = std::numeric_limits<double>::digits; + nbits = (nbits < bits_in_mantissa ? nbits : bits_in_mantissa); int64_t mask = max_mantissa_value<double> (); if (nbits < bits_in_mantissa) mask = mask >> (bits_in_mantissa - nbits); else if (nbits < 1) mask = 0; - int bits_in_type = sizeof (double) * std::numeric_limits<unsigned char>::digits; + int bits_in_type = sizeof (double) + * std::numeric_limits<unsigned char>::digits; NDArray m = m_arg.array_value (); DO_BITSHIFT ( ); } else if (cname == "single") { - static const int bits_in_mantissa = std::numeric_limits<float>::digits; + static const int bits_in_mantissa + = std::numeric_limits<float>::digits; nbits = (nbits < bits_in_mantissa ? nbits : bits_in_mantissa); int64_t mask = max_mantissa_value<float> (); if (nbits < bits_in_mantissa) mask = mask >> (bits_in_mantissa - nbits); else if (nbits < 1) mask = 0; - int bits_in_type = sizeof (float) * std::numeric_limits<unsigned char>::digits; + int bits_in_type = sizeof (float) + * std::numeric_limits<unsigned char>::digits; FloatNDArray m = m_arg.float_array_value (); DO_BITSHIFT (Float); } @@ -617,7 +622,7 @@ } DEFUN (bitmax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bitmax ()\n\ @deftypefnx {Built-in Function} {} bitmax (\"double\")\n\ @deftypefnx {Built-in Function} {} bitmax (\"single\")\n\ @@ -652,7 +657,7 @@ } DEFUN (flintmax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} flintmax ()\n\ @deftypefnx {Built-in Function} {} flintmax (\"double\")\n\ @deftypefnx {Built-in Function} {} flintmax (\"single\")\n\ @@ -687,7 +692,7 @@ } DEFUN (intmax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} intmax (@var{type})\n\ Return the largest integer that can be represented in an integer type.\n\ The variable @var{type} can be\n\ @@ -757,7 +762,7 @@ } DEFUN (intmin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} intmin (@var{type})\n\ Return the smallest integer that can be represented in an integer type.\n\ The variable @var{type} can be\n\ @@ -827,7 +832,7 @@ } DEFUN (sizemax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sizemax ()\n\ Return the largest value allowed for the size of an array.\n\ If Octave is compiled with 64-bit indexing, the result is of class int64,\n\
--- a/libinterp/corefcn/bsxfun.cc +++ b/libinterp/corefcn/bsxfun.cc @@ -89,7 +89,8 @@ return bsxfun_builtin_unknown; } -typedef octave_value (*bsxfun_handler) (const octave_value&, const octave_value&); +typedef octave_value (*bsxfun_handler) (const octave_value&, + const octave_value&); // Static table of handlers. bsxfun_handler bsxfun_handler_table[bsxfun_num_builtin_ops][btyp_num_types]; @@ -112,7 +113,8 @@ return octave_value (bsxfun_rel (xa, ya)); } -// Pow needs a special handler for reals because of the potentially complex result. +// pow() needs a special handler for reals +// because of the potentially complex result. template <class NDA, class CNDA> static octave_value do_bsxfun_real_pow (const octave_value& x, const octave_value& y) @@ -172,8 +174,10 @@ bsxfun_handler_table[bsxfun_builtin_power][btyp_float] = do_bsxfun_real_pow<FloatNDArray, FloatComplexNDArray>; - REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_complex, ComplexNDArray, bsxfun_pow); - REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_float_complex, FloatComplexNDArray, bsxfun_pow); + REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_complex, ComplexNDArray, + bsxfun_pow); + REGISTER_OP_HANDLER (bsxfun_builtin_power, btyp_float_complex, + FloatComplexNDArray, bsxfun_pow); // For chars, we want just relational handlers. REGISTER_REL_HANDLER (bsxfun_builtin_eq, btyp_char, charNDArray, bsxfun_eq); @@ -273,7 +277,7 @@ } #if 0 -// FIXME -- this function is not used; is it OK to delete it? +// FIXME: this function is not used; is it OK to delete it? static void update_index (octave_value_list& idx, const dim_vector& dv, octave_idx_type i) { @@ -310,7 +314,7 @@ } DEFUN (bsxfun, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} bsxfun (@var{f}, @var{A}, @var{B})\n\ The binary singleton expansion function applier performs broadcasting,\n\ that is, applies a binary function @var{f} element-by-element to two\n\ @@ -343,23 +347,26 @@ if (func.is_undefined ()) error ("bsxfun: invalid function name: %s", name.c_str ()); } - else if (! (args(0).is_function_handle () || args(0).is_inline_function ())) + else if (! (args(0).is_function_handle () + || args(0).is_inline_function ())) error ("bsxfun: F must be a string or function handle"); const octave_value A = args (1); const octave_value B = args (2); if (func.is_builtin_function () - || (func.is_function_handle () && ! A.is_object () && ! B.is_object ())) + || (func.is_function_handle () + && ! A.is_object () && ! B.is_object ())) { - // This may break if the default behavior is overriden. 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. + // This may break if the default behavior is overriden. 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 (); if (fcn_val) { - octave_value tmp = maybe_optimized_builtin (fcn_val->name (), A, B); + octave_value tmp = maybe_optimized_builtin (fcn_val->name (), + A, B); if (tmp.is_defined ()) retval(0) = tmp; } @@ -374,7 +381,7 @@ octave_idx_type nd = nda; if (nda > ndb) - dvb.resize (nda, 1); + dvb.resize (nda, 1); else if (nda < ndb) { dva.resize (ndb, 1); @@ -395,8 +402,10 @@ dvc.resize (nd); for (octave_idx_type i = 0; i < nd; i++) - dvc (i) = (dva (i) < 1 ? dva (i) : (dvb (i) < 1 ? dvb (i) : - (dva (i) > dvb (i) ? dva (i) : dvb (i)))); + dvc (i) = (dva (i) < 1 ? dva (i) + : (dvb (i) < 1 ? dvb (i) + : (dva (i) > dvb (i) + ? dva (i) : dvb (i)))); if (dva == dvb || dva.numel () == 1 || dvb.numel () == 1) { @@ -453,7 +462,8 @@ if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) inputs (1) = Bc; - octave_value_list tmp = func.do_multi_index_op (1, inputs); + octave_value_list tmp = func.do_multi_index_op (1, + inputs); if (error_state) break; @@ -493,7 +503,8 @@ if (tmp(0).is_real_type ()) { have_FloatNDArray = true; - result_FloatNDArray = tmp(0).float_array_value (); + result_FloatNDArray + = tmp(0).float_array_value (); result_FloatNDArray.resize (dvc); } else @@ -571,7 +582,8 @@ result_FloatComplexNDArray = FloatComplexNDArray (result_FloatNDArray); result_FloatComplexNDArray.insert - (tmp(0).float_complex_array_value (), ra_idx); + (tmp(0).float_complex_array_value (), + ra_idx); have_FloatNDArray = false; have_FloatComplexNDArray = true; }
--- a/libinterp/corefcn/c-file-ptr-stream.cc +++ b/libinterp/corefcn/c-file-ptr-stream.cc @@ -45,7 +45,7 @@ buf_close (); } -// FIXME -- I'm sure there is room for improvement here... +// FIXME: I'm sure there is room for improvement here... c_file_ptr_buf::int_type c_file_ptr_buf::overflow (int_type c) @@ -92,8 +92,8 @@ c_file_ptr_buf::pbackfail (int_type c) { #if defined (CXX_ISO_COMPLIANT_LIBRARY) - return (c != traits_type::eof () && f) ? ungetc (c, f) : - traits_type::not_eof (c); + return (c != traits_type::eof () && f) ? ungetc (c, f) + : traits_type::not_eof (c); #else return (c != EOF && f) ? ungetc (c, f) : EOF; #endif @@ -217,7 +217,7 @@ buf_close (); } -// FIXME -- I'm sure there is room for improvement here... +// FIXME: I'm sure there is room for improvement here... c_zfile_ptr_buf::int_type c_zfile_ptr_buf::overflow (int_type c) @@ -264,8 +264,8 @@ c_zfile_ptr_buf::pbackfail (int_type c) { #if defined (CXX_ISO_COMPLIANT_LIBRARY) - return (c != traits_type::eof () && f) ? gzungetc (c, f) : - traits_type::not_eof (c); + return (c != traits_type::eof () && f) ? gzungetc (c, f) + : traits_type::not_eof (c); #else return (c != EOF && f) ? gzungetc (c, f) : EOF; #endif @@ -336,7 +336,7 @@ int c_zfile_ptr_buf::flush (void) { - // FIXME -- do we need something more complex here, passing + // FIXME: do we need something more complex here, passing // something other than 0 for the second argument to gzflush and // checking the return value, etc.?
--- a/libinterp/corefcn/c-file-ptr-stream.h +++ b/libinterp/corefcn/c-file-ptr-stream.h @@ -44,7 +44,7 @@ c_file_ptr_buf (FILE *f_arg, close_fcn cf_arg = file_close) : std::streambuf (), f (f_arg), cf (cf_arg) - { } + { } ~c_file_ptr_buf (void); @@ -99,8 +99,7 @@ c_file_ptr_buf& operator = (const c_file_ptr_buf&); }; -// FIXME -- the following three classes could probably share -// some code... +// FIXME: the following three classes could probably share some code... template <typename STREAM_T, typename FILE_T, typename BUF_T> class @@ -118,7 +117,7 @@ void stream_close (void) { if (buf) buf->buf_close (); } int seek (off_t offset, int origin) - { return buf ? buf->seek (offset, origin) : -1; } + { return buf ? buf->seek (offset, origin) : -1; } off_t tell (void) { return buf ? buf->tell () : -1; } @@ -135,9 +134,12 @@ c_file_ptr_stream& operator = (const c_file_ptr_stream&); }; -typedef c_file_ptr_stream<std::istream, FILE *, c_file_ptr_buf> i_c_file_ptr_stream; -typedef c_file_ptr_stream<std::ostream, FILE *, c_file_ptr_buf> o_c_file_ptr_stream; -typedef c_file_ptr_stream<std::iostream, FILE *, c_file_ptr_buf> io_c_file_ptr_stream; +typedef c_file_ptr_stream<std::istream, FILE *, c_file_ptr_buf> + i_c_file_ptr_stream; +typedef c_file_ptr_stream<std::ostream, FILE *, c_file_ptr_buf> + o_c_file_ptr_stream; +typedef c_file_ptr_stream<std::iostream, FILE *, c_file_ptr_buf> + io_c_file_ptr_stream; #ifdef HAVE_ZLIB @@ -162,7 +164,7 @@ c_zfile_ptr_buf (gzFile f_arg, close_fcn cf_arg = file_close) : std::streambuf (), f (f_arg), cf (cf_arg) - { } + { } ~c_zfile_ptr_buf (void); @@ -193,7 +195,7 @@ int file_number () const { return -1; } int seek (off_t offset, int origin) - { return f ? gzseek (f, offset, origin) >= 0 : -1; } + { return f ? gzseek (f, offset, origin) >= 0 : -1; } off_t tell (void) { return f ? gztell (f) : -1; } @@ -218,9 +220,12 @@ c_zfile_ptr_buf& operator = (const c_zfile_ptr_buf&); }; -typedef c_file_ptr_stream<std::istream, gzFile, c_zfile_ptr_buf> i_c_zfile_ptr_stream; -typedef c_file_ptr_stream<std::ostream, gzFile, c_zfile_ptr_buf> o_c_zfile_ptr_stream; -typedef c_file_ptr_stream<std::iostream, gzFile, c_zfile_ptr_buf> io_c_zfile_ptr_stream; +typedef c_file_ptr_stream<std::istream, gzFile, c_zfile_ptr_buf> + i_c_zfile_ptr_stream; +typedef c_file_ptr_stream<std::ostream, gzFile, c_zfile_ptr_buf> + o_c_zfile_ptr_stream; +typedef c_file_ptr_stream<std::iostream, gzFile, c_zfile_ptr_buf> + io_c_zfile_ptr_stream; #endif
--- a/libinterp/corefcn/cellfun.cc +++ b/libinterp/corefcn/cellfun.cc @@ -70,13 +70,15 @@ octave_value& error_handler) { octave_value_list tmp; - try { - tmp = func.do_multi_index_op (nargout, inputlist); - } - catch (octave_execution_exception) { - if (error_handler.is_defined ()) - error_state = 1; - } + try + { + tmp = func.do_multi_index_op (nargout, inputlist); + } + catch (octave_execution_exception) + { + if (error_handler.is_defined ()) + error_state = 1; + } if (error_state) { @@ -85,7 +87,9 @@ octave_scalar_map msg; msg.assign ("identifier", last_error_id ()); msg.assign ("message", last_error_message ()); - msg.assign ("index", static_cast<double> (count + static_cast<octave_idx_type>(1))); + msg.assign ("index", + static_cast<double> (count + + static_cast<octave_idx_type>(1))); octave_value_list errlist = inputlist; errlist.prepend (msg); @@ -264,7 +268,7 @@ } DEFUN (cellfun, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cellfun (@var{name}, @var{C})\n\ @deftypefnx {Built-in Function} {} cellfun (\"size\", @var{C}, @var{k})\n\ @deftypefnx {Built-in Function} {} cellfun (\"isclass\", @var{C}, @var{class})\n\ @@ -1038,7 +1042,7 @@ // handle the nargout = 0 case. DEFUN (arrayfun, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {} arrayfun (@var{func}, @var{A})\n\ @deftypefnx {Function File} {@var{x} =} arrayfun (@var{func}, @var{A})\n\ @deftypefnx {Function File} {@var{x} =} arrayfun (@var{func}, @var{A}, @var{b}, @dots{})\n\ @@ -1156,7 +1160,7 @@ if (nargin < 2) { - error_with_id ("Octave:invalid-fun-call", + error_with_id ("Octave:invalid-fun-call", "arrayfun: function requires at least 2 arguments"); print_usage (); return retval; @@ -1230,7 +1234,7 @@ bool uniform_output = true; octave_value error_handler; - + get_mapper_fun_options (args, nargin, uniform_output, error_handler); if (error_state) @@ -1268,7 +1272,7 @@ { if (mask[i] && inputs[i].dims () != fdims) { - error_with_id ("Octave:invalid-input-arg", + error_with_id ("Octave:invalid-input-arg", "arrayfun: dimensions mismatch"); return retval; } @@ -1316,7 +1320,7 @@ if (nargout > 0 && tmp.length () < nargout) { - error_with_id ("Octave:invalid-fun-call", + error_with_id ("Octave:invalid-fun-call", "arrayfun: function returned fewer than nargout values"); return retval; } @@ -1429,7 +1433,7 @@ if (nargout > 0 && tmp.length () < nargout) { - error_with_id ("Octave:invalid-fun-call", + error_with_id ("Octave:invalid-fun-call", "arrayfun: function returned fewer than nargout values"); return retval; } @@ -1461,7 +1465,7 @@ } } else - error_with_id ("Octave:invalid-fun-call", + error_with_id ("Octave:invalid-fun-call", "arrayfun: argument NAME must be a string or function handle"); return retval; @@ -1776,7 +1780,7 @@ } } -// FIXME -- this is a mess, but if a size method for the object exists, +// FIXME: this is a mess, but if a size method for the object exists, // we have to call it to get the size of the object instead of using the // internal dims method. @@ -1802,7 +1806,7 @@ { Cell retval; - // FIXME -- this copy is only needed because the octave_value::size + // FIXME: this copy is only needed because the octave_value::size // method is not const. octave_value array = obj; @@ -1838,7 +1842,7 @@ } DEFUN (num2cell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{C} =} num2cell (@var{A})\n\ @deftypefnx {Built-in Function} {@var{C} =} num2cell (@var{A}, @var{dim})\n\ Convert the numeric matrix @var{A} to a cell array. If @var{dim} is\n\ @@ -2167,7 +2171,7 @@ } DEFUN (mat2cell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{C} =} mat2cell (@var{A}, @var{m}, @var{n})\n\ @deftypefnx {Built-in Function} {@var{C} =} mat2cell (@var{A}, @var{d1}, @var{d2}, @dots{})\n\ @deftypefnx {Built-in Function} {@var{C} =} mat2cell (@var{A}, @var{r})\n\ @@ -2247,7 +2251,8 @@ case btyp_complex: { if (sparse) - retval = do_mat2cell_2d (a.sparse_complex_matrix_value (), d, nargin-1); + retval = do_mat2cell_2d (a.sparse_complex_matrix_value (), d, + nargin-1); else retval = do_mat2cell (a.complex_array_value (), d, nargin - 1); break; @@ -2337,7 +2342,7 @@ } DEFUN (cellslices, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{sl} =} cellslices (@var{x}, @var{lb}, @var{ub}, @var{dim})\n\ Given an array @var{x}, this function produces a cell array of slices from\n\ the array determined by the index vectors @var{lb}, @var{ub}, for lower and\n\ @@ -2385,41 +2390,55 @@ { // specialize for some dense arrays. if (x.is_bool_type ()) - retcell = do_cellslices_nda (x.bool_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.bool_array_value (), + lb, ub, dim); else if (x.is_char_matrix ()) - retcell = do_cellslices_nda (x.char_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.char_array_value (), + lb, ub, dim); else if (x.is_integer_type ()) { if (x.is_int8_type ()) - retcell = do_cellslices_nda (x.int8_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.int8_array_value (), + lb, ub, dim); else if (x.is_int16_type ()) - retcell = do_cellslices_nda (x.int16_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.int16_array_value (), + lb, ub, dim); else if (x.is_int32_type ()) - retcell = do_cellslices_nda (x.int32_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.int32_array_value (), + lb, ub, dim); else if (x.is_int64_type ()) - retcell = do_cellslices_nda (x.int64_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.int64_array_value (), + lb, ub, dim); else if (x.is_uint8_type ()) - retcell = do_cellslices_nda (x.uint8_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.uint8_array_value (), + lb, ub, dim); else if (x.is_uint16_type ()) - retcell = do_cellslices_nda (x.uint16_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.uint16_array_value (), + lb, ub, dim); else if (x.is_uint32_type ()) - retcell = do_cellslices_nda (x.uint32_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.uint32_array_value (), + lb, ub, dim); else if (x.is_uint64_type ()) - retcell = do_cellslices_nda (x.uint64_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.uint64_array_value (), + lb, ub, dim); } else if (x.is_complex_type ()) { if (x.is_single_type ()) - retcell = do_cellslices_nda (x.float_complex_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.float_complex_array_value (), + lb, ub, dim); else - retcell = do_cellslices_nda (x.complex_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.complex_array_value (), + lb, ub, dim); } else { if (x.is_single_type ()) - retcell = do_cellslices_nda (x.float_array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.float_array_value (), + lb, ub, dim); else - retcell = do_cellslices_nda (x.array_value (), lb, ub, dim); + retcell = do_cellslices_nda (x.array_value (), + lb, ub, dim); } } else @@ -2458,7 +2477,7 @@ */ DEFUN (cellindexmat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{y} =} cellindexmat (@var{x}, @var{varargin})\n\ Given a cell array of matrices @var{x}, this function computes\n\ \n\
--- a/libinterp/corefcn/colloc.cc +++ b/libinterp/corefcn/colloc.cc @@ -35,7 +35,7 @@ #include "utils.h" DEFUN (colloc, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{r}, @var{amat}, @var{bmat}, @var{q}] =} colloc (@var{n}, \"left\", \"right\")\n\ Compute derivative and integral weight matrices for orthogonal\n\ collocation using the subroutines given in J. Villadsen and\n\
--- a/libinterp/corefcn/comment-list.h +++ b/libinterp/corefcn/comment-list.h @@ -56,15 +56,15 @@ : txt (oc.txt), typ (oc.typ) { } octave_comment_elt& operator = (const octave_comment_elt& oc) - { - if (this != &oc) - { - txt = oc.txt; - typ = oc.typ; - } + { + if (this != &oc) + { + txt = oc.txt; + typ = oc.typ; + } - return *this; - } + return *this; + } std::string text (void) const { return txt; } @@ -89,11 +89,11 @@ octave_comment_list (void) { } void append (const octave_comment_elt& elt) - { octave_base_list<octave_comment_elt>::append (elt); } + { octave_base_list<octave_comment_elt>::append (elt); } void append (const std::string& s, octave_comment_elt::comment_type t = octave_comment_elt::unknown) - { append (octave_comment_elt (s, t)); } + { append (octave_comment_elt (s, t)); } octave_comment_list *dup (void) const; };
--- a/libinterp/corefcn/conv2.cc +++ b/libinterp/corefcn/conv2.cc @@ -35,7 +35,7 @@ enum Shape { SHAPE_FULL, SHAPE_SAME, SHAPE_VALID }; DEFUN (conv2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} conv2 (@var{A}, @var{B})\n\ @deftypefnx {Built-in Function} {} conv2 (@var{v1}, @var{v2}, @var{m})\n\ @deftypefnx {Built-in Function} {} conv2 (@dots{}, @var{shape})\n\ @@ -72,8 +72,8 @@ if (nargin < 2) { - print_usage (); - return retval; + print_usage (); + return retval; } else if (nargin == 3) { @@ -109,7 +109,7 @@ if (separable) { - // If user requests separable, check first two params are vectors + // If user requests separable, check first two params are vectors if (! (1 == args(0).rows () || 1 == args(0).columns ()) || ! (1 == args(1).rows () || 1 == args(1).columns ())) @@ -291,7 +291,7 @@ */ DEFUN (convn, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{C} =} convn (@var{A}, @var{B})\n\ @deftypefnx {Built-in Function} {@var{C} =} convn (@var{A}, @var{B}, @var{shape})\n\ Return the n-D convolution of @var{A} and @var{B}. The size of the result\n\ @@ -323,8 +323,8 @@ if (nargin < 2 || nargin > 3) { - print_usage (); - return retval; + print_usage (); + return retval; } else if (nargin == 3) {
--- a/libinterp/corefcn/daspk.cc +++ b/libinterp/corefcn/daspk.cc @@ -171,7 +171,7 @@ while (0) DEFUN (daspk, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} daspk (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})\n\ Solve the set of differential-algebraic equations\n\ @tex\n\ @@ -310,7 +310,7 @@ fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); daspk_fcn = extract_function - (c(0), "daspk", fcn_name, fname, "; endfunction"); + (c(0), "daspk", fcn_name, fname, "; endfunction"); } if (daspk_fcn) @@ -323,8 +323,8 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, xdot, t, cj) jac = "); - daspk_jac = extract_function - (c(1), "daspk", jac_name, jname, "; endfunction"); + daspk_jac = extract_function (c(1), "daspk", jac_name, + jname, "; endfunction"); if (!daspk_jac) { @@ -354,8 +354,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - daspk_fcn = extract_function - (f_arg, "daspk", fcn_name, fname, "; endfunction"); + daspk_fcn = extract_function (f_arg, "daspk", fcn_name, + fname, "; endfunction"); } while (0); break; @@ -370,8 +370,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - daspk_fcn = extract_function - (tmp(0), "daspk", fcn_name, fname, "; endfunction"); + daspk_fcn = extract_function (tmp(0), "daspk", fcn_name, + fname, "; endfunction"); if (daspk_fcn) { @@ -379,9 +379,9 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, xdot, t, cj) jac = "); - daspk_jac = extract_function - (tmp(1), "daspk", jac_name, jname, - "; endfunction"); + daspk_jac = extract_function (tmp(1), "daspk", + jac_name, jname, + "; endfunction"); if (!daspk_jac) {
--- a/libinterp/corefcn/dasrt.cc +++ b/libinterp/corefcn/dasrt.cc @@ -207,7 +207,7 @@ while (0) DEFUN (dasrt, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{x}, @var{xdot}, @var{t_out}, @var{istat}, @var{msg}] =} dasrt (@var{fcn}, [], @var{x_0}, @var{xdot_0}, @var{t})\n\ @deftypefnx {Built-in Function} {@dots{} =} dasrt (@var{fcn}, @var{g}, @var{x_0}, @var{xdot_0}, @var{t})\n\ @deftypefnx {Built-in Function} {@dots{} =} dasrt (@var{fcn}, [], @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})\n\ @@ -397,8 +397,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dasrt_f = extract_function - (c(0), "dasrt", fcn_name, fname, "; endfunction"); + dasrt_f = extract_function (c(0), "dasrt", fcn_name, fname, + "; endfunction"); } if (dasrt_f) @@ -411,8 +411,8 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, xdot, t, cj) jac = "); - dasrt_j = extract_function - (c(1), "dasrt", jac_name, jname, "; endfunction"); + dasrt_j = extract_function (c(1), "dasrt", jac_name, jname, + "; endfunction"); if (!dasrt_j) { @@ -440,8 +440,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dasrt_f = extract_function - (f_arg, "dasrt", fcn_name, fname, "; endfunction"); + dasrt_f = extract_function (f_arg, "dasrt", fcn_name, fname, + "; endfunction"); break; case 2: @@ -454,8 +454,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dasrt_f = extract_function - (tmp(0), "dasrt", fcn_name, fname, "; endfunction"); + dasrt_f = extract_function (tmp(0), "dasrt", fcn_name, + fname, "; endfunction"); if (dasrt_f) { @@ -463,8 +463,8 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, xdot, t, cj) jac = "); - dasrt_j = extract_function - (tmp(1), "dasrt", jac_name, jname, "; endfunction"); + dasrt_j = extract_function (tmp(1), "dasrt", jac_name, + jname, "; endfunction"); if (! dasrt_j) dasrt_f = 0; @@ -517,14 +517,13 @@ ColumnVector stateprime (args(argp++).vector_value ()); if (error_state) - DASRT_ABORT2 - ("expecting time derivative of state vector as argument %d", argp); + DASRT_ABORT2 ("expecting time derivative of state vector as argument %d", + argp); ColumnVector out_times (args(argp++).vector_value ()); if (error_state) - DASRT_ABORT2 - ("expecting output time vector as %s argument %d", argp); + DASRT_ABORT2 ("expecting output time vector as %s argument %d", argp); double tzero = out_times (0); @@ -537,8 +536,7 @@ crit_times = ColumnVector (args(argp++).vector_value ()); if (error_state) - DASRT_ABORT2 - ("expecting critical time vector as argument %d", argp); + DASRT_ABORT2 ("expecting critical time vector as argument %d", argp); crit_times_set = true; }
--- a/libinterp/corefcn/dassl.cc +++ b/libinterp/corefcn/dassl.cc @@ -171,7 +171,7 @@ while (0) DEFUN (dassl, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} dassl (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})\n\ Solve the set of differential-algebraic equations\n\ @tex\n\ @@ -310,8 +310,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dassl_fcn = extract_function - (c(0), "dassl", fcn_name, fname, "; endfunction"); + dassl_fcn = extract_function (c(0), "dassl", fcn_name, fname, + "; endfunction"); } if (dassl_fcn) @@ -320,19 +320,19 @@ dassl_jac = c(1).function_value (); else { - jac_name = unique_symbol_name ("__dassl_jac__"); - jname = "function jac = "; - jname.append (jac_name); - jname.append (" (x, xdot, t, cj) jac = "); - dassl_jac = extract_function - (c(1), "dassl", jac_name, jname, "; endfunction"); + jac_name = unique_symbol_name ("__dassl_jac__"); + jname = "function jac = "; + jname.append (jac_name); + jname.append (" (x, xdot, t, cj) jac = "); + dassl_jac = extract_function (c(1), "dassl", jac_name, + jname, "; endfunction"); - if (!dassl_jac) - { - if (fcn_name.length ()) - clear_function (fcn_name); - dassl_fcn = 0; - } + if (!dassl_jac) + { + if (fcn_name.length ()) + clear_function (fcn_name); + dassl_fcn = 0; + } } } } @@ -355,8 +355,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dassl_fcn = extract_function - (f_arg, "dassl", fcn_name, fname, "; endfunction"); + dassl_fcn = extract_function (f_arg, "dassl", fcn_name, + fname, "; endfunction"); } while (0); break; @@ -371,8 +371,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, xdot, t) y = "); - dassl_fcn = extract_function - (tmp(0), "dassl", fcn_name, fname, "; endfunction"); + dassl_fcn = extract_function (tmp(0), "dassl", fcn_name, + fname, "; endfunction"); if (dassl_fcn) { @@ -380,9 +380,9 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, xdot, t, cj) jac = "); - dassl_jac = extract_function - (tmp(1), "dassl", jac_name, jname, - "; endfunction"); + dassl_jac = extract_function (tmp(1), "dassl", + jac_name, jname, + "; endfunction"); if (!dassl_jac) {
--- a/libinterp/corefcn/data.cc +++ b/libinterp/corefcn/data.cc @@ -108,7 +108,7 @@ return retval DEFUN (all, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} all (@var{x})\n\ @deftypefnx {Built-in Function} {} all (@var{x}, @var{dim})\n\ For a vector argument, return true (logical 1) if all elements of the vector\n\ @@ -155,7 +155,7 @@ */ DEFUN (any, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} any (@var{x})\n\ @deftypefnx {Built-in Function} {} any (@var{x}, @var{dim})\n\ For a vector argument, return true (logical 1) if any element of the vector\n\ @@ -211,7 +211,7 @@ // These mapping functions may also be useful in other places, eh? DEFUN (atan2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} atan2 (@var{y}, @var{x})\n\ Compute atan (@var{y} / @var{x}) for corresponding elements of @var{y}\n\ and @var{x}. Signal an error if @var{y} and @var{x} do not match in size\n\ @@ -351,7 +351,7 @@ } DEFUN (hypot, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} hypot (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} hypot (@var{x}, @var{y}, @var{z}, @dots{})\n\ Compute the element-by-element square root of the sum of the squares of\n\ @@ -414,7 +414,7 @@ } DEFUN (log2, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log2 (@var{x})\n\ @deftypefnx {Mapping Function} {[@var{f}, @var{e}] =} log2 (@var{x})\n\ Compute the base-2 logarithm of each element of @var{x}.\n\ @@ -449,7 +449,7 @@ { FloatNDArray f; FloatNDArray x = args(0).float_array_value (); - // FIXME -- should E be an int value? + // FIXME: should E be an int value? FloatMatrix e; map_2_xlog2 (x, f, e); retval(1) = e; @@ -459,7 +459,7 @@ { FloatComplexNDArray f; FloatComplexNDArray x = args(0).float_complex_array_value (); - // FIXME -- should E be an int value? + // FIXME: should E be an int value? FloatNDArray e; map_2_xlog2 (x, f, e); retval(1) = e; @@ -470,7 +470,7 @@ { NDArray f; NDArray x = args(0).array_value (); - // FIXME -- should E be an int value? + // FIXME: should E be an int value? Matrix e; map_2_xlog2 (x, f, e); retval(1) = e; @@ -480,7 +480,7 @@ { ComplexNDArray f; ComplexNDArray x = args(0).complex_array_value (); - // FIXME -- should E be an int value? + // FIXME: should E be an int value? NDArray e; map_2_xlog2 (x, f, e); retval(1) = e; @@ -514,7 +514,7 @@ */ DEFUN (rem, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} rem (@var{x}, @var{y})\n\ @deftypefnx {Mapping Function} {} fmod (@var{x}, @var{y})\n\ Return the remainder of the division @code{@var{x} / @var{y}}, computed\n\ @@ -577,7 +577,8 @@ } else error ("rem: cannot combine %s and %d", - args(0).class_name ().c_str (), args(1).class_name ().c_str ()); + args(0).class_name ().c_str (), + args(1).class_name ().c_str ()); } else if (args(0).is_single_type () || args(1).is_single_type ()) { @@ -643,7 +644,7 @@ DEFALIAS (fmod, rem) DEFUN (mod, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} mod (@var{x}, @var{y})\n\ Compute the modulo of @var{x} and @var{y}. Conceptually this is given by\n\ \n\ @@ -710,7 +711,8 @@ } else error ("mod: cannot combine %s and %d", - args(0).class_name ().c_str (), args(1).class_name ().c_str ()); + args(0).class_name ().c_str (), + args(1).class_name ().c_str ()); } else if (args(0).is_single_type () || args(1).is_single_type ()) { @@ -793,7 +795,7 @@ %!assert (mod (2.1, 0.2), 0.1, eps) */ -// FIXME: Need to convert the reduction functions of this file for single precision +// FIXME: Need to convert reduction functions of this file for single precision #define NATIVE_REDUCTION_1(FCN, TYPE, DIM) \ (arg.is_ ## TYPE ## _type ()) \ @@ -852,7 +854,8 @@ } \ else \ { \ - SparseComplexMatrix tmp = arg.sparse_complex_matrix_value (); \ + SparseComplexMatrix tmp \ + = arg.sparse_complex_matrix_value (); \ \ if (! error_state) \ retval = tmp.FCN (dim); \ @@ -1024,7 +1027,8 @@ } \ else if (arg.is_single_type ()) \ { \ - FloatComplexNDArray tmp = arg.float_complex_array_value (); \ + FloatComplexNDArray tmp \ + = arg.float_complex_array_value (); \ \ if (! error_state) \ retval = tmp.FCN (dim); \ @@ -1053,7 +1057,7 @@ return retval DEFUN (cumprod, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cumprod (@var{x})\n\ @deftypefnx {Built-in Function} {} cumprod (@var{x}, @var{dim})\n\ Cumulative product of elements along dimension @var{dim}. If\n\ @@ -1086,7 +1090,7 @@ */ DEFUN (cumsum, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cumsum (@var{x})\n\ @deftypefnx {Built-in Function} {} cumsum (@var{x}, @var{dim})\n\ @deftypefnx {Built-in Function} {} cumsum (@dots{}, \"native\")\n\ @@ -1235,7 +1239,7 @@ */ DEFUN (diag, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{M} =} diag (@var{v})\n\ @deftypefnx {Built-in Function} {@var{M} =} diag (@var{v}, @var{k})\n\ @deftypefnx {Built-in Function} {@var{M} =} diag (@var{v}, @var{m}, @var{n})\n\ @@ -1366,7 +1370,7 @@ */ DEFUN (prod, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} prod (@var{x})\n\ @deftypefnx {Built-in Function} {} prod (@var{x}, @var{dim})\n\ Product of elements along dimension @var{dim}. If @var{dim} is\n\ @@ -1658,7 +1662,7 @@ retval = octave_value (new octave_class (m, cname, parents)); } - done: +done: return retval; } @@ -1709,7 +1713,8 @@ all_dq_strings_p = false; if (all_real_p && ! args(i).is_real_type ()) all_real_p = false; - if (all_cmplx_p && ! (args(i).is_complex_type () || args(i).is_real_type ())) + if (all_cmplx_p && ! (args(i).is_complex_type () + || args(i).is_real_type ())) all_cmplx_p = false; if (!any_sparse_p && args(i).is_sparse_type ()) any_sparse_p = true; @@ -1798,7 +1803,8 @@ dim_vector dv = args(0).dims (); // Default concatenation. - bool (dim_vector::*concat_rule) (const dim_vector&, int) = &dim_vector::concat; + bool (dim_vector::*concat_rule) (const dim_vector&, int) + = &dim_vector::concat; if (dim == -1 || dim == -2) { @@ -2081,7 +2087,7 @@ */ DEFUN (vertcat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} vertcat (@var{array1}, @var{array2}, @dots{}, @var{arrayN})\n\ Return the vertical concatenation of N-D array objects, @var{array1},\n\ @var{array2}, @dots{}, @var{arrayN} along dimension 1.\n\ @@ -2105,7 +2111,7 @@ */ DEFUN (cat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cat (@var{dim}, @var{array1}, @var{array2}, @dots{}, @var{arrayN})\n\ Return the concatenation of N-D array objects, @var{array1},\n\ @var{array2}, @dots{}, @var{arrayN} along dimension @var{dim}.\n\ @@ -2175,7 +2181,7 @@ /* %!function ret = __testcat (t1, t2, tr, cmplx) %! assert (cat (1, cast ([], t1), cast ([], t2)), cast ([], tr)); -%! +%! %! assert (cat (1, cast (1, t1), cast (2, t2)), cast ([1; 2], tr)); %! assert (cat (1, cast (1, t1), cast ([2; 3], t2)), cast ([1; 2; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3, t2)), cast ([1; 2; 3], tr)); @@ -2184,7 +2190,7 @@ %! assert (cat (2, cast (1, t1), cast ([2, 3], t2)), cast ([1, 2, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3, t2)), cast ([1, 2, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast ([3, 4], t2)), cast ([1, 2, 3, 4], tr)); -%! +%! %! assert ([cast(1, t1); cast(2, t2)], cast ([1; 2], tr)); %! assert ([cast(1, t1); cast([2; 3], t2)], cast ([1; 2; 3], tr)); %! assert ([cast([1; 2], t1); cast(3, t2)], cast ([1; 2; 3], tr)); @@ -2193,7 +2199,7 @@ %! assert ([cast(1, t1), cast([2, 3], t2)], cast ([1, 2, 3], tr)); %! assert ([cast([1, 2], t1), cast(3, t2)], cast ([1, 2, 3], tr)); %! assert ([cast([1, 2], t1), cast([3, 4], t2)], cast ([1, 2, 3, 4], tr)); -%! +%! %! if (nargin == 3 || cmplx) %! assert (cat (1, cast (1i, t1), cast (2, t2)), cast ([1i; 2], tr)); %! assert (cat (1, cast (1i, t1), cast ([2; 3], t2)), cast ([1i; 2; 3], tr)); @@ -2203,7 +2209,7 @@ %! assert (cat (2, cast (1i, t1), cast ([2, 3], t2)), cast ([1i, 2, 3], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast (3, t2)), cast ([1i, 2, 3], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast ([3, 4], t2)), cast ([1i, 2, 3, 4], tr)); -%! +%! %! assert ([cast(1i, t1); cast(2, t2)], cast ([1i; 2], tr)); %! assert ([cast(1i, t1); cast([2; 3], t2)], cast ([1i; 2; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3, t2)], cast ([1i; 2; 3], tr)); @@ -2212,7 +2218,7 @@ %! assert ([cast(1i, t1), cast([2, 3], t2)], cast ([1i, 2, 3], tr)); %! assert ([cast([1i, 2], t1), cast(3, t2)], cast ([1i, 2, 3], tr)); %! assert ([cast([1i, 2], t1), cast([3, 4], t2)], cast ([1i, 2, 3, 4], tr)); -%! +%! %! assert (cat (1, cast (1, t1), cast (2i, t2)), cast ([1; 2i], tr)); %! assert (cat (1, cast (1, t1), cast ([2i; 3], t2)), cast ([1; 2i; 3], tr)); %! assert (cat (1, cast ([1; 2], t1), cast (3i, t2)), cast ([1; 2; 3i], tr)); @@ -2221,7 +2227,7 @@ %! assert (cat (2, cast (1, t1), cast ([2i, 3], t2)), cast ([1, 2i, 3], tr)); %! assert (cat (2, cast ([1, 2], t1), cast (3i, t2)), cast ([1, 2, 3i], tr)); %! assert (cat (2, cast ([1, 2], t1), cast ([3i, 4], t2)), cast ([1, 2, 3i, 4], tr)); -%! +%! %! assert ([cast(1, t1); cast(2i, t2)], cast ([1; 2i], tr)); %! assert ([cast(1, t1); cast([2i; 3], t2)], cast ([1; 2i; 3], tr)); %! assert ([cast([1; 2], t1); cast(3i, t2)], cast ([1; 2; 3i], tr)); @@ -2230,7 +2236,7 @@ %! assert ([cast(1, t1), cast([2i, 3], t2)], cast ([1, 2i, 3], tr)); %! assert ([cast([1, 2], t1), cast(3i, t2)], cast ([1, 2, 3i], tr)); %! assert ([cast([1, 2], t1), cast([3i, 4], t2)], cast ([1, 2, 3i, 4], tr)); -%! +%! %! assert (cat (1, cast (1i, t1), cast (2i, t2)), cast ([1i; 2i], tr)); %! assert (cat (1, cast (1i, t1), cast ([2i; 3], t2)), cast ([1i; 2i; 3], tr)); %! assert (cat (1, cast ([1i; 2], t1), cast (3i, t2)), cast ([1i; 2; 3i], tr)); @@ -2239,7 +2245,7 @@ %! assert (cat (2, cast (1i, t1), cast ([2i, 3], t2)), cast ([1i, 2i, 3], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast (3i, t2)), cast ([1i, 2, 3i], tr)); %! assert (cat (2, cast ([1i, 2], t1), cast ([3i, 4], t2)), cast ([1i, 2, 3i, 4], tr)); -%! +%! %! assert ([cast(1i, t1); cast(2i, t2)], cast ([1i; 2i], tr)); %! assert ([cast(1i, t1); cast([2i; 3], t2)], cast ([1i; 2i; 3], tr)); %! assert ([cast([1i; 2], t1); cast(3i, t2)], cast ([1i; 2; 3i], tr)); @@ -2324,7 +2330,7 @@ { Array<int> vec = args(1).int_vector_value (); - // FIXME -- maybe we should create an idx_vector object + // FIXME: maybe we should create an idx_vector object // here and pass that to permute? int n = vec.length (); @@ -2344,7 +2350,7 @@ } DEFUN (permute, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} permute (@var{A}, @var{perm})\n\ Return the generalized transpose for an N-D array object @var{A}.\n\ The permutation vector @var{perm} must contain the elements\n\ @@ -2356,7 +2362,7 @@ } DEFUN (ipermute, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ipermute (@var{A}, @var{iperm})\n\ The inverse of the @code{permute} function. The expression\n\ \n\ @@ -2373,7 +2379,7 @@ } DEFUN (length, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} length (@var{a})\n\ Return the length of the object @var{a}.\n\ \n\ @@ -2395,7 +2401,7 @@ } DEFUN (ndims, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ndims (@var{a})\n\ Return the number of dimensions of @var{a}.\n\ For any array, the result will always be larger than or equal to 2.\n\ @@ -2421,7 +2427,7 @@ } DEFUN (numel, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} numel (@var{a})\n\ @deftypefnx {Built-in Function} {} numel (@var{a}, @var{idx1}, @var{idx2}, @dots{})\n\ Return the number of elements in the object @var{a}.\n\ @@ -2468,7 +2474,7 @@ } DEFUN (size, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} size (@var{a})\n\ @deftypefnx {Built-in Function} {} size (@var{a}, @var{dim})\n\ Return the number of rows and columns of @var{a}.\n\ @@ -2559,7 +2565,7 @@ } DEFUN (size_equal, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} size_equal (@var{a}, @var{b}, @dots{})\n\ Return true if the dimensions of all arguments agree.\n\ Trailing singleton dimensions are ignored.\n\ @@ -2593,7 +2599,7 @@ } DEFUN (nnz, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{scalar} =} nnz (@var{a})\n\ Return the number of non zero elements in @var{a}.\n\ @seealso{sparse, nzmax}\n\ @@ -2610,7 +2616,7 @@ } DEFUN (nzmax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{scalar} =} nzmax (@var{SM})\n\ Return the amount of storage allocated to the sparse matrix @var{SM}.\n\ Note that Octave tends to crop unused memory at the first opportunity\n\ @@ -2631,7 +2637,7 @@ } DEFUN (rows, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rows (@var{a})\n\ Return the number of rows of @var{a}.\n\ @seealso{columns, size, length, numel, isscalar, isvector, ismatrix}\n\ @@ -2648,7 +2654,7 @@ } DEFUN (columns, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} columns (@var{a})\n\ Return the number of columns of @var{a}.\n\ @seealso{rows, size, length, numel, isscalar, isvector, ismatrix}\n\ @@ -2665,7 +2671,7 @@ } DEFUN (sum, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sum (@var{x})\n\ @deftypefnx {Built-in Function} {} sum (@var{x}, @var{dim})\n\ @deftypefnx {Built-in Function} {} sum (@dots{}, \"native\")\n\ @@ -2795,7 +2801,7 @@ MAKE_INT_BRANCH (uint32); MAKE_INT_BRANCH (uint64); #undef MAKE_INT_BRANCH - // GAGME: Accursed Matlab compatibility... + // GAGME: Accursed Matlab compatibility... case btyp_char: if (isextra) retval = arg.array_value (true).xsum (dim); @@ -2890,7 +2896,7 @@ */ DEFUN (sumsq, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sumsq (@var{x})\n\ @deftypefnx {Built-in Function} {} sumsq (@var{x}, @var{dim})\n\ Sum of squares of elements along dimension @var{dim}. If @var{dim}\n\ @@ -2929,7 +2935,7 @@ */ DEFUN (islogical, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} islogical (@var{x})\n\ @deftypefnx {Built-in Function} {} isbool (@var{x})\n\ Return true if @var{x} is a logical object.\n\ @@ -2963,7 +2969,7 @@ */ DEFUN (isinteger, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isinteger (@var{x})\n\ Return true if @var{x} is an integer object (int8, uint8, int16, etc.).\n\ Note that @w{@code{isinteger (14)}} is false because numeric constants in\n\ @@ -2982,7 +2988,7 @@ } DEFUN (iscomplex, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} iscomplex (@var{x})\n\ Return true if @var{x} is a complex-valued numeric object.\n\ @seealso{isreal, isnumeric, islogical, ischar, isfloat, isa}\n\ @@ -2999,7 +3005,7 @@ } DEFUN (isfloat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isfloat (@var{x})\n\ Return true if @var{x} is a floating-point numeric object.\n\ Objects of class double or single are floating-point objects.\n\ @@ -3016,11 +3022,11 @@ return retval; } -// FIXME -- perhaps this should be implemented with an +// FIXME: perhaps this should be implemented with an // octave_value member function? DEFUN (complex, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} complex (@var{x})\n\ @deftypefnx {Built-in Function} {} complex (@var{re}, @var{im})\n\ Return a complex result from real arguments. With 1 real argument @var{x},\n\ @@ -3138,7 +3144,9 @@ result = SparseComplexMatrix (re_val); else { - result = SparseComplexMatrix (re_val.rows (), re_val.cols (), Complex (0, im_val (0))); + result = SparseComplexMatrix (re_val.rows (), + re_val.cols (), + Complex (0, im_val (0))); octave_idx_type nr = re_val.rows (); octave_idx_type nc = re_val.cols (); @@ -3158,9 +3166,11 @@ { if (re_val.dims () == im_val.dims ()) { - SparseComplexMatrix result = SparseComplexMatrix (re_val) - + Complex (0, 1) * SparseComplexMatrix (im_val); - retval = octave_value (new octave_sparse_complex_matrix (result)); + SparseComplexMatrix result; + result = SparseComplexMatrix (re_val) + + Complex (0, 1) * SparseComplexMatrix (im_val); + retval = octave_value ( + new octave_sparse_complex_matrix (result)); } else error ("complex: dimension mismatch"); @@ -3178,7 +3188,9 @@ float im_val = im.double_value (); if (! error_state) - retval = octave_value (new octave_float_complex (FloatComplex (re_val, im_val))); + retval = octave_value ( + new octave_float_complex (FloatComplex (re_val, + im_val))); } else { @@ -3186,12 +3198,14 @@ if (! error_state) { - FloatComplexNDArray result (im_val.dims (), FloatComplex ()); + FloatComplexNDArray result (im_val.dims (), + FloatComplex ()); for (octave_idx_type i = 0; i < im_val.numel (); i++) result.xelem (i) = FloatComplex (re_val, im_val(i)); - retval = octave_value (new octave_float_complex_matrix (result)); + retval = octave_value ( + new octave_float_complex_matrix (result)); } } } @@ -3205,12 +3219,14 @@ if (! error_state) { - FloatComplexNDArray result (re_val.dims (), FloatComplex ()); + FloatComplexNDArray result (re_val.dims (), + FloatComplex ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) result.xelem (i) = FloatComplex (re_val(i), im_val); - retval = octave_value (new octave_float_complex_matrix (result)); + retval = octave_value ( + new octave_float_complex_matrix (result)); } } else @@ -3221,12 +3237,15 @@ { if (re_val.dims () == im_val.dims ()) { - FloatComplexNDArray result (re_val.dims (), FloatComplex ()); + FloatComplexNDArray result (re_val.dims (), + FloatComplex ()); for (octave_idx_type i = 0; i < re_val.numel (); i++) - result.xelem (i) = FloatComplex (re_val(i), im_val(i)); - - retval = octave_value (new octave_float_complex_matrix (result)); + result.xelem (i) = FloatComplex (re_val(i), + im_val(i)); + + retval = octave_value ( + new octave_float_complex_matrix (result)); } else error ("complex: dimension mismatch"); @@ -3243,7 +3262,8 @@ double im_val = im.double_value (); if (! error_state) - retval = octave_value (new octave_complex (Complex (re_val, im_val))); + retval = octave_value (new octave_complex (Complex (re_val, + im_val))); } else { @@ -3291,7 +3311,8 @@ for (octave_idx_type i = 0; i < re_val.numel (); i++) result.xelem (i) = Complex (re_val(i), im_val(i)); - retval = octave_value (new octave_complex_matrix (result)); + retval = octave_value ( + new octave_complex_matrix (result)); } else error ("complex: dimension mismatch"); @@ -3309,7 +3330,7 @@ } DEFUN (isreal, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isreal (@var{x})\n\ Return true if @var{x} is a non-complex matrix or scalar.\n\ For compatibility with @sc{matlab}, this includes logical and character\n\ @@ -3328,7 +3349,7 @@ } DEFUN (isempty, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isempty (@var{a})\n\ Return true if @var{a} is an empty matrix (any one of its dimensions is\n\ zero). Otherwise, return false.\n\ @@ -3351,7 +3372,7 @@ */ DEFUN (isnumeric, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isnumeric (@var{x})\n\ Return true if @var{x} is a numeric object, i.e., an integer, real, or\n\ complex array. Logical and character arrays are not considered to be\n\ @@ -3386,7 +3407,7 @@ */ DEFUN (ismatrix, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ismatrix (@var{a})\n\ Return true if @var{a} is a numeric, logical, or character matrix.\n\ Scalars (1x1 matrices) and vectors (@nospell{1xN} or @nospell{Nx1} matrices)\n\ @@ -3401,7 +3422,9 @@ { octave_value arg = args(0); - retval = arg.is_matrix_type () || arg.is_scalar_type () || arg.is_range (); + retval = arg.is_matrix_type () + || arg.is_scalar_type () + || arg.is_range (); } else print_usage (); @@ -3488,7 +3511,7 @@ check_dimensions (dims, fcn); - // FIXME -- perhaps this should be made extensible by + // FIXME: perhaps this should be made extensible by // using the class name to lookup a function to call to create // the new value. @@ -3783,7 +3806,8 @@ switch (dt) { case oct_data_conv::dt_single: - retval = FloatComplexNDArray (dims, static_cast<FloatComplex> (val)); + retval = FloatComplexNDArray (dims, + static_cast<FloatComplex> (val)); break; case oct_data_conv::dt_double: @@ -3853,7 +3877,7 @@ } DEFUN (ones, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ones (@var{n})\n\ @deftypefnx {Built-in Function} {} ones (@var{m}, @var{n})\n\ @deftypefnx {Built-in Function} {} ones (@var{m}, @var{n}, @var{k}, @dots{})\n\ @@ -3902,7 +3926,7 @@ */ DEFUN (zeros, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} zeros (@var{n})\n\ @deftypefnx {Built-in Function} {} zeros (@var{m}, @var{n})\n\ @deftypefnx {Built-in Function} {} zeros (@var{m}, @var{n}, @var{k}, @dots{})\n\ @@ -3944,7 +3968,7 @@ */ DEFUN (Inf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @c List other form of function in documentation index\n\ @findex inf\n\ \n\ @@ -4001,7 +4025,7 @@ */ DEFUN (NaN, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @c List other form of function in documentation index\n\ @findex nan\n\ \n\ @@ -4060,7 +4084,7 @@ */ DEFUN (e, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} e\n\ @deftypefnx {Built-in Function} {} e (@var{n})\n\ @deftypefnx {Built-in Function} {} e (@var{n}, @var{m})\n\ @@ -4095,7 +4119,7 @@ } DEFUN (eps, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} eps\n\ @deftypefnx {Built-in Function} {} eps (@var{x})\n\ @deftypefnx {Built-in Function} {} eps (@var{n}, @var{m})\n\ @@ -4136,16 +4160,16 @@ Array<float> x = args(0).float_array_value (); if (! error_state) - { + { Array<float> epsval (x.dims ()); - + for (octave_idx_type i = 0; i < x.numel (); i++) { float val = ::fabsf (x(i)); if (xisnan (val) || xisinf (val)) epsval(i) = lo_ieee_nan_value (); else if (val < std::numeric_limits<float>::min ()) - epsval(i) = powf (2.0, -149e0); + epsval(i) = powf (2.0, -149e0); else { int expon; @@ -4201,7 +4225,7 @@ %!assert (eps (realmin/16), 2^(-1074)) %!assert (eps (Inf), NaN) %!assert (eps (NaN), NaN) -%!assert (eps ([1/2 1 2 realmax 0 realmin/2 realmin/16 Inf NaN]), +%!assert (eps ([1/2 1 2 realmax 0 realmin/2 realmin/16 Inf NaN]), %! [2^(-53) 2^(-52) 2^(-51) 2^971 2^(-1074) 2^(-1074) 2^(-1074) NaN NaN]) %!assert (eps (single (1/2)), single (2^(-24))) %!assert (eps (single (1)), single (2^(-23))) @@ -4212,13 +4236,13 @@ %!assert (eps (realmin ("single")/16), single (2^(-149))) %!assert (eps (single (Inf)), single (NaN)) %!assert (eps (single (NaN)), single (NaN)) -%!assert (eps (single ([1/2 1 2 realmax("single") 0 realmin("single")/2 realmin("single")/16 Inf NaN])), +%!assert (eps (single ([1/2 1 2 realmax("single") 0 realmin("single")/2 realmin("single")/16 Inf NaN])), %! single ([2^(-24) 2^(-23) 2^(-22) 2^104 2^(-149) 2^(-149) 2^(-149) NaN NaN])) */ DEFUN (pi, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} pi\n\ @deftypefnx {Built-in Function} {} pi (@var{n})\n\ @deftypefnx {Built-in Function} {} pi (@var{n}, @var{m})\n\ @@ -4260,7 +4284,7 @@ } DEFUN (realmax, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} realmax\n\ @deftypefnx {Built-in Function} {} realmax (@var{n})\n\ @deftypefnx {Built-in Function} {} realmax (@var{n}, @var{m})\n\ @@ -4294,7 +4318,7 @@ } DEFUN (realmin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} realmin\n\ @deftypefnx {Built-in Function} {} realmin (@var{n})\n\ @deftypefnx {Built-in Function} {} realmin (@var{n}, @var{m})\n\ @@ -4328,7 +4352,7 @@ } DEFUN (I, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @c List other forms of function in documentation index\n\ @findex i\n\ @findex j\n\ @@ -4369,7 +4393,7 @@ DEFALIAS (j, I); DEFUN (NA, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} NA\n\ @deftypefnx {Built-in Function} {} NA (@var{n})\n\ @deftypefnx {Built-in Function} {} NA (@var{n}, @var{m})\n\ @@ -4401,7 +4425,7 @@ */ DEFUN (false, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} false (@var{x})\n\ @deftypefnx {Built-in Function} {} false (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} false (@var{n}, @var{m}, @var{k}, @dots{})\n\ @@ -4417,7 +4441,7 @@ } DEFUN (true, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} true (@var{x})\n\ @deftypefnx {Built-in Function} {} true (@var{n}, @var{m})\n\ @deftypefnx {Built-in Function} {} true (@var{n}, @var{m}, @var{k}, @dots{})\n\ @@ -4484,7 +4508,7 @@ { octave_value retval; - // FIXME -- perhaps this should be made extensible by using + // FIXME: perhaps this should be made extensible by using // the class name to lookup a function to call to create the new // value. @@ -4548,7 +4572,7 @@ #undef INT_EYE_MATRIX DEFUN (eye, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} eye (@var{n})\n\ @deftypefnx {Built-in Function} {} eye (@var{m}, @var{n})\n\ @deftypefnx {Built-in Function} {} eye ([@var{m} @var{n}])\n\ @@ -4705,7 +4729,7 @@ } DEFUN (linspace, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} linspace (@var{base}, @var{limit})\n\ @deftypefnx {Built-in Function} {} linspace (@var{base}, @var{limit}, @var{n})\n\ Return a row vector with @var{n} linearly spaced elements between\n\ @@ -4794,11 +4818,11 @@ %!error linspace (1, 2, 3, 4) */ -// FIXME -- should accept dimensions as separate args for N-d +// FIXME: should accept dimensions as separate args for N-d // arrays as well as 1-d and 2-d arrays. DEFUN (resize, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} resize (@var{x}, @var{m})\n\ @deftypefnx {Built-in Function} {} resize (@var{x}, @var{m}, @var{n}, @dots{})\n\ @deftypefnx {Built-in Function} {} resize (@var{x}, [@var{m} @var{n} @dots{}])\n\ @@ -4885,10 +4909,10 @@ return retval; } -// FIXME -- should use octave_idx_type for dimensions. +// FIXME: should use octave_idx_type for dimensions. DEFUN (reshape, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} reshape (@var{A}, @var{m}, @var{n}, @dots{})\n\ @deftypefnx {Built-in Function} {} reshape (@var{A}, [@var{m} @var{n} @dots{}])\n\ @deftypefnx {Built-in Function} {} reshape (@var{A}, @dots{}, [], @dots{})\n\ @@ -4988,7 +5012,8 @@ octave_idx_type size_empty_dim = a_nel / nel; if (a_nel != size_empty_dim * nel) - error ("reshape: SIZE is not divisible by the product of known dimensions (= %d)", nel); + error ("reshape: SIZE is not divisible by the product of known dimensions (= %d)", + nel); else new_dims(empty_dim-1) = size_empty_dim; } @@ -5026,7 +5051,7 @@ */ DEFUN (vec, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{v} =} vec (@var{x})\n\ @deftypefnx {Built-in Function} {@var{v} =} vec (@var{x}, @var{dim})\n\ Return the vector obtained by stacking the columns of the matrix @var{x}\n\ @@ -5092,7 +5117,7 @@ */ DEFUN (squeeze, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} squeeze (@var{x})\n\ Remove singleton dimensions from @var{x} and return the result.\n\ Note that for compatibility with @sc{matlab}, all objects have\n\ @@ -5111,7 +5136,7 @@ } DEFUN (full, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{FM} =} full (@var{SM})\n\ Return a full storage matrix from a sparse, diagonal, permutation matrix\n\ or a range.\n\ @@ -5131,7 +5156,7 @@ // Compute various norms of the vector X. DEFUN (norm, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} norm (@var{A})\n\ @deftypefnx {Built-in Function} {} norm (@var{A}, @var{p})\n\ @deftypefnx {Built-in Function} {} norm (@var{A}, @var{p}, @var{opt})\n\ @@ -5340,7 +5365,7 @@ %!test %! ## Test for norm returning NaN on sparse matrix (bug #30631) -%! A = sparse (2,2); +%! A = sparse (2,2); %! A(2,1) = 1; %! assert (norm (A), 1); */ @@ -5359,7 +5384,7 @@ } DEFUN (not, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} not (@var{x})\n\ Return the logical NOT of @var{x}. This function is equivalent to\n\ @code{! x}.\n\ @@ -5370,7 +5395,7 @@ } DEFUN (uplus, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uplus (@var{x})\n\ This function and @w{@tcode{+ x}} are equivalent.\n\ @seealso{uminus, plus, minus}\n\ @@ -5380,7 +5405,7 @@ } DEFUN (uminus, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uminus (@var{x})\n\ This function and @w{@tcode{- x}} are equivalent.\n\ @seealso{uplus, minus}\n\ @@ -5390,7 +5415,7 @@ } DEFUN (transpose, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} transpose (@var{x})\n\ Return the transpose of @var{x}.\n\ This function and @tcode{x.'} are equivalent.\n\ @@ -5421,7 +5446,7 @@ */ DEFUN (ctranspose, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ctranspose (@var{x})\n\ Return the complex conjugate transpose of @var{x}.\n\ This function and @tcode{x'} are equivalent.\n\ @@ -5483,19 +5508,19 @@ break; case 2: retval = do_binary_op (op, args(0), args(1)); - break; + break; default: - retval = do_binary_op (op, args(0), args(1)); - for (int i = 2; i < nargin; i++) - retval.assign (aop, args(i)); - break; + retval = do_binary_op (op, args(0), args(1)); + for (int i = 2; i < nargin; i++) + retval.assign (aop, args(i)); + break; } return retval; } DEFUN (plus, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} plus (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} plus (@var{x1}, @var{x2}, @dots{})\n\ This function and @w{@tcode{x + y}} are equivalent.\n\ @@ -5515,7 +5540,7 @@ } DEFUN (minus, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} minus (@var{x}, @var{y})\n\ This function and @w{@tcode{x - y}} are equivalent.\n\ @seealso{plus, uminus}\n\ @@ -5525,7 +5550,7 @@ } DEFUN (mtimes, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mtimes (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} mtimes (@var{x1}, @var{x2}, @dots{})\n\ Return the matrix multiplication product of inputs.\n\ @@ -5546,7 +5571,7 @@ } DEFUN (mrdivide, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mrdivide (@var{x}, @var{y})\n\ Return the matrix right division of @var{x} and @var{y}.\n\ This function and @w{@tcode{x / y}} are equivalent.\n\ @@ -5557,7 +5582,7 @@ } DEFUN (mpower, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mpower (@var{x}, @var{y})\n\ Return the matrix power operation of @var{x} raised to the @var{y} power.\n\ This function and @w{@tcode{x ^ y}} are equivalent.\n\ @@ -5568,7 +5593,7 @@ } DEFUN (mldivide, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mldivide (@var{x}, @var{y})\n\ Return the matrix left division of @var{x} and @var{y}.\n\ This function and @w{@tcode{x @xbackslashchar{} y}} are equivalent.\n\ @@ -5579,7 +5604,7 @@ } DEFUN (lt, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} lt (@var{x}, @var{y})\n\ This function is equivalent to @w{@code{x < y}}.\n\ @seealso{le, eq, ge, gt, ne}\n\ @@ -5589,7 +5614,7 @@ } DEFUN (le, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} le (@var{x}, @var{y})\n\ This function is equivalent to @w{@code{x <= y}}.\n\ @seealso{eq, ge, gt, ne, lt}\n\ @@ -5599,7 +5624,7 @@ } DEFUN (eq, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} eq (@var{x}, @var{y})\n\ Return true if the two inputs are equal.\n\ This function is equivalent to @w{@code{x == y}}.\n\ @@ -5610,7 +5635,7 @@ } DEFUN (ge, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ge (@var{x}, @var{y})\n\ This function is equivalent to @w{@code{x >= y}}.\n\ @seealso{le, eq, gt, ne, lt}\n\ @@ -5620,7 +5645,7 @@ } DEFUN (gt, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} gt (@var{x}, @var{y})\n\ This function is equivalent to @w{@code{x > y}}.\n\ @seealso{le, eq, ge, ne, lt}\n\ @@ -5630,7 +5655,7 @@ } DEFUN (ne, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ne (@var{x}, @var{y})\n\ Return true if the two inputs are not equal.\n\ This function is equivalent to @w{@code{x != y}}.\n\ @@ -5641,7 +5666,7 @@ } DEFUN (times, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} times (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} times (@var{x1}, @var{x2}, @dots{})\n\ Return the element-by-element multiplication product of inputs.\n\ @@ -5662,7 +5687,7 @@ } DEFUN (rdivide, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rdivide (@var{x}, @var{y})\n\ Return the element-by-element right division of @var{x} and @var{y}.\n\ This function and @w{@tcode{x ./ y}} are equivalent.\n\ @@ -5673,7 +5698,7 @@ } DEFUN (power, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} power (@var{x}, @var{y})\n\ Return the element-by-element operation of @var{x} raised to the\n\ @var{y} power. If several complex results are possible,\n\ @@ -5689,7 +5714,7 @@ } DEFUN (ldivide, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ldivide (@var{x}, @var{y})\n\ Return the element-by-element left division of @var{x} and @var{y}.\n\ This function and @w{@tcode{x .@xbackslashchar{} y}} are equivalent.\n\ @@ -5700,7 +5725,7 @@ } DEFUN (and, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} and (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} and (@var{x1}, @var{x2}, @dots{})\n\ Return the logical AND of @var{x} and @var{y}.\n\ @@ -5721,7 +5746,7 @@ } DEFUN (or, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} or (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} or (@var{x1}, @var{x2}, @dots{})\n\ Return the logical OR of @var{x} and @var{y}.\n\ @@ -5744,7 +5769,7 @@ static double tic_toc_timestamp = -1.0; DEFUN (tic, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} tic ()\n\ @deftypefnx {Built-in Function} {@var{id} =} tic ()\n\ @deftypefnx {Built-in Function} {} toc ()\n\ @@ -5813,7 +5838,7 @@ } DEFUN (toc, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} toc ()\n\ @deftypefnx {Built-in Function} {} toc (@var{id})\n\ @deftypefnx {Built-in Function} {@var{val} =} toc (@dots{})\n\ @@ -5840,9 +5865,10 @@ start_time = (static_cast<double> (val / CLOCKS_PER_SEC) - + static_cast<double> (val % CLOCKS_PER_SEC) / CLOCKS_PER_SEC); - - // FIXME -- should we also check to see whether the start + + static_cast<double> (val % CLOCKS_PER_SEC) + / CLOCKS_PER_SEC); + + // FIXME: should we also check to see whether the start // time is after the beginning of this Octave session? } else @@ -5878,7 +5904,7 @@ */ DEFUN (cputime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{total}, @var{user}, @var{system}] =} cputime ();\n\ Return the CPU time used by your Octave session. The first output is\n\ the total time spent executing your process and is equal to the sum of\n\ @@ -5907,10 +5933,10 @@ getrusage (RUSAGE_SELF, &ru); usr = static_cast<double> (ru.ru_utime.tv_sec) + - static_cast<double> (ru.ru_utime.tv_usec) * 1e-6; + static_cast<double> (ru.ru_utime.tv_usec) * 1e-6; sys = static_cast<double> (ru.ru_stime.tv_sec) + - static_cast<double> (ru.ru_stime.tv_usec) * 1e-6; + static_cast<double> (ru.ru_stime.tv_usec) * 1e-6; #else @@ -5927,14 +5953,14 @@ seconds = ticks / CLOCKS_PER_SEC; usr = static_cast<double> (seconds) + static_cast<double>(fraction) / - static_cast<double>(CLOCKS_PER_SEC); + static_cast<double>(CLOCKS_PER_SEC); ticks = t.tms_stime + t.tms_cstime; fraction = ticks % CLOCKS_PER_SEC; seconds = ticks / CLOCKS_PER_SEC; sys = static_cast<double> (seconds) + static_cast<double>(fraction) / - static_cast<double>(CLOCKS_PER_SEC); + static_cast<double>(CLOCKS_PER_SEC); #endif @@ -5946,7 +5972,7 @@ } DEFUN (sort, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{s}, @var{i}] =} sort (@var{x})\n\ @deftypefnx {Built-in Function} {[@var{s}, @var{i}] =} sort (@var{x}, @var{dim})\n\ @deftypefnx {Built-in Function} {[@var{s}, @var{i}] =} sort (@var{x}, @var{mode})\n\ @@ -6095,7 +6121,7 @@ Array<octave_idx_type> sidx; retval(0) = arg.sort (sidx, dim, smode); - retval(1) = idx_vector (sidx, dv(dim)); // No checking, the extent is known. + retval(1) = idx_vector (sidx, dv(dim)); // No checking, extent is known. } else retval(0) = arg.sort (dim, smode); @@ -6285,7 +6311,7 @@ // This function does not yet support sparse matrices. DEFUN (__sort_rows_idx__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __sort_rows_idx__ (@var{a}, @var{mode})\n\ Undocumented internal function.\n\ @end deftypefn\n") @@ -6334,9 +6360,9 @@ static sortmode get_sort_mode_option (const octave_value& arg, const char *argn) { - // FIXME -- we initialize to UNSORTED here to avoid a GCC warning + // FIXME: we initialize to UNSORTED here to avoid a GCC warning // about possibly using sortmode uninitialized. - // FIXME -- shouldn't these modes be scoped inside a class? + // FIXME: shouldn't these modes be scoped inside a class? sortmode smode = UNSORTED; std::string mode = arg.string_value (); @@ -6356,7 +6382,7 @@ } DEFUN (issorted, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} issorted (@var{a})\n\ @deftypefnx {Built-in Function} {} issorted (@var{a}, @var{mode})\n\ @deftypefnx {Built-in Function} {} issorted (@var{a}, \"rows\", @var{mode})\n\ @@ -6467,7 +6493,7 @@ */ DEFUN (nth_element, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nth_element (@var{x}, @var{n})\n\ @deftypefnx {Built-in Function} {} nth_element (@var{x}, @var{n}, @var{dim})\n\ Select the n-th smallest element of a vector, using the ordering defined by\n\ @@ -6575,7 +6601,7 @@ } DEFUN (__accumarray_sum__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __accumarray_sum__ (@var{idx}, @var{vals}, @var{n})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -6602,14 +6628,18 @@ if (vals.is_single_type ()) { if (vals.is_complex_type ()) - retval = do_accumarray_sum (idx, vals.float_complex_array_value (), n); + retval = do_accumarray_sum (idx, + vals.float_complex_array_value (), + n); else retval = do_accumarray_sum (idx, vals.float_array_value (), n); } else if (vals.is_numeric_type () || vals.is_bool_type ()) { if (vals.is_complex_type ()) - retval = do_accumarray_sum (idx, vals.complex_array_value (), n); + retval = do_accumarray_sum (idx, + vals.complex_array_value (), + n); else retval = do_accumarray_sum (idx, vals.array_value (), n); } @@ -6676,20 +6706,23 @@ zero.double_value ()); break; case btyp_float: - retval = do_accumarray_minmax (idx, vals.float_array_value (), n, ismin, - zero.float_value ()); + retval = do_accumarray_minmax (idx, vals.float_array_value (), n, + ismin, zero.float_value ()); break; case btyp_complex: - retval = do_accumarray_minmax (idx, vals.complex_array_value (), n, ismin, - zero.complex_value ()); + retval = do_accumarray_minmax (idx, vals.complex_array_value (), + n, ismin, zero.complex_value ()); break; case btyp_float_complex: - retval = do_accumarray_minmax (idx, vals.float_complex_array_value (), n, ismin, + retval = do_accumarray_minmax (idx, + vals.float_complex_array_value (), + n, ismin, zero.float_complex_value ()); break; #define MAKE_INT_BRANCH(X) \ case btyp_ ## X: \ - retval = do_accumarray_minmax (idx, vals.X ## _array_value (), n, ismin, \ + retval = do_accumarray_minmax (idx, vals.X ## _array_value (), \ + n, ismin, \ zero.X ## _scalar_value ()); \ break @@ -6718,7 +6751,7 @@ } DEFUN (__accumarray_min__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __accumarray_min__ (@var{idx}, @var{vals}, @var{zero}, @var{n})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -6727,7 +6760,7 @@ } DEFUN (__accumarray_max__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __accumarray_max__ (@var{idx}, @var{vals}, @var{zero}, @var{n})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -6766,7 +6799,7 @@ } DEFUN (__accumdim_sum__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __accumdim_sum__ (@var{idx}, @var{vals}, @var{dim}, @var{n})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -6791,14 +6824,18 @@ if (vals.is_single_type ()) { if (vals.is_complex_type ()) - retval = do_accumdim_sum (idx, vals.float_complex_array_value (), dim, n); + retval = do_accumdim_sum (idx, + vals.float_complex_array_value (), + dim, n); else - retval = do_accumdim_sum (idx, vals.float_array_value (), dim, n); + retval = do_accumdim_sum (idx, vals.float_array_value (), + dim, n); } else if (vals.is_numeric_type () || vals.is_bool_type ()) { if (vals.is_complex_type ()) - retval = do_accumdim_sum (idx, vals.complex_array_value (), dim, n); + retval = do_accumdim_sum (idx, vals.complex_array_value (), + dim, n); else retval = do_accumdim_sum (idx, vals.array_value (), dim, n); } @@ -6877,7 +6914,7 @@ } DEFUN (merge, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} merge (@var{mask}, @var{tval}, @var{fval})\n\ @deftypefnx {Built-in Function} {} ifelse (@var{mask}, @var{tval}, @var{fval})\n\ Merge elements of @var{true_val} and @var{false_val}, depending on the\n\ @@ -6990,7 +7027,8 @@ while (order > 0 && k > 0) { idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); - retval = SparseT (retval.index (col1, sl1)) - SparseT (retval.index (col2, sl2)); + retval = SparseT (retval.index (col1, sl1)) + - SparseT (retval.index (col2, sl2)); assert (retval.columns () == k-1); order--; k--; @@ -7002,7 +7040,8 @@ while (order > 0 && k > 0) { idx_vector col1 (':'), col2 (':'), sl1 (1, k), sl2 (0, k-1); - retval = SparseT (retval.index (sl1, col1)) - SparseT (retval.index (sl2, col2)); + retval = SparseT (retval.index (sl1, col1)) + - SparseT (retval.index (sl2, col2)); assert (retval.rows () == k-1); order--; k--; @@ -7077,7 +7116,8 @@ else if (array.is_sparse_type ()) { if (array.is_complex_type ()) - retval = do_sparse_diff (array.sparse_complex_matrix_value (), order, dim); + retval = do_sparse_diff (array.sparse_complex_matrix_value (), + order, dim); else retval = do_sparse_diff (array.sparse_matrix_value (), order, dim); } @@ -7100,7 +7140,7 @@ } DEFUN (diff, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} diff (@var{x})\n\ @deftypefnx {Built-in Function} {} diff (@var{x}, @var{k})\n\ @deftypefnx {Built-in Function} {} diff (@var{x}, @var{k}, @var{dim})\n\ @@ -7217,7 +7257,7 @@ } DEFUN (repelems, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} repelems (@var{x}, @var{r})\n\ Construct a vector of repeated elements from @var{x}. @var{r}\n\ is a 2x@var{N} integer matrix specifying which elements to repeat and\n\ @@ -7311,7 +7351,7 @@ } DEFUN (base64_encode, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} base64_encode (@var{x})\n\ Encode a double matrix or array @var{x} into the base64 format string\n\ @var{s}.\n\ @@ -7324,12 +7364,12 @@ if (nargin != 1) print_usage (); - else + else { - if (! args(0).is_numeric_type ()) + if (! args(0).is_numeric_type ()) error ("base64_encode: encoding is supported only for numeric arrays"); - else if (args(0).is_complex_type () - || args(0).is_sparse_type ()) + else if (args(0).is_complex_type () + || args(0).is_sparse_type ()) error ("base64_encode: encoding complex or sparse data is not supported"); else if (args(0).is_integer_type ()) { @@ -7367,33 +7407,33 @@ { const Array<float> in = args(0).float_array_value (); size_t inlen; - inlen = in.numel () * sizeof (float) / sizeof (char); + inlen = in.numel () * sizeof (float) / sizeof (char); const char* inc; - inc = reinterpret_cast<const char*> (in.data ()); + inc = reinterpret_cast<const char*> (in.data ()); char* out; - if (! error_state - && octave_base64_encode (inc, inlen, &out)) - { - retval(0) = octave_value (out); - ::free (out); - } - } - else - { - const Array<double> in = args(0).array_value (); - size_t inlen; - inlen = in.numel () * sizeof (double) / sizeof (char); - const char* inc; - inc = reinterpret_cast<const char*> (in.data ()); - char* out; - if (! error_state + if (! error_state && octave_base64_encode (inc, inlen, &out)) { retval(0) = octave_value (out); ::free (out); } } - } + else + { + const Array<double> in = args(0).array_value (); + size_t inlen; + inlen = in.numel () * sizeof (double) / sizeof (char); + const char* inc; + inc = reinterpret_cast<const char*> (in.data ()); + char* out; + if (! error_state + && octave_base64_encode (inc, inlen, &out)) + { + retval(0) = octave_value (out); + ::free (out); + } + } + } return retval; } @@ -7413,7 +7453,7 @@ */ DEFUN (base64_decode, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{x} =} base64_decode (@var{s})\n\ @deftypefnx {Built-in Function} {@var{x} =} base64_decode (@var{s}, @var{dims})\n\ Decode the double matrix or array @var{x} from the base64 encoded string\n\ @@ -7455,19 +7495,19 @@ res = res.reshape (dims); retval = res; - } + } } - return retval; + return retval; } /* %!assert (base64_decode (base64_encode (pi)), pi) %! -%!test +%!test %! in = randn (10); %! outv = base64_decode (base64_encode (in)); -%! outm = base64_decode (base64_encode (in), size (in)); +%! outm = base64_decode (base64_encode (in), size (in)); %! assert (outv, in(:).'); %! assert (outm, in);
--- a/libinterp/corefcn/debug.cc +++ b/libinterp/corefcn/debug.cc @@ -360,8 +360,7 @@ tree_statement_list *cmds = fcn->body (); - // FIXME -- move the operation on cmds to the - // tree_statement_list class? + // FIXME: move the operation on cmds to the tree_statement_list class? if (cmds) { @@ -557,8 +556,8 @@ { tree_statement_list *cmds = f->body (); - // FIXME -- move the operation on cmds to the - // tree_statement_list class? + // FIXME: move the operation on cmds to the + // tree_statement_list class? if (cmds) { octave_value_list bkpts = cmds->list_breakpoints (); @@ -607,7 +606,7 @@ } DEFUN (dbstop, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\")\n\ @deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line})\n\ @deftypefnx {Built-in Function} {@var{rline} =} dbstop (\"@var{func}\", @var{line1}, @var{line2}, @dots{})\n\ @@ -652,7 +651,7 @@ } DEFUN (dbclear, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dbclear (\"@var{func}\")\n\ @deftypefnx {Built-in Function} {} dbclear (\"@var{func}\", @var{line}, @dots{})\n\ @deftypefnx {Built-in Function} {} dbclear (@var{line}, @dots{})\n\ @@ -691,7 +690,7 @@ } DEFUN (dbstatus, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dbstatus ()\n\ @deftypefnx {Built-in Function} {@var{brk_list} =} dbstatus ()\n\ @deftypefnx {Built-in Function} {@var{brk_list} =} dbstatus (\"@var{func}\")\n\ @@ -745,14 +744,14 @@ } else { - octave_user_code *dbg_fcn = get_user_code (); - if (dbg_fcn) - { - symbol_name = dbg_fcn->name (); - fcn_list(0) = symbol_name; - } + octave_user_code *dbg_fcn = get_user_code (); + if (dbg_fcn) + { + symbol_name = dbg_fcn->name (); + fcn_list(0) = symbol_name; + } - bp_list = bp_table::get_breakpoint_list (fcn_list); + bp_list = bp_table::get_breakpoint_list (fcn_list); } if (nargout == 0) @@ -807,7 +806,7 @@ } DEFUN (dbwhere, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbwhere\n\ In debugging mode, report the current file and line number where\n\ execution is stopped.\n\ @@ -904,7 +903,7 @@ } DEFUN (dbtype, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbtype\n\ @deftypefnx {Command} {} dbtype @var{lineno}\n\ @deftypefnx {Command} {} dbtype @var{startl:endl}\n\ @@ -952,7 +951,7 @@ size_t ind = arg.find (':'); if (ind != std::string::npos) // (dbtype start:end) - { + { dbg_fcn = get_user_code (); if (dbg_fcn) @@ -1037,7 +1036,7 @@ } DEFUN (dblist, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dblist\n\ @deftypefnx {Command} {} dblist @var{n}\n\ In debugging mode, list @var{n} lines of the function being debugged\n\ @@ -1226,7 +1225,7 @@ } DEFUN (dbstack, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbstack\n\ @deftypefnx {Command} {} dbstack @var{n}\n\ @deftypefnx {Command} {} dbstack @var{-completenames}\n\ @@ -1299,7 +1298,7 @@ } DEFUN (dbup, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dbup\n\ @deftypefnx {Built-in Function} {} dbup (@var{n})\n\ In debugging mode, move up the execution stack @var{n} frames.\n\ @@ -1315,7 +1314,7 @@ } DEFUN (dbdown, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dbdown\n\ @deftypefnx {Built-in Function} {} dbdown (@var{n})\n\ In debugging mode, move down the execution stack @var{n} frames.\n\ @@ -1331,7 +1330,7 @@ } DEFUN (dbstep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbstep\n\ @deftypefnx {Command} {} dbstep @var{n}\n\ @deftypefnx {Command} {} dbstep in\n\ @@ -1410,7 +1409,7 @@ DEFALIAS (dbnext, dbstep); DEFUN (dbcont, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbcont\n\ Leave command-line debugging mode and continue code execution normally.\n\ @seealso{dbstep, dbquit}\n\ @@ -1434,7 +1433,7 @@ } DEFUN (dbquit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} dbquit\n\ Quit debugging mode immediately without further code execution and\n\ return to the Octave prompt.\n\ @@ -1461,7 +1460,7 @@ } DEFUN (isdebugmode, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isdebugmode ()\n\ Return true if in debugging mode, otherwise false.\n\ @seealso{dbwhere, dbstack, dbstatus}\n\
--- a/libinterp/corefcn/defaults.cc +++ b/libinterp/corefcn/defaults.cc @@ -252,14 +252,14 @@ if (tpath.empty ()) tpath = Vlocal_ver_arch_lib_dir + dir_path::path_sep_str () - + Vlocal_api_arch_lib_dir + dir_path::path_sep_str () - + Vlocal_arch_lib_dir + dir_path::path_sep_str () - + Varch_lib_dir + dir_path::path_sep_str () - + Vbin_dir; + + Vlocal_api_arch_lib_dir + dir_path::path_sep_str () + + Vlocal_arch_lib_dir + dir_path::path_sep_str () + + Varch_lib_dir + dir_path::path_sep_str () + + Vbin_dir; VEXEC_PATH = tpath; - // FIXME -- should we really be modifying PATH in the environment? + // FIXME: should we really be modifying PATH in the environment? // The way things are now, Octave will ignore directories set in the // PATH with calls like // @@ -371,7 +371,8 @@ if (lsf.empty ()) { - Vlocal_site_defaults_file = subst_octave_home (OCTAVE_LOCALSTARTUPFILEDIR); + Vlocal_site_defaults_file + = subst_octave_home (OCTAVE_LOCALSTARTUPFILEDIR); Vlocal_site_defaults_file.append ("/octaverc"); } else @@ -466,7 +467,7 @@ } DEFUN (EDITOR, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} EDITOR ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} EDITOR (@var{new_val})\n\ @deftypefnx {Built-in Function} {} EDITOR (@var{new_val}, \"local\")\n\ @@ -499,7 +500,7 @@ */ DEFUN (EXEC_PATH, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} EXEC_PATH ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} EXEC_PATH (@var{new_val})\n\ @deftypefnx {Built-in Function} {} EXEC_PATH (@var{new_val}, \"local\")\n\ @@ -537,7 +538,7 @@ */ DEFUN (IMAGE_PATH, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} IMAGE_PATH ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} IMAGE_PATH (@var{new_val})\n\ @deftypefnx {Built-in Function} {} IMAGE_PATH (@var{new_val}, \"local\")\n\ @@ -567,7 +568,7 @@ */ DEFUN (OCTAVE_HOME, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} OCTAVE_HOME ()\n\ Return the name of the top-level Octave installation directory.\n\ \n\ @@ -590,7 +591,7 @@ */ DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} OCTAVE_VERSION ()\n\ Return the version number of Octave, as a string.\n\ @end deftypefn")
--- a/libinterp/corefcn/defaults.in.h +++ b/libinterp/corefcn/defaults.in.h @@ -225,7 +225,10 @@ extern OCTINTERP_API void install_defaults (void); -extern OCTINTERP_API void set_exec_path (const std::string& path = std::string ()); -extern OCTINTERP_API void set_image_path (const std::string& path = std::string ()); +extern OCTINTERP_API void +set_exec_path (const std::string& path = std::string ()); + +extern OCTINTERP_API void +set_image_path (const std::string& path = std::string ()); #endif
--- a/libinterp/corefcn/defun-int.h +++ b/libinterp/corefcn/defun-int.h @@ -35,7 +35,8 @@ extern OCTINTERP_API void print_usage (void); extern OCTINTERP_API void print_usage (const std::string&); -extern OCTINTERP_API void check_version (const std::string& version, const std::string& fcn); +extern OCTINTERP_API void check_version (const std::string& version, + const std::string& fcn); extern OCTINTERP_API void install_builtin_function (octave_builtin::fcn f, const std::string& name, @@ -59,8 +60,8 @@ get_current_shlib (void); // This is a convenience class that calls the above function automatically at -// construction time. When deriving new classes, you can either use it as a field -// or as a parent (with multiple inheritance). +// construction time. When deriving new classes, you can either use it as a +// field or as a parent (with multiple inheritance). class octave_auto_shlib : public octave_shlib { @@ -90,7 +91,8 @@ typedef bool (*octave_dld_fcn_installer) (const octave_shlib&, bool relative); -typedef octave_function * (*octave_dld_fcn_getter) (const octave_shlib&, bool relative); +typedef octave_function * + (*octave_dld_fcn_getter) (const octave_shlib&, bool relative); #define DEFINE_FUN_INSTALLER_FUN(name, doc) \ DEFINE_FUNX_INSTALLER_FUN(#name, F ## name, G ## name, doc)
--- a/libinterp/corefcn/defun.cc +++ b/libinterp/corefcn/defun.cc @@ -133,12 +133,14 @@ { if (curr_fcn->is_dld_function ()) { - octave_dld_function *dld = dynamic_cast<octave_dld_function *> (curr_fcn); + octave_dld_function *dld + = dynamic_cast<octave_dld_function *> (curr_fcn); retval = dld->get_shlib (); } else if (curr_fcn->is_mex_function ()) { - octave_mex_function *mex = dynamic_cast<octave_mex_function *> (curr_fcn); + octave_mex_function *mex + = dynamic_cast<octave_mex_function *> (curr_fcn); retval = mex->get_shlib (); } } @@ -148,7 +150,8 @@ bool defun_isargout (int nargout, int iout) { - const std::list<octave_lvalue> *lvalue_list = octave_builtin::curr_lvalue_list; + const std::list<octave_lvalue> *lvalue_list + = octave_builtin::curr_lvalue_list; if (iout >= std::max (nargout, 1)) return false; else if (lvalue_list) @@ -172,7 +175,9 @@ void defun_isargout (int nargout, int nout, bool *isargout) { - const std::list<octave_lvalue> *lvalue_list = octave_builtin::curr_lvalue_list; + const std::list<octave_lvalue> *lvalue_list + = octave_builtin::curr_lvalue_list; + if (lvalue_list) { int k = 0;
--- a/libinterp/corefcn/det.cc +++ b/libinterp/corefcn/det.cc @@ -48,7 +48,7 @@ dynamic_cast<const CLASS *> (&arg.get_rep ()) : 0 DEFUN (det, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} det (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{d}, @var{rcond}] =} det (@var{A})\n\ Compute the determinant of @var{A}.\n\ @@ -106,13 +106,15 @@ { if (isfloat) { - retval(0) = arg.float_complex_diag_matrix_value ().determinant ().value (); + retval(0) = arg.float_complex_diag_matrix_value () + .determinant ().value (); if (nargout > 1) retval(1) = arg.float_complex_diag_matrix_value ().rcond (); } else { - retval(0) = arg.complex_diag_matrix_value ().determinant ().value (); + retval(0) = arg.complex_diag_matrix_value () + .determinant ().value (); if (nargout > 1) retval(1) = arg.complex_diag_matrix_value ().rcond (); } @@ -121,7 +123,8 @@ { if (isfloat) { - retval(0) = arg.float_diag_matrix_value ().determinant ().value (); + retval(0) = arg.float_diag_matrix_value () + .determinant ().value (); if (nargout > 1) retval(1) = arg.float_diag_matrix_value ().rcond (); } @@ -200,7 +203,8 @@ if (! error_state) { MAYBE_CAST (rep, octave_matrix); - MatrixType mtype = rep ? rep -> matrix_type () : MatrixType (); + MatrixType mtype = rep ? rep -> matrix_type () + : MatrixType (); DET det = m.determinant (mtype, info, rcond); retval(1) = rcond; retval(0) = info == -1 ? 0.0 : det.value (); @@ -230,7 +234,8 @@ if (! error_state) { MAYBE_CAST (rep, octave_complex_matrix); - MatrixType mtype = rep ? rep -> matrix_type () : MatrixType (); + MatrixType mtype = rep ? rep -> matrix_type () + : MatrixType (); ComplexDET det = m.determinant (mtype, info, rcond); retval(1) = rcond; retval(0) = info == -1 ? Complex (0.0) : det.value ();
--- a/libinterp/corefcn/dirfns.cc +++ b/libinterp/corefcn/dirfns.cc @@ -79,7 +79,7 @@ { Vlast_chdir_time.stamp (); - // FIXME -- should these actions be handled as a list of functions + // FIXME: should these actions be handled as a list of functions // to call so users can add their own chdir handlers? load_path::update (); @@ -93,7 +93,7 @@ } DEFUN (cd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} cd @var{dir}\n\ @deftypefnx {Command} {} cd\n\ @deftypefnx {Built-in Function} {@var{old_dir} =} cd @var{dir}\n\ @@ -155,7 +155,7 @@ DEFALIAS (chdir, cd); DEFUN (pwd, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} pwd ()\n\ @deftypefnx {Built-in Function} {@var{dir} =} pwd ()\n\ Return the current working directory.\n\ @@ -166,7 +166,7 @@ } DEFUN (readdir, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{files} =} readdir (@var{dir})\n\ @deftypefnx {Built-in Function} {[@var{files}, @var{err}, @var{msg}] =} readdir (@var{dir})\n\ Return the names of files in the directory @var{dir} as a cell array of\n\ @@ -217,7 +217,7 @@ // OTOH, that might cause trouble with compatibility later... DEFUNX ("mkdir", Fmkdir, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mkdir @var{dir}\n\ @deftypefnx {Built-in Function} {} mkdir (@var{parent}, @var{dir})\n\ @deftypefnx {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} mkdir (@dots{})\n\ @@ -304,7 +304,7 @@ } DEFUNX ("rmdir", Frmdir, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rmdir @var{dir}\n\ @deftypefnx {Built-in Function} {} rmdir (@var{dir}, \"s\")\n\ @deftypefnx {Built-in Function} {[@var{status}, @var{msg}, @var{msgid}] =} rmdir (@dots{})\n\ @@ -379,7 +379,7 @@ } DEFUNX ("link", Flink, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} link @var{old} @var{new}\n\ @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} link (@var{old}, @var{new})\n\ Create a new link (also known as a hard link) to an existing file.\n\ @@ -426,7 +426,7 @@ } DEFUNX ("symlink", Fsymlink, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} symlink @var{old} @var{new}\n\ @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} symlink (@var{old}, @var{new})\n\ Create a symbolic link @var{new} which contains the string @var{old}.\n\ @@ -473,7 +473,7 @@ } DEFUNX ("readlink", Freadlink, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} readlink @var{symlink}\n\ @deftypefnx {Built-in Function} {[@var{result}, @var{err}, @var{msg}] =} readlink (@var{symlink})\n\ Read the value of the symbolic link @var{symlink}.\n\ @@ -517,7 +517,7 @@ } DEFUNX ("rename", Frename, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rename @var{old} @var{new}\n\ @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} rename (@var{old}, @var{new})\n\ Change the name of file @var{old} to @var{new}.\n\ @@ -564,7 +564,7 @@ } DEFUN (glob, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} glob (@var{pattern})\n\ Given an array of pattern strings (as a char array or a cell array) in\n\ @var{pattern}, return a cell array of file names that match any of\n\ @@ -665,7 +665,7 @@ */ DEFUNX ("fnmatch", Ffnmatch, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fnmatch (@var{pattern}, @var{string})\n\ Return true or false for each element of @var{string} that matches any of\n\ the elements of the string array @var{pattern}, using the rules of\n\ @@ -703,7 +703,7 @@ } DEFUN (filesep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} filesep ()\n\ @deftypefnx {Built-in Function} {} filesep (\"all\")\n\ Return the system-dependent character used to separate directory names.\n\ @@ -740,7 +740,7 @@ } DEFUN (pathsep, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} pathsep ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} pathsep (@var{new_val})\n\ Query or set the character used to separate directories in a path.\n\ @@ -785,7 +785,7 @@ } DEFUN (confirm_recursive_rmdir, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} confirm_recursive_rmdir ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} confirm_recursive_rmdir (@var{new_val})\n\ @deftypefnx {Built-in Function} {} confirm_recursive_rmdir (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/display.cc +++ b/libinterp/corefcn/display.cc @@ -53,7 +53,7 @@ return 32; else if (CFStringCompare (pixelEncoding, CFSTR (IO16BitDirectPixels), 0) == 0) return 16; - else + else return 8; } #endif
--- a/libinterp/corefcn/dlmread.cc +++ b/libinterp/corefcn/dlmread.cc @@ -41,7 +41,8 @@ #include "oct-obj.h" #include "utils.h" -static const octave_idx_type idx_max = std::numeric_limits<octave_idx_type>::max (); +static const octave_idx_type idx_max = + std::numeric_limits<octave_idx_type>::max (); static bool read_cell_spec (std::istream& is, octave_idx_type& row, octave_idx_type& col) @@ -156,7 +157,7 @@ } DEFUN (dlmread, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{data} =} dlmread (@var{file})\n\ @deftypefnx {Built-in Function} {@var{data} =} dlmread (@var{file}, @var{sep})\n\ @deftypefnx {Built-in Function} {@var{data} =} dlmread (@var{file}, @var{sep}, @var{r0}, @var{c0})\n\ @@ -196,7 +197,7 @@ { empty_value = args(nargin-1).double_value (); if (error_state) - return retval; + return retval; nargin -= 2; } @@ -214,7 +215,7 @@ // File name. std::string fname (args(0).string_value ()); if (error_state) - return retval; + return retval; std::string tname = file_ops::tilde_expand (fname); @@ -233,7 +234,7 @@ octave_stream is = octave_stream_list::lookup (args(0), "dlmread"); if (error_state) - return retval; + return retval; input = is.input_stream ();
--- a/libinterp/corefcn/dot.cc +++ b/libinterp/corefcn/dot.cc @@ -104,7 +104,7 @@ } DEFUN (dot, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dot (@var{x}, @var{y}, @var{dim})\n\ Compute the dot product of two vectors. If @var{x} and @var{y}\n\ are matrices, calculate the dot products along the first\n\ @@ -170,7 +170,8 @@ get_red_dims (dimx, dimy, dim, dimz, m, n, k); FloatComplexNDArray z(dimz); if (! error_state) - F77_XFCN (cdotc3, CDOTC3, (m, n, k, x.data (), y.data (), + F77_XFCN (cdotc3, CDOTC3, (m, n, k, + x.data (), y.data (), z.fortran_vec ())); retval = z; } @@ -181,7 +182,8 @@ get_red_dims (dimx, dimy, dim, dimz, m, n, k); ComplexNDArray z(dimz); if (! error_state) - F77_XFCN (zdotc3, ZDOTC3, (m, n, k, x.data (), y.data (), + F77_XFCN (zdotc3, ZDOTC3, (m, n, k, + x.data (), y.data (), z.fortran_vec ())); retval = z; } @@ -263,7 +265,7 @@ */ DEFUN (blkmm, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} blkmm (@var{A}, @var{B})\n\ Compute products of matrix blocks. The blocks are given as\n\ 2-dimensional subarrays of the arrays @var{A}, @var{B}.\n\ @@ -317,7 +319,8 @@ FloatComplexNDArray y = argy.float_complex_array_value (); FloatComplexNDArray z(dimz); if (! error_state) - F77_XFCN (cmatm3, CMATM3, (m, n, k, np, x.data (), y.data (), + F77_XFCN (cmatm3, CMATM3, (m, n, k, np, + x.data (), y.data (), z.fortran_vec ())); retval = z; } @@ -327,7 +330,8 @@ ComplexNDArray y = argy.complex_array_value (); ComplexNDArray z(dimz); if (! error_state) - F77_XFCN (zmatm3, ZMATM3, (m, n, k, np, x.data (), y.data (), + F77_XFCN (zmatm3, ZMATM3, (m, n, k, np, + x.data (), y.data (), z.fortran_vec ())); retval = z; } @@ -340,7 +344,8 @@ FloatNDArray y = argy.float_array_value (); FloatNDArray z(dimz); if (! error_state) - F77_XFCN (smatm3, SMATM3, (m, n, k, np, x.data (), y.data (), + F77_XFCN (smatm3, SMATM3, (m, n, k, np, + x.data (), y.data (), z.fortran_vec ())); retval = z; } @@ -350,7 +355,8 @@ NDArray y = argy.array_value (); NDArray z(dimz); if (! error_state) - F77_XFCN (dmatm3, DMATM3, (m, n, k, np, x.data (), y.data (), + F77_XFCN (dmatm3, DMATM3, (m, n, k, np, + x.data (), y.data (), z.fortran_vec ())); retval = z; }
--- a/libinterp/corefcn/dynamic-ld.cc +++ b/libinterp/corefcn/dynamic-ld.cc @@ -187,7 +187,7 @@ octave_shlib_list::find_file (const std::string& file_name) { return (instance_ok ()) - ? instance->do_find_file (file_name) : octave_shlib (); + ? instance->do_find_file (file_name) : octave_shlib (); } void @@ -281,7 +281,7 @@ if (! function) { - // FIXME -- can we determine this C mangling scheme + // FIXME: can we determine this C mangling scheme // automatically at run time or configure time? function = oct_file.search (fcn_name, name_uscore_mangler); @@ -345,7 +345,7 @@ if (! function) { - // FIXME -- can we determine this C mangling scheme + // FIXME: can we determine this C mangling scheme // automatically at run time or configure time? function = mex_file.search (fcn_name, mex_uscore_mangler); @@ -416,20 +416,20 @@ octave_function * octave_dynamic_loader::load_oct (const std::string& fcn_name, - const std::string& file_name, - bool relative) + const std::string& file_name, + bool relative) { return (instance_ok ()) - ? instance->do_load_oct (fcn_name, file_name, relative) : 0; + ? instance->do_load_oct (fcn_name, file_name, relative) : 0; } octave_function * octave_dynamic_loader::load_mex (const std::string& fcn_name, - const std::string& file_name, - bool relative) + const std::string& file_name, + bool relative) { return (instance_ok ()) - ? instance->do_load_mex (fcn_name, file_name, relative) : 0; + ? instance->do_load_mex (fcn_name, file_name, relative) : 0; } bool
--- a/libinterp/corefcn/dynamic-ld.h +++ b/libinterp/corefcn/dynamic-ld.h @@ -42,13 +42,13 @@ static octave_function * load_oct (const std::string& fcn_name, - const std::string& file_name = std::string (), - bool relative = false); + const std::string& file_name = std::string (), + bool relative = false); static octave_function * load_mex (const std::string& fcn_name, - const std::string& file_name = std::string (), - bool relative = false); + const std::string& file_name = std::string (), + bool relative = false); static bool remove_oct (const std::string& fcn_name, octave_shlib& shl); @@ -70,13 +70,13 @@ octave_function * do_load_oct (const std::string& fcn_name, - const std::string& file_name = std::string (), - bool relative = false); + const std::string& file_name = std::string (), + bool relative = false); octave_function * do_load_mex (const std::string& fcn_name, - const std::string& file_name = std::string (), - bool relative = false); + const std::string& file_name = std::string (), + bool relative = false); bool do_remove_oct (const std::string& fcn_name, octave_shlib& shl);
--- a/libinterp/corefcn/eig.cc +++ b/libinterp/corefcn/eig.cc @@ -34,7 +34,7 @@ #include "utils.h" DEFUN (eig, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{lambda} =} eig (@var{A})\n\ @deftypefnx {Built-in Function} {@var{lambda} =} eig (@var{A}, @var{B})\n\ @deftypefnx {Built-in Function} {[@var{V}, @var{lambda}] =} eig (@var{A})\n\
--- a/libinterp/corefcn/ellipj.cc +++ b/libinterp/corefcn/ellipj.cc @@ -35,7 +35,7 @@ } DEFUN (ellipj, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{sn}, @var{cn}, @var{dn}, @var{err}] =} ellipj (@var{u}, @var{m})\n\ @deftypefnx {Built-in Function} {[@var{sn}, @var{cn}, @var{dn}, @var{err}] =} ellipj (@var{u}, @var{m}, @var{tol})\n\ Compute the Jacobi elliptic functions @var{sn}, @var{cn}, and @var{dn}\n\ @@ -100,7 +100,8 @@ if (u_arg.is_scalar_type ()) { if (u_arg.is_real_type ()) - { // u real, m scalar + { + // u real, m scalar double u = args(0).double_value (); if (error_state) @@ -121,7 +122,8 @@ retval(0) = sn; } else - { // u complex, m scalar + { + // u complex, m scalar Complex u = u_arg.complex_value (); if (error_state) @@ -143,9 +145,10 @@ } } else - { // u is matrix, m is scalar + { + // u is matrix, m is scalar ComplexNDArray u = u_arg.complex_array_value (); - + if (error_state) { gripe_ellipj_arg ("first"); @@ -187,9 +190,11 @@ dim_vector sz_m = m.dims (); if (u_arg.is_scalar_type ()) - { // u is scalar, m is array + { + // u is scalar, m is array if (u_arg.is_real_type ()) - { // u is real scalar, m is array + { + // u is real scalar, m is array double u = u_arg.double_value (); if (error_state) @@ -218,7 +223,8 @@ retval(0) = sn; } else - { // u is complex scalar, m is array + { + // u is complex scalar, m is array Complex u = u_arg.complex_value (); if (error_state) @@ -248,9 +254,11 @@ } } else - { // u is array, m is array + { + // u is array, m is array if (u_arg.is_real_type ()) - { // u is real array, m is array + { + // u is real array, m is array NDArray u = u_arg.array_value (); if (error_state) @@ -263,7 +271,8 @@ if (sz_u.length () == 2 && sz_m.length () == 2 && sz_u(1) == 1 && sz_m(0) == 1) - { // u is real column vector, m is row vector + { + // u is real column vector, m is row vector octave_idx_type ur = sz_u(0); octave_idx_type mc = sz_m(1); dim_vector sz_out (ur, mc); @@ -276,7 +285,8 @@ for (octave_idx_type j = 0; j < mc; j++) for (octave_idx_type i = 0; i < ur; i++) - ellipj (pu[i], pm[j], sn(i,j), cn(i,j), dn(i,j), err(i,j)); + ellipj (pu[i], pm[j], sn(i,j), cn(i,j), dn(i,j), + err(i,j)); if (nargout > 3) retval(3) = err; @@ -310,7 +320,8 @@ error ("ellipj: Invalid size combination for U and M"); } else - { // u is complex array, m is array + { + // u is complex array, m is array ComplexNDArray u = u_arg.complex_array_value (); if (error_state) @@ -323,7 +334,8 @@ if (sz_u.length () == 2 && sz_m.length () == 2 && sz_u(1) == 1 && sz_m(0) == 1) - { // u is complex column vector, m is row vector + { + // u is complex column vector, m is row vector octave_idx_type ur = sz_u(0); octave_idx_type mc = sz_m(1); dim_vector sz_out (ur, mc); @@ -336,7 +348,8 @@ for (octave_idx_type j = 0; j < mc; j++) for (octave_idx_type i = 0; i < ur; i++) - ellipj (pu[i], pm[j], sn(i,j), cn(i,j), dn(i,j), err(i,j)); + ellipj (pu[i], pm[j], sn(i,j), cn(i,j), dn(i,j), + err(i,j)); if (nargout > 3) retval(3) = err;
--- a/libinterp/corefcn/error.cc +++ b/libinterp/corefcn/error.cc @@ -164,9 +164,9 @@ output_buf << std::endl; - // FIXME -- we really want to capture the message before it - // has all the formatting goop attached to it. We probably also - // want just the message, not the traceback information. + // FIXME: we really want to capture the message before it has all the + // formatting goop attached to it. We probably also want just the + // message, not the traceback information. std::string msg_string = output_buf.str (); @@ -197,9 +197,9 @@ if (! buffer_error_messages) flush_octave_stdout (); - // FIXME -- we really want to capture the message before it - // has all the formatting goop attached to it. We probably also - // want just the message, not the traceback information. + // FIXME: we really want to capture the message before it has all the + // formatting goop attached to it. We probably also want just the + // message, not the traceback information. std::ostringstream output_buf; @@ -231,7 +231,7 @@ { cfn += ':'; if (cfn.length () > base_msg.length () - || base_msg.compare (0, cfn.length (), cfn) != 0) + || base_msg.compare (0, cfn.length (), cfn) != 0) { msg_string += cfn + ' '; } @@ -827,7 +827,7 @@ } DEFUN (rethrow, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rethrow (@var{err})\n\ Reissue a previous error as defined by @var{err}. @var{err} is a structure\n\ that must contain at least the @qcode{\"message\"} and @qcode{\"identifier\"}\n\ @@ -895,9 +895,8 @@ rethrow_error (id.c_str (), "%s", tmp_msg); delete [] tmp_msg; - // FIXME -- is this the right thing to do for - // Vlast_error_stack? Should it be saved and restored - // with unwind_protect? + // FIXME: is this the right thing to do for Vlast_error_stack? + // Should it be saved and restored with unwind_protect? Vlast_error_stack = err_stack; @@ -924,7 +923,8 @@ pr_where_1 ("error: called from '%s' near line %d, column %d", nm.c_str (), l, c); else - pr_where_1 ("error: called from '%d' near line %d", nm.c_str (), l); + pr_where_1 ("error: called from '%d' near line %d", + nm.c_str (), l); } } } @@ -938,7 +938,8 @@ pr_where_1 ("error: in file %s near line %d, column %d", file.c_str (), l, c); else - pr_where_1 ("error: in file %s near line %d", file.c_str (), l); + pr_where_1 ("error: in file %s near line %d", + file.c_str (), l); } } else @@ -949,7 +950,8 @@ pr_where_1 ("error: called from '%s' in file %s near line %d, column %d", nm.c_str (), file.c_str (), l, c); else - pr_where_1 ("error: called from '%d' in file %s near line %d", nm.c_str (), file.c_str (), l); + pr_where_1 ("error: called from '%d' in file %s near line %d", + nm.c_str (), file.c_str (), l); } } } @@ -1005,7 +1007,7 @@ } else nargs(0) = "call to " + caller - + " with message identifier requires message"; + + " with message identifier requires message"; } } } @@ -1014,7 +1016,7 @@ } DEFUN (error, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} error (@var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} error (@var{id}, @var{template}, @dots{})\n\ Format the optional arguments under the control of the template string\n\ @@ -1132,7 +1134,7 @@ octave_value c = m.getfield ("message"); if (c.is_string ()) - nargs(0) = c.string_value (); + nargs(0) = c.string_value (); } if (m.contains ("identifier")) @@ -1140,12 +1142,12 @@ octave_value c = m.getfield ("identifier"); if (c.is_string ()) - id = c.string_value (); + id = c.string_value (); } - // FIXME -- also need to handle "stack" field in error - // structure, but that will require some more significant - // surgery on handle_message, error_with_id, etc. + // FIXME: also need to handle "stack" field in error structure, + // but that will require some more significant surgery on + // handle_message, error_with_id, etc. } else { @@ -1216,7 +1218,7 @@ } DEFUN (warning, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} warning (@var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} warning (@var{id}, @var{template}, @dots{})\n\ @deftypefnx {Built-in Function} {} warning (\"on\", @var{id})\n\ @@ -1307,8 +1309,7 @@ octave_value curr_state = val.contents ("state"); - // FIXME -- this might be better with a dictionary - // object. + // FIXME: this might be better with a dictionary object. octave_value curr_warning_states = symbol_table::varval (".saved_warning_states.", @@ -1373,7 +1374,7 @@ // handle the current setting. argc--; } - + if (arg2 == "all") { octave_map tmp; @@ -1479,9 +1480,9 @@ { if (ident(i).string_value () == arg2) { - // FIXME -- if state for "all" is - // same as arg1, we can simply remove the - // item from the list. + // FIXME: if state for "all" is same as arg1, + // we can simply remove the item + // from the list. state(i) = arg1; warning_options.assign ("state", state); @@ -1492,8 +1493,8 @@ if (! found) { - // FIXME -- if state for "all" is - // same as arg1, we don't need to do anything. + // FIXME: if state for "all" is same as arg1, + // we don't need to do anything. ident.resize (dim_vector (1, nel+1)); state.resize (dim_vector (1, nel+1)); @@ -1646,7 +1647,7 @@ } DEFUN (lasterror, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{lasterr} =} lasterror ()\n\ @deftypefnx {Built-in Function} {} lasterror (@var{err})\n\ @deftypefnx {Built-in Function} {} lasterror (\"reset\")\n\ @@ -1748,7 +1749,7 @@ if (! error_state && new_err.contains ("stack")) { - new_err_stack = + new_err_stack = new_err.getfield ("stack").scalar_map_value (); if (! error_state && new_err_stack.contains ("file")) @@ -1817,7 +1818,7 @@ } DEFUN (lasterr, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lasterr ()\n\ @deftypefnx {Built-in Function} {} lasterr (@var{msg})\n\ @deftypefnx {Built-in Function} {} lasterr (@var{msg}, @var{msgid})\n\ @@ -1868,7 +1869,7 @@ } DEFUN (lastwarn, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{msg}, @var{msgid}] =} lastwarn ()\n\ @deftypefnx {Built-in Function} {} lastwarn (@var{msg})\n\ @deftypefnx {Built-in Function} {} lastwarn (@var{msg}, @var{msgid})\n\ @@ -1915,7 +1916,7 @@ } DEFUN (usage, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} usage (@var{msg})\n\ Print the message @var{msg}, prefixed by the string @samp{usage: }, and\n\ set Octave's internal error state such that control will return to the\n\ @@ -1949,7 +1950,7 @@ } DEFUN (beep_on_error, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} beep_on_error ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} beep_on_error (@var{new_val})\n\ @deftypefnx {Built-in Function} {} beep_on_error (@var{new_val}, \"local\")\n\ @@ -1965,7 +1966,7 @@ } DEFUN (debug_on_error, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_error ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_error (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_error (@var{new_val}, \"local\")\n\ @@ -1984,7 +1985,7 @@ } DEFUN (debug_on_warning, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_warning ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_warning (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_warning (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/error.h +++ b/libinterp/corefcn/error.h @@ -37,7 +37,9 @@ extern OCTINTERP_API int warning_enabled (const std::string& id); -extern OCTINTERP_API void vmessage (const char *name, const char *fmt, va_list args); +extern OCTINTERP_API void +vmessage (const char *name, const char *fmt, va_list args); + extern OCTINTERP_API void message (const char *name, const char *fmt, ...); extern OCTINTERP_API void vusage (const char *fmt, va_list args); @@ -56,7 +58,8 @@ extern OCTINTERP_API void parse_error (const char *fmt, ...); extern OCTINTERP_API void -vmessage_with_id (const char *id, const char *name, const char *fmt, va_list args); +vmessage_with_id (const char *id, const char *name, + const char *fmt, va_list args); extern OCTINTERP_API void message_with_id (const char *id, const char *name, const char *fmt, ...);
--- a/libinterp/corefcn/event-queue.h +++ b/libinterp/corefcn/event-queue.h @@ -99,19 +99,19 @@ event_queue_safe (void) : event_queue () { } ~event_queue_safe (void) - { - while (! empty ()) - { - try - { - run_first (); - } - catch (...) // Yes, the black hole. Remember we're in a dtor. - { - gripe_exception (); - } - } - } + { + while (! empty ()) + { + try + { + run_first (); + } + catch (...) // Yes, the black hole. Remember we're in a dtor. + { + gripe_exception (); + } + } + } private:
--- a/libinterp/corefcn/fft.cc +++ b/libinterp/corefcn/fft.cc @@ -68,7 +68,8 @@ { n_points = NINTbig (dval); if (n_points < 0) - error ("%s: number of points (N) must be greater than zero", fcn); + error ("%s: number of points (N) must be greater than zero", + fcn); } } } @@ -82,7 +83,8 @@ if (xisnan (dval)) error ("%s: DIM cannot be NaN", fcn); else if (dval < 1 || dval > dims.length ()) - error ("%s: DIM must be a valid dimension along which to perform FFT", fcn); + error ("%s: DIM must be a valid dimension along which to perform FFT", + fcn); else // to be safe, cast it back to int since dim is an int dim = NINT (dval) - 1; @@ -198,7 +200,7 @@ DEFUN (fft, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fft (@var{x})\n\ @deftypefnx {Built-in Function} {} fft (@var{x}, @var{n})\n\ @deftypefnx {Built-in Function} {} fft (@var{x}, @var{n}, @var{dim})\n\ @@ -227,7 +229,7 @@ DEFUN (ifft, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ifft (@var{x})\n\ @deftypefnx {Built-in Function} {} ifft (@var{x}, @var{n})\n\ @deftypefnx {Built-in Function} {} ifft (@var{x}, @var{n}, @var{dim})\n\
--- a/libinterp/corefcn/fft2.cc +++ b/libinterp/corefcn/fft2.cc @@ -168,7 +168,7 @@ } DEFUN (fft2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fft2 (@var{A})\n\ @deftypefnx {Built-in Function} {} fft2 (@var{A}, @var{m}, @var{n})\n\ Compute the two-dimensional discrete Fourier transform of @var{A} using\n\ @@ -189,7 +189,7 @@ DEFUN (ifft2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ifft2 (@var{A})\n\ @deftypefnx {Built-in Function} {} ifft2 (@var{A}, @var{m}, @var{n})\n\ Compute the inverse two-dimensional discrete Fourier transform of @var{A}\n\
--- a/libinterp/corefcn/fftn.cc +++ b/libinterp/corefcn/fftn.cc @@ -75,7 +75,8 @@ if (xisnan (val(i,0))) error ("%s: SIZE has invalid NaN entries", fcn); else if (NINTbig (val(i,0)) < 0) - error ("%s: all dimensions in SIZE must be greater than zero", fcn); + error ("%s: all dimensions in SIZE must be greater than zero", + fcn); else { dims(i) = NINTbig(val(i,0)); @@ -150,7 +151,7 @@ } DEFUN (fftn, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fftn (@var{A})\n\ @deftypefnx {Built-in Function} {} fftn (@var{A}, @var{size})\n\ Compute the N-dimensional discrete Fourier transform of @var{A} using\n\ @@ -169,7 +170,7 @@ } DEFUN (ifftn, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ifftn (@var{A})\n\ @deftypefnx {Built-in Function} {} ifftn (@var{A}, @var{size})\n\ Compute the inverse N-dimensional discrete Fourier transform of @var{A}\n\
--- a/libinterp/corefcn/file-io.cc +++ b/libinterp/corefcn/file-io.cc @@ -109,8 +109,8 @@ // List of files to delete when we exit or crash. // -// FIXME -- this should really be static, but that causes -// problems on some systems. +// FIXME: this should really be static, +// but that causes problems on some systems. std::stack <std::string> tmp_files; void @@ -237,7 +237,7 @@ } DEFUN (fclose, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fclose (@var{fid})\n\ @deftypefnx {Built-in Function} {} fclose (\"all\")\n\ Close the specified file. If successful, @code{fclose} returns 0,\n\ @@ -259,7 +259,7 @@ } DEFUN (fclear, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fclear (@var{fid})\n\ Clear the stream state for the specified file.\n\ @seealso{fopen}\n\ @@ -285,7 +285,7 @@ } DEFUN (fflush, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fflush (@var{fid})\n\ Flush output to @var{fid}. This is useful for ensuring that all\n\ pending output makes it to the screen before some other event occurs.\n\ @@ -303,7 +303,7 @@ if (nargin == 1) { - // FIXME -- any way to avoid special case for stdout? + // FIXME: any way to avoid special case for stdout? int fid = octave_stream_list::get_file_number (args (0)); @@ -328,7 +328,7 @@ } DEFUN (fgetl, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{str} =} fgetl (@var{fid})\n\ @deftypefnx {Built-in Function} {@var{str} =} fgetl (@var{fid}, @var{len})\n\ Read characters from a file, stopping after a newline, or EOF,\n\ @@ -379,7 +379,7 @@ } DEFUN (fgets, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{str} =} fgets (@var{fid})\n\ @deftypefnx {Built-in Function} {@var{str} =} fgets (@var{fid}, @var{len})\n\ Read characters from a file, stopping after a newline, or EOF,\n\ @@ -430,7 +430,7 @@ } DEFUN (fskipl, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{nlines} =} fskipl (@var{fid})\n\ @deftypefnx {Built-in Function} {@var{nlines} =} fskipl (@var{fid}, @var{count})\n\ @deftypefnx {Built-in Function} {@var{nlines} =} fskipl (@var{fid}, Inf)\n\ @@ -540,7 +540,8 @@ { FILE *fptr = gnulib::fopen (fname.c_str (), mode.c_str ()); - retval = octave_stdiostream::create (fname, fptr, md, flt_fmt); + retval = octave_stdiostream::create (fname, fptr, md, + flt_fmt); if (! fptr) retval.error (gnulib::strerror (errno)); @@ -586,7 +587,7 @@ } DEFUN (fopen, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} fopen (@var{name}, @var{mode}, @var{arch})\n\ @deftypefnx {Built-in Function} {@var{fid_list} =} fopen (\"all\")\n\ @deftypefnx {Built-in Function} {[@var{file}, @var{mode}, @var{arch}] =} fopen (@var{fid})\n\ @@ -714,10 +715,10 @@ if (nargin > 0 && nargin < 4) { octave_value mode = (nargin == 2 || nargin == 3) - ? args(1) : octave_value ("r"); + ? args(1) : octave_value ("r"); octave_value arch = (nargin == 3) - ? args(2) : octave_value ("native"); + ? args(2) : octave_value ("native"); int fid = -1; @@ -743,7 +744,7 @@ } DEFUN (freport, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} freport ()\n\ Print a list of which files have been opened, and whether they are open\n\ for reading, writing, or both. For example:\n\ @@ -776,7 +777,7 @@ } DEFUN (frewind, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} frewind (@var{fid})\n\ Move the file pointer to the beginning of the file @var{fid}, returning\n\ 0 for success, and -1 if an error was encountered. It is equivalent to\n\ @@ -807,7 +808,7 @@ } DEFUN (fseek, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fseek (@var{fid}, @var{offset})\n\ @deftypefnx {Built-in Function} {} fseek (@var{fid}, @var{offset}, @var{origin})\n\ @deftypefnx {Built-in Function} {@var{status} =} fseek (@dots{})\n\ @@ -836,7 +837,7 @@ if (! error_state) { octave_value origin_arg = (nargin == 3) - ? args(2) : octave_value (-1.0); + ? args(2) : octave_value (-1.0); retval = os.seek (args(1), origin_arg); } @@ -848,7 +849,7 @@ } DEFUN (ftell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ftell (@var{fid})\n\ Return the position of the file pointer as the number of characters\n\ from the beginning of the file @var{fid}.\n\ @@ -873,7 +874,7 @@ } DEFUN (fprintf, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fprintf (@var{fid}, @var{template}, @dots{})\n\ This function is just like @code{printf}, except that the output is\n\ written to the stream @var{fid} instead of @code{stdout}.\n\ @@ -934,7 +935,7 @@ } DEFUN (printf, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} printf (@var{template}, @dots{})\n\ Print optional arguments under the control of the template string\n\ @var{template} to the stream @code{stdout} and return the number of\n\ @@ -984,7 +985,7 @@ } DEFUN (fputs, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fputs (@var{fid}, @var{string})\n\ Write a string to a file with no formatting.\n\ \n\ @@ -1012,7 +1013,7 @@ } DEFUN (puts, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} puts (@var{string})\n\ Write a string to the standard output with no formatting.\n\ \n\ @@ -1033,7 +1034,7 @@ } DEFUN (sprintf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sprintf (@var{template}, @dots{})\n\ This is like @code{printf}, except that the output is returned as a\n\ string. Unlike the C library function, which requires you to provide a\n\ @@ -1093,7 +1094,7 @@ } DEFUN (fscanf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{val}, @var{count}, @var{errmsg}] =} fscanf (@var{fid}, @var{template}, @var{size})\n\ @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}, @var{errmsg}] =} fscanf (@var{fid}, @var{template}, \"C\")\n\ In the first form, read from @var{fid} according to @var{template},\n\ @@ -1178,8 +1179,9 @@ octave_idx_type count = 0; Array<double> size = (nargin == 3) - ? args(2).vector_value () - : Array<double> (dim_vector (1, 1), lo_ieee_inf_value ()); + ? args(2).vector_value () + : Array<double> (dim_vector (1, 1), + lo_ieee_inf_value ()); if (! error_state) { @@ -1222,7 +1224,7 @@ } DEFUN (sscanf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{val}, @var{count}, @var{errmsg}, @var{pos}] =} sscanf (@var{string}, @var{template}, @var{size})\n\ @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}, @var{errmsg}] =} sscanf (@var{string}, @var{template}, \"C\")\n\ This is like @code{fscanf}, except that the characters are taken from the\n\ @@ -1283,15 +1285,15 @@ octave_idx_type count = 0; Array<double> size = (nargin == 3) - ? args(2).vector_value () - : Array<double> (dim_vector (1, 1), - lo_ieee_inf_value ()); + ? args(2).vector_value () + : Array<double> (dim_vector (1, 1), + lo_ieee_inf_value ()); octave_value tmp = os.scanf (args(1), size, count, who); if (! error_state) { - // FIXME -- is this the right thing to do? + // FIXME: is this the right thing to do? // Extract error message first, because getting // position will clear it. std::string errmsg = os.error (); @@ -1304,7 +1306,8 @@ } } else - ::error ("%s: format TEMPLATE must be a string", who.c_str ()); + ::error ("%s: format TEMPLATE must be a string", + who.c_str ()); } else ::error ("%s: unable to create temporary input buffer", @@ -1319,7 +1322,7 @@ } DEFUN (scanf, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{val}, @var{count}, @var{errmsg}] =} scanf (@var{template}, @var{size})\n\ @deftypefnx {Built-in Function} {[@var{v1}, @var{v2}, @dots{}, @var{count}, @var{errmsg}]] =} scanf (@var{template}, \"C\")\n\ This is equivalent to calling @code{fscanf} with @var{fid} = @code{stdin}.\n\ @@ -1400,7 +1403,7 @@ } DEFUN (fread, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{val}, @var{count}] =} fread (@var{fid}, @var{size}, @var{precision}, @var{skip}, @var{arch})\n\ Read binary data of type @var{precision} from the specified file ID\n\ @var{fid}.\n\ @@ -1661,7 +1664,7 @@ } DEFUN (fwrite, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{count} =} fwrite (@var{fid}, @var{data}, @var{precision}, @var{skip}, @var{arch})\n\ Write data in binary form of type @var{precision} to the specified file\n\ ID @var{fid}, returning the number of values successfully written to the\n\ @@ -1722,7 +1725,7 @@ } DEFUNX ("feof", Ffeof, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} feof (@var{fid})\n\ Return 1 if an end-of-file condition has been encountered for a given\n\ file and 0 otherwise. Note that it will only return 1 if the end of the\n\ @@ -1749,7 +1752,7 @@ } DEFUNX ("ferror", Fferror, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} ferror (@var{fid})\n\ @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} ferror (@var{fid}, \"clear\")\n\ Return 1 if an error condition has been encountered for the file ID\n\ @@ -1799,7 +1802,7 @@ } DEFUN (popen, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{fid} =} popen (@var{command}, @var{mode})\n\ Start a process and create a pipe. The name of the command to run is\n\ given by @var{command}. The file identifier corresponding to the input\n\ @@ -1874,7 +1877,7 @@ } DEFUNX ("pclose", Fpclose, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} pclose (@var{fid})\n\ Close a file identifier that was opened by @code{popen}. You may also\n\ use @code{fclose} for the same purpose.\n\ @@ -1893,7 +1896,7 @@ } DEFUNX ("tmpnam", Ftmpnam, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @c List other forms of function in documentation index\n\ @findex octave_tmp_file_name\n\ \n\ @@ -1941,7 +1944,7 @@ DEFALIAS (octave_tmp_file_name, tmpnam); DEFUN (tmpfile, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} tmpfile ()\n\ Return the file ID corresponding to a new temporary file with a unique\n\ name. The file is opened in binary read/write (@qcode{\"w+b\"}) mode.\n\ @@ -1992,7 +1995,7 @@ } DEFUN (mkstemp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{fid}, @var{name}, @var{msg}] =} mkstemp (@var{template}, @var{delete})\n\ Return the file ID corresponding to a new temporary file with a unique\n\ name created from @var{template}. The last six characters of @var{template}\n\ @@ -2107,7 +2110,7 @@ } DEFUNX ("umask", Fumask, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} umask (@var{mask})\n\ Set the permission mask for file creation. The parameter @var{mask}\n\ is an integer, interpreted as an octal number. If successful,\n\ @@ -2169,7 +2172,7 @@ } DEFUNX ("P_tmpdir", FP_tmpdir, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} P_tmpdir ()\n\ Return the default name of the directory for temporary files on\n\ this system. The name of this directory is system dependent.\n\ @@ -2191,7 +2194,7 @@ // this way for Matlab compatibility. DEFUNX ("SEEK_SET", FSEEK_SET, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} SEEK_SET ()\n\ @deftypefnx {Built-in Function} {} SEEK_CUR ()\n\ @deftypefnx {Built-in Function} {} SEEK_END ()\n\ @@ -2215,7 +2218,7 @@ } DEFUNX ("SEEK_CUR", FSEEK_CUR, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} SEEK_CUR ()\n\ Return the numerical value to pass to @code{fseek} to\n\ position the file pointer relative to the current position.\n\ @@ -2226,7 +2229,7 @@ } DEFUNX ("SEEK_END", FSEEK_END, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} SEEK_END ()\n\ Return the numerical value to pass to @code{fseek} to\n\ position the file pointer relative to the end of the file.\n\ @@ -2253,7 +2256,7 @@ } DEFUNX ("stdin", Fstdin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} stdin ()\n\ Return the numeric value corresponding to the standard input stream.\n\ When Octave is used interactively, this is filtered through the command\n\ @@ -2265,7 +2268,7 @@ } DEFUNX ("stdout", Fstdout, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} stdout ()\n\ Return the numeric value corresponding to the standard output stream.\n\ Data written to the standard output is normally filtered through the pager.\n\ @@ -2276,7 +2279,7 @@ } DEFUNX ("stderr", Fstderr, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} stderr ()\n\ Return the numeric value corresponding to the standard error stream.\n\ Even if paging is turned on, the standard error is not sent to the\n\
--- a/libinterp/corefcn/filter.cc +++ b/libinterp/corefcn/filter.cc @@ -49,7 +49,8 @@ filter (MArray<float>&, MArray<float>&, MArray<float>&, int dim); extern MArray<FloatComplex> -filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, int dim); +filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, + int dim); #endif template <class T> @@ -169,7 +170,9 @@ psi += si_offset; - for (octave_idx_type i = 0, idx = x_offset; i < x_len; i++, idx += x_stride) + for (octave_idx_type i = 0, idx = x_offset; + i < x_len; + i++, idx += x_stride) { py[idx] = psi[0] + pb[0] * px[idx]; @@ -202,7 +205,9 @@ psi += si_offset; - for (octave_idx_type i = 0, idx = x_offset; i < x_len; i++, idx += x_stride) + for (octave_idx_type i = 0, idx = x_offset; + i < x_len; + i++, idx += x_stride) { py[idx] = psi[0] + pb[0] * px[idx]; @@ -264,12 +269,11 @@ if (dim == x_dims.length ()) dim = 0; } - else - if (dim < 0 || dim > x_dims.length ()) - { - error ("filter: DIM must be a valid dimension"); - return MArray<T> (); - } + else if (dim < 0 || dim > x_dims.length ()) + { + error ("filter: DIM must be a valid dimension"); + return MArray<T> (); + } octave_idx_type a_len = a.length (); octave_idx_type b_len = b.length (); @@ -286,7 +290,7 @@ } DEFUN (filter, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {y =} filter (@var{b}, @var{a}, @var{x})\n\ @deftypefnx {Built-in Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si})\n\ @deftypefnx {Built-in Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, [], @var{dim})\n\ @@ -658,7 +662,8 @@ MArray<FloatComplex>&, int dim); template MArray<FloatComplex> -filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, int dim); +filter (MArray<FloatComplex>&, MArray<FloatComplex>&, MArray<FloatComplex>&, + int dim); /* %!shared a, b, x, r
--- a/libinterp/corefcn/find.cc +++ b/libinterp/corefcn/find.cc @@ -333,7 +333,7 @@ } DEFUN (find, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{idx} =} find (@var{x})\n\ @deftypefnx {Built-in Function} {@var{idx} =} find (@var{x}, @var{n})\n\ @deftypefnx {Built-in Function} {@var{idx} =} find (@var{x}, @var{n}, @var{direction})\n\
--- a/libinterp/corefcn/gammainc.cc +++ b/libinterp/corefcn/gammainc.cc @@ -33,7 +33,7 @@ #include "utils.h" DEFUN (gammainc, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} gammainc (@var{x}, @var{a})\n\ @deftypefnx {Mapping Function} {} gammainc (@var{x}, @var{a}, \"lower\")\n\ @deftypefnx {Mapping Function} {} gammainc (@var{x}, @var{a}, \"upper\")\n\ @@ -116,7 +116,8 @@ if (! error_state) retval = lower ? gammainc (x, a) - : static_cast<float>(1) - gammainc (x, a); + : static_cast<float>(1) + - gammainc (x, a); } else { @@ -124,7 +125,8 @@ if (! error_state) retval = lower ? gammainc (x, a) - : static_cast<float>(1) - gammainc (x, a); + : static_cast<float>(1) + - gammainc (x, a); } } } @@ -140,7 +142,8 @@ if (! error_state) retval = lower ? gammainc (x, a) - : static_cast<float>(1) - gammainc (x, a); + : static_cast<float>(1) + - gammainc (x, a); } else { @@ -148,7 +151,8 @@ if (! error_state) retval = lower ? gammainc (x, a) - : static_cast<float>(1) - gammainc (x, a); + : static_cast<float>(1) + - gammainc (x, a); } } } @@ -224,7 +228,7 @@ %! v3 = gammainc (x.*x, a); %! assert (v1, v3, sqrt (eps ("single"))); -%!assert (gammainc (single (0:4), single (0.5), "upper"), +%!assert (gammainc (single (0:4), single (0.5), "upper"), %! single (1)-gammainc (single (0:4), single (0.5)), %! single (1e-7)) */
--- a/libinterp/corefcn/gcd.cc +++ b/libinterp/corefcn/gcd.cc @@ -433,7 +433,7 @@ } DEFUN (gcd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{g} =} gcd (@var{a1}, @var{a2}, @dots{})\n\ @deftypefnx {Built-in Function} {[@var{g}, @var{v1}, @dots{}] =} gcd (@var{a1}, @var{a2}, @dots{})\n\ \n\
--- a/libinterp/corefcn/getgrent.cc +++ b/libinterp/corefcn/getgrent.cc @@ -63,7 +63,7 @@ } DEFUN (getgrent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{grp_struct} =} getgrent ()\n\ Return an entry from the group database, opening it if necessary.\n\ Once the end of data has been reached, @code{getgrent} returns 0.\n\ @@ -90,7 +90,7 @@ } DEFUN (getgrgid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{grp_struct} =} getgrgid (@var{gid}).\n\ Return the first entry from the group database with the group ID\n\ @var{gid}. If the group ID does not exist in the database,\n\ @@ -130,7 +130,7 @@ } DEFUN (getgrnam, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{grp_struct} =} getgrnam (@var{name})\n\ Return the first entry from the group database with the group name\n\ @var{name}. If the group name does not exist in the database,\n\ @@ -163,7 +163,7 @@ } DEFUN (setgrent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} setgrent ()\n\ Return the internal pointer to the beginning of the group database.\n\ @end deftypefn") @@ -189,7 +189,7 @@ } DEFUN (endgrent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} endgrent ()\n\ Close the group database.\n\ @end deftypefn")
--- a/libinterp/corefcn/getpwent.cc +++ b/libinterp/corefcn/getpwent.cc @@ -66,7 +66,7 @@ } DEFUN (getpwent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{pw_struct} =} getpwent ()\n\ Return a structure containing an entry from the password database,\n\ opening it if necessary. Once the end of the data has been reached,\n\ @@ -94,7 +94,7 @@ } DEFUN (getpwuid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{pw_struct} =} getpwuid (@var{uid}).\n\ Return a structure containing the first entry from the password database\n\ with the user ID @var{uid}. If the user ID does not exist in the\n\ @@ -134,7 +134,7 @@ } DEFUN (getpwnam, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{pw_struct} =} getpwnam (@var{name})\n\ Return a structure containing the first entry from the password database\n\ with the user name @var{name}. If the user name does not exist in the\n\ @@ -167,7 +167,7 @@ } DEFUN (setpwent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} setpwent ()\n\ Return the internal pointer to the beginning of the password database.\n\ @end deftypefn") @@ -193,7 +193,7 @@ } DEFUN (endpwent, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} endpwent ()\n\ Close the password database.\n\ @end deftypefn")
--- a/libinterp/corefcn/getrusage.cc +++ b/libinterp/corefcn/getrusage.cc @@ -60,7 +60,7 @@ // System resource functions. DEFUN (getrusage, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} getrusage ()\n\ Return a structure containing a number of statistics about the current\n\ Octave process. Not all fields are available on all systems. If it is\n\ @@ -124,7 +124,7 @@ octave_scalar_map m; octave_scalar_map tv_tmp; - // FIXME -- maybe encapsulate all of this in a liboctave class + // FIXME: maybe encapsulate all of this in a liboctave class #if defined (HAVE_GETRUSAGE) struct rusage ru;
--- a/libinterp/corefcn/givens.cc +++ b/libinterp/corefcn/givens.cc @@ -31,7 +31,7 @@ #include "oct-obj.h" DEFUN (givens, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{g} =} givens (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {[@var{c}, @var{s}] =} givens (@var{x}, @var{y})\n\ @tex\n\
--- a/libinterp/corefcn/gl-render.cc +++ b/libinterp/corefcn/gl-render.cc @@ -62,16 +62,16 @@ count (1) { } ~texture_rep (void) - { - if (valid) - glDeleteTextures (1, &id); - } + { + if (valid) + glDeleteTextures (1, &id); + } void bind (int mode) const - { if (valid) glBindTexture (mode, id); } + { if (valid) glBindTexture (mode, id); } void tex_coord (double q, double r) const - { if (valid) glTexCoord2d (q*tx, r*ty); } + { if (valid) glTexCoord2d (q*tx, r*ty); } GLuint id; int w, h; @@ -91,37 +91,37 @@ opengl_texture (const opengl_texture& tx) : rep (tx.rep) - { - rep->count++; - } + { + rep->count++; + } ~opengl_texture (void) - { - if (--rep->count == 0) - delete rep; - } + { + if (--rep->count == 0) + delete rep; + } opengl_texture& operator = (const opengl_texture& tx) - { - if (--rep->count == 0) - delete rep; - - rep = tx.rep; - rep->count++; - - return *this; - } + { + if (--rep->count == 0) + delete rep; + + rep = tx.rep; + rep->count++; + + return *this; + } static opengl_texture create (const octave_value& data); void bind (int mode = GL_TEXTURE_2D) const - { rep->bind (mode); } + { rep->bind (mode); } void tex_coord (double q, double r) const - { rep->tex_coord (q, r); } + { rep->tex_coord (q, r); } bool is_valid (void) const - { return rep->valid; } + { return rep->valid; } }; static int @@ -232,27 +232,27 @@ opengl_tesselator (void) : glu_tess (0), fill () { init (); } virtual ~opengl_tesselator (void) - { if (glu_tess) gluDeleteTess (glu_tess); } + { if (glu_tess) gluDeleteTess (glu_tess); } void begin_polygon (bool filled = true) - { - gluTessProperty (glu_tess, GLU_TESS_BOUNDARY_ONLY, - (filled ? GL_FALSE : GL_TRUE)); - fill = filled; - gluTessBeginPolygon (glu_tess, this); - } + { + gluTessProperty (glu_tess, GLU_TESS_BOUNDARY_ONLY, + (filled ? GL_FALSE : GL_TRUE)); + fill = filled; + gluTessBeginPolygon (glu_tess, this); + } void end_polygon (void) const - { gluTessEndPolygon (glu_tess); } + { gluTessEndPolygon (glu_tess); } void begin_contour (void) const - { gluTessBeginContour (glu_tess); } + { gluTessBeginContour (glu_tess); } void end_contour (void) const - { gluTessEndContour (glu_tess); } + { gluTessEndContour (glu_tess); } void add_vertex (double *loc, void *data) const - { gluTessVertex (glu_tess, loc, data); } + { gluTessVertex (glu_tess, loc, data); } protected: virtual void begin (GLenum /*type*/) { } @@ -267,47 +267,47 @@ virtual void edge_flag (GLboolean /*flag*/) { } virtual void error (GLenum err) - { ::error ("OpenGL tesselation error (%d)", err); } + { ::error ("OpenGL tesselation error (%d)", err); } virtual void init (void) - { - glu_tess = gluNewTess (); - - gluTessCallback (glu_tess, GLU_TESS_BEGIN_DATA, - reinterpret_cast<fcn> (tess_begin)); - gluTessCallback (glu_tess, GLU_TESS_END_DATA, - reinterpret_cast<fcn> (tess_end)); - gluTessCallback (glu_tess, GLU_TESS_VERTEX_DATA, - reinterpret_cast<fcn> (tess_vertex)); - gluTessCallback (glu_tess, GLU_TESS_COMBINE_DATA, - reinterpret_cast<fcn> (tess_combine)); - gluTessCallback (glu_tess, GLU_TESS_EDGE_FLAG_DATA, - reinterpret_cast<fcn> (tess_edge_flag)); - gluTessCallback (glu_tess, GLU_TESS_ERROR_DATA, - reinterpret_cast<fcn> (tess_error)); - } + { + glu_tess = gluNewTess (); + + gluTessCallback (glu_tess, GLU_TESS_BEGIN_DATA, + reinterpret_cast<fcn> (tess_begin)); + gluTessCallback (glu_tess, GLU_TESS_END_DATA, + reinterpret_cast<fcn> (tess_end)); + gluTessCallback (glu_tess, GLU_TESS_VERTEX_DATA, + reinterpret_cast<fcn> (tess_vertex)); + gluTessCallback (glu_tess, GLU_TESS_COMBINE_DATA, + reinterpret_cast<fcn> (tess_combine)); + gluTessCallback (glu_tess, GLU_TESS_EDGE_FLAG_DATA, + reinterpret_cast<fcn> (tess_edge_flag)); + gluTessCallback (glu_tess, GLU_TESS_ERROR_DATA, + reinterpret_cast<fcn> (tess_error)); + } bool is_filled (void) const { return fill; } private: static void CALLBACK tess_begin (GLenum type, void *t) - { reinterpret_cast<opengl_tesselator *> (t)->begin (type); } + { reinterpret_cast<opengl_tesselator *> (t)->begin (type); } static void CALLBACK tess_end (void *t) - { reinterpret_cast<opengl_tesselator *> (t)->end (); } + { reinterpret_cast<opengl_tesselator *> (t)->end (); } static void CALLBACK tess_vertex (void *v, void *t) - { reinterpret_cast<opengl_tesselator *> (t)->vertex (v); } + { reinterpret_cast<opengl_tesselator *> (t)->vertex (v); } static void CALLBACK tess_combine (GLdouble c[3], void *v[4], GLfloat w[4], void **out, void *t) - { reinterpret_cast<opengl_tesselator *> (t)->combine (c, v, w, out); } + { reinterpret_cast<opengl_tesselator *> (t)->combine (c, v, w, out); } static void CALLBACK tess_edge_flag (GLboolean flag, void *t) - { reinterpret_cast<opengl_tesselator *> (t)->edge_flag (flag); } + { reinterpret_cast<opengl_tesselator *> (t)->edge_flag (flag); } static void CALLBACK tess_error (GLenum err, void *t) - { reinterpret_cast<opengl_tesselator *> (t)->error (err); } + { reinterpret_cast<opengl_tesselator *> (t)->error (err); } private: @@ -355,43 +355,43 @@ vertex_data_rep *rep; vertex_data_rep *nil_rep (void) const - { - static vertex_data_rep *nr = new vertex_data_rep (); - - return nr; - } + { + static vertex_data_rep *nr = new vertex_data_rep (); + + return nr; + } public: vertex_data (void) : rep (nil_rep ()) - { rep->count++; } + { rep->count++; } vertex_data (const vertex_data& v) : rep (v.rep) - { rep->count++; } + { rep->count++; } vertex_data (const Matrix& c, const Matrix& col, const Matrix& n, double a, float as, float ds, float ss, float se) : rep (new vertex_data_rep (c, col, n, a, as, ds, ss, se)) - { } + { } vertex_data (vertex_data_rep *new_rep) : rep (new_rep) { } ~vertex_data (void) - { - if (--rep->count == 0) - delete rep; - } + { + if (--rep->count == 0) + delete rep; + } vertex_data& operator = (const vertex_data& v) - { - if (--rep->count == 0) - delete rep; - - rep = v.rep; - rep->count++; - - return *this; - } + { + if (--rep->count == 0) + delete rep; + + rep = v.rep; + rep->count++; + + return *this; + } vertex_data_rep *get_rep (void) const { return rep; } }; @@ -408,118 +408,118 @@ protected: void begin (GLenum type) - { - //printf ("patch_tesselator::begin (%d)\n", type); - first = true; - - if (color_mode == 2 || light_mode == 2) - glShadeModel (GL_SMOOTH); - else - glShadeModel (GL_FLAT); - - if (is_filled ()) - renderer->set_polygon_offset (true, 1+index); - - glBegin (type); - } + { + //printf ("patch_tesselator::begin (%d)\n", type); + first = true; + + if (color_mode == 2 || light_mode == 2) + glShadeModel (GL_SMOOTH); + else + glShadeModel (GL_FLAT); + + if (is_filled ()) + renderer->set_polygon_offset (true, 1+index); + + glBegin (type); + } void end (void) - { - //printf ("patch_tesselator::end\n"); - glEnd (); - renderer->set_polygon_offset (false); - } + { + //printf ("patch_tesselator::end\n"); + glEnd (); + renderer->set_polygon_offset (false); + } void vertex (void *data) - { - vertex_data::vertex_data_rep *v - = reinterpret_cast<vertex_data::vertex_data_rep *> (data); - //printf ("patch_tesselator::vertex (%g, %g, %g)\n", v->coords(0), v->coords(1), v->coords(2)); - - // FIXME: why did I need to keep the first vertex of the face - // in JHandles? I think it's related to the fact that the - // tessellation process might re-order the vertices, such that - // the first one you get here might not be the first one of the face; - // but I can't figure out the actual reason. - if (color_mode > 0 && (first || color_mode == 2)) - { - Matrix col = v->color; - - if (col.numel () == 3) - { - glColor3dv (col.data ()); - if (light_mode > 0) - { - float buf[4] = { 0, 0, 0, 1 }; - - for (int k = 0; k < 3; k++) - buf[k] = (v->ambient * col(k)); - glMaterialfv (LIGHT_MODE, GL_AMBIENT, buf); - - for (int k = 0; k < 3; k++) - buf[k] = (v->diffuse * col(k)); - glMaterialfv (LIGHT_MODE, GL_AMBIENT, buf); - } - } - } - - if (light_mode > 0 && (first || light_mode == 2)) - glNormal3dv (v->normal.data ()); - - glVertex3dv (v->coords.data ()); - - first = false; - } + { + vertex_data::vertex_data_rep *v + = reinterpret_cast<vertex_data::vertex_data_rep *> (data); + //printf ("patch_tesselator::vertex (%g, %g, %g)\n", v->coords(0), v->coords(1), v->coords(2)); + + // FIXME: why did I need to keep the first vertex of the face + // in JHandles? I think it's related to the fact that the + // tessellation process might re-order the vertices, such that + // the first one you get here might not be the first one of the face; + // but I can't figure out the actual reason. + if (color_mode > 0 && (first || color_mode == 2)) + { + Matrix col = v->color; + + if (col.numel () == 3) + { + glColor3dv (col.data ()); + if (light_mode > 0) + { + float buf[4] = { 0, 0, 0, 1 }; + + for (int k = 0; k < 3; k++) + buf[k] = (v->ambient * col(k)); + glMaterialfv (LIGHT_MODE, GL_AMBIENT, buf); + + for (int k = 0; k < 3; k++) + buf[k] = (v->diffuse * col(k)); + glMaterialfv (LIGHT_MODE, GL_AMBIENT, buf); + } + } + } + + if (light_mode > 0 && (first || light_mode == 2)) + glNormal3dv (v->normal.data ()); + + glVertex3dv (v->coords.data ()); + + first = false; + } void combine (GLdouble xyz[3], void *data[4], GLfloat w[4], void **out_data) - { - //printf ("patch_tesselator::combine\n"); - - vertex_data::vertex_data_rep *v[4]; - int vmax = 4; - - for (int i = 0; i < 4; i++) - { - v[i] = reinterpret_cast<vertex_data::vertex_data_rep *> (data[i]); - - if (vmax == 4 && ! v[i]) - vmax = i; - } - - Matrix vv (1, 3, 0.0); - Matrix cc; - Matrix nn (1, 3, 0.0); - double aa = 0.0; - - vv(0) = xyz[0]; - vv(1) = xyz[1]; - vv(2) = xyz[2]; - - if (v[0]->color.numel ()) - { - cc.resize (1, 3, 0.0); - for (int ic = 0; ic < 3; ic++) - for (int iv = 0; iv < vmax; iv++) - cc(ic) += (w[iv] * v[iv]->color (ic)); - } - - if (v[0]->normal.numel () > 0) - { - for (int in = 0; in < 3; in++) - for (int iv = 0; iv < vmax; iv++) - nn(in) += (w[iv] * v[iv]->normal (in)); - } - - for (int iv = 0; iv < vmax; iv++) - aa += (w[iv] * v[iv]->alpha); - - vertex_data new_v (vv, cc, nn, aa, v[0]->ambient, v[0]->diffuse, - v[0]->specular, v[0]->specular_exp); - tmp_vdata.push_back (new_v); - - *out_data = new_v.get_rep (); - } + { + //printf ("patch_tesselator::combine\n"); + + vertex_data::vertex_data_rep *v[4]; + int vmax = 4; + + for (int i = 0; i < 4; i++) + { + v[i] = reinterpret_cast<vertex_data::vertex_data_rep *> (data[i]); + + if (vmax == 4 && ! v[i]) + vmax = i; + } + + Matrix vv (1, 3, 0.0); + Matrix cc; + Matrix nn (1, 3, 0.0); + double aa = 0.0; + + vv(0) = xyz[0]; + vv(1) = xyz[1]; + vv(2) = xyz[2]; + + if (v[0]->color.numel ()) + { + cc.resize (1, 3, 0.0); + for (int ic = 0; ic < 3; ic++) + for (int iv = 0; iv < vmax; iv++) + cc(ic) += (w[iv] * v[iv]->color (ic)); + } + + if (v[0]->normal.numel () > 0) + { + for (int in = 0; in < 3; in++) + for (int iv = 0; iv < vmax; iv++) + nn(in) += (w[iv] * v[iv]->normal (in)); + } + + for (int iv = 0; iv < vmax; iv++) + aa += (w[iv] * v[iv]->alpha); + + vertex_data new_v (vv, cc, nn, aa, v[0]->ambient, v[0]->diffuse, + v[0]->specular, v[0]->specular_exp); + tmp_vdata.push_back (new_v); + + *out_data = new_v.get_rep (); + } private: @@ -600,7 +600,7 @@ const figure::properties& figProps = dynamic_cast<const figure::properties&> (fig.get_properties ()); - // Initialize OpenGL context + // Initialize OpenGL context init_gl_context (figProps.is___enhanced__ (), props.get_backgroundcolor_rgb ()); @@ -996,7 +996,8 @@ std::string gridstyle = props.get_gridlinestyle (); std::string minorgridstyle = props.get_minorgridlinestyle (); bool do_xgrid = (props.is_xgrid () && (gridstyle != "none")); - bool do_xminorgrid = (props.is_xminorgrid () && (minorgridstyle != "none")); + bool do_xminorgrid = (props.is_xminorgrid () + && (minorgridstyle != "none")); bool do_xminortick = props.is_xminortick (); Matrix xticks = xform.xscale (props.get_xtick ().matrix_value ()); Matrix xmticks = xform.xscale (props.get_xmtick ().matrix_value ()); @@ -1103,7 +1104,8 @@ std::string gridstyle = props.get_gridlinestyle (); std::string minorgridstyle = props.get_minorgridlinestyle (); bool do_ygrid = (props.is_ygrid () && (gridstyle != "none")); - bool do_yminorgrid = (props.is_yminorgrid () && (minorgridstyle != "none")); + bool do_yminorgrid = (props.is_yminorgrid () + && (minorgridstyle != "none")); bool do_yminortick = props.is_yminortick (); Matrix yticks = xform.yscale (props.get_ytick ().matrix_value ()); Matrix ymticks = xform.yscale (props.get_ymtick ().matrix_value ()); @@ -1201,7 +1203,8 @@ std::string gridstyle = props.get_gridlinestyle (); std::string minorgridstyle = props.get_minorgridlinestyle (); bool do_zgrid = (props.is_zgrid () && (gridstyle != "none")); - bool do_zminorgrid = (props.is_zminorgrid () && (minorgridstyle != "none")); + bool do_zminorgrid = (props.is_zminorgrid () + && (minorgridstyle != "none")); bool do_zminortick = props.is_zminortick (); Matrix zticks = xform.zscale (props.get_ztick ().matrix_value ()); Matrix zmticks = xform.zscale (props.get_zmtick ().matrix_value ()); @@ -1403,10 +1406,10 @@ if (x_max > floatmax || y_max > floatmax || z_max > floatmax || x_min < -floatmax || y_min < -floatmax || z_min < -floatmax) - { - warning ("gl-render: data values greater than float capacity. (1) Scale data, or (2) Use gnuplot"); - return; - } + { + warning ("gl-render: data values greater than float capacity. (1) Scale data, or (2) Use gnuplot"); + return; + } setup_opengl_transformation (props); @@ -1436,7 +1439,9 @@ Matrix z = xform.zscale (props.get_zdata ().matrix_value ()); bool has_z = (z.numel () > 0); - int n = static_cast<int> (std::min (std::min (x.numel (), y.numel ()), (has_z ? z.numel () : std::numeric_limits<int>::max ()))); + int n = static_cast<int> (std::min (std::min (x.numel (), y.numel ()), + (has_z ? z.numel () + : std::numeric_limits<int>::max ()))); octave_uint8 clip_mask = (props.is_clipping () ? 0x7F : 0x40), clip_ok (0x40); std::vector<octave_uint8> clip (n); @@ -1584,7 +1589,8 @@ int ea_mode = (props.edgealpha_is_double () ? 0 : (props.edgealpha_is ("flat") ? 1 : 2)); - Matrix fcolor = (fc_mode == 3 ? Matrix (1, 3, 1.0) : props.get_facecolor_rgb ()); + Matrix fcolor = (fc_mode == 3 ? Matrix (1, 3, 1.0) + : props.get_facecolor_rgb ()); Matrix ecolor = props.get_edgecolor_rgb (); float as = props.get_ambientstrength (); @@ -1705,7 +1711,8 @@ // Vertex 1 if (fc_mode == 3) - tex.tex_coord (double (i-1) / (zc-1), double (j-1) / (zr-1)); + tex.tex_coord (double (i-1) / (zc-1), + double (j-1) / (zr-1)); else if (fc_mode > 0) { // FIXME: is there a smarter way to do this? @@ -1729,7 +1736,9 @@ d = sqrt (n(j-1,i-1,0) * n(j-1,i-1,0) + n(j-1,i-1,1) * n(j-1,i-1,1) + n(j-1,i-1,2) * n(j-1,i-1,2)); - glNormal3d (n(j-1,i-1,0)/d, n(j-1,i-1,1)/d, n(j-1,i-1,2)/d); + glNormal3d (n(j-1,i-1,0)/d, + n(j-1,i-1,1)/d, + n(j-1,i-1,2)/d); } glVertex3d (x(j1,i-1), y(j-1,i1), z(j-1,i-1)); @@ -2276,7 +2285,7 @@ } vdata[i+j*fr] = - vertex_data (vv, cc, nn, aa, as, ds, ss, se); + vertex_data (vv, cc, nn, aa, as, ds, ss, se); } if (fl_mode > 0 || el_mode > 0) @@ -2387,7 +2396,8 @@ { if (! clip(int (f(i,j) - 1))) { - vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); + vertex_data::vertex_data_rep *vv + = vdata[i+j*fr].get_rep (); const Matrix m = vv->coords; if (! flag) { @@ -2413,7 +2423,8 @@ for (int j = 0; j < count_f(i); j++) { - vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep (); + vertex_data::vertex_data_rep *vv + = vdata[i+j*fr].get_rep (); tess.add_vertex (vv->coords.fortran_vec (), vv); } @@ -2434,8 +2445,9 @@ } } - if (! props.marker_is ("none") && - ! (props.markeredgecolor_is ("none") && props.markerfacecolor_is ("none"))) + if (! props.marker_is ("none") + && ! (props.markeredgecolor_is ("none") + && props.markerfacecolor_is ("none"))) { bool do_edge = ! props.markeredgecolor_is ("none"); bool do_face = ! props.markerfacecolor_is ("none"); @@ -2455,11 +2467,11 @@ // Single color specifications, we can simplify a little bit if (mfcolor.numel () == 0 - && ! props.markerfacecolor_is ("none")) + && ! props.markerfacecolor_is ("none")) mfcolor = mc; if (mecolor.numel () == 0 - && ! props.markeredgecolor_is ("none")) + && ! props.markeredgecolor_is ("none")) mecolor = mc; } else @@ -2467,7 +2479,7 @@ if (c.numel () == 0) c = props.get_color_data ().matrix_value (); has_markerfacecolor = ((c.numel () > 0) - && (c.rows () == f.rows ())); + && (c.rows () == f.rows ())); } } @@ -2494,9 +2506,9 @@ } Matrix lc = (do_edge ? (mecolor.numel () == 0 ? cc : mecolor) - : Matrix ()); + : Matrix ()); Matrix fc = (do_face ? (mfcolor.numel () == 0 ? cc : mfcolor) - : Matrix ()); + : Matrix ()); draw_marker (v(idx,0), v(idx,1), (has_z ? v(idx,2) : 0), lc, fc); } @@ -2621,7 +2633,7 @@ { GLfloat vp[4]; glGetFloatv (GL_VIEWPORT, vp); - // FIXME -- actually add the code to do it! + // FIXME: actually add the code to do it! } @@ -3069,8 +3081,8 @@ Matrix opengl_renderer::render_text (const std::string& txt, - double x, double y, double z, - int halign, int valign, double rotation) + double x, double y, double z, + int halign, int valign, double rotation) { #if HAVE_FREETYPE if (txt.empty ())
--- a/libinterp/corefcn/gl2ps-renderer.cc +++ b/libinterp/corefcn/gl2ps-renderer.cc @@ -71,10 +71,11 @@ while (state == GL2PS_OVERFLOW) { - // For LaTeX output the fltk print process uses two drawnow() commands. - // The first one is for the pdf/ps/eps graph to be included. The print_cmd - // is saved as old_print_cmd. Then the second drawnow() outputs the tex-file - // and the graphic filename to be included is extracted from old_print_cmd. + // For LaTeX output the fltk print process uses 2 drawnow() commands. + // The first one is for the pdf/ps/eps graph to be included. The + // print_cmd is saved as old_print_cmd. Then the second drawnow() + // outputs the tex-file and the graphic filename to be included is + // extracted from old_print_cmd. std::string include_graph; std::size_t found_redirect = old_print_cmd.find (">"); if (found_redirect != std::string::npos) @@ -85,7 +86,8 @@ if (n_begin != std::string::npos) { std::size_t n_end = include_graph.find_last_not_of (" "); - include_graph = include_graph.substr (n_begin, n_end - n_begin + 1); + include_graph = include_graph.substr (n_begin, + n_end - n_begin + 1); } else include_graph = "foobar-inc"; @@ -183,7 +185,7 @@ else fontname = "Helvetica"; - // FIXME -- add support for bold and italic + // FIXME: add support for bold and italic } template <typename T>
--- a/libinterp/corefcn/gl2ps-renderer.h +++ b/libinterp/corefcn/gl2ps-renderer.h @@ -32,8 +32,7 @@ { public: glps_renderer (FILE *_fp, const std::string& _term) - : opengl_renderer () , fp (_fp), term (_term), - fontsize (), fontname () { } + : opengl_renderer () , fp (_fp), term (_term), fontsize (), fontname () { } ~glps_renderer (void) { } @@ -45,7 +44,6 @@ double x, double y, double z, int halign, int valign, double rotation = 0.0); - void set_font (const base_properties& props); void draw_text (const text::properties& props);
--- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -137,7 +137,7 @@ { Matrix cmap (64, 3, 0.0); - // Produce X in the same manner as linspace so that + // Produce X in the same manner as linspace so that // jet_colormap and jet.m produce *exactly* the same result. double delta = 1.0 / 63.0; @@ -451,7 +451,7 @@ double f = 0.0; - // FIXME -- this assumes the system font is Helvetica 10pt + // FIXME: this assumes the system font is Helvetica 10pt // (for which "x" requires 6x12 pixels at 74.951 pixels/inch) f = 12.0 * res / 74.951; @@ -579,7 +579,7 @@ if (ax.valid_object ()) { const axes::properties& ax_props = - dynamic_cast<const axes::properties&> (ax.get_properties ()); + dynamic_cast<const axes::properties&> (ax.get_properties ()); graphics_xform ax_xform = ax_props.get_transform (); bool is_rectangle = (pos.numel () == 4); Matrix ax_bbox = ax_props.get_boundingbox (true), @@ -620,10 +620,13 @@ { if (is_rectangle) { - ColumnVector v1 = ax_xform.untransform (retval(0) + ax_bbox(0) - 1, - ax_bbox(1) + ax_bbox(3) - retval(1) + 1), - v2 = ax_xform.untransform (retval(0) + retval(2) + ax_bbox(0) - 1, - ax_bbox(1) + ax_bbox(3) - (retval(1) + retval(3)) + 1); + ColumnVector v1, v2; + v1 = ax_xform.untransform ( + retval(0) + ax_bbox(0) - 1, + ax_bbox(1) + ax_bbox(3) - retval(1) + 1); + v2 = ax_xform.untransform ( + retval(0) + retval(2) + ax_bbox(0) - 1, + ax_bbox(1) + ax_bbox(3) - (retval(1) + retval(3)) + 1); retval.resize (1, 4); @@ -634,8 +637,10 @@ } else { - ColumnVector v = ax_xform.untransform (retval(0) + ax_bbox(0) - 1, - ax_bbox(1) + ax_bbox(3) - retval(1) + 1); + ColumnVector v; + v = ax_xform.untransform ( + retval(0) + ax_bbox(0) - 1, + ax_bbox(1) + ax_bbox(3) - retval(1) + 1); retval.resize (1, 3); @@ -658,7 +663,8 @@ { graphics_object obj = gh_manager::get_object (0); Matrix sz = obj.get ("screensize").matrix_value (); - return convert_position (sz, obj.get ("units").string_value (), "pixels", sz.extract_n (0, 2, 1, 2)).extract_n (0, 2, 1, 2); + return convert_position (sz, obj.get ("units").string_value (), "pixels", + sz.extract_n (0, 2, 1, 2)).extract_n (0, 2, 1, 2); } static void @@ -1120,7 +1126,7 @@ } else error ("invalid value for color property \"%s\"", - get_name ().c_str ()); + get_name ().c_str ()); } else if (val.is_numeric_type ()) { @@ -1141,7 +1147,7 @@ } else error ("invalid value for color property \"%s\"", - get_name ().c_str ()); + get_name ().c_str ()); } else error ("invalid value for color property \"%s\"", @@ -1320,21 +1326,29 @@ if (data.is_integer_type ()) { if (data.is_int8_type ()) - get_array_limits (data.int8_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.int8_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_uint8_type ()) - get_array_limits (data.uint8_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.uint8_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_int16_type ()) - get_array_limits (data.int16_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.int16_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_uint16_type ()) - get_array_limits (data.uint16_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.uint16_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_int32_type ()) - get_array_limits (data.int32_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.int32_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_uint32_type ()) - get_array_limits (data.uint32_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.uint32_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_int64_type ()) - get_array_limits (data.int64_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.int64_array_value (), + xmin, xmax, xminp, xmaxp); else if (data.is_uint64_type ()) - get_array_limits (data.uint64_array_value (), xmin, xmax, xminp, xmaxp); + get_array_limits (data.uint64_array_value (), + xmin, xmax, xminp, xmaxp); } else get_array_limits (data.array_value (), xmin, xmax, xminp, xmaxp); @@ -1497,8 +1511,8 @@ } else if (type.compare ("any")) { - octave_value val = - (args.length () > 0 ? args(0) : octave_value (Matrix ())); + octave_value val = args.length () > 0 ? args(0) + : octave_value (Matrix ()); retval = property (new any_property (name, h, val)); } @@ -1554,8 +1568,8 @@ { retval.set (args(0)); - // FIXME -- additional argument could define constraints, - // but is this really useful? + // FIXME: additional argument could define constraints, + // but is this really useful? } } else if (type.compare ("color")) @@ -1588,12 +1602,12 @@ graphics_object go; std::map<caseless_str, graphics_object>::const_iterator it = - dprop_obj_map.find (go_name); + dprop_obj_map.find (go_name); if (it == dprop_obj_map.end ()) { base_graphics_object *bgo = - make_graphics_object_from_type (go_name); + make_graphics_object_from_type (go_name); if (bgo) { @@ -1750,12 +1764,13 @@ if (offset > 0) { - // FIXME -- should we validate property names and values here? + // FIXME: should we validate property names and values here? std::string pname = name.substr (offset); std::transform (pfx.begin (), pfx.end (), pfx.begin (), tolower); - std::transform (pname.begin (), pname.end (), pname.begin (), tolower); + std::transform (pname.begin (), pname.end (), pname.begin (), + tolower); bool has_property = false; if (pfx == "axes") @@ -1891,7 +1906,8 @@ std::string pname = name.substr (offset); std::transform (pfx.begin (), pfx.end (), pfx.begin (), tolower); - std::transform (pname.begin (), pname.end (), pname.begin (), tolower); + std::transform (pname.begin (), pname.end (), pname.begin (), + tolower); plist_map_const_iterator p = find (pfx); @@ -1983,7 +1999,7 @@ if (names.numel () != values.columns ()) { error ("set: number of names must match number of value columns (%d != %d)", - names.numel (), values.columns ()); + names.numel (), values.columns ()); } octave_idx_type k = names.columns (); @@ -2055,7 +2071,7 @@ caseless_str name = m.keys ()[p]; octave_value val = octave_value (m.contents (name).elem (m.numel () - 1)); - + set_value_or_default (name, val); if (error_state) @@ -2176,7 +2192,7 @@ } else { - // Matlab specifically uses "\default" to escape string setting + // Matlab specifically uses "\default" to escape string setting if (tval.compare ("\\default") == 0) rep->set (name, "default"); else if (tval.compare ("\\factory") == 0) @@ -2293,7 +2309,8 @@ handle_map.erase (p); if (h.value () < 0) - handle_free_list.insert (std::ceil (h.value ()) - make_handle_fraction ()); + handle_free_list.insert + (std::ceil (h.value ()) - make_handle_fraction ()); } else error ("graphics_handle::free: invalid object %g", h.value ()); @@ -2487,7 +2504,7 @@ void gh_manager::do_close_all_figures (void) { - // FIXME -- should we process or discard pending events? + // FIXME: should we process or discard pending events? event_queue.clear (); @@ -2659,7 +2676,8 @@ { octave_value retval; - std::map<caseless_str, property, cmp_caseless_str>::const_iterator it = all_props.find (name); + std::map<caseless_str, property, cmp_caseless_str>::const_iterator it = + all_props.find (name); if (it != all_props.end ()) retval = it->second.get (); @@ -2674,8 +2692,8 @@ { octave_scalar_map m; - for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator it = all_props.begin (); - it != all_props.end (); ++it) + for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator + it = all_props.begin (); it != all_props.end (); ++it) if (all || ! it->second.is_hidden ()) m.assign (it->second.get_name (), it->second.get ()); @@ -2703,7 +2721,8 @@ base_properties::set_dynamic (const caseless_str& pname, const octave_value& val) { - std::map<caseless_str, property, cmp_caseless_str>::iterator it = all_props.find (pname); + std::map<caseless_str, property, cmp_caseless_str>::iterator it = + all_props.find (pname); if (it != all_props.end ()) it->second.set (val); @@ -2721,7 +2740,8 @@ property base_properties::get_property_dynamic (const caseless_str& name) { - std::map<caseless_str, property, cmp_caseless_str>::const_iterator it = all_props.find (name); + std::map<caseless_str, property, cmp_caseless_str>::const_iterator it = + all_props.find (name); if (it == all_props.end ()) { @@ -2911,7 +2931,7 @@ for (octave_map::const_iterator pa = m.begin (); pa != m.end (); pa++) { - // FIXME -- there has to be a better way. I think we want to + // FIXME: there has to be a better way. I think we want to // ask whether it is OK to delete the listener for the given // property. How can we know in advance that it will be OK? @@ -3723,49 +3743,71 @@ typ = "uslegal"; else if (std::abs (sz(0) - 11.0) + std::abs (sz(1) - 17.0) < tol) typ = "tabloid"; - else if (std::abs (sz(0) - 841.0 * mm2in) + std::abs (sz(1) - 1198.0 * mm2in) < tol) + else if (std::abs (sz(0) - 841.0 * mm2in) + + std::abs (sz(1) - 1198.0 * mm2in) < tol) typ = "a0"; - else if (std::abs (sz(0) - 594.0 * mm2in) + std::abs (sz(1) - 841.0 * mm2in) < tol) + else if (std::abs (sz(0) - 594.0 * mm2in) + + std::abs (sz(1) - 841.0 * mm2in) < tol) typ = "a1"; - else if (std::abs (sz(0) - 420.0 * mm2in) + std::abs (sz(1) - 594.0 * mm2in) < tol) + else if (std::abs (sz(0) - 420.0 * mm2in) + + std::abs (sz(1) - 594.0 * mm2in) < tol) typ = "a2"; - else if (std::abs (sz(0) - 297.0 * mm2in) + std::abs (sz(1) - 420.0 * mm2in) < tol) + else if (std::abs (sz(0) - 297.0 * mm2in) + + std::abs (sz(1) - 420.0 * mm2in) < tol) typ = "a3"; - else if (std::abs (sz(0) - 210.0 * mm2in) + std::abs (sz(1) - 297.0 * mm2in) < tol) + else if (std::abs (sz(0) - 210.0 * mm2in) + + std::abs (sz(1) - 297.0 * mm2in) < tol) typ = "a4"; - else if (std::abs (sz(0) - 148.0 * mm2in) + std::abs (sz(1) - 210.0 * mm2in) < tol) + else if (std::abs (sz(0) - 148.0 * mm2in) + + std::abs (sz(1) - 210.0 * mm2in) < tol) typ = "a5"; - else if (std::abs (sz(0) - 1029.0 * mm2in) + std::abs (sz(1) - 1456.0 * mm2in) < tol) + else if (std::abs (sz(0) - 1029.0 * mm2in) + + std::abs (sz(1) - 1456.0 * mm2in) < tol) typ = "b0"; - else if (std::abs (sz(0) - 728.0 * mm2in) + std::abs (sz(1) - 1028.0 * mm2in) < tol) + else if (std::abs (sz(0) - 728.0 * mm2in) + + std::abs (sz(1) - 1028.0 * mm2in) < tol) typ = "b1"; - else if (std::abs (sz(0) - 514.0 * mm2in) + std::abs (sz(1) - 728.0 * mm2in) < tol) + else if (std::abs (sz(0) - 514.0 * mm2in) + + std::abs (sz(1) - 728.0 * mm2in) < tol) typ = "b2"; - else if (std::abs (sz(0) - 364.0 * mm2in) + std::abs (sz(1) - 514.0 * mm2in) < tol) + else if (std::abs (sz(0) - 364.0 * mm2in) + + std::abs (sz(1) - 514.0 * mm2in) < tol) typ = "b3"; - else if (std::abs (sz(0) - 257.0 * mm2in) + std::abs (sz(1) - 364.0 * mm2in) < tol) + else if (std::abs (sz(0) - 257.0 * mm2in) + + std::abs (sz(1) - 364.0 * mm2in) < tol) typ = "b4"; - else if (std::abs (sz(0) - 182.0 * mm2in) + std::abs (sz(1) - 257.0 * mm2in) < tol) + else if (std::abs (sz(0) - 182.0 * mm2in) + + std::abs (sz(1) - 257.0 * mm2in) < tol) typ = "b5"; - else if (std::abs (sz(0) - 9.0) + std::abs (sz(1) - 12.0) < tol) + else if (std::abs (sz(0) - 9.0) + + std::abs (sz(1) - 12.0) < tol) typ = "arch-a"; - else if (std::abs (sz(0) - 12.0) + std::abs (sz(1) - 18.0) < tol) + else if (std::abs (sz(0) - 12.0) + + std::abs (sz(1) - 18.0) < tol) typ = "arch-b"; - else if (std::abs (sz(0) - 18.0) + std::abs (sz(1) - 24.0) < tol) + else if (std::abs (sz(0) - 18.0) + + std::abs (sz(1) - 24.0) < tol) typ = "arch-c"; - else if (std::abs (sz(0) - 24.0) + std::abs (sz(1) - 36.0) < tol) + else if (std::abs (sz(0) - 24.0) + + std::abs (sz(1) - 36.0) < tol) typ = "arch-d"; - else if (std::abs (sz(0) - 36.0) + std::abs (sz(1) - 48.0) < tol) + else if (std::abs (sz(0) - 36.0) + + std::abs (sz(1) - 48.0) < tol) typ = "arch-e"; - else if (std::abs (sz(0) - 8.5) + std::abs (sz(1) - 11.0) < tol) + else if (std::abs (sz(0) - 8.5) + + std::abs (sz(1) - 11.0) < tol) typ = "a"; - else if (std::abs (sz(0) - 11.0) + std::abs (sz(1) - 17.0) < tol) + else if (std::abs (sz(0) - 11.0) + + std::abs (sz(1) - 17.0) < tol) typ = "b"; - else if (std::abs (sz(0) - 17.0) + std::abs (sz(1) - 22.0) < tol) + else if (std::abs (sz(0) - 17.0) + + std::abs (sz(1) - 22.0) < tol) typ = "c"; - else if (std::abs (sz(0) - 22.0) + std::abs (sz(1) - 34.0) < tol) + else if (std::abs (sz(0) - 22.0) + + std::abs (sz(1) - 34.0) < tol) typ = "d"; - else if (std::abs (sz(0) - 34.0) + std::abs (sz(1) - 43.0) < tol) + else if (std::abs (sz(0) - 34.0) + + std::abs (sz(1) - 43.0) < tol) typ = "e"; // Call papertype.set rather than set_papertype to avoid loops between // update_papersize and update_papertype @@ -4446,7 +4488,7 @@ base_properties::remove_child (h); } - // FIXME -- is it necessary to check whether the axes object is + // FIXME: is it necessary to check whether the axes object is // being deleted now? I think this function is only called when an // individual child object is delete and not when the parent axes // object is deleted. @@ -4590,15 +4632,17 @@ inline Matrix unit_cube (void) { - static double data[32] = { - 0,0,0,1, - 1,0,0,1, - 0,1,0,1, - 0,0,1,1, - 1,1,0,1, - 1,0,1,1, - 0,1,1,1, - 1,1,1,1}; + static double data[32] = + { + 0,0,0,1, + 1,0,0,1, + 0,1,0,1, + 0,0,1,1, + 1,1,0,1, + 1,0,1,1, + 0,1,1,1, + 1,1,1,1 + }; Matrix m (4, 8); memcpy (m.fortran_vec (), data, sizeof (double)*32); return m; @@ -4759,7 +4803,7 @@ { double af; - // FIXME -- was this really needed? When compared to Matlab, it + // FIXME: was this really needed? When compared to Matlab, it // does not seem to be required. Need investigation with concrete // graphics toolkit to see results visually. if (false && dowarp) @@ -4964,33 +5008,33 @@ y2Dright = false; layer2Dtop = false; if (xstate == AXE_HORZ_DIR && ystate == AXE_VERT_DIR) - { - if (xaxislocation_is ("top")) - { - double tmp = yPlane; - yPlane = yPlaneN; - yPlaneN = tmp; - x2Dtop = true; - } - ypTick = yPlaneN; - ypTickN = yPlane; - if (yaxislocation_is ("right")) - { - double tmp = xPlane; - xPlane = xPlaneN; - xPlaneN = tmp; - y2Dright = true; - } - xpTick = xPlaneN; - xpTickN = xPlane; - if (layer_is ("top")) - { - zpTick = zPlaneN; - layer2Dtop = true; - } - else - zpTick = zPlane; - } + { + if (xaxislocation_is ("top")) + { + double tmp = yPlane; + yPlane = yPlaneN; + yPlaneN = tmp; + x2Dtop = true; + } + ypTick = yPlaneN; + ypTickN = yPlane; + if (yaxislocation_is ("right")) + { + double tmp = xPlane; + xPlane = xPlaneN; + xPlaneN = tmp; + y2Dright = true; + } + xpTick = xPlaneN; + xpTickN = xPlane; + if (layer_is ("top")) + { + zpTick = zPlaneN; + layer2Dtop = true; + } + else + zpTick = zPlane; + } Matrix viewmat = get_view ().matrix_value (); nearhoriz = std::abs (viewmat(1)) <= 5; @@ -5055,8 +5099,9 @@ if (updating_xlabel_position) return; - text::properties& xlabel_props = reinterpret_cast<text::properties&> - (gh_manager::get_object (get_xlabel ()).get_properties ()); + text::properties& xlabel_props + = reinterpret_cast<text::properties&> + (gh_manager::get_object (get_xlabel ()).get_properties ()); bool is_empty = xlabel_props.get_string ().is_empty (); @@ -5108,19 +5153,19 @@ switch (xstate) { - case AXE_ANY_DIR: - p(0) += (xyzSym ? wmax : -wmax); - p(1) += hmax; - break; - - case AXE_VERT_DIR: - p(0) -= wmax; - angle = 90; - break; - - case AXE_HORZ_DIR: - p(1) += (x2Dtop ? -hmax : hmax); - break; + case AXE_ANY_DIR: + p(0) += (xyzSym ? wmax : -wmax); + p(1) += hmax; + break; + + case AXE_VERT_DIR: + p(0) -= wmax; + angle = 90; + break; + + case AXE_HORZ_DIR: + p(1) += (x2Dtop ? -hmax : hmax); + break; } if (xlabel_props.positionmode_is ("auto")) @@ -5146,8 +5191,9 @@ if (updating_ylabel_position) return; - text::properties& ylabel_props = reinterpret_cast<text::properties&> - (gh_manager::get_object (get_ylabel ()).get_properties ()); + text::properties& ylabel_props + = reinterpret_cast<text::properties&> + (gh_manager::get_object (get_ylabel ()).get_properties ()); bool is_empty = ylabel_props.get_string ().is_empty (); @@ -5208,19 +5254,19 @@ switch (ystate) { - case AXE_ANY_DIR: - p(0) += (!xyzSym ? wmax : -wmax); - p(1) += hmax; - break; - - case AXE_VERT_DIR: - p(0) += (y2Dright ? wmax : -wmax); - angle = 90; - break; - - case AXE_HORZ_DIR: - p(1) += hmax; - break; + case AXE_ANY_DIR: + p(0) += (!xyzSym ? wmax : -wmax); + p(1) += hmax; + break; + + case AXE_VERT_DIR: + p(0) += (y2Dright ? wmax : -wmax); + angle = 90; + break; + + case AXE_HORZ_DIR: + p(1) += hmax; + break; } if (ylabel_props.positionmode_is ("auto")) @@ -5246,8 +5292,9 @@ if (updating_zlabel_position) return; - text::properties& zlabel_props = reinterpret_cast<text::properties&> - (gh_manager::get_object (get_zlabel ()).get_properties ()); + text::properties& zlabel_props + = reinterpret_cast<text::properties&> + (gh_manager::get_object (get_zlabel ()).get_properties ()); bool camAuto = cameraupvectormode_is ("auto"); bool is_empty = zlabel_props.get_string ().is_empty (); @@ -5312,28 +5359,28 @@ switch (zstate) { - case AXE_ANY_DIR: - if (camAuto) - { - p(0) -= wmax; - angle = 90; - } - - // FIXME -- what's the correct offset? - // - // p[0] += (!xySym ? wmax : -wmax); - // p[1] += (zSign ? hmax : -hmax); - - break; - - case AXE_VERT_DIR: - p(0) -= wmax; - angle = 90; - break; - - case AXE_HORZ_DIR: - p(1) += hmax; - break; + case AXE_ANY_DIR: + if (camAuto) + { + p(0) -= wmax; + angle = 90; + } + + // FIXME: what's the correct offset? + // + // p[0] += (!xySym ? wmax : -wmax); + // p[1] += (zSign ? hmax : -hmax); + + break; + + case AXE_VERT_DIR: + p(0) -= wmax; + angle = 90; + break; + + case AXE_HORZ_DIR: + p(1) += hmax; + break; } if (zlabel_props.positionmode_is ("auto")) @@ -5359,8 +5406,9 @@ if (updating_title_position) return; - text::properties& title_props = reinterpret_cast<text::properties&> - (gh_manager::get_object (get_title ()).get_properties ()); + text::properties& title_props + = reinterpret_cast<text::properties&> + (gh_manager::get_object (get_title ()).get_properties ()); unwind_protect frame; frame.protect_var (updating_title_position); @@ -5413,15 +5461,15 @@ normalized_aspectratios (Matrix& aspectratios, const Matrix& scalefactors, double xlength, double ylength, double zlength) { - double xval = xlength/scalefactors(0); - double yval = ylength/scalefactors(1); - double zval = zlength/scalefactors(2); - - double minval = xmin (xmin (xval, yval), zval); - - aspectratios(0) = xval/minval; - aspectratios(1) = yval/minval; - aspectratios(2) = zval/minval; + double xval = xlength/scalefactors(0); + double yval = ylength/scalefactors(1); + double zval = zlength/scalefactors(2); + + double minval = xmin (xmin (xval, yval), zval); + + aspectratios(0) = xval/minval; + aspectratios(1) = yval/minval; + aspectratios(2) = zval/minval; } static void @@ -5579,9 +5627,8 @@ axes::properties::get_boundingbox (bool internal, const Matrix& parent_pix_size) const { - Matrix pos = (internal ? - get_position ().matrix_value () - : get_outerposition ().matrix_value ()); + Matrix pos = internal ? get_position ().matrix_value () + : get_outerposition ().matrix_value (); Matrix parent_size (parent_pix_size); if (parent_size.numel () == 0) @@ -5641,8 +5688,9 @@ else if (i == 3) text_handle = get_zlabel (); - text::properties& text_props = reinterpret_cast<text::properties&> - (gh_manager::get_object (text_handle).get_properties ()); + text::properties& text_props + = reinterpret_cast<text::properties&> + (gh_manager::get_object (text_handle).get_properties ()); Matrix text_pos = text_props.get_data_position (); text_pos = xform.transform (text_pos(0), text_pos(1), text_pos(2)); @@ -5663,20 +5711,22 @@ { double text_rotation = text_props.get_rotation (); if (text_rotation == 0. || text_rotation == 180.) - ignore_horizontal = true; + ignore_horizontal = true; else if (text_rotation == 90. || text_rotation == 270.) - ignore_vertical = true; + ignore_vertical = true; } if (! ignore_horizontal) { ext(0) = std::min (ext(0), text_pos(0)+text_ext(0)); - ext(2) = std::max (ext(2), text_pos(0)+text_ext(0)+text_ext(2)); + ext(2) = std::max (ext(2), + text_pos(0)+text_ext(0)+text_ext(2)); } if (! ignore_vertical) { - ext(1) = std::min (ext(1), text_pos(1)-text_ext(1)-text_ext(3)); + ext(1) = std::min (ext(1), + text_pos(1)-text_ext(1)-text_ext(3)); ext(3) = std::max (ext(3), text_pos(1)-text_ext(1)); } } @@ -5724,7 +5774,7 @@ // Split string with delimiter '|' while (std::getline (iss, tmpstr, '|')) sv.append (tmpstr); - + // If string ends with '|' Matlab appends a null string if (*valstr.rbegin () == '|') sv.append (std::string ("")); @@ -5813,7 +5863,7 @@ // Split string with delimiter '|' while (std::getline (iss, tmpstr, '|')) sv.append (tmpstr); - + // If string ends with '|' Matlab appends a null string if (*valstr.rbegin () == '|') sv.append (std::string ("")); @@ -5856,12 +5906,25 @@ axes::properties::update_units (const caseless_str& old_units) { graphics_object obj = gh_manager::get_object (get_parent ()); - Matrix parent_bb = obj.get_properties ().get_boundingbox (true).extract_n (0, 2, 1, 2); + Matrix parent_bb + = obj.get_properties ().get_boundingbox (true).extract_n (0, 2, 1, 2); caseless_str new_units = get_units (); - position.set (octave_value (convert_position (get_position ().matrix_value (), old_units, new_units, parent_bb)), false); - outerposition.set (octave_value (convert_position (get_outerposition ().matrix_value (), old_units, new_units, parent_bb)), false); - tightinset.set (octave_value (convert_position (get_tightinset ().matrix_value (), old_units, new_units, parent_bb)), false); - looseinset.set (octave_value (convert_position (get_looseinset ().matrix_value (), old_units, new_units, parent_bb)), false); + position.set (octave_value (convert_position (get_position ().matrix_value (), + old_units, new_units, + parent_bb)), + false); + outerposition.set (octave_value (convert_position (get_outerposition ().matrix_value (), + old_units, new_units, + parent_bb)), + false); + tightinset.set (octave_value (convert_position (get_tightinset ().matrix_value (), + old_units, new_units, + parent_bb)), + false); + looseinset.set (octave_value (convert_position (get_looseinset ().matrix_value (), + old_units, new_units, + parent_bb)), + false); } void @@ -5960,8 +6023,8 @@ return retval; } -// FIXME -- remove. -// FIXME -- maybe this should go into array_property class? +// FIXME: remove. +// FIXME: maybe this should go into array_property class? /* static void check_limit_vals (double& min_val, double& max_val, @@ -6035,7 +6098,7 @@ // A translation from Tom Holoryd's python code at // http://kurage.nimh.nih.gov/tomh/tics.py -// FIXME -- add log ticks +// FIXME: add log ticks double axes::properties::calc_tick_sep (double lo, double hi) @@ -6107,8 +6170,9 @@ warning ("axis: omitting non-positive data in log plot"); min_val = min_pos; } - // FIXME -- maybe this test should also be relative? - if (std::abs (min_val - max_val) < sqrt (std::numeric_limits<double>::epsilon ())) + // FIXME: maybe this test should also be relative? + if (std::abs (min_val - max_val) + < sqrt (std::numeric_limits<double>::epsilon ())) { // Widen range when too small if (min_val >= 0) @@ -6143,7 +6207,8 @@ max_val = 1; } // FIXME -- maybe this test should also be relative? - else if (std::abs (min_val - max_val) < sqrt (std::numeric_limits<double>::epsilon ())) + else if (std::abs (min_val - max_val) + < sqrt (std::numeric_limits<double>::epsilon ())) { min_val -= 0.1 * std::abs (min_val); max_val += 0.1 * std::abs (max_val); @@ -6172,7 +6237,7 @@ array_property& mticks, bool limmode_is_auto, bool is_logscale) { - // FIXME -- add log ticks and lims + // FIXME: add log ticks and lims if (lims.get ().is_empty ()) return; @@ -6904,7 +6969,8 @@ } void -axes::properties::zoom (const Matrix& xl, const Matrix& yl, bool push_to_zoom_stack) +axes::properties::zoom (const Matrix& xl, const Matrix& yl, + bool push_to_zoom_stack) { if (push_to_zoom_stack) { @@ -7334,28 +7400,32 @@ double& nz = n(j, i, 2); if ((j > 0) && (i > 0)) - // upper left quadrangle - cross_product (x(j1,i-1)-x(j2,i), y(j-1,i1)-y(j,i2), z(j-1,i-1)-z(j,i), - x(j2,i-1)-x(j1,i), y(j,i1)-y(j-1,i2), z(j,i-1)-z(j-1,i), - nx, ny, nz); + // upper left quadrangle + cross_product + (x(j1,i-1)-x(j2,i), y(j-1,i1)-y(j,i2), z(j-1,i-1)-z(j,i), + x(j2,i-1)-x(j1,i), y(j,i1)-y(j-1,i2), z(j,i-1)-z(j-1,i), + nx, ny, nz); if ((j > 0) && (i < (p -1))) - // upper right quadrangle - cross_product (x(j1,i+1)-x(j2,i), y(j-1,i3)-y(j,i2), z(j-1,i+1)-z(j,i), - x(j1,i)-x(j2,i+1), y(j-1,i2)-y(j,i3), z(j-1,i)-z(j,i+1), - nx, ny, nz); + // upper right quadrangle + cross_product + (x(j1,i+1)-x(j2,i), y(j-1,i3)-y(j,i2), z(j-1,i+1)-z(j,i), + x(j1,i)-x(j2,i+1), y(j-1,i2)-y(j,i3), z(j-1,i)-z(j,i+1), + nx, ny, nz); if ((j < (q - 1)) && (i > 0)) - // lower left quadrangle - cross_product (x(j2,i-1)-x(j3,i), y(j,i1)-y(j+1,i2), z(j,i-1)-z(j+1,i), - x(j3,i-1)-x(j2,i), y(j+1,i1)-y(j,i2), z(j+1,i-1)-z(j,i), - nx, ny, nz); + // lower left quadrangle + cross_product + (x(j2,i-1)-x(j3,i), y(j,i1)-y(j+1,i2), z(j,i-1)-z(j+1,i), + x(j3,i-1)-x(j2,i), y(j+1,i1)-y(j,i2), z(j+1,i-1)-z(j,i), + nx, ny, nz); if ((j < (q - 1)) && (i < (p -1))) - // lower right quadrangle - cross_product (x(j3,i)-x(j2,i+1), y(j+1,i2)-y(j,i3), z(j+1,i)-z(j,i+1), - x(j3,i+1)-x(j2,i), y(j+1,i3)-y(j,i2), z(j+1,i+1)-z(j,i), - nx, ny, nz); + // lower right quadrangle + cross_product + (x(j3,i)-x(j2,i+1), y(j+1,i2)-y(j,i3), z(j+1,i)-z(j,i+1), + x(j3,i+1)-x(j2,i), y(j+1,i3)-y(j,i2), z(j+1,i+1)-z(j,i), + nx, ny, nz); double d = -std::max (std::max (fabs (nx), fabs (ny)), fabs (nz)); @@ -7756,7 +7826,7 @@ graphics_object obj = gh_manager::get_object (get_parent ()); parent_size = - obj.get_properties ().get_boundingbox (true).extract_n (0, 2, 1, 2); + obj.get_properties ().get_boundingbox (true).extract_n (0, 2, 1, 2); } pos = convert_position (pos, get_units (), "pixels", parent_size); @@ -8031,12 +8101,12 @@ callback (cb), callback_data (data) { } void execute (void) - { - if (callback.is_defined ()) - gh_manager::execute_callback (handle, callback, callback_data); - else - gh_manager::execute_callback (handle, callback_name, callback_data); - } + { + if (callback.is_defined ()) + gh_manager::execute_callback (handle, callback, callback_data); + else + gh_manager::execute_callback (handle, callback_name, callback_data); + } private: callback_event (void) @@ -8059,9 +8129,9 @@ { } void execute (void) - { - function (function_data); - } + { + function (function_data); + } private: @@ -8089,19 +8159,19 @@ property_value (value), notify_toolkit (do_notify_toolkit) { } void execute (void) - { - gh_manager::auto_lock guard; - - graphics_object go = gh_manager::get_object (handle); - - if (go) - { - property p = go.get_properties ().get_property (property_name); - - if (p.ok ()) - p.set (property_value, true, notify_toolkit); - } - } + { + gh_manager::auto_lock guard; + + graphics_object go = gh_manager::get_object (handle); + + if (go) + { + property p = go.get_properties ().get_property (property_name); + + if (p.ok ()) + p.set (property_value, true, notify_toolkit); + } + } private: set_event (void) @@ -8168,7 +8238,7 @@ { graphics_object go = gh_manager::get_object (0); root_figure::properties& props = - dynamic_cast<root_figure::properties&> (go.get_properties ()); + dynamic_cast<root_figure::properties&> (go.get_properties ()); props.set_callbackobject (h.as_octave_value ()); } @@ -8294,23 +8364,25 @@ const graphics_object& current = callback_objects.front (); if (current.get_properties ().is_interruptible ()) - do_post_event (graphics_event::create_callback_event (h, name, data)); + do_post_event (graphics_event::create_callback_event (h, name, + data)); else { caseless_str busy_action (go.get_properties ().get_busyaction ()); if (busy_action.compare ("queue")) - do_post_event (graphics_event::create_callback_event (h, name, data)); + do_post_event (graphics_event::create_callback_event (h, name, + data)); else { caseless_str cname (name); - if (cname.compare ("deletefcn") - || cname.compare ("createfcn") + if (cname.compare ("deletefcn") || cname.compare ("createfcn") || (go.isa ("figure") && (cname.compare ("closerequestfcn") || cname.compare ("resizefcn")))) - do_post_event (graphics_event::create_callback_event (h, name, data)); + do_post_event ( + graphics_event::create_callback_event (h, name, data)); } } } @@ -8446,7 +8518,7 @@ // --------------------------------------------------------------------- DEFUN (ishandle, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ishandle (@var{h})\n\ Return true if @var{h} is a graphics handle and false otherwise.\n\ \n\ @@ -8506,7 +8578,7 @@ } DEFUN (__is_handle_visible__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} __is_handle_visible__ (@var{h})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -8522,7 +8594,7 @@ } DEFUN (reset, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} reset (@var{h}, @var{property})\n\ Remove any defaults set for the handle @var{h}. The default figure\n\ properties of @qcode{\"position\"}, @qcode{\"units\"},\n\ @@ -8552,7 +8624,7 @@ } DEFUN (set, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} set (@var{h}, @var{property}, @var{value}, @dots{})\n\ @deftypefnx {Built-in Function} {} set (@var{h}, @var{properties}, @var{values})\n\ @deftypefnx {Built-in Function} {} set (@var{h}, @var{pv})\n\ @@ -8625,7 +8697,7 @@ else { error ("set: number of graphics handles must match number of value rows (%d != %d)", - hcv.length (), args(2).cell_value ().rows ()); + hcv.length (), args(2).cell_value ().rows ()); break; } @@ -8661,7 +8733,7 @@ break; request_drawnow = true; - } + } if (! error_state && request_drawnow) Vdrawnow_requested = true; @@ -8691,7 +8763,7 @@ } DEFUN (get, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} get (@var{h})\n\ @deftypefnx {Built-in Function} {@var{val} =} get (@var{h}, @var{p})\n\ Return the value of the named property @var{p} from the graphics handle\n\ @@ -8768,7 +8840,9 @@ if (obj) { - for (octave_idx_type m = 0; ! error_state && m < plen; m++) + for (octave_idx_type m = 0; + ! error_state && m < plen; + m++) { caseless_str property = plist(m); @@ -8866,7 +8940,7 @@ // property values or lists respectively. DEFUN (__get__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __get__ (@var{h})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -8994,7 +9068,7 @@ } DEFUN (__go_figure__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_figure__ (@var{fignum})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9113,7 +9187,7 @@ if (go.isa ("surface")) nd = 3; else if ((go.isa ("line") || go.isa ("patch")) - && ! go.get ("zdata").is_empty ()) + && ! go.get ("zdata").is_empty ()) nd = 3; else { @@ -9140,7 +9214,7 @@ } DEFUN (__calc_dimensions__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __calc_dimensions__ (@var{axes})\n\ Internal function. Determine the number of dimensions in a graphics\n\ object, whether 2 or 3.\n\ @@ -9166,7 +9240,7 @@ } DEFUN (__go_axes__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_axes__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9175,7 +9249,7 @@ } DEFUN (__go_line__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_line__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9184,7 +9258,7 @@ } DEFUN (__go_text__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_text__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9193,7 +9267,7 @@ } DEFUN (__go_image__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_image__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9202,7 +9276,7 @@ } DEFUN (__go_surface__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_surface__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9211,7 +9285,7 @@ } DEFUN (__go_patch__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_patch__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9220,7 +9294,7 @@ } DEFUN (__go_hggroup__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_hggroup__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9229,7 +9303,7 @@ } DEFUN (__go_uimenu__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uimenu__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9238,7 +9312,7 @@ } DEFUN (__go_uicontrol__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uicontrol__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9247,7 +9321,7 @@ } DEFUN (__go_uipanel__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uipanel__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9256,7 +9330,7 @@ } DEFUN (__go_uicontextmenu__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uicontextmenu__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9265,7 +9339,7 @@ } DEFUN (__go_uitoolbar__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uitoolbar__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9274,7 +9348,7 @@ } DEFUN (__go_uipushtool__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uipushtool__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9283,7 +9357,7 @@ } DEFUN (__go_uitoggletool__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_uitoggletool__ (@var{parent})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9292,7 +9366,7 @@ } DEFUN (__go_delete__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_delete__ (@var{h})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9337,7 +9411,7 @@ } DEFUN (__go_axes_init__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_axes_init__ (@var{h}, @var{mode})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9376,7 +9450,8 @@ h = gh_manager::lookup (val); if (! h.ok ()) - error ("__go_axes_init__: axis deleted during initialization (= %g)", val); + error ("__go_axes_init__: axis deleted during initialization (= %g)", + val); } else error ("__go_axes_init__: invalid graphics object (= %g)", val); @@ -9391,7 +9466,7 @@ } DEFUN (__go_handles__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_handles__ (@var{show_hidden})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9407,7 +9482,7 @@ } DEFUN (__go_figure_handles__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_figure_handles__ (@var{show_hidden})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -9423,7 +9498,7 @@ } DEFUN (__go_execute_callback__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name})\n\ @deftypefnx {Built-in Function} {} __go_execute_callback__ (@var{h}, @var{name}, @var{param})\n\ Undocumented internal function.\n\ @@ -9469,7 +9544,7 @@ } DEFUN (__image_pixel_size__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{px}, @var{py}} __image_pixel_size__ (@var{h})\n\ Internal function: returns the pixel size of the image in normalized units.\n\ @end deftypefn") @@ -9564,7 +9639,7 @@ } DEFUN (available_graphics_toolkits, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} available_graphics_toolkits ()\n\ Return a cell array of registered graphics toolkits.\n\ @seealso{graphics_toolkit, register_graphics_toolkit}\n\ @@ -9576,7 +9651,7 @@ } DEFUN (register_graphics_toolkit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} register_graphics_toolkit (@var{toolkit})\n\ List @var{toolkit} as an available graphics toolkit.\n\ @seealso{available_graphics_toolkits}\n\ @@ -9602,7 +9677,7 @@ } DEFUN (loaded_graphics_toolkits, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} loaded_graphics_toolkits ()\n\ Return a cell array of the currently loaded graphics toolkits.\n\ @seealso{available_graphics_toolkits}\n\ @@ -9614,7 +9689,7 @@ } DEFUN (drawnow, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} drawnow ()\n\ @deftypefnx {Built-in Function} {} drawnow (\"expose\")\n\ @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\ @@ -9650,7 +9725,8 @@ if (h.ok () && h != 0) { graphics_object go = gh_manager::get_object (h); - figure::properties& fprops = dynamic_cast <figure::properties&> (go.get_properties ()); + figure::properties& fprops + = dynamic_cast <figure::properties&> (go.get_properties ()); if (fprops.is_modified ()) { @@ -9745,8 +9821,8 @@ gh_manager::unlock (); - go.get_toolkit () - .print_figure (go, term, file, mono, debug_file); + go.get_toolkit ().print_figure (go, term, file, + mono, debug_file); gh_manager::lock (); } @@ -9775,7 +9851,7 @@ } DEFUN (addlistener, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addlistener (@var{h}, @var{prop}, @var{fcn})\n\ Register @var{fcn} as listener for the property @var{prop} of the graphics\n\ object @var{h}. Property listeners are executed (in order of registration)\n\ @@ -9854,7 +9930,7 @@ } DEFUN (dellistener, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} dellistener (@var{h}, @var{prop}, @var{fcn})\n\ Remove the registration of @var{fcn} as a listener for the property\n\ @var{prop} of the graphics object @var{h}. The function @var{fcn} must\n\ @@ -9901,14 +9977,17 @@ graphics_object go = gh_manager::get_object (gh); if (args.length () == 2) - go.delete_property_listener (pname, octave_value (), POSTSET); + go.delete_property_listener (pname, octave_value (), + POSTSET); else { caseless_str persistent = args(2).string_value (); if (persistent.compare ("persistent")) { - go.delete_property_listener (pname, octave_value (), PERSISTENT); - go.delete_property_listener (pname, octave_value (), POSTSET); + go.delete_property_listener (pname, octave_value (), + PERSISTENT); + go.delete_property_listener (pname, octave_value (), + POSTSET); } else go.delete_property_listener (pname, args(2), POSTSET); @@ -9931,7 +10010,7 @@ } DEFUN (addproperty, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addproperty (@var{name}, @var{h}, @var{type})\n\ @deftypefnx {Built-in Function} {} addproperty (@var{name}, @var{h}, @var{type}, @var{arg}, @dots{})\n\ Create a new property named @var{name} in graphics object @var{h}.\n\ @@ -10144,11 +10223,11 @@ if (go.get_properties ().has_property (pname)) { - go.get_properties () - .delete_listener (pname, listener, mode); + go.get_properties ().delete_listener (pname, listener, + mode); if (mode == POSTSET) - go.get_properties () - .delete_listener (pname, listener, PERSISTENT); + go.get_properties ().delete_listener (pname, listener, + PERSISTENT); } } } @@ -10221,7 +10300,7 @@ } DEFUN (waitfor, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} waitfor (@var{h})\n\ @deftypefnx {Built-in Function} {} waitfor (@var{h}, @var{prop})\n\ @deftypefnx {Built-in Function} {} waitfor (@var{h}, @var{prop}, @var{value})\n\ @@ -10408,7 +10487,7 @@ if (args.length () > (timeout_index + 1)) { timeout = static_cast<int> - (args(timeout_index + 1).scalar_value ()); + (args(timeout_index + 1).scalar_value ()); if (! error_state) {
--- a/libinterp/corefcn/graphics.in.h +++ b/libinterp/corefcn/graphics.in.h @@ -65,34 +65,34 @@ virtual ~base_scaler (void) { } virtual Matrix scale (const Matrix& m) const - { - error ("invalid axis scale"); - return m; - } + { + error ("invalid axis scale"); + return m; + } virtual NDArray scale (const NDArray& m) const - { - error ("invalid axis scale"); - return m; - } + { + error ("invalid axis scale"); + return m; + } virtual double scale (double d) const - { - error ("invalid axis scale"); - return d; - } + { + error ("invalid axis scale"); + return d; + } virtual double unscale (double d) const - { - error ("invalid axis scale"); - return d; - } + { + error ("invalid axis scale"); + return d; + } virtual base_scaler* clone () const - { return new base_scaler (); } + { return new base_scaler (); } virtual bool is_linear (void) const - { return false; } + { return false; } }; class lin_scaler : public base_scaler @@ -119,38 +119,38 @@ log_scaler (void) { } Matrix scale (const Matrix& m) const - { - Matrix retval (m.rows (), m.cols ()); - - do_scale (m.data (), retval.fortran_vec (), m.numel ()); - - return retval; - } + { + Matrix retval (m.rows (), m.cols ()); + + do_scale (m.data (), retval.fortran_vec (), m.numel ()); + + return retval; + } NDArray scale (const NDArray& m) const - { - NDArray retval (m.dims ()); - - do_scale (m.data (), retval.fortran_vec (), m.numel ()); - - return retval; - } + { + NDArray retval (m.dims ()); + + do_scale (m.data (), retval.fortran_vec (), m.numel ()); + + return retval; + } double scale (double d) const - { return log10 (d); } + { return log10 (d); } double unscale (double d) const - { return pow (10.0, d); } + { return pow (10.0, d); } base_scaler* clone (void) const - { return new log_scaler (); } + { return new log_scaler (); } private: void do_scale (const double *src, double *dest, int n) const - { - for (int i = 0; i < n; i++) - dest[i] = log10 (src[i]); - } + { + for (int i = 0; i < n; i++) + dest[i] = log10 (src[i]); + } }; class neg_log_scaler : public base_scaler @@ -159,38 +159,38 @@ neg_log_scaler (void) { } Matrix scale (const Matrix& m) const - { - Matrix retval (m.rows (), m.cols ()); - - do_scale (m.data (), retval.fortran_vec (), m.numel ()); - - return retval; - } + { + Matrix retval (m.rows (), m.cols ()); + + do_scale (m.data (), retval.fortran_vec (), m.numel ()); + + return retval; + } NDArray scale (const NDArray& m) const - { - NDArray retval (m.dims ()); - - do_scale (m.data (), retval.fortran_vec (), m.numel ()); - - return retval; - } + { + NDArray retval (m.dims ()); + + do_scale (m.data (), retval.fortran_vec (), m.numel ()); + + return retval; + } double scale (double d) const - { return -log10 (-d); } + { return -log10 (-d); } double unscale (double d) const - { return -pow (10.0, -d); } + { return -pow (10.0, -d); } base_scaler* clone (void) const - { return new neg_log_scaler (); } + { return new neg_log_scaler (); } private: void do_scale (const double *src, double *dest, int n) const - { - for (int i = 0; i < n; i++) - dest[i] = -log10 (-src[i]); - } + { + for (int i = 0; i < n; i++) + dest[i] = -log10 (-src[i]); + } }; class scaler @@ -205,57 +205,57 @@ ? new log_scaler () : (s == "neglog" ? new neg_log_scaler () : (s == "linear" ? new lin_scaler () : new base_scaler ()))) - { } + { } ~scaler (void) { delete rep; } Matrix scale (const Matrix& m) const - { return rep->scale (m); } + { return rep->scale (m); } NDArray scale (const NDArray& m) const - { return rep->scale (m); } + { return rep->scale (m); } double scale (double d) const - { return rep->scale (d); } + { return rep->scale (d); } double unscale (double d) const - { return rep->unscale (d); } + { return rep->unscale (d); } bool is_linear (void) const - { return rep->is_linear (); } + { return rep->is_linear (); } scaler& operator = (const scaler& s) - { - if (rep) - { - delete rep; - rep = 0; - } - - rep = s.rep->clone (); - - return *this; - } + { + if (rep) + { + delete rep; + rep = 0; + } + + rep = s.rep->clone (); + + return *this; + } scaler& operator = (const std::string& s) - { - if (rep) - { - delete rep; - rep = 0; - } - - if (s == "log") - rep = new log_scaler (); - else if (s == "neglog") - rep = new neg_log_scaler (); - else if (s == "linear") - rep = new lin_scaler (); - else - rep = new base_scaler (); - - return *this; - } + { + if (rep) + { + delete rep; + rep = 0; + } + + if (s == "log") + rep = new log_scaler (); + else if (s == "neglog") + rep = new neg_log_scaler (); + else if (s == "linear") + rep = new lin_scaler (); + else + rep = new base_scaler (); + + return *this; + } private: base_scaler *rep; @@ -275,16 +275,16 @@ public: base_property (void) : id (-1), count (1), name (), parent (), hidden (), listeners () - { } + { } base_property (const std::string& s, const graphics_handle& h) : id (-1), count (1), name (s), parent (h), hidden (false), listeners () - { } + { } base_property (const base_property& p) : id (-1), count (1), name (p.name), parent (p.parent), hidden (p.hidden), listeners () - { } + { } virtual ~base_property (void) { } @@ -314,103 +314,105 @@ bool do_notify_toolkit = true); virtual octave_value get (void) const - { - error ("get: invalid property \"%s\"", name.c_str ()); - return octave_value (); - } + { + error ("get: invalid property \"%s\"", name.c_str ()); + return octave_value (); + } virtual std::string values_as_string (void) const - { - error ("values_as_string: invalid property \"%s\"", name.c_str ()); - return std::string (); - } + { + error ("values_as_string: invalid property \"%s\"", name.c_str ()); + return std::string (); + } virtual Cell values_as_cell (void) const - { - error ("values_as_cell: invalid property \"%s\"", name.c_str ()); - return Cell (); - } + { + error ("values_as_cell: invalid property \"%s\"", name.c_str ()); + return Cell (); + } base_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } void add_listener (const octave_value& v, listener_mode mode = POSTSET) - { - octave_value_list& l = listeners[mode]; - l.resize (l.length () + 1, v); - } + { + octave_value_list& l = listeners[mode]; + l.resize (l.length () + 1, v); + } void delete_listener (const octave_value& v = octave_value (), listener_mode mode = POSTSET) - { - octave_value_list& l = listeners[mode]; - - if (v.is_defined ()) - { - bool found = false; - int i; - - for (i = 0; i < l.length (); i++) - { - if (v.internal_rep () == l(i).internal_rep ()) - { - found = true; - break; - } - } - if (found) - { - for (int j = i; j < l.length () - 1; j++) - l(j) = l(j + 1); - - l.resize (l.length () - 1); - } - } - else - { - if (mode == PERSISTENT) - l.resize (0); - else - { - octave_value_list lnew (0); - octave_value_list& lp = listeners[PERSISTENT]; - for (int i = l.length () - 1; i >= 0 ; i--) - { - for (int j = 0; j < lp.length (); j++) - { - if (l(i).internal_rep () == lp(j).internal_rep ()) - { - lnew.resize (lnew.length () + 1, l(i)); - break; - } - } - } - l = lnew; - } - } - - } + { + octave_value_list& l = listeners[mode]; + + if (v.is_defined ()) + { + bool found = false; + int i; + + for (i = 0; i < l.length (); i++) + { + if (v.internal_rep () == l(i).internal_rep ()) + { + found = true; + break; + } + } + if (found) + { + for (int j = i; j < l.length () - 1; j++) + l(j) = l(j + 1); + + l.resize (l.length () - 1); + } + } + else + { + if (mode == PERSISTENT) + l.resize (0); + else + { + octave_value_list lnew (0); + octave_value_list& lp = listeners[PERSISTENT]; + for (int i = l.length () - 1; i >= 0 ; i--) + { + for (int j = 0; j < lp.length (); j++) + { + if (l(i).internal_rep () == lp(j).internal_rep ()) + { + lnew.resize (lnew.length () + 1, l(i)); + break; + } + } + } + l = lnew; + } + } + + } OCTINTERP_API void run_listeners (listener_mode mode = POSTSET); virtual base_property* clone (void) const - { return new base_property (*this); } + { return new base_property (*this); } protected: virtual bool do_set (const octave_value&) - { - error ("set: invalid property \"%s\"", name.c_str ()); - return false; - } + { + error ("set: invalid property \"%s\"", name.c_str ()); + return false; + } private: typedef std::map<listener_mode, octave_value_list> listener_map; - typedef std::map<listener_mode, octave_value_list>::iterator listener_map_iterator; - typedef std::map<listener_mode, octave_value_list>::const_iterator listener_map_const_iterator; + typedef std::map<listener_mode, octave_value_list>::iterator + listener_map_iterator; + typedef std::map<listener_mode, octave_value_list>::const_iterator + listener_map_const_iterator; private: int id; @@ -434,36 +436,36 @@ : base_property (p), str (p.str) { } octave_value get (void) const - { return octave_value (str); } + { return octave_value (str); } std::string string_value (void) const { return str; } string_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new string_property (*this); } protected: bool do_set (const octave_value& val) - { - if (val.is_string ()) - { - std::string new_str = val.string_value (); - - if (new_str != str) - { - str = new_str; - return true; - } - } - else - error ("set: invalid string property value for \"%s\"", - get_name ().c_str ()); - return false; - } + { + if (val.is_string ()) + { + std::string new_str = val.string_value (); + + if (new_str != str) + { + str = new_str; + return true; + } + } + else + error ("set: invalid string property value for \"%s\"", + get_name ().c_str ()); + return false; + } private: std::string str; @@ -480,188 +482,189 @@ const std::string& val = "", const char& sep = '|', const desired_enum& typ = string_t) : base_property (s, h), desired_type (typ), separator (sep), str () - { - size_t pos = 0; - - while (true) - { - size_t new_pos = val.find_first_of (separator, pos); - - if (new_pos == std::string::npos) - { - str.append (val.substr (pos)); - break; - } - else - str.append (val.substr (pos, new_pos - pos)); - - pos = new_pos + 1; - } - } + { + size_t pos = 0; + + while (true) + { + size_t new_pos = val.find_first_of (separator, pos); + + if (new_pos == std::string::npos) + { + str.append (val.substr (pos)); + break; + } + else + str.append (val.substr (pos, new_pos - pos)); + + pos = new_pos + 1; + } + } string_array_property (const std::string& s, const graphics_handle& h, const Cell& c, const char& sep = '|', const desired_enum& typ = string_t) : base_property (s, h), desired_type (typ), separator (sep), str () - { - if (c.is_cellstr ()) - { - string_vector strings (c.numel ()); - - for (octave_idx_type i = 0; i < c.numel (); i++) - strings[i] = c(i).string_value (); - - str = strings; - } - else - error ("set: invalid order property value for \"%s\"", - get_name ().c_str ()); - } + { + if (c.is_cellstr ()) + { + string_vector strings (c.numel ()); + + for (octave_idx_type i = 0; i < c.numel (); i++) + strings[i] = c(i).string_value (); + + str = strings; + } + else + error ("set: invalid order property value for \"%s\"", + get_name ().c_str ()); + } string_array_property (const string_array_property& p) : base_property (p), desired_type (p.desired_type), separator (p.separator), str (p.str) { } octave_value get (void) const - { - if (desired_type == string_t) - return octave_value (string_value ()); - else - return octave_value (cell_value ()); - } + { + if (desired_type == string_t) + return octave_value (string_value ()); + else + return octave_value (cell_value ()); + } std::string string_value (void) const - { - std::string s; - - for (octave_idx_type i = 0; i < str.length (); i++) - { - s += str[i]; - if (i != str.length () - 1) - s += separator; - } - - return s; - } + { + std::string s; + + for (octave_idx_type i = 0; i < str.length (); i++) + { + s += str[i]; + if (i != str.length () - 1) + s += separator; + } + + return s; + } Cell cell_value (void) const {return Cell (str);} string_vector string_vector_value (void) const { return str; } string_array_property& operator = (const octave_value& val) - { - set (val); - return *this; - } - - base_property* clone (void) const { return new string_array_property (*this); } + { + set (val); + return *this; + } + + base_property* clone (void) const + { return new string_array_property (*this); } protected: bool do_set (const octave_value& val) - { - if (val.is_string () && val.rows () == 1) - { - bool replace = false; - std::string new_str = val.string_value (); - string_vector strings; - size_t pos = 0; - - // Split single string on delimiter (usually '|') - while (pos != std::string::npos) - { - size_t new_pos = new_str.find_first_of (separator, pos); - - if (new_pos == std::string::npos) + { + if (val.is_string () && val.rows () == 1) + { + bool replace = false; + std::string new_str = val.string_value (); + string_vector strings; + size_t pos = 0; + + // Split single string on delimiter (usually '|') + while (pos != std::string::npos) + { + size_t new_pos = new_str.find_first_of (separator, pos); + + if (new_pos == std::string::npos) + { + strings.append (new_str.substr (pos)); + break; + } + else + strings.append (new_str.substr (pos, new_pos - pos)); + + pos = new_pos + 1; + } + + if (str.numel () == strings.numel ()) + { + for (octave_idx_type i = 0; i < str.numel (); i++) + if (strings[i] != str[i]) { - strings.append (new_str.substr (pos)); + replace = true; break; } - else - strings.append (new_str.substr (pos, new_pos - pos)); - - pos = new_pos + 1; - } - - if (str.numel () == strings.numel ()) - { - for (octave_idx_type i = 0; i < str.numel (); i++) + } + else + replace = true; + + desired_type = string_t; + + if (replace) + { + str = strings; + return true; + } + } + else if (val.is_string ()) // multi-row character matrix + { + bool replace = false; + charMatrix chm = val.char_matrix_value (); + octave_idx_type nel = chm.rows (); + string_vector strings (nel); + + if (nel != str.numel ()) + replace = true; + for (octave_idx_type i = 0; i < nel; i++) + { + strings[i] = chm.row_as_string (i); + if (!replace && strings[i] != str[i]) + replace = true; + } + + desired_type = string_t; + + if (replace) + { + str = strings; + return true; + } + } + else if (val.is_cellstr ()) + { + bool replace = false; + Cell new_cell = val.cell_value (); + + string_vector strings = new_cell.cellstr_value (); + + octave_idx_type nel = strings.length (); + + if (nel != str.length ()) + replace = true; + else + { + for (octave_idx_type i = 0; i < nel; i++) + { if (strings[i] != str[i]) { replace = true; break; } - } - else - replace = true; - - desired_type = string_t; - - if (replace) - { - str = strings; - return true; - } - } - else if (val.is_string ()) // multi-row character matrix - { - bool replace = false; - charMatrix chm = val.char_matrix_value (); - octave_idx_type nel = chm.rows (); - string_vector strings (nel); - - if (nel != str.numel ()) - replace = true; - for (octave_idx_type i = 0; i < nel; i++) - { - strings[i] = chm.row_as_string (i); - if (!replace && strings[i] != str[i]) - replace = true; - } - - desired_type = string_t; - - if (replace) - { - str = strings; - return true; - } - } - else if (val.is_cellstr ()) - { - bool replace = false; - Cell new_cell = val.cell_value (); - - string_vector strings = new_cell.cellstr_value (); - - octave_idx_type nel = strings.length (); - - if (nel != str.length ()) - replace = true; - else - { - for (octave_idx_type i = 0; i < nel; i++) - { - if (strings[i] != str[i]) - { - replace = true; - break; - } - } - } - - desired_type = cell_t; - - if (replace) - { - str = strings; - return true; - } - } - else - error ("set: invalid string property value for \"%s\"", - get_name ().c_str ()); - return false; - } + } + } + + desired_type = cell_t; + + if (replace) + { + str = strings; + return true; + } + } + else + error ("set: invalid string property value for \"%s\"", + get_name ().c_str ()); + return false; + } private: desired_enum desired_type; @@ -961,15 +964,15 @@ Cell values_as_cell (void) const { return vals.values_as_cell (); } bool is (const caseless_str& v) const - { return v.compare (current_val); } + { return v.compare (current_val); } bool is_radio (void) const { return true; } radio_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new radio_property (*this); } @@ -997,11 +1000,11 @@ } else error ("set: invalid value for radio property \"%s\" (value = %s)", - get_name ().c_str (), s.c_str ()); + get_name ().c_str (), s.c_str ()); } else error ("set: invalid value for radio property \"%s\"", - get_name ().c_str ()); + get_name ().c_str ()); return false; } @@ -1045,14 +1048,14 @@ } bool operator == (const color_values& c) const - { - return (xrgb(0) == c.xrgb(0) - && xrgb(1) == c.xrgb(1) - && xrgb(2) == c.xrgb(2)); - } + { + return (xrgb(0) == c.xrgb(0) + && xrgb(1) == c.xrgb(1) + && xrgb(2) == c.xrgb(2)); + } bool operator != (const color_values& c) const - { return ! (*this == c); } + { return ! (*this == c); } Matrix rgb (void) const { return xrgb; } @@ -1138,7 +1141,7 @@ bool is_radio (void) const { return (current_type == radio_t); } bool is (const std::string& v) const - { return (is_radio () && current_val == v); } + { return (is_radio () && current_val == v); } Matrix rgb (void) const { @@ -1157,16 +1160,17 @@ } color_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } operator octave_value (void) const { return get (); } base_property* clone (void) const { return new color_property (*this); } - std::string values_as_string (void) const { return radio_val.values_as_string (); } + std::string values_as_string (void) const + { return radio_val.values_as_string (); } Cell values_as_cell (void) const { return radio_val.values_as_cell (); } @@ -1198,31 +1202,31 @@ double double_value (void) const { return current_val; } double_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new double_property (*this); } protected: bool do_set (const octave_value& v) - { - if (v.is_scalar_type () && v.is_real_type ()) - { - double new_val = v.double_value (); - - if (new_val != current_val) - { - current_val = new_val; - return true; - } - } - else - error ("set: invalid value for double property \"%s\"", - get_name ().c_str ()); - return false; - } + { + if (v.is_scalar_type () && v.is_real_type ()) + { + double new_val = v.double_value (); + + if (new_val != current_val) + { + current_val = new_val; + return true; + } + } + else + error ("set: invalid value for double property \"%s\"", + get_name ().c_str ()); + return false; + } private: double current_val; @@ -1271,7 +1275,7 @@ bool is_radio (void) const { return (current_type == radio_t); } bool is (const std::string& v) const - { return (is_radio () && current_val == v); } + { return (is_radio () && current_val == v); } double double_value (void) const { @@ -1290,15 +1294,15 @@ } double_radio_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } operator octave_value (void) const { return get (); } base_property* clone (void) const - { return new double_radio_property (*this); } + { return new double_radio_property (*this); } protected: OCTINTERP_API bool do_set (const octave_value& v); @@ -1319,18 +1323,18 @@ : base_property ("", graphics_handle ()), data (Matrix ()), xmin (), xmax (), xminp (), xmaxp (), type_constraints (), size_constraints () - { - get_data_limits (); - } + { + get_data_limits (); + } array_property (const std::string& nm, const graphics_handle& h, const octave_value& m) : base_property (nm, h), data (m.is_sparse_type () ? m.full_value () : m), xmin (), xmax (), xminp (), xmaxp (), type_constraints (), size_constraints () - { - get_data_limits (); - } + { + get_data_limits (); + } // This copy constructor is only intended to be used // internally to access min/max values; no need to @@ -1339,15 +1343,15 @@ : base_property (p), data (p.data), xmin (p.xmin), xmax (p.xmax), xminp (p.xminp), xmaxp (p.xmaxp), type_constraints (), size_constraints () - { } + { } octave_value get (void) const { return data; } void add_constraint (const std::string& type) - { type_constraints.insert (type); } + { type_constraints.insert (type); } void add_constraint (const dim_vector& dims) - { size_constraints.push_back (dims); } + { size_constraints.push_back (dims); } double min_val (void) const { return xmin; } double max_val (void) const { return xmax; } @@ -1355,56 +1359,56 @@ double max_neg (void) const { return xmaxp; } Matrix get_limits (void) const - { - Matrix m (1, 4); - - m(0) = min_val (); - m(1) = max_val (); - m(2) = min_pos (); - m(3) = max_neg (); - - return m; - } + { + Matrix m (1, 4); + + m(0) = min_val (); + m(1) = max_val (); + m(2) = min_pos (); + m(3) = max_neg (); + + return m; + } array_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const - { - array_property *p = new array_property (*this); - - p->type_constraints = type_constraints; - p->size_constraints = size_constraints; - - return p; - } + { + array_property *p = new array_property (*this); + + p->type_constraints = type_constraints; + p->size_constraints = size_constraints; + + return p; + } protected: bool do_set (const octave_value& v) - { - octave_value tmp = v.is_sparse_type () ? v.full_value () : v; - - if (validate (tmp)) - { - // FIXME: should we check for actual data change? - if (! is_equal (tmp)) - { - data = tmp; - - get_data_limits (); - - return true; - } - } - else - error ("invalid value for array property \"%s\"", - get_name ().c_str ()); - - return false; - } + { + octave_value tmp = v.is_sparse_type () ? v.full_value () : v; + + if (validate (tmp)) + { + // FIXME: should we check for actual data change? + if (! is_equal (tmp)) + { + data = tmp; + + get_data_limits (); + + return true; + } + } + else + error ("invalid value for array property \"%s\"", + get_name ().c_str ()); + + return false; + } private: OCTINTERP_API bool validate (const octave_value& v); @@ -1469,14 +1473,14 @@ } base_property* clone (void) const - { - row_vector_property *p = new row_vector_property (*this); - - p->type_constraints = type_constraints; - p->size_constraints = size_constraints; - - return p; - } + { + row_vector_property *p = new row_vector_property (*this); + + p->type_constraints = type_constraints; + p->size_constraints = size_constraints; + + return p; + } protected: bool do_set (const octave_value& v) @@ -1514,12 +1518,12 @@ bool_property (const std::string& nm, const graphics_handle& h, bool val) : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")) - { } + { } bool_property (const std::string& nm, const graphics_handle& h, const char* val) : radio_property (nm, h, radio_values ("on|off"), val) - { } + { } bool_property (const bool_property& p) : radio_property (p) { } @@ -1527,21 +1531,21 @@ bool is_on (void) const { return is ("on"); } bool_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new bool_property (*this); } protected: bool do_set (const octave_value& val) - { - if (val.is_bool_scalar ()) - return radio_property::do_set (val.bool_value () ? "on" : "off"); - else - return radio_property::do_set (val); - } + { + if (val.is_bool_scalar ()) + return radio_property::do_set (val.bool_value () ? "on" : "off"); + else + return radio_property::do_set (val); + } }; // --------------------------------------------------------------------- @@ -1562,16 +1566,16 @@ graphics_handle handle_value (void) const { return current_val; } handle_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } handle_property& operator = (const graphics_handle& h) - { - set (octave_value (h.value ())); - return *this; - } + { + set (octave_value (h.value ())); + return *this; + } base_property* clone (void) const { return new handle_property (*this); } @@ -1588,7 +1592,7 @@ { public: any_property (const std::string& nm, const graphics_handle& h, - const octave_value& m = Matrix ()) + const octave_value& m = Matrix ()) : base_property (nm, h), data (m) { } any_property (const any_property& p) @@ -1597,19 +1601,19 @@ octave_value get (void) const { return data; } any_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new any_property (*this); } protected: bool do_set (const octave_value& v) - { - data = v; - return true; - } + { + data = v; + return true; + } private: octave_value data; @@ -1622,80 +1626,80 @@ public: children_property (void) : base_property ("", graphics_handle ()), children_list () - { - do_init_children (Matrix ()); - } + { + do_init_children (Matrix ()); + } children_property (const std::string& nm, const graphics_handle& h, const Matrix &val) : base_property (nm, h), children_list () - { - do_init_children (val); - } + { + do_init_children (val); + } children_property (const children_property& p) : base_property (p), children_list () - { - do_init_children (p.children_list); - } + { + do_init_children (p.children_list); + } children_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new children_property (*this); } bool remove_child (const double &val) - { - return do_remove_child (val); - } + { + return do_remove_child (val); + } void adopt (const double &val) - { - do_adopt_child (val); - } + { + do_adopt_child (val); + } Matrix get_children (void) const - { - return do_get_children (false); - } + { + return do_get_children (false); + } Matrix get_hidden (void) const - { - return do_get_children (true); - } + { + return do_get_children (true); + } Matrix get_all (void) const - { - return do_get_all_children (); - } + { + return do_get_all_children (); + } octave_value get (void) const - { - return octave_value (get_children ()); - } + { + return octave_value (get_children ()); + } void delete_children (bool clear = false) - { - do_delete_children (clear); - } + { + do_delete_children (clear); + } void renumber (graphics_handle old_gh, graphics_handle new_gh) - { - for (children_list_iterator p = children_list.begin (); - p != children_list.end (); p++) - { - if (*p == old_gh) - { - *p = new_gh.value (); - return; - } - } - - error ("children_list::renumber: child not found!"); - } + { + for (children_list_iterator p = children_list.begin (); + p != children_list.end (); p++) + { + if (*p == old_gh) + { + *p = new_gh.value (); + return; + } + } + + error ("children_list::renumber: child not found!"); + } private: typedef std::list<double>::iterator children_list_iterator; @@ -1704,102 +1708,102 @@ protected: bool do_set (const octave_value& val) - { - const Matrix new_kids = val.matrix_value (); - - octave_idx_type nel = new_kids.numel (); - - const Matrix new_kids_column = new_kids.reshape (dim_vector (nel, 1)); - - bool is_ok = true; - - if (! error_state) - { - const Matrix visible_kids = do_get_children (false); - - if (visible_kids.numel () == new_kids.numel ()) - { - Matrix t1 = visible_kids.sort (); - Matrix t2 = new_kids_column.sort (); - - if (t1 != t2) - is_ok = false; - } - else - is_ok = false; - - if (! is_ok) - error ("set: new children must be a permutation of existing children"); - } - else - { + { + const Matrix new_kids = val.matrix_value (); + + octave_idx_type nel = new_kids.numel (); + + const Matrix new_kids_column = new_kids.reshape (dim_vector (nel, 1)); + + bool is_ok = true; + + if (! error_state) + { + const Matrix visible_kids = do_get_children (false); + + if (visible_kids.numel () == new_kids.numel ()) + { + Matrix t1 = visible_kids.sort (); + Matrix t2 = new_kids_column.sort (); + + if (t1 != t2) + is_ok = false; + } + else is_ok = false; - error ("set: expecting children to be array of graphics handles"); - } - - if (is_ok) - { - Matrix tmp = new_kids_column.stack (get_hidden ()); - - children_list.clear (); - - // Don't use do_init_children here, as that reverses the - // order of the list, and we don't want to do that if setting - // the child list directly. - - for (octave_idx_type i = 0; i < tmp.numel (); i++) - children_list.push_back (tmp.xelem (i)); - } - - return is_ok; - } + + if (! is_ok) + error ("set: new children must be a permutation of existing children"); + } + else + { + is_ok = false; + error ("set: expecting children to be array of graphics handles"); + } + + if (is_ok) + { + Matrix tmp = new_kids_column.stack (get_hidden ()); + + children_list.clear (); + + // Don't use do_init_children here, as that reverses the + // order of the list, and we don't want to do that if setting + // the child list directly. + + for (octave_idx_type i = 0; i < tmp.numel (); i++) + children_list.push_back (tmp.xelem (i)); + } + + return is_ok; + } private: void do_init_children (const Matrix &val) - { - children_list.clear (); - for (octave_idx_type i = 0; i < val.numel (); i++) - children_list.push_front (val.xelem (i)); - } + { + children_list.clear (); + for (octave_idx_type i = 0; i < val.numel (); i++) + children_list.push_front (val.xelem (i)); + } void do_init_children (const std::list<double> &val) - { - children_list.clear (); - for (const_children_list_iterator p = val.begin (); p != val.end (); p++) - children_list.push_front (*p); - } + { + children_list.clear (); + for (const_children_list_iterator p = val.begin (); p != val.end (); p++) + children_list.push_front (*p); + } Matrix do_get_children (bool return_hidden) const; Matrix do_get_all_children (void) const - { - Matrix retval (children_list.size (), 1); - octave_idx_type i = 0; - - for (const_children_list_iterator p = children_list.begin (); - p != children_list.end (); p++) - retval(i++) = *p; - return retval; - } + { + Matrix retval (children_list.size (), 1); + octave_idx_type i = 0; + + for (const_children_list_iterator p = children_list.begin (); + p != children_list.end (); p++) + retval(i++) = *p; + return retval; + } bool do_remove_child (double child) - { - for (children_list_iterator p = children_list.begin (); - p != children_list.end (); p++) - { - if (*p == child) - { - children_list.erase (p); - return true; - } - } - return false; - } + { + for (children_list_iterator p = children_list.begin (); + p != children_list.end (); p++) + { + if (*p == child) + { + children_list.erase (p); + return true; + } + } + return false; + } void do_adopt_child (const double &val) - { - children_list.push_front (val); - } + { + children_list.push_front (val); + } void do_delete_children (bool clear); }; @@ -1823,31 +1827,31 @@ OCTINTERP_API void execute (const octave_value& data = octave_value ()) const; bool is_defined (void) const - { - return (callback.is_defined () && ! callback.is_empty ()); - } + { + return (callback.is_defined () && ! callback.is_empty ()); + } callback_property& operator = (const octave_value& val) - { - set (val); - return *this; - } + { + set (val); + return *this; + } base_property* clone (void) const { return new callback_property (*this); } protected: bool do_set (const octave_value& v) - { - if (validate (v)) - { - callback = v; - return true; - } - else - error ("invalid value for callback property \"%s\"", - get_name ().c_str ()); - return false; - } + { + if (validate (v)) + { + callback = v; + return true; + } + else + error ("invalid value for callback property \"%s\"", + get_name ().c_str ()); + return false; + } private: OCTINTERP_API bool validate (const octave_value& v) const; @@ -1865,99 +1869,99 @@ { public: property (void) : rep (new base_property ("", graphics_handle ())) - { } + { } property (base_property *bp, bool persist = false) : rep (bp) - { if (persist) rep->count++; } + { if (persist) rep->count++; } property (const property& p) : rep (p.rep) - { - rep->count++; - } + { + rep->count++; + } ~property (void) - { - if (--rep->count == 0) - delete rep; - } + { + if (--rep->count == 0) + delete rep; + } bool ok (void) const - { return rep->ok (); } + { return rep->ok (); } std::string get_name (void) const - { return rep->get_name (); } + { return rep->get_name (); } void set_name (const std::string& name) - { rep->set_name (name); } + { rep->set_name (name); } graphics_handle get_parent (void) const - { return rep->get_parent (); } + { return rep->get_parent (); } void set_parent (const graphics_handle& h) - { rep->set_parent (h); } + { rep->set_parent (h); } bool is_hidden (void) const - { return rep->is_hidden (); } + { return rep->is_hidden (); } void set_hidden (bool flag) - { rep->set_hidden (flag); } + { rep->set_hidden (flag); } bool is_radio (void) const - { return rep->is_radio (); } + { return rep->is_radio (); } int get_id (void) const - { return rep->get_id (); } + { return rep->get_id (); } void set_id (int d) - { rep->set_id (d); } + { rep->set_id (d); } octave_value get (void) const - { return rep->get (); } + { return rep->get (); } bool set (const octave_value& val, bool do_run = true, bool do_notify_toolkit = true) - { return rep->set (val, do_run, do_notify_toolkit); } + { return rep->set (val, do_run, do_notify_toolkit); } std::string values_as_string (void) const - { return rep->values_as_string (); } + { return rep->values_as_string (); } Cell values_as_cell (void) const - { return rep->values_as_cell (); } + { return rep->values_as_cell (); } property& operator = (const octave_value& val) - { - *rep = val; - return *this; - } + { + *rep = val; + return *this; + } property& operator = (const property& p) - { - if (rep && --rep->count == 0) - delete rep; - - rep = p.rep; - rep->count++; - - return *this; - } + { + if (rep && --rep->count == 0) + delete rep; + + rep = p.rep; + rep->count++; + + return *this; + } void add_listener (const octave_value& v, listener_mode mode = POSTSET) - { rep->add_listener (v, mode); } + { rep->add_listener (v, mode); } void delete_listener (const octave_value& v = octave_value (), listener_mode mode = POSTSET) { rep->delete_listener (v, mode); } void run_listeners (listener_mode mode = POSTSET) - { rep->run_listeners (mode); } + { rep->run_listeners (mode); } OCTINTERP_API static - property create (const std::string& name, const graphics_handle& parent, - const caseless_str& type, - const octave_value_list& args); + property create (const std::string& name, const graphics_handle& parent, + const caseless_str& type, + const octave_value_list& args); property clone (void) const - { return property (rep->clone ()); } + { return property (rep->clone ()); } /* const string_property& as_string_property (void) const @@ -2049,36 +2053,36 @@ virtual bool is_valid (void) const { return false; } virtual void redraw_figure (const graphics_object&) const - { gripe_invalid ("redraw_figure"); } + { gripe_invalid ("redraw_figure"); } virtual void print_figure (const graphics_object&, const std::string&, const std::string&, bool, const std::string& = "") const - { gripe_invalid ("print_figure"); } + { gripe_invalid ("print_figure"); } virtual Matrix get_canvas_size (const graphics_handle&) const - { - gripe_invalid ("get_canvas_size"); - return Matrix (1, 2, 0.0); - } + { + gripe_invalid ("get_canvas_size"); + return Matrix (1, 2, 0.0); + } virtual double get_screen_resolution (void) const - { - gripe_invalid ("get_screen_resolution"); - return 72.0; - } + { + gripe_invalid ("get_screen_resolution"); + return 72.0; + } virtual Matrix get_screen_size (void) const - { - gripe_invalid ("get_screen_size"); - return Matrix (1, 2, 0.0); - } + { + gripe_invalid ("get_screen_size"); + return Matrix (1, 2, 0.0); + } // Callback function executed when the given graphics object // changes. This allows the graphics toolkit to act on property // changes if needed. virtual void update (const graphics_object&, int) - { gripe_invalid ("base_graphics_toolkit::update"); } + { gripe_invalid ("base_graphics_toolkit::update"); } void update (const graphics_handle&, int); @@ -2086,7 +2090,7 @@ // created. This allows the graphics toolkit to do toolkit-specific // initializations for a newly created object. virtual bool initialize (const graphics_object&) - { gripe_invalid ("base_graphics_toolkit::initialize"); return false; } + { gripe_invalid ("base_graphics_toolkit::initialize"); return false; } bool initialize (const graphics_handle&); @@ -2094,7 +2098,7 @@ // graphics object. This allows the graphics toolkit to perform // toolkit-specific cleanup operations before an object is deleted. virtual void finalize (const graphics_object&) - { gripe_invalid ("base_graphics_toolkit::finalize"); } + { gripe_invalid ("base_graphics_toolkit::finalize"); } void finalize (const graphics_handle&); @@ -2108,10 +2112,10 @@ private: void gripe_invalid (const std::string& fname) const - { - if (! is_valid ()) - error ("%s: invalid graphics toolkit", fname.c_str ()); - } + { + if (! is_valid ()) + error ("%s: invalid graphics toolkit", fname.c_str ()); + } }; class graphics_toolkit @@ -2119,85 +2123,85 @@ public: graphics_toolkit (void) : rep (new base_graphics_toolkit ("unknown")) - { - rep->count++; - } + { + rep->count++; + } graphics_toolkit (base_graphics_toolkit* b) : rep (b) - { - rep->count++; - } + { + rep->count++; + } graphics_toolkit (const graphics_toolkit& b) : rep (b.rep) - { - rep->count++; - } + { + rep->count++; + } ~graphics_toolkit (void) - { - if (--rep->count == 0) - delete rep; - } + { + if (--rep->count == 0) + delete rep; + } graphics_toolkit& operator = (const graphics_toolkit& b) - { - if (rep != b.rep) - { - if (--rep->count == 0) - delete rep; - - rep = b.rep; - rep->count++; - } - - return *this; - } + { + if (rep != b.rep) + { + if (--rep->count == 0) + delete rep; + + rep = b.rep; + rep->count++; + } + + return *this; + } operator bool (void) const { return rep->is_valid (); } std::string get_name (void) const { return rep->get_name (); } void redraw_figure (const graphics_object& go) const - { rep->redraw_figure (go); } + { rep->redraw_figure (go); } void print_figure (const graphics_object& go, const std::string& term, const std::string& file, bool mono, const std::string& debug_file = "") const - { rep->print_figure (go, term, file, mono, debug_file); } + { rep->print_figure (go, term, file, mono, debug_file); } Matrix get_canvas_size (const graphics_handle& fh) const - { return rep->get_canvas_size (fh); } + { return rep->get_canvas_size (fh); } double get_screen_resolution (void) const - { return rep->get_screen_resolution (); } + { return rep->get_screen_resolution (); } Matrix get_screen_size (void) const - { return rep->get_screen_size (); } + { return rep->get_screen_size (); } // Notifies graphics toolkit that object't property has changed. void update (const graphics_object& go, int id) - { rep->update (go, id); } + { rep->update (go, id); } void update (const graphics_handle& h, int id) - { rep->update (h, id); } + { rep->update (h, id); } // Notifies graphics toolkit that new object was created. bool initialize (const graphics_object& go) - { return rep->initialize (go); } + { return rep->initialize (go); } bool initialize (const graphics_handle& h) - { return rep->initialize (h); } + { return rep->initialize (h); } // Notifies graphics toolkit that object was destroyed. // This is called only for explicitly deleted object. Children are // deleted implicitly and graphics toolkit isn't notified. void finalize (const graphics_object& go) - { rep->finalize (go); } + { rep->finalize (go); } void finalize (const graphics_handle& h) - { rep->finalize (h); } + { rep->finalize (h); } // Close the graphics toolkit. void close (void) { rep->close (); } @@ -2243,7 +2247,7 @@ static graphics_toolkit find_toolkit (const std::string& name) { return instance_ok () - ? instance->do_find_toolkit (name) : graphics_toolkit (); + ? instance->do_find_toolkit (name) : graphics_toolkit (); } static Cell available_toolkits_list (void) @@ -2351,7 +2355,7 @@ Cell do_available_toolkits_list (void) const { Cell m (1 , available_toolkits.size ()); - + octave_idx_type i = 0; for (const_available_toolkits_iterator p = available_toolkits.begin (); p != available_toolkits.end (); p++) @@ -2363,7 +2367,7 @@ Cell do_loaded_toolkits_list (void) const { Cell m (1 , loaded_toolkits.size ()); - + octave_idx_type i = 0; for (const_loaded_toolkits_iterator p = loaded_toolkits.begin (); p != loaded_toolkits.end (); p++) @@ -2413,9 +2417,9 @@ void override_defaults (base_graphics_object& obj); virtual void init_integerhandle (const octave_value&) - { - panic_impossible (); - } + { + panic_impossible (); + } // Look through DEFAULTS for properties with given CLASS_NAME, and // apply them to the current object with set (virtual method). @@ -2423,11 +2427,11 @@ void set_from_list (base_graphics_object& obj, property_list& defaults); void insert_property (const std::string& name, property p) - { - p.set_name (name); - p.set_parent (__myhandle__); - all_props[name] = p; - } + { + p.set_name (name); + p.set_parent (__myhandle__); + all_props[name] = p; + } virtual void set (const caseless_str&, const octave_value&); @@ -2456,10 +2460,10 @@ bool is_modified (void) const { return is___modified__ (); } virtual void remove_child (const graphics_handle& h) - { - if (children.remove_child (h.value ())) - mark_modified (); - } + { + if (children.remove_child (h.value ())) + mark_modified (); + } virtual void adopt (const graphics_handle& h) { @@ -2469,9 +2473,10 @@ virtual graphics_toolkit get_toolkit (void) const; - virtual Matrix get_boundingbox (bool /*internal*/ = false, - const Matrix& /*parent_pix_size*/ = Matrix ()) const - { return Matrix (1, 4, 0.0); } + virtual Matrix + get_boundingbox (bool /*internal*/ = false, + const Matrix& /*parent_pix_size*/ = Matrix ()) const + { return Matrix (1, 4, 0.0); } virtual void update_boundingbox (void); @@ -2488,19 +2493,19 @@ void set_parent (const octave_value& val); Matrix get_children (void) const - { - return children.get_children (); - } + { + return children.get_children (); + } Matrix get_all_children (void) const - { - return children.get_all (); - } + { + return children.get_all (); + } Matrix get_hidden_children (void) const - { - return children.get_hidden (); - } + { + return children.get_hidden (); + } void set_modified (const octave_value& val) { set___modified__ (val); } @@ -2517,19 +2522,19 @@ const graphics_handle& h) const; virtual void delete_children (bool clear = false) - { - children.delete_children (clear); - } + { + children.delete_children (clear); + } void renumber_child (graphics_handle old_gh, graphics_handle new_gh) - { - children.renumber (old_gh, new_gh); - } + { + children.renumber (old_gh, new_gh); + } void renumber_parent (graphics_handle new_gh) - { - parent = new_gh; - } + { + parent = new_gh; + } static property_list::pval_map_type factory_defaults (void); @@ -2594,23 +2599,23 @@ protected: struct cmp_caseless_str + { + bool operator () (const caseless_str &a, const caseless_str &b) const { - bool operator () (const caseless_str &a, const caseless_str &b) const - { - std::string a1 = a; - std::transform (a1.begin (), a1.end (), a1.begin (), tolower); - std::string b1 = b; - std::transform (b1.begin (), b1.end (), b1.begin (), tolower); - - return a1 < b1; - } - }; + std::string a1 = a; + std::transform (a1.begin (), a1.end (), a1.begin (), tolower); + std::string b1 = b; + std::transform (b1.begin (), b1.end (), b1.begin (), tolower); + + return a1 < b1; + } + }; std::map<caseless_str, property, cmp_caseless_str> all_props; protected: void insert_static_property (const std::string& name, base_property& p) - { insert_property (name, property (&p, true)); } + { insert_property (name, property (&p, true)); } virtual void init (void) { } }; @@ -2786,7 +2791,7 @@ virtual std::string type (void) const { return (valid_object () ? get_properties ().graphics_object_name () - : "unknown"); + : "unknown"); } bool isa (const std::string& go_name) const @@ -2808,53 +2813,53 @@ virtual void add_property_listener (const std::string& nm, const octave_value& v, listener_mode mode = POSTSET) - { - if (valid_object ()) - get_properties ().add_listener (nm, v, mode); - } + { + if (valid_object ()) + get_properties ().add_listener (nm, v, mode); + } virtual void delete_property_listener (const std::string& nm, const octave_value& v, listener_mode mode = POSTSET) - { - if (valid_object ()) - get_properties ().delete_listener (nm, v, mode); - } + { + if (valid_object ()) + get_properties ().delete_listener (nm, v, mode); + } virtual void remove_all_listeners (void); virtual void reset_default_properties (void) - { - if (valid_object ()) - { - std::string msg = (type () + "::reset_default_properties"); - gripe_not_implemented (msg.c_str ()); - } - else - error ("base_graphics_object::default: invalid graphics object"); - } + { + if (valid_object ()) + { + std::string msg = (type () + "::reset_default_properties"); + gripe_not_implemented (msg.c_str ()); + } + else + error ("base_graphics_object::default: invalid graphics object"); + } protected: virtual void initialize (const graphics_object& go) - { - if (! toolkit_flag) - toolkit_flag = get_toolkit ().initialize (go); - } + { + if (! toolkit_flag) + toolkit_flag = get_toolkit ().initialize (go); + } virtual void finalize (const graphics_object& go) - { - if (toolkit_flag) - { - get_toolkit ().finalize (go); - toolkit_flag = false; - } - } + { + if (toolkit_flag) + { + get_toolkit ().finalize (go); + toolkit_flag = false; + } + } virtual void update (const graphics_object& go, int id) - { - if (toolkit_flag) - get_toolkit ().update (go, id); - } + { + if (toolkit_flag) + get_toolkit ().update (go, id); + } protected: // A reference count. @@ -2938,9 +2943,9 @@ octave_value get (const caseless_str& name) const { return name.compare ("default") - ? get_defaults () - : (name.compare ("factory") - ? get_factory_defaults () : rep->get (name)); + ? get_defaults () + : (name.compare ("factory") + ? get_factory_defaults () : rep->get (name)); } octave_value get (const std::string& name) const @@ -3056,14 +3061,14 @@ void add_property_listener (const std::string& nm, const octave_value& v, listener_mode mode = POSTSET) - { rep->add_property_listener (nm, v, mode); } + { rep->add_property_listener (nm, v, mode); } void delete_property_listener (const std::string& nm, const octave_value& v, listener_mode mode = POSTSET) - { rep->delete_property_listener (nm, v, mode); } + { rep->delete_property_listener (nm, v, mode); } void initialize (void) { rep->initialize (*this); } - + void finalize (void) { rep->finalize (*this); } void update (int id) { rep->update (*this, id); } @@ -3140,7 +3145,8 @@ public: - root_figure (void) : xproperties (0, graphics_handle ()), default_properties () { } + root_figure (void) + : xproperties (0, graphics_handle ()), default_properties () { } ~root_figure (void) { } @@ -3242,21 +3248,21 @@ { public: void init_integerhandle (const octave_value& val) - { - integerhandle = val; - } + { + integerhandle = val; + } void remove_child (const graphics_handle& h); void set_visible (const octave_value& val); graphics_toolkit get_toolkit (void) const - { - if (! toolkit) - toolkit = gtk_manager::get_toolkit (); - - return toolkit; - } + { + if (! toolkit) + toolkit = gtk_manager::get_toolkit (); + + return toolkit; + } void set_toolkit (const graphics_toolkit& b); @@ -3370,16 +3376,16 @@ protected: void init (void) - { - alphamap.add_constraint (dim_vector (-1, 1)); - colormap.add_constraint (dim_vector (-1, 3)); - outerposition.add_constraint (dim_vector (1, 4)); - paperposition.add_constraint (dim_vector (1, 4)); - papersize.add_constraint (dim_vector (1, 2)); - pointershapecdata.add_constraint (dim_vector (16, 16)); - pointershapehotspot.add_constraint (dim_vector (1, 2)); - position.add_constraint (dim_vector (1, 4)); - } + { + alphamap.add_constraint (dim_vector (-1, 1)); + colormap.add_constraint (dim_vector (-1, 3)); + outerposition.add_constraint (dim_vector (1, 4)); + paperposition.add_constraint (dim_vector (1, 4)); + papersize.add_constraint (dim_vector (1, 2)); + pointershapecdata.add_constraint (dim_vector (16, 16)); + pointershapehotspot.add_constraint (dim_vector (1, 2)); + position.add_constraint (dim_vector (1, 4)); + } private: mutable graphics_toolkit toolkit; @@ -3461,9 +3467,9 @@ graphics_xform (void) : xform (xform_eye ()), xform_inv (xform_eye ()), sx ("linear"), sy ("linear"), sz ("linear"), zlim (1, 2, 0.0) - { - zlim(1) = 1.0; - } + { + zlim(1) = 1.0; + } graphics_xform (const Matrix& xm, const Matrix& xim, const scaler& x, const scaler& y, const scaler& z, @@ -3477,16 +3483,16 @@ ~graphics_xform (void) { } graphics_xform& operator = (const graphics_xform& g) - { - xform = g.xform; - xform_inv = g.xform_inv; - sx = g.sx; - sy = g.sy; - sz = g.sz; - zlim = g.zlim; - - return *this; - } + { + xform = g.xform; + xform_inv = g.xform_inv; + sx = g.sx; + sy = g.sy; + sz = g.sz; + zlim = g.zlim; + + return *this; + } static ColumnVector xform_vector (double x, double y, double z); @@ -3499,34 +3505,34 @@ bool use_scale = true) const; ColumnVector untransform (double x, double y, bool use_scale = true) const - { return untransform (x, y, (zlim(0)+zlim(1))/2, use_scale); } + { return untransform (x, y, (zlim(0)+zlim(1))/2, use_scale); } Matrix xscale (const Matrix& m) const { return sx.scale (m); } Matrix yscale (const Matrix& m) const { return sy.scale (m); } Matrix zscale (const Matrix& m) const { return sz.scale (m); } Matrix scale (const Matrix& m) const - { - bool has_z = (m.columns () > 2); - - if (sx.is_linear () && sy.is_linear () - && (! has_z || sz.is_linear ())) - return m; - - Matrix retval (m.dims ()); - - int r = m.rows (); - - for (int i = 0; i < r; i++) - { - retval(i,0) = sx.scale (m(i,0)); - retval(i,1) = sy.scale (m(i,1)); - if (has_z) - retval(i,2) = sz.scale (m(i,2)); - } - - return retval; - } + { + bool has_z = (m.columns () > 2); + + if (sx.is_linear () && sy.is_linear () + && (! has_z || sz.is_linear ())) + return m; + + Matrix retval (m.dims ()); + + int r = m.rows (); + + for (int i = 0; i < r; i++) + { + retval(i,0) = sx.scale (m(i,0)); + retval(i,1) = sy.scale (m(i,1)); + if (has_z) + retval(i,2) = sz.scale (m(i,2)); + } + + return retval; + } private: Matrix xform; @@ -3535,7 +3541,8 @@ Matrix zlim; }; -enum { +enum +{ AXE_ANY_DIR = 0, AXE_DEPTH_DIR = 1, AXE_HORZ_DIR = 2, @@ -3558,28 +3565,29 @@ Matrix get_boundingbox (bool internal = false, const Matrix& parent_pix_size = Matrix ()) const; - Matrix get_extent (bool with_text = false, bool only_text_height=false) const; + Matrix get_extent (bool with_text = false, + bool only_text_height=false) const; double get_fontsize_points (double box_pix_height = 0) const; void update_boundingbox (void) - { - if (units_is ("normalized")) - { - sync_positions (); - base_properties::update_boundingbox (); - } - } + { + if (units_is ("normalized")) + { + sync_positions (); + base_properties::update_boundingbox (); + } + } void update_camera (void); void update_axes_layout (void); void update_aspectratios (void); void update_transform (void) - { - update_aspectratios (); - update_camera (); - update_axes_layout (); - } + { + update_aspectratios (); + update_camera (); + update_axes_layout (); + } void sync_positions (void); @@ -3590,7 +3598,7 @@ void update_title_position (void); graphics_xform get_transform (void) const - { return graphics_xform (x_render, x_render_inv, sx, sy, sz, x_zlim); } + { return graphics_xform (x_render, x_render_inv, sx, sy, sz, x_zlim); } Matrix get_transform_matrix (void) const { return x_render; } Matrix get_inverse_transform_matrix (void) const { return x_render_inv; } @@ -3644,7 +3652,8 @@ void zoom_about_point (double x, double y, double factor, bool push_to_zoom_stack = true); - void zoom (const Matrix& xl, const Matrix& yl, bool push_to_zoom_stack = true); + void zoom (const Matrix& xl, const Matrix& yl, + bool push_to_zoom_stack = true); void translate_view (double x0, double x1, double y0, double y1); void rotate_view (double delta_az, double delta_el); void unzoom (void); @@ -3834,15 +3843,15 @@ void update_layer (void) { update_axes_layout (); } void update_yaxislocation (void) - { - update_axes_layout (); - update_ylabel_position (); - } + { + update_axes_layout (); + update_ylabel_position (); + } void update_xaxislocation (void) - { - update_axes_layout (); - update_xlabel_position (); - } + { + update_axes_layout (); + update_xlabel_position (); + } void update_xdir (void) { update_camera (); update_axes_layout (); } void update_ydir (void) { update_camera (); update_axes_layout (); } @@ -3853,61 +3862,64 @@ void update_tickdirmode (void) { update_ticklength (); } void update_xtick (void) - { - if (xticklabelmode.is ("auto")) - calc_ticklabels (xtick, xticklabel, xscale.is ("log")); - } + { + if (xticklabelmode.is ("auto")) + calc_ticklabels (xtick, xticklabel, xscale.is ("log")); + } void update_ytick (void) - { - if (yticklabelmode.is ("auto")) - calc_ticklabels (ytick, yticklabel, yscale.is ("log")); - } + { + if (yticklabelmode.is ("auto")) + calc_ticklabels (ytick, yticklabel, yscale.is ("log")); + } void update_ztick (void) - { - if (zticklabelmode.is ("auto")) - calc_ticklabels (ztick, zticklabel, zscale.is ("log")); - } + { + if (zticklabelmode.is ("auto")) + calc_ticklabels (ztick, zticklabel, zscale.is ("log")); + } void update_xtickmode (void) - { + { if (xtickmode.is ("auto")) { - calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"), xscale.is ("log")); + calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"), + xscale.is ("log")); update_xtick (); } - } + } void update_ytickmode (void) - { + { if (ytickmode.is ("auto")) { - calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"), yscale.is ("log")); + calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"), + yscale.is ("log")); update_ytick (); } - } + } void update_ztickmode (void) - { + { if (ztickmode.is ("auto")) { - calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"), zscale.is ("log")); + calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"), + zscale.is ("log")); update_ztick (); } - } + } void update_xticklabelmode (void) - { - if (xticklabelmode.is ("auto")) - calc_ticklabels (xtick, xticklabel, xscale.is ("log")); - } + { + if (xticklabelmode.is ("auto")) + calc_ticklabels (xtick, xticklabel, xscale.is ("log")); + } void update_yticklabelmode (void) - { - if (yticklabelmode.is ("auto")) - calc_ticklabels (ytick, yticklabel, yscale.is ("log")); - } + { + if (yticklabelmode.is ("auto")) + calc_ticklabels (ytick, yticklabel, yscale.is ("log")); + } void update_zticklabelmode (void) - { - if (zticklabelmode.is ("auto")) - calc_ticklabels (ztick, zticklabel, zscale.is ("log")); - } + { + if (zticklabelmode.is ("auto")) + calc_ticklabels (ztick, zticklabel, zscale.is ("log")); + } void update_font (void); void update_fontname (void) { update_font (); } @@ -3960,45 +3972,47 @@ } void update_looseinset (void) - { - caseless_str old_units = get_units (); - set_units ("normalized"); - Matrix innerbox = position.get ().matrix_value (); - innerbox(2) = innerbox(2) + innerbox(0); - innerbox(3) = innerbox(3) + innerbox(1); - Matrix outerbox = outerposition.get ().matrix_value (); - outerbox(2) = outerbox(2) + outerbox(0); - outerbox(3) = outerbox(3) + outerbox(1); - Matrix linset = looseinset.get ().matrix_value (); - Matrix tinset = tightinset.get ().matrix_value (); - if (activepositionproperty.is ("position")) - { - outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0)); - outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1)); - outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2)); - outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3)); - outerbox(2) = outerbox(2) - outerbox(0); - outerbox(3) = outerbox(3) - outerbox(1); - outerposition = outerbox; - } - else - { - innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0)); - innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1)); - innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2)); - innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3)); - innerbox(2) = innerbox(2) - innerbox(0); - innerbox(3) = innerbox(3) - innerbox(1); - position = innerbox; - } - set_units (old_units); - update_transform (); - } + { + caseless_str old_units = get_units (); + set_units ("normalized"); + Matrix innerbox = position.get ().matrix_value (); + innerbox(2) = innerbox(2) + innerbox(0); + innerbox(3) = innerbox(3) + innerbox(1); + Matrix outerbox = outerposition.get ().matrix_value (); + outerbox(2) = outerbox(2) + outerbox(0); + outerbox(3) = outerbox(3) + outerbox(1); + Matrix linset = looseinset.get ().matrix_value (); + Matrix tinset = tightinset.get ().matrix_value (); + if (activepositionproperty.is ("position")) + { + outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0)); + outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1)); + outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2)); + outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3)); + outerbox(2) = outerbox(2) - outerbox(0); + outerbox(3) = outerbox(3) - outerbox(1); + outerposition = outerbox; + } + else + { + innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0)); + innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1)); + innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2)); + innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3)); + innerbox(2) = innerbox(2) - innerbox(0); + innerbox(3) = innerbox(3) - innerbox(1); + position = innerbox; + } + set_units (old_units); + update_transform (); + } double calc_tick_sep (double minval, double maxval); - void calc_ticks_and_lims (array_property& lims, array_property& ticks, array_property& mticks, + void calc_ticks_and_lims (array_property& lims, array_property& ticks, + array_property& mticks, bool limmode_is_auto, bool is_logscale); - void calc_ticklabels (const array_property& ticks, any_property& labels, bool is_logscale); + void calc_ticklabels (const array_property& ticks, any_property& labels, + bool is_logscale); Matrix get_ticklabel_extents (const Matrix& ticks, const string_vector& ticklabels, const Matrix& limits); @@ -4033,7 +4047,8 @@ void update_xlim (bool do_clr_zoom = true) { if (xtickmode.is ("auto")) - calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"), xscale.is ("log")); + calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"), + xscale.is ("log")); if (xticklabelmode.is ("auto")) calc_ticklabels (xtick, xticklabel, xscale.is ("log")); @@ -4050,7 +4065,8 @@ void update_ylim (bool do_clr_zoom = true) { if (ytickmode.is ("auto")) - calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"), yscale.is ("log")); + calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"), + yscale.is ("log")); if (yticklabelmode.is ("auto")) calc_ticklabels (ytick, yticklabel, yscale.is ("log")); @@ -4067,7 +4083,8 @@ void update_zlim (void) { if (ztickmode.is ("auto")) - calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"), zscale.is ("log")); + calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"), + zscale.is ("log")); if (zticklabelmode.is ("auto")) calc_ticklabels (ztick, zticklabel, zscale.is ("log")); @@ -4216,10 +4233,10 @@ void update_ydata (void) { set_ylim (compute_ylim ()); } void update_zdata (void) - { - set_zlim (zdata.get_limits ()); - set_zliminclude (get_zdata ().numel () > 0); - } + { + set_zlim (zdata.get_limits ()); + set_zliminclude (get_zdata ().numel () > 0); + } }; private: @@ -4256,11 +4273,11 @@ if (! error_state) { octave_value new_val (val); - + if (new_val.numel () == 2) { dim_vector dv (1, 3); - + new_val = new_val.resize (dv, true); } @@ -4328,36 +4345,36 @@ protected: void init (void) - { - position.add_constraint (dim_vector (1, 3)); - cached_units = get_units (); - update_font (); - } + { + position.add_constraint (dim_vector (1, 3)); + cached_units = get_units (); + update_font (); + } private: void update_position (void) - { - Matrix pos = get_data_position (); - Matrix lim; - - lim = Matrix (1, 3, pos(0)); - lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); - set_xlim (lim); - - lim = Matrix (1, 3, pos(1)); - lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); - set_ylim (lim); - - if (pos.numel () == 3) - { - lim = Matrix (1, 3, pos(2)); - lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); - set_zliminclude ("on"); - set_zlim (lim); - } - else - set_zliminclude ("off"); - } + { + Matrix pos = get_data_position (); + Matrix lim; + + lim = Matrix (1, 3, pos(0)); + lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); + set_xlim (lim); + + lim = Matrix (1, 3, pos(1)); + lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); + set_ylim (lim); + + if (pos.numel () == 3) + { + lim = Matrix (1, 3, pos(2)); + lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2)); + set_zliminclude ("on"); + set_zlim (lim); + } + else + set_zliminclude ("off"); + } void update_text_extent (void); @@ -4415,14 +4432,14 @@ { public: bool is_aliminclude (void) const - { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } + { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } std::string get_aliminclude (void) const - { return aliminclude.current_value (); } + { return aliminclude.current_value (); } bool is_climinclude (void) const - { return (climinclude.is_on () && cdatamapping.is ("scaled")); } + { return (climinclude.is_on () && cdatamapping.is ("scaled")); } std::string get_climinclude (void) const - { return climinclude.current_value (); } + { return climinclude.current_value (); } octave_value get_color_data (void) const; @@ -4470,20 +4487,20 @@ private: void update_alphadata (void) - { - if (alphadatamapping_is ("scaled")) - set_alim (alphadata.get_limits ()); - else - alim = alphadata.get_limits (); - } + { + if (alphadatamapping_is ("scaled")) + set_alim (alphadata.get_limits ()); + else + alim = alphadata.get_limits (); + } void update_cdata (void) - { - if (cdatamapping_is ("scaled")) - set_clim (cdata.get_limits ()); - else - clim = cdata.get_limits (); - } + { + if (cdatamapping_is ("scaled")) + set_clim (cdata.get_limits ()); + else + clim = cdata.get_limits (); + } void update_xdata (void) { @@ -4564,14 +4581,14 @@ octave_value get_color_data (void) const; bool is_aliminclude (void) const - { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } + { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } std::string get_aliminclude (void) const - { return aliminclude.current_value (); } + { return aliminclude.current_value (); } bool is_climinclude (void) const - { return (climinclude.is_on () && cdatamapping.is ("scaled")); } + { return (climinclude.is_on () && cdatamapping.is ("scaled")); } std::string get_climinclude (void) const - { return climinclude.current_value (); } + { return climinclude.current_value (); } // See the genprops.awk script for an explanation of the // properties declarations. @@ -4629,20 +4646,20 @@ protected: void init (void) - { - xdata.add_constraint (dim_vector (-1, -1)); - ydata.add_constraint (dim_vector (-1, -1)); - zdata.add_constraint (dim_vector (-1, -1)); - faces.add_constraint (dim_vector (-1, -1)); - vertices.add_constraint (dim_vector (-1, 2)); - vertices.add_constraint (dim_vector (-1, 3)); - cdata.add_constraint (dim_vector (-1, -1)); - cdata.add_constraint (dim_vector (-1, -1, 3)); - facevertexcdata.add_constraint (dim_vector (-1, 1)); - facevertexcdata.add_constraint (dim_vector (-1, 3)); - facevertexalphadata.add_constraint (dim_vector (-1, 1)); - vertexnormals.add_constraint (dim_vector (-1, -1)); - } + { + xdata.add_constraint (dim_vector (-1, -1)); + ydata.add_constraint (dim_vector (-1, -1)); + zdata.add_constraint (dim_vector (-1, -1)); + faces.add_constraint (dim_vector (-1, -1)); + vertices.add_constraint (dim_vector (-1, 2)); + vertices.add_constraint (dim_vector (-1, 3)); + cdata.add_constraint (dim_vector (-1, -1)); + cdata.add_constraint (dim_vector (-1, -1, 3)); + facevertexcdata.add_constraint (dim_vector (-1, 1)); + facevertexcdata.add_constraint (dim_vector (-1, 3)); + facevertexalphadata.add_constraint (dim_vector (-1, 1)); + vertexnormals.add_constraint (dim_vector (-1, -1)); + } private: void update_xdata (void) { set_xlim (xdata.get_limits ()); } @@ -4650,12 +4667,12 @@ void update_zdata (void) { set_zlim (zdata.get_limits ()); } void update_cdata (void) - { - if (cdatamapping_is ("scaled")) - set_clim (cdata.get_limits ()); - else - clim = cdata.get_limits (); - } + { + if (cdatamapping_is ("scaled")) + set_clim (cdata.get_limits ()); + else + clim = cdata.get_limits (); + } }; private: @@ -4688,14 +4705,14 @@ octave_value get_color_data (void) const; bool is_aliminclude (void) const - { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } + { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } std::string get_aliminclude (void) const - { return aliminclude.current_value (); } + { return aliminclude.current_value (); } bool is_climinclude (void) const - { return (climinclude.is_on () && cdatamapping.is ("scaled")); } + { return (climinclude.is_on () && cdatamapping.is ("scaled")); } std::string get_climinclude (void) const - { return climinclude.current_value (); } + { return climinclude.current_value (); } // See the genprops.awk script for an explanation of the // properties declarations. @@ -4755,62 +4772,62 @@ protected: void init (void) - { - xdata.add_constraint (dim_vector (-1, -1)); - ydata.add_constraint (dim_vector (-1, -1)); - zdata.add_constraint (dim_vector (-1, -1)); - cdata.add_constraint ("double"); - cdata.add_constraint ("single"); - cdata.add_constraint (dim_vector (-1, -1)); - cdata.add_constraint (dim_vector (-1, -1, 3)); - alphadata.add_constraint ("double"); - alphadata.add_constraint ("uint8"); - alphadata.add_constraint (dim_vector (-1, -1)); - vertexnormals.add_constraint (dim_vector (-1, -1, 3)); - } + { + xdata.add_constraint (dim_vector (-1, -1)); + ydata.add_constraint (dim_vector (-1, -1)); + zdata.add_constraint (dim_vector (-1, -1)); + cdata.add_constraint ("double"); + cdata.add_constraint ("single"); + cdata.add_constraint (dim_vector (-1, -1)); + cdata.add_constraint (dim_vector (-1, -1, 3)); + alphadata.add_constraint ("double"); + alphadata.add_constraint ("uint8"); + alphadata.add_constraint (dim_vector (-1, -1)); + vertexnormals.add_constraint (dim_vector (-1, -1, 3)); + } private: void update_alphadata (void) - { - if (alphadatamapping_is ("scaled")) - set_alim (alphadata.get_limits ()); - else - alim = alphadata.get_limits (); - } + { + if (alphadatamapping_is ("scaled")) + set_alim (alphadata.get_limits ()); + else + alim = alphadata.get_limits (); + } void update_cdata (void) - { - if (cdatamapping_is ("scaled")) - set_clim (cdata.get_limits ()); - else - clim = cdata.get_limits (); - } + { + if (cdatamapping_is ("scaled")) + set_clim (cdata.get_limits ()); + else + clim = cdata.get_limits (); + } void update_xdata (void) - { - update_normals (); - set_xlim (xdata.get_limits ()); - } + { + update_normals (); + set_xlim (xdata.get_limits ()); + } void update_ydata (void) - { - update_normals (); - set_ylim (ydata.get_limits ()); - } + { + update_normals (); + set_ylim (ydata.get_limits ()); + } void update_zdata (void) - { - update_normals (); - set_zlim (zdata.get_limits ()); - } + { + update_normals (); + set_zlim (zdata.get_limits ()); + } void update_normals (void); void update_normalmode (void) - { update_normals (); } + { update_normals (); } void update_vertexnormals (void) - { set_normalmode ("manual"); } + { set_normalmode ("manual"); } }; private: @@ -4841,17 +4858,17 @@ { public: void remove_child (const graphics_handle& h) - { - base_properties::remove_child (h); - update_limits (); - } + { + base_properties::remove_child (h); + update_limits (); + } void adopt (const graphics_handle& h) - { - - base_properties::adopt (h); - update_limits (h); - } + { + + base_properties::adopt (h); + update_limits (h); + } // See the genprops.awk script for an explanation of the // properties declarations. @@ -4875,13 +4892,13 @@ END_PROPERTIES private: - void update_limits (void) const; - - void update_limits (const graphics_handle& h) const; + void update_limits (void) const; + + void update_limits (const graphics_handle& h) const; protected: void init (void) - { } + { } }; @@ -4919,14 +4936,14 @@ { public: void remove_child (const graphics_handle& h) - { - base_properties::remove_child (h); - } + { + base_properties::remove_child (h); + } void adopt (const graphics_handle& h) - { - base_properties::adopt (h); - } + { + base_properties::adopt (h); + } // See the genprops.awk script for an explanation of the // properties declarations. @@ -4948,7 +4965,7 @@ protected: void init (void) - { } + { } }; private: @@ -4991,11 +5008,11 @@ protected: void init (void) - { - position.add_constraint (dim_vector (1, 2)); - position.add_constraint (dim_vector (2, 1)); - visible.set (octave_value (true)); - } + { + position.add_constraint (dim_vector (1, 2)); + position.add_constraint (dim_vector (2, 1)); + visible.set (octave_value (true)); + } }; private: @@ -5069,15 +5086,15 @@ protected: void init (void) - { - cdata.add_constraint ("double"); - cdata.add_constraint ("single"); - cdata.add_constraint (dim_vector (-1, -1, 3)); - position.add_constraint (dim_vector (1, 4)); - sliderstep.add_constraint (dim_vector (1, 2)); - cached_units = get_units (); - } - + { + cdata.add_constraint ("double"); + cdata.add_constraint ("single"); + cdata.add_constraint (dim_vector (-1, -1, 3)); + position.add_constraint (dim_vector (1, 4)); + sliderstep.add_constraint (dim_vector (1, 2)); + cached_units = get_units (); + } + void update_text_extent (void); void update_string (void) { update_text_extent (); } @@ -5195,7 +5212,7 @@ protected: void init (void) - { } + { } }; private: @@ -5289,11 +5306,11 @@ protected: void init (void) - { - cdata.add_constraint ("double"); - cdata.add_constraint ("single"); - cdata.add_constraint (dim_vector (-1, -1, 3)); - } + { + cdata.add_constraint ("double"); + cdata.add_constraint ("single"); + cdata.add_constraint (dim_vector (-1, -1, 3)); + } }; private: @@ -5342,11 +5359,11 @@ protected: void init (void) - { - cdata.add_constraint ("double"); - cdata.add_constraint ("single"); - cdata.add_constraint (dim_vector (-1, -1, 3)); - } + { + cdata.add_constraint ("double"); + cdata.add_constraint ("single"); + cdata.add_constraint (dim_vector (-1, -1, 3)); + } }; private: @@ -5407,54 +5424,54 @@ graphics_event (void) : rep (0) { } graphics_event (const graphics_event& e) : rep (e.rep) - { - rep->count++; - } + { + rep->count++; + } ~graphics_event (void) - { - if (rep && --rep->count == 0) - delete rep; - } + { + if (rep && --rep->count == 0) + delete rep; + } graphics_event& operator = (const graphics_event& e) - { - if (rep != e.rep) - { - if (rep && --rep->count == 0) - delete rep; - - rep = e.rep; - if (rep) - rep->count++; - } - - return *this; - } + { + if (rep != e.rep) + { + if (rep && --rep->count == 0) + delete rep; + + rep = e.rep; + if (rep) + rep->count++; + } + + return *this; + } void execute (void) - { if (rep) rep->execute (); } + { if (rep) rep->execute (); } bool ok (void) const - { return (rep != 0); } + { return (rep != 0); } + + static graphics_event + create_callback_event (const graphics_handle& h, + const std::string& name, + const octave_value& data = Matrix ()); static graphics_event - create_callback_event (const graphics_handle& h, - const std::string& name, - const octave_value& data = Matrix ()); - - static graphics_event - create_callback_event (const graphics_handle& h, - const octave_value& cb, - const octave_value& data = Matrix ()); + create_callback_event (const graphics_handle& h, + const octave_value& cb, + const octave_value& data = Matrix ()); static graphics_event - create_function_event (event_fcn fcn, void *data = 0); + create_function_event (event_fcn fcn, void *data = 0); static graphics_event - create_set_event (const graphics_handle& h, const std::string& name, - const octave_value& value, - bool notify_toolkit = true); + create_set_event (const graphics_handle& h, const std::string& name, + const octave_value& value, + bool notify_toolkit = true); private: base_graphics_event *rep; }; @@ -5491,7 +5508,8 @@ static graphics_handle get_handle (bool integer_figure_handle) { return instance_ok () - ? instance->do_get_handle (integer_figure_handle) : graphics_handle (); + ? instance->do_get_handle (integer_figure_handle) + : graphics_handle (); } static void free (const graphics_handle& h) @@ -5515,7 +5533,7 @@ static graphics_handle lookup (const octave_value& val) { return val.is_real_scalar () - ? lookup (val.double_value ()) : graphics_handle (); + ? lookup (val.double_value ()) : graphics_handle (); } static graphics_object get_object (double val) @@ -5536,18 +5554,18 @@ bool do_notify_toolkit = true) { return instance_ok () - ? instance->do_make_graphics_handle (go_name, parent, - integer_figure_handle, - do_createfcn, do_notify_toolkit) - : graphics_handle (); + ? instance->do_make_graphics_handle (go_name, parent, + integer_figure_handle, + do_createfcn, do_notify_toolkit) + : graphics_handle (); } static graphics_handle make_figure_handle (double val, bool do_notify_toolkit = true) { return instance_ok () - ? instance->do_make_figure_handle (val, do_notify_toolkit) - : graphics_handle (); + ? instance->do_make_figure_handle (val, do_notify_toolkit) + : graphics_handle (); } static void push_figure (const graphics_handle& h) @@ -5565,13 +5583,13 @@ static graphics_handle current_figure (void) { return instance_ok () - ? instance->do_current_figure () : graphics_handle (); + ? instance->do_current_figure () : graphics_handle (); } static Matrix handle_list (bool show_hidden = false) { return instance_ok () - ? instance->do_handle_list (show_hidden) : Matrix (); + ? instance->do_handle_list (show_hidden) : Matrix (); } static void lock (void) @@ -5593,11 +5611,11 @@ if (instance_ok ()) instance->do_unlock (); } - + static Matrix figure_handle_list (bool show_hidden = false) { return instance_ok () - ? instance->do_figure_handle_list (show_hidden) : Matrix (); + ? instance->do_figure_handle_list (show_hidden) : Matrix (); } static void execute_listener (const graphics_handle& h, @@ -5642,7 +5660,7 @@ if (instance_ok ()) instance->do_post_callback (h, name, data); } - + static void post_function (graphics_event::event_fcn fcn, void* data = 0) { if (instance_ok ()) @@ -5667,10 +5685,10 @@ } static void enable_event_processing (bool enable = true) - { - if (instance_ok ()) - instance->do_enable_event_processing (enable); - } + { + if (instance_ok ()) + instance->do_enable_event_processing (enable); + } static bool is_handle_visible (const graphics_handle& h) { @@ -5699,7 +5717,7 @@ ? instance->graphics_lock : octave_mutex (), wait) - { } + { } private: @@ -5713,7 +5731,8 @@ static gh_manager *instance; typedef std::map<graphics_handle, graphics_object>::iterator iterator; - typedef std::map<graphics_handle, graphics_object>::const_iterator const_iterator; + typedef std::map<graphics_handle, graphics_object>::const_iterator + const_iterator; typedef std::set<graphics_handle>::iterator free_list_iterator; typedef std::set<graphics_handle>::const_iterator const_free_list_iterator; @@ -5847,7 +5866,7 @@ void do_post_callback (const graphics_handle& h, const std::string name, const octave_value& data); - + void do_post_function (graphics_event::event_fcn fcn, void* fcn_data); void do_post_set (const graphics_handle& h, const std::string name,
--- a/libinterp/corefcn/gripes.cc +++ b/libinterp/corefcn/gripes.cc @@ -61,7 +61,8 @@ } void -gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) +gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, + octave_idx_type r2, octave_idx_type c2) { error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)", r1, c1, r2, c2);
--- a/libinterp/corefcn/gripes.h +++ b/libinterp/corefcn/gripes.h @@ -45,7 +45,8 @@ gripe_nonconformant (void); extern OCTINTERP_API void -gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2); +gripe_nonconformant (octave_idx_type r1, octave_idx_type c1, + octave_idx_type r2, octave_idx_type c2); extern OCTINTERP_API void gripe_empty_arg (const char *name, bool is_error);
--- a/libinterp/corefcn/help.cc +++ b/libinterp/corefcn/help.cc @@ -788,7 +788,7 @@ const static map_type keywords_map (keywords, keywords + size (keywords)); const static string_vector keyword_names = names (keywords_map); -// FIXME -- It's not likely that this does the right thing now. +// FIXME: It's not likely that this does the right thing now. string_vector make_name_list (void) @@ -845,9 +845,10 @@ { const size_t p1 = msg.find ('\n'); std::string t = msg.substr (0, p1); - const size_t p2 = t.find ("<html"); // FIXME: this comparison should be case-insensitive + // FIXME: this comparison should be case-insensitive + const size_t p2 = t.find ("<html"); - return (p2 != std::string::npos); + return (p2 != std::string::npos); } static bool @@ -889,7 +890,7 @@ if (w.empty ()) w = fcn->is_user_function () - ? "command-line function" : "built-in function"; + ? "command-line function" : "built-in function"; } } @@ -936,7 +937,7 @@ } DEFUN (built_in_docstrings_file, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} built_in_docstrings_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} built_in_docstrings_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} built_in_docstrings_file (@var{new_val}, \"local\")\n\ @@ -981,7 +982,7 @@ return; } - // FIXME -- eliminate fixed buffer size. + // FIXME: eliminate fixed buffer size. size_t bufsize = 100000; OCTAVE_LOCAL_BUFFER (char, buf, bufsize); @@ -1130,7 +1131,7 @@ } DEFUN (get_help_text_from_file, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{text}, @var{format}] =} get_help_text_from_file (@var{fname})\n\ Return the raw help text from the file @var{fname}.\n\ \n\ @@ -1168,7 +1169,7 @@ // operators. DEFUN (__operators__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __operators__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1180,7 +1181,7 @@ // keywords. DEFUN (__keywords__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __keywords__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1192,7 +1193,7 @@ // functions. DEFUN (__builtins__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __builtins__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1233,7 +1234,7 @@ } else type = val.is_user_script () - ? std::string ("script") : std::string ("function"); + ? std::string ("script") : std::string ("function"); } } else @@ -1271,7 +1272,7 @@ } DEFUN (__which__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __which__ (@var{name}, @dots{})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1318,7 +1319,7 @@ return retval; } -// FIXME -- Are we sure this function always does the right thing? +// FIXME: Are we sure this function always does the right thing? inline bool file_is_in_dir (const std::string filename, const std::string dir) { @@ -1326,7 +1327,8 @@ { const int dir_len = dir.size (); const int filename_len = filename.size (); - const int max_allowed_seps = file_ops::is_dir_sep (dir[dir_len-1]) ? 0 : 1; + const int max_allowed_seps = file_ops::is_dir_sep (dir[dir_len-1]) ? 0 + : 1; int num_seps = 0; for (int i = dir_len; i < filename_len; i++) @@ -1344,7 +1346,7 @@ // the current path. DEFUN (__list_functions__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {@var{retval} =} __list_functions__ ()\n\ @deftypefnx {Function File} {@var{retval} =} __list_functions__ (@var{directory})\n\ Undocumented internal function.\n\ @@ -1384,7 +1386,7 @@ } DEFUN (doc_cache_file, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} doc_cache_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} doc_cache_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} doc_cache_file (@var{new_val}, \"local\")\n\ @@ -1408,7 +1410,7 @@ } DEFUN (texi_macros_file, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} texi_macros_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} texi_macros_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} texi_macros_file (@var{new_val}, \"local\")\n\ @@ -1432,7 +1434,7 @@ } DEFUN (info_file, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} info_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} info_file (@var{new_val})\n\ @deftypefnx {Built-in Function} {} info_file (@var{new_val}, \"local\")\n\ @@ -1454,7 +1456,7 @@ } DEFUN (info_program, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} info_program ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} info_program (@var{new_val})\n\ @deftypefnx {Built-in Function} {} info_program (@var{new_val}, \"local\")\n\ @@ -1478,7 +1480,7 @@ } DEFUN (makeinfo_program, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} makeinfo_program ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} makeinfo_program (@var{new_val})\n\ @deftypefnx {Built-in Function} {} makeinfo_program (@var{new_val}, \"local\")\n\ @@ -1496,7 +1498,7 @@ } DEFUN (suppress_verbose_help_message, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} suppress_verbose_help_message ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} suppress_verbose_help_message (@var{new_val})\n\ @deftypefnx {Built-in Function} {} suppress_verbose_help_message (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/hess.cc +++ b/libinterp/corefcn/hess.cc @@ -36,7 +36,7 @@ #include "utils.h" DEFUN (hess, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{H} =} hess (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{P}, @var{H}] =} hess (@var{A})\n\ @cindex Hessenberg decomposition\n\ @@ -95,7 +95,7 @@ { if (arg.is_real_type ()) { - FloatMatrix tmp = arg.float_matrix_value (); + FloatMatrix tmp = arg.float_matrix_value (); if (! error_state) {
--- a/libinterp/corefcn/hex2num.cc +++ b/libinterp/corefcn/hex2num.cc @@ -33,7 +33,7 @@ #include "utils.h" DEFUN (hex2num, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{n} =} hex2num (@var{s})\n\ @deftypefnx {Built-in Function} {@var{n} =} hex2num (@var{s}, @var{class})\n\ Typecast the 16 character hexadecimal character string to an IEEE 754\n\ @@ -197,7 +197,7 @@ */ DEFUN (num2hex, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} num2hex (@var{n})\n\ Typecast a double or single precision number or vector to a 8 or 16\n\ character hexadecimal string of the IEEE 754 representation of the number.\n\ @@ -257,7 +257,7 @@ for (octave_idx_type j = 0; j < nchars; j++) { unsigned char ch = - static_cast<char> (num.ival >> ((nchars - 1 - j) * 4) & 0xF); + static_cast<char>(num.ival >> ((nchars - 1 - j) * 4) & 0xF); if (ch >= 10) ch += 'a' - 10; else @@ -294,7 +294,7 @@ for (octave_idx_type j = 0; j < nchars; j++) { unsigned char ch = - static_cast<char> (num.ival >> ((nchars - 1 - j) * 4) & 0xF); + static_cast<char>(num.ival >> ((nchars - 1 - j) * 4) & 0xF); if (ch >= 10) ch += 'a' - 10; else
--- a/libinterp/corefcn/input.cc +++ b/libinterp/corefcn/input.cc @@ -147,9 +147,9 @@ void octave_base_reader::do_input_echo (const std::string& input_string) const { - int do_echo = reading_script_file () ? - (Vecho_executing_commands & ECHO_SCRIPTS) - : (Vecho_executing_commands & ECHO_CMD_LINE) && ! forced_interactive; + int do_echo = reading_script_file () + ? (Vecho_executing_commands & ECHO_SCRIPTS) + : (Vecho_executing_commands & ECHO_CMD_LINE) && ! forced_interactive; if (do_echo) { @@ -324,7 +324,7 @@ return command_editor::get_input_stream (); } -// FIXME -- make this generate file names when appropriate. +// FIXME: make this generate file names when appropriate. static string_vector generate_possible_completions (const std::string& text, std::string& prefix, @@ -436,8 +436,8 @@ else retval = name; - // FIXME -- looks_like_struct is broken for now, - // so it always returns false. + // FIXME: looks_like_struct is broken for now, + // so it always returns false. if (matches == 1 && looks_like_struct (retval)) { @@ -475,7 +475,7 @@ command_editor::set_name ("Octave"); - // FIXME -- this needs to include a comma too, but that + // FIXME: this needs to include a comma too, but that // causes trouble for the new struct element completion code. static const char *s = "\t\n !\"\'*+-/:;<=>(){}[\\]^`~"; @@ -536,7 +536,7 @@ } else { - // FIXME -- we should come up with a clean way to detect + // FIXME: we should come up with a clean way to detect // that we are stopped on the no-op command that marks the // end of a function or script. @@ -702,7 +702,7 @@ if (read_as_string) { - // FIXME -- fix gnu_readline and octave_gets instead! + // FIXME: fix gnu_readline and octave_gets instead! if (input_buf.length () == 1 && input_buf[0] == '\n') retval(0) = ""; else @@ -725,7 +725,7 @@ } DEFUN (input, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{ans} =} input (@var{prompt})\n\ @deftypefnx {Built-in Function} {@var{ans} =} input (@var{prompt}, \"s\")\n\ Print a prompt and wait for user input. For example,\n\ @@ -794,7 +794,7 @@ } DEFUN (yes_or_no, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{ans} =} yes_or_no (\"@var{prompt}\")\n\ Ask the user a yes-or-no question. Return logical true if the answer is yes\n\ or false if the answer is no. Takes one argument, @var{prompt}, which is\n\ @@ -853,7 +853,7 @@ frame.add_fcn (octave_call_stack::restore_frame, octave_call_stack::current_frame ()); - // FIXME -- probably we just want to print one line, not the + // FIXME: probably we just want to print one line, not the // entire statement, which might span many lines... // // tree_print_code tpc (octave_stdout); @@ -872,7 +872,7 @@ } DEFUN (keyboard, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} keyboard ()\n\ @deftypefnx {Built-in Function} {} keyboard (\"@var{prompt}\")\n\ This function is normally used for simple debugging. When the\n\ @@ -915,7 +915,7 @@ } DEFUN (echo, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} echo options\n\ Control whether commands are displayed as they are executed. Valid\n\ options are:\n\ @@ -999,7 +999,7 @@ } DEFUN (completion_matches, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} completion_matches (@var{hint})\n\ Generate possible completions given @var{hint}.\n\ \n\ @@ -1075,7 +1075,7 @@ } DEFUN (readline_read_init_file, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} readline_read_init_file (@var{file})\n\ Read the readline library initialization file @var{file}. If\n\ @var{file} is omitted, read the default initialization file (normally\n\ @@ -1106,7 +1106,7 @@ } DEFUN (readline_re_read_init_file, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} readline_re_read_init_file ()\n\ Re-read the last readline library initialization file that was read.\n\ @xref{Readline Init File, , , readline, GNU Readline Library},\n\ @@ -1136,7 +1136,7 @@ } DEFUN (add_input_event_hook, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn})\n\ @deftypefnx {Built-in Function} {@var{id} =} add_input_event_hook (@var{fcn}, @var{data})\n\ Add the named function or function handle @var{fcn} to the list of functions\n\ @@ -1187,7 +1187,7 @@ } DEFUN (remove_input_event_hook, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} remove_input_event_hook (@var{name})\n\ @deftypefnx {Built-in Function} {} remove_input_event_hook (@var{fcn_id})\n\ Remove the named function or function handle with the given identifier\n\ @@ -1230,7 +1230,7 @@ } DEFUN (PS1, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} PS1 ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} PS1 (@var{new_val})\n\ @deftypefnx {Built-in Function} {} PS1 (@var{new_val}, \"local\")\n\ @@ -1270,7 +1270,7 @@ } DEFUN (PS2, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} PS2 ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} PS2 (@var{new_val})\n\ @deftypefnx {Built-in Function} {} PS2 (@var{new_val}, \"local\")\n\ @@ -1291,7 +1291,7 @@ } DEFUN (PS4, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} PS4 ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} PS4 (@var{new_val})\n\ @deftypefnx {Built-in Function} {} PS4 (@var{new_val}, \"local\")\n\ @@ -1310,7 +1310,7 @@ } DEFUN (completion_append_char, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} completion_append_char ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} completion_append_char (@var{new_val})\n\ @deftypefnx {Built-in Function} {} completion_append_char (@var{new_val}, \"local\")\n\ @@ -1327,7 +1327,7 @@ } DEFUN (echo_executing_commands, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} echo_executing_commands ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} echo_executing_commands (@var{new_val})\n\ @deftypefnx {Built-in Function} {} echo_executing_commands (@var{new_val}, \"local\")\n\ @@ -1360,7 +1360,7 @@ } DEFUN (__request_drawnow__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __request_drawnow__ ()\n\ @deftypefnx {Built-in Function} {} __request_drawnow__ (@var{flag})\n\ Undocumented internal function.\n\ @@ -1381,7 +1381,7 @@ } DEFUN (__gud_mode__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __gud_mode__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1401,7 +1401,7 @@ } DEFUN (filemarker, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} filemarker ()\n\ @deftypefnx {Built-in Function} {} filemarker (@var{new_val})\n\ @deftypefnx {Built-in Function} {} filemarker (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/input.h +++ b/libinterp/corefcn/input.h @@ -58,7 +58,8 @@ extern bool octave_yes_or_no (const std::string& prompt); -extern octave_value do_keyboard (const octave_value_list& args = octave_value_list ()); +extern octave_value do_keyboard (const octave_value_list& args + = octave_value_list ()); extern void remove_input_event_hook_functions (void);
--- a/libinterp/corefcn/inv.cc +++ b/libinterp/corefcn/inv.cc @@ -37,7 +37,7 @@ #include "utils.h" DEFUN (inv, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{x} =} inv (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{x}, @var{rcond}] =} inv (@var{A})\n\ Compute the inverse of the square matrix @var{A}. Return an estimate\n\ @@ -232,12 +232,12 @@ %!error <argument must be a square matrix> inv ([1, 2; 3, 4; 5, 6]) */ -// FIXME -- this should really be done with an alias, but +// FIXME: this should really be done with an alias, but // alias_builtin() won't do the right thing if we are actually using // dynamic linking. DEFUN (inverse, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{x} =} inverse (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{x}, @var{rcond}] =} inverse (@var{A})\n\ Compute the inverse of the square matrix @var{A}.\n\
--- a/libinterp/corefcn/jit-ir.h +++ b/libinterp/corefcn/jit-ir.h @@ -289,7 +289,7 @@ // paremeters typedef jit_internal_node<jit_value, jit_use> PARENT_T; - jit_use (void) : muser (0), mindex (0) {} + jit_use (void) : muser (0), mindex (0) { } // we should really have a move operator, but not until c++11 :( jit_use (const jit_use& use) : muser (0), mindex (0) @@ -329,7 +329,7 @@ public: // FIXME: this code could be so much pretier with varadic templates... jit_instruction (void) : mid (next_id ()), mparent (0) - {} + { } jit_instruction (size_t nargs) : mid (next_id ()), mparent (0) { @@ -354,8 +354,8 @@ #undef JIT_INSTRUCTION_CTOR jit_instruction (const std::vector<jit_value *>& aarguments) - : already_infered (aarguments.size ()), marguments (aarguments.size ()), - mid (next_id ()), mparent (0) + : already_infered (aarguments.size ()), marguments (aarguments.size ()), + mid (next_id ()), mparent (0) { for (size_t i = 0; i < aarguments.size (); ++i) stash_argument (i, aarguments[i]); @@ -430,9 +430,9 @@ const std::vector<jit_type *>& argument_types (void) const { return already_infered; } - virtual void push_variable (void) {} + virtual void push_variable (void) { } - virtual void pop_variable (void) {} + virtual void pop_variable (void) { } virtual void construct_ssa (void) { @@ -509,8 +509,7 @@ JIT_VALUE_ACCEPT; }; -template <typename T, jit_type *(*EXTRACT_T)(void), typename PASS_T, - bool QUOTE> +template <typename T, jit_type *(*EXTRACT_T)(void), typename PASS_T, bool QUOTE> class jit_const : public jit_value { @@ -561,7 +560,7 @@ jit_block (const std::string& aname, size_t avisit_count = 0) : mvisit_count (avisit_count), mid (NO_ID), idom (0), mname (aname), malive (false) - {} + { } virtual void replace_with (jit_value *value); @@ -776,9 +775,9 @@ jit_phi_incomming : public jit_internal_node<jit_block, jit_phi_incomming> { public: - jit_phi_incomming (void) : muser (0) {} + jit_phi_incomming (void) : muser (0) { } - jit_phi_incomming (jit_phi *auser) : muser (auser) {} + jit_phi_incomming (jit_phi *auser) : muser (auser) { } jit_phi_incomming (const jit_phi_incomming& use) { @@ -804,12 +803,12 @@ jit_variable : public jit_value { public: - jit_variable (const std::string& aname) : mname (aname), mlast_use (0) {} + jit_variable (const std::string& aname) : mname (aname), mlast_use (0) { } const std::string &name (void) const { return mname; } - // manipulate the value_stack, for use during SSA construction. The top of the - // value stack represents the current value for this variable + // manipulate the value_stack, for use during SSA construction. The top of + // the value stack represents the current value for this variable bool has_top (void) const { return ! value_stack.empty (); @@ -868,13 +867,13 @@ jit_assign_base : public jit_instruction { public: - jit_assign_base (jit_variable *adest) : jit_instruction (), mdest (adest) {} + jit_assign_base (jit_variable *adest) : jit_instruction (), mdest (adest) { } jit_assign_base (jit_variable *adest, size_t npred) : jit_instruction (npred), mdest (adest) {} jit_assign_base (jit_variable *adest, jit_value *arg0, jit_value *arg1) - : jit_instruction (arg0, arg1), mdest (adest) {} + : jit_instruction (arg0, arg1), mdest (adest) { } jit_variable *dest (void) const { return mdest; } @@ -905,7 +904,7 @@ { public: jit_assign (jit_variable *adest, jit_value *asrc) - : jit_assign_base (adest, adest, asrc), martificial (false) {} + : jit_assign_base (adest, adest, asrc), martificial (false) { } jit_value *overwrite (void) const { @@ -981,7 +980,7 @@ return incomming (i)->to_llvm (); } - virtual void construct_ssa (void) {} + virtual void construct_ssa (void) { } virtual bool infer (void); @@ -1025,7 +1024,7 @@ jit_terminator (size_t asuccessor_count, \ OCT_MAKE_DECL_LIST (jit_value *, arg, N)) \ : jit_instruction (OCT_MAKE_ARG_LIST (arg, N)), \ - malive (asuccessor_count, false) {} + malive (asuccessor_count, false) { } JIT_TERMINATOR_CONST (1) JIT_TERMINATOR_CONST (2) @@ -1080,7 +1079,7 @@ jit_branch : public jit_terminator { public: - jit_branch (jit_block *succ) : jit_terminator (1, succ) {} + jit_branch (jit_block *succ) : jit_terminator (1, succ) { } virtual size_t successor_count (void) const { return 1; } @@ -1098,7 +1097,7 @@ { public: jit_cond_branch (jit_value *c, jit_block *ctrue, jit_block *cfalse) - : jit_terminator (2, ctrue, cfalse, c) {} + : jit_terminator (2, ctrue, cfalse, c) { } jit_value *cond (void) const { return argument (2); } @@ -1147,12 +1146,12 @@ #define JIT_CALL_CONST(N) \ jit_call (const jit_operation& aoperation, \ OCT_MAKE_DECL_LIST (jit_value *, arg, N)) \ - : jit_instruction (OCT_MAKE_ARG_LIST (arg, N)), moperation (aoperation) {} \ + : jit_instruction (OCT_MAKE_ARG_LIST (arg, N)), moperation (aoperation) { } \ \ jit_call (const jit_operation& (*aoperation) (void), \ OCT_MAKE_DECL_LIST (jit_value *, arg, N)) \ : jit_instruction (OCT_MAKE_ARG_LIST (arg, N)), moperation (aoperation ()) \ - {} + { } JIT_CALL_CONST (1) JIT_CALL_CONST (2) @@ -1163,8 +1162,8 @@ jit_call (const jit_operation& aoperation, const std::vector<jit_value *>& args) - : jit_instruction (args), moperation (aoperation) - {} + : jit_instruction (args), moperation (aoperation) + { } const jit_operation& operation (void) const { return moperation; } @@ -1213,19 +1212,19 @@ public: // Which variable is the error check for? enum variable - { - var_error_state, - var_interrupt - }; + { + var_error_state, + var_interrupt + }; static std::string variable_to_string (variable v); jit_error_check (variable var, jit_call *acheck_for, jit_block *normal, jit_block *error) - : jit_terminator (2, error, normal, acheck_for), mvariable (var) {} + : jit_terminator (2, error, normal, acheck_for), mvariable (var) { } jit_error_check (variable var, jit_block *normal, jit_block *error) - : jit_terminator (2, error, normal), mvariable (var) {} + : jit_terminator (2, error, normal), mvariable (var) { } variable check_variable (void) const { return mvariable; } @@ -1264,7 +1263,7 @@ { public: context (void) : value (0), index (0), count (0) - {} + { } context (jit_factory& factory, jit_value *avalue, size_t aindex, size_t acount); @@ -1329,8 +1328,8 @@ { public: jit_store_argument (jit_variable *var) - : jit_instruction (var), dest (var) - {} + : jit_instruction (var), dest (var) + { } const std::string& name (void) const { @@ -1381,9 +1380,9 @@ jit_return : public jit_instruction { public: - jit_return (void) {} + jit_return (void) { } - jit_return (jit_value *retval) : jit_instruction (retval) {} + jit_return (jit_value *retval) : jit_instruction (retval) { } jit_value *result (void) const { @@ -1413,7 +1412,7 @@ jit_ir_walker { public: - virtual ~jit_ir_walker () {} + virtual ~jit_ir_walker () { } #define JIT_METH(clname) \ virtual void visit (jit_ ## clname&) = 0;
--- a/libinterp/corefcn/jit-typeinfo.cc +++ b/libinterp/corefcn/jit-typeinfo.cc @@ -517,7 +517,7 @@ operator<< (std::ostream& os, const jit_range& rng) { return os << "Range[" << rng.base << ", " << rng.limit << ", " << rng.inc - << ", " << rng.nelem << "]"; + << ", " << rng.nelem << "]"; } // -------------------- jit_matrix -------------------- @@ -526,8 +526,8 @@ operator<< (std::ostream& os, const jit_matrix& mat) { return os << "Matrix[" << mat.ref_count << ", " << mat.slice_data << ", " - << mat.slice_len << ", " << mat.dimensions << ", " - << mat.array << "]"; + << mat.slice_len << ", " << mat.dimensions << ", " + << mat.array << "]"; } // -------------------- jit_type -------------------- @@ -718,7 +718,7 @@ #ifdef CALLINST_ADDATTRIBUTE_ARG_IS_ATTRIBUTES llvm::AttrBuilder attr_builder; attr_builder.addAttribute(llvm::Attributes::StructRet); - llvm::Attributes attrs = llvm::Attributes::get(context, attr_builder); + llvm::Attributes attrs = llvm::Attributes::get(context, attr_builder); callinst->addAttribute (1, attrs); #else callinst->addAttribute (1, llvm::Attribute::StructRet); @@ -814,7 +814,7 @@ void jit_operation::add_overload (const jit_function& func, - const std::vector<jit_type*>& args) + const std::vector<jit_type*>& args) { if (args.size () >= overloads.size ()) overloads.resize (args.size () + 1); @@ -1637,8 +1637,8 @@ builder.CreateBr (done); builder.SetInsertPoint (normal); - llvm::Value *len = builder.CreateExtractValue (mat, - llvm::ArrayRef<unsigned> (2)); + llvm::Value *len + = builder.CreateExtractValue (mat, llvm::ArrayRef<unsigned> (2)); cond = builder.CreateICmpSGT (int_idx, len); @@ -1722,8 +1722,8 @@ builder.CreateBr (done); builder.SetInsertPoint (success); - llvm::Value *data = builder.CreateExtractValue (mat, - llvm::ArrayRef<unsigned> (1)); + llvm::Value *data + = builder.CreateExtractValue (mat, llvm::ArrayRef<unsigned> (1)); llvm::Value *gep = builder.CreateInBoundsGEP (data, int_idx); builder.CreateStore (value, gep); builder.CreateBr (done); @@ -1923,7 +1923,8 @@ { std::stringstream name; name << "octave_jit_print_" << ty->name (); - jit_function fn = create_external (engine, fptr, name.str (), 0, intN (8), ty); + jit_function fn = create_external (engine, fptr, name.str (), + 0, intN (8), ty); print_fn.add_overload (fn); } @@ -2245,7 +2246,7 @@ octave_builtin *builtin = dynamic_cast<octave_builtin *> (ov.internal_rep ()); return builtin && builtin->to_jit () ? builtin->to_jit () - : unknown_function; + : unknown_function; } if (ov.is_range ())
--- a/libinterp/corefcn/jit-typeinfo.h +++ b/libinterp/corefcn/jit-typeinfo.h @@ -37,7 +37,7 @@ // manage the types. // // FIXME: -// Operations are defined and implemented in jit_typeinfo. Eventually they +// Operations are defined and implemented in jit_typeinfo. Eventually they // should be moved elsewhere. (just like with octave_typeinfo) // jit_range is compatable with the llvm range structure @@ -46,7 +46,7 @@ { jit_range (const Range& from) : base (from.base ()), limit (from.limit ()), inc (from.inc ()), nelem (from.nelem ()) - {} + { } operator Range () const { @@ -61,14 +61,14 @@ octave_idx_type nelem; }; -std::ostream& operator<< (std::ostream& os, const jit_range& rng); +std::ostream& operator << (std::ostream& os, const jit_range& rng); // jit_array is compatable with the llvm array/matrix structures template <typename T, typename U> struct jit_array { - jit_array () : array (0) {} + jit_array () : array (0) { } jit_array (T& from) : array (new T (from)) { @@ -105,7 +105,7 @@ typedef jit_array<NDArray, double> jit_matrix; -std::ostream& operator<< (std::ostream& os, const jit_matrix& mat); +std::ostream& operator << (std::ostream& os, const jit_matrix& mat); // calling convention namespace @@ -217,12 +217,12 @@ class jit_value; -// An abstraction for calling llvm functions with jit_values. Deals with calling -// convention details. +// An abstraction for calling llvm functions with jit_values. Deals with +// calling convention details. class jit_function { - friend std::ostream& operator<< (std::ostream& os, const jit_function& fn); + friend std::ostream& operator << (std::ostream& os, const jit_function& fn); public: // create a function in an invalid state jit_function (); @@ -317,7 +317,7 @@ bool mcan_error; }; -std::ostream& operator<< (std::ostream& os, const jit_function& fn); +std::ostream& operator << (std::ostream& os, const jit_function& fn); // Keeps track of information about how to implement operations (+, -, *, ect) @@ -389,7 +389,7 @@ jit_index_operation : public jit_operation { public: - jit_index_operation (void) : module (0), engine (0) {} + jit_index_operation (void) : module (0), engine (0) { } void initialize (llvm::Module *amodule, llvm::ExecutionEngine *aengine) {
--- a/libinterp/corefcn/jit-util.h +++ b/libinterp/corefcn/jit-util.h @@ -77,10 +77,10 @@ class jit_fail_exception : public std::runtime_error { public: - jit_fail_exception (void) : std::runtime_error ("unknown"), mknown (false) {} + jit_fail_exception (void) : std::runtime_error ("unknown"), mknown (false) { } jit_fail_exception (const std::string& reason) : std::runtime_error (reason), mknown (true) - {} + { } bool known (void) const { return mknown; } private: @@ -102,7 +102,7 @@ { friend class jit_internal_node<LIST_T, NODE_T>; public: - jit_internal_list (void) : use_head (0), use_tail (0), muse_count (0) {} + jit_internal_list (void) : use_head (0), use_tail (0), muse_count (0) { } virtual ~jit_internal_list (void) { @@ -127,7 +127,7 @@ public: typedef jit_internal_list<LIST_T, NODE_T> jit_ilist; - jit_internal_node (void) : mvalue (0), mnext (0), mprev (0) {} + jit_internal_node (void) : mvalue (0), mnext (0), mprev (0) { } ~jit_internal_node (void) { remove (); }
--- a/libinterp/corefcn/kron.cc +++ b/libinterp/corefcn/kron.cc @@ -88,7 +88,8 @@ for (octave_idx_type jb = 0; jb < ncb; jb++) { octave_quit (); - mx_inline_mul (nrb, &c.xelem (ja*nrb, ja*ncb + jb), a.dgelem (ja), b.data () + nrb*jb); + mx_inline_mul (nrb, &c.xelem (ja*nrb, ja*ncb + jb), a.dgelem (ja), + b.data () + nrb*jb); } return c;
--- a/libinterp/corefcn/load-path.cc +++ b/libinterp/corefcn/load-path.cc @@ -77,7 +77,8 @@ const dir_info& di = p->second; - if (fs.mtime () + fs.time_resolution () > di.dir_time_last_checked) + if (fs.mtime () + fs.time_resolution () + > di.dir_time_last_checked) initialize (); else *this = di; @@ -129,7 +130,7 @@ { std::string abs_name = octave_env::make_absolute (dir_name); - // FIXME -- nothing is ever removed from this cache of + // FIXME: nothing is ever removed from this cache of // directory information, so there could be some resource // problems. Perhaps it should be pruned from time to time. @@ -308,8 +309,7 @@ return retval; } -// FIXME -- maybe we should also maintain a map to speed up this -// method of access. +// FIXME: maybe we should also maintain a map to speed up this method of access. load_path::const_dir_info_list_iterator load_path::find_dir_info (const std::string& dir_arg) const @@ -444,8 +444,7 @@ else { for (file_info_list_iterator p = file_info_list.begin (); - p != file_info_list.end (); - p++) + p != file_info_list.end (); p++) { if (p->dir_name == full_dir_name) { @@ -722,7 +721,7 @@ } } - // FIXME -- is there a better way to do this? + // FIXME: is there a better way to do this? i = find_dir_info ("."); @@ -801,14 +800,13 @@ else { for (file_info_list_iterator p = file_info_list.begin (); - p != file_info_list.end (); - p++) + p != file_info_list.end (); p++) { if (p->dir_name == full_dir_name) { file_info_list.erase (p); - // FIXME -- if there are no other elements, we + // FIXME: if there are no other elements, we // should remove this element of fm but calling // erase here would invalidate the iterator q. @@ -1379,7 +1377,7 @@ } } - done: +done: if (! dir_name.empty ()) retval = file_ops::concat (dir_name, file_name); @@ -1436,8 +1434,7 @@ rel_flist.resize (rel_flen); for (const_dir_info_list_iterator p = dir_info_list.begin (); - p != dir_info_list.end (); - p++) + p != dir_info_list.end (); p++) { string_vector all_files = p->all_files; @@ -1448,8 +1445,8 @@ for (octave_idx_type j = 0; j < rel_flen; j++) { if (all_files[i] == rel_flist[j]) - retlist.push_back - (file_ops::concat (p->dir_name, rel_flist[j])); + retlist.push_back (file_ops::concat (p->dir_name, + rel_flist[j])); } } } @@ -1645,9 +1642,8 @@ if (! method_file_map.empty ()) { - for (dir_info::const_method_file_map_iterator p = method_file_map.begin (); - p != method_file_map.end (); - p++) + for (dir_info::const_method_file_map_iterator + p = method_file_map.begin (); p != method_file_map.end (); p++) { os << "\n*** methods in " << i->dir_name << "/@" << p->first << ":\n\n"; @@ -1730,7 +1726,9 @@ static bool in_path_list (const std::string& path_list, const std::string& path) { - size_t ps = path.size (), pls = path_list.size (), pos = path_list.find (path); + size_t ps = path.size (); + size_t pls = path_list.size (); + size_t pos = path_list.find (path); char psc = dir_path::path_sep_char (); while (pos != std::string::npos) { @@ -1802,7 +1800,7 @@ { file_info& old = file_info_list.front (); - // FIXME -- do we need to be more careful about the + // FIXME: do we need to be more careful about the // way we look for old.dir_name in sys_path to avoid // partial matches? @@ -1904,7 +1902,7 @@ } else { - // FIXME -- is this possible? + // FIXME: is this possible? file_info& fi = *p2; @@ -1996,7 +1994,7 @@ } DEFUN (genpath, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} genpath (@var{dir})\n\ @deftypefnx {Built-in Function} {} genpath (@var{dir}, @var{skip}, @dots{})\n\ Return a path constructed from @var{dir} and all its subdirectories.\n\ @@ -2047,7 +2045,7 @@ { load_path::update (); - // FIXME -- maybe we should rename this variable since it is being + // FIXME: maybe we should rename this variable since it is being // used for more than keeping track of the prompt time. // This will force updated functions to be found. @@ -2055,7 +2053,7 @@ } DEFUN (rehash, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rehash ()\n\ Reinitialize Octave's load path directory cache.\n\ @end deftypefn") @@ -2068,7 +2066,7 @@ } DEFUN (command_line_path, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} command_line_path (@dots{})\n\ Return the command line path variable.\n\ \n\ @@ -2079,7 +2077,7 @@ } DEFUN (restoredefaultpath, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} restoredefaultpath (@dots{})\n\ Restore Octave's path to its initial state at startup.\n\ \n\ @@ -2097,7 +2095,7 @@ // ~/.octaverc file DEFUN (__pathorig__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} __pathorig__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2106,7 +2104,7 @@ } DEFUN (path, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} path (@dots{})\n\ Modify or display Octave's load path.\n\ \n\ @@ -2148,7 +2146,8 @@ retval = load_path::path (); else if (argc == 1 && nargout == 0) { - octave_stdout << "\nOctave's search path contains the following directories:\n\n"; + octave_stdout << + "\nOctave's search path contains the following directories:\n\n"; string_vector dirs = load_path::dirs (); @@ -2162,7 +2161,7 @@ } DEFUN (addpath, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} addpath (@var{dir1}, @dots{})\n\ @deftypefnx {Built-in Function} {} addpath (@var{dir1}, @dots{}, @var{option})\n\ Add named directories to the function search path. If\n\ @@ -2278,7 +2277,7 @@ } DEFUN (rmpath, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rmpath (@var{dir1}, @dots{})\n\ Remove @var{dir1}, @dots{} from the current function search path.\n\ \n\
--- a/libinterp/corefcn/load-path.h +++ b/libinterp/corefcn/load-path.h @@ -99,7 +99,8 @@ std::string& dir_name) { return instance_ok () - ? instance->do_find_method (class_name, meth, dir_name) : std::string (); + ? instance->do_find_method (class_name, meth, dir_name) + : std::string (); } static std::string find_method (const std::string& class_name, @@ -112,19 +113,19 @@ static std::list<std::string> methods (const std::string& class_name) { return instance_ok () - ? instance->do_methods (class_name) : std::list<std::string> (); + ? instance->do_methods (class_name) : std::list<std::string> (); } static std::list<std::string> overloads (const std::string& meth) { return instance_ok () - ? instance->do_overloads (meth) : std::list<std::string> (); + ? instance->do_overloads (meth) : std::list<std::string> (); } static std::string find_fcn (const std::string& fcn, std::string& dir_name) { return instance_ok () - ? instance->do_find_fcn (fcn, dir_name) : std::string (); + ? instance->do_find_fcn (fcn, dir_name) : std::string (); } static std::string find_fcn (const std::string& fcn) @@ -137,7 +138,7 @@ const std::string& fcn) { return instance_ok () - ? instance->do_find_private_fcn (dir, fcn) : std::string (); + ? instance->do_find_private_fcn (dir, fcn) : std::string (); } static std::string find_fcn_file (const std::string& fcn) @@ -145,7 +146,7 @@ std::string dir_name; return instance_ok () ? - instance->do_find_fcn (fcn, dir_name, M_FILE) : std::string (); + instance->do_find_fcn (fcn, dir_name, M_FILE) : std::string (); } static std::string find_oct_file (const std::string& fcn) @@ -153,7 +154,7 @@ std::string dir_name; return instance_ok () ? - instance->do_find_fcn (fcn, dir_name, OCT_FILE) : std::string (); + instance->do_find_fcn (fcn, dir_name, OCT_FILE) : std::string (); } static std::string find_mex_file (const std::string& fcn) @@ -161,37 +162,37 @@ std::string dir_name; return instance_ok () ? - instance->do_find_fcn (fcn, dir_name, MEX_FILE) : std::string (); + instance->do_find_fcn (fcn, dir_name, MEX_FILE) : std::string (); } static std::string find_file (const std::string& file) { return instance_ok () - ? instance->do_find_file (file) : std::string (); + ? instance->do_find_file (file) : std::string (); } static std::string find_dir (const std::string& dir) { return instance_ok () - ? instance->do_find_dir (dir) : std::string (); + ? instance->do_find_dir (dir) : std::string (); } static string_vector find_matching_dirs (const std::string& dir) { return instance_ok () - ? instance->do_find_matching_dirs (dir) : string_vector (); + ? instance->do_find_matching_dirs (dir) : string_vector (); } static std::string find_first_of (const string_vector& files) { return instance_ok () ? - instance->do_find_first_of (files) : std::string (); + instance->do_find_first_of (files) : std::string (); } static string_vector find_all_first_of (const string_vector& files) { return instance_ok () ? - instance->do_find_all_first_of (files) : string_vector (); + instance->do_find_all_first_of (files) : string_vector (); } static string_vector dirs (void) @@ -202,13 +203,13 @@ static std::list<std::string> dir_list (void) { return instance_ok () - ? instance->do_dir_list () : std::list<std::string> (); + ? instance->do_dir_list () : std::list<std::string> (); } static string_vector files (const std::string& dir, bool omit_exts = false) { return instance_ok () - ? instance->do_files (dir, omit_exts) : string_vector (); + ? instance->do_files (dir, omit_exts) : string_vector (); } static string_vector fcn_names (void) @@ -241,7 +242,8 @@ static std::string get_command_line_path (void) { - return instance_ok () ? instance->do_get_command_line_path () : std::string (); + return instance_ok () ? instance->do_get_command_line_path () + : std::string (); } static std::string system_path (void) @@ -302,7 +304,7 @@ : dir_name (), abs_dir_name (), is_relative (false), dir_mtime (), dir_time_last_checked (), all_files (), fcn_files (), private_file_map (), method_file_map () - { } + { } dir_info (const std::string& d) : dir_name (d), abs_dir_name (), is_relative (false), @@ -428,7 +430,8 @@ typedef fcn_map_type::iterator fcn_map_iterator; // <DIR_NAME, <FCN_NAME, TYPE>> - typedef std::map<std::string, dir_info::fcn_file_map_type> private_fcn_map_type; + typedef std::map<std::string, dir_info::fcn_file_map_type> + private_fcn_map_type; typedef private_fcn_map_type::const_iterator const_private_fcn_map_iterator; typedef private_fcn_map_type::iterator private_fcn_map_iterator; @@ -553,7 +556,8 @@ std::string do_system_path (void) const { return sys_path; } - std::string do_get_command_line_path (void) const { return command_line_path; } + std::string do_get_command_line_path (void) const + { return command_line_path; } void add_to_fcn_map (const dir_info& di, bool at_end) const;
--- a/libinterp/corefcn/load-save.cc +++ b/libinterp/corefcn/load-save.cc @@ -274,11 +274,11 @@ file.clear (); file.seekg (0, std::ios::beg); - // FIXME -- looks_like_mat_ascii_file does not check to see - // whether the file contains numbers. It just skips comments and - // checks for the same number of words on each line. We may need - // a better check here. The best way to do that might be just - // to try to read the file and see if it works. + // FIXME: looks_like_mat_ascii_file does not check to see + // whether the file contains numbers. It just skips comments + // and checks for the same number of words on each line. We + // may need a better check here. The best way to do that + // might be just to try to read the file and see if it works. if (looks_like_mat_ascii_file (file, filename)) retval = LS_MAT_ASCII; @@ -555,7 +555,7 @@ } DEFUN (load, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} load file\n\ @deftypefnx {Command} {} load options file\n\ @deftypefnx {Command} {} load options file v1 v2 @dots{}\n\ @@ -840,7 +840,8 @@ else if (format == LS_MAT5_BINARY || format == LS_MAT7_BINARY) { - if (read_mat5_binary_file_header (file, swap, false, orig_fname) < 0) + if (read_mat5_binary_file_header (file, swap, false, + orig_fname) < 0) { if (file) file.close (); return retval; @@ -874,7 +875,8 @@ else if (format == LS_MAT5_BINARY || format == LS_MAT7_BINARY) { - if (read_mat5_binary_file_header (file, swap, false, orig_fname) < 0) + if (read_mat5_binary_file_header (file, swap, false, + orig_fname) < 0) { if (file) file.close (); return retval; @@ -1039,7 +1041,8 @@ size_t saved = 0; - typedef std::list<symbol_table::symbol_record>::const_iterator const_vars_iterator; + typedef std::list<symbol_table::symbol_record>::const_iterator + const_vars_iterator; for (const_vars_iterator p = vars.begin (); p != vars.end (); p++) { @@ -1261,7 +1264,7 @@ os << comment_string << "\n"; } } - break; + break; default: break; @@ -1362,7 +1365,8 @@ double save_mem_size = 0; - typedef std::list<symbol_table::symbol_record>::const_iterator const_vars_iterator; + typedef std::list<symbol_table::symbol_record>::const_iterator + const_vars_iterator; for (const_vars_iterator p = vars.begin (); p != vars.end (); p++) { @@ -1376,7 +1380,7 @@ double val_size = val.byte_size () / 1024; - // FIXME -- maybe we should try to throw out the largest first... + // FIXME: maybe we should try to throw out the largest first... if (Voctave_core_file_limit < 0 || save_mem_size + val_size < Voctave_core_file_limit) @@ -1399,7 +1403,7 @@ { if (Vcrash_dumps_octave_core) { - // FIXME -- should choose better file name? + // FIXME: should choose better file name? const char *fname = Voctave_core_file_name.c_str (); @@ -1485,7 +1489,7 @@ } DEFUN (save, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} save file\n\ @deftypefnx {Command} {} save options file\n\ @deftypefnx {Command} {} save options file @var{v1} @var{v2} @dots{}\n\ @@ -1669,8 +1673,8 @@ if (append) warning ("save: ignoring -append option for output to stdout"); - // FIXME -- should things intended for the screen end up - // in a octave_value (string)? + // FIXME: should things intended for the screen + // end up in an octave_value (string)? save_vars (argv, i, argc, octave_stdout, format, save_as_floats, true); @@ -1727,12 +1731,12 @@ save_as_floats, write_header_info); hdf5_file.close (); - } - else - { - gripe_file_open ("save", fname); - return retval; - } + } + else + { + gripe_file_open ("save", fname); + return retval; + } } else #endif /* HAVE_HDF5 */ @@ -1786,7 +1790,7 @@ } DEFUN (crash_dumps_octave_core, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} crash_dumps_octave_core ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} crash_dumps_octave_core (@var{new_val})\n\ @deftypefnx {Built-in Function} {} crash_dumps_octave_core (@var{new_val}, \"local\")\n\ @@ -1804,7 +1808,7 @@ } DEFUN (save_default_options, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} save_default_options ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} save_default_options (@var{new_val})\n\ @deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\ @@ -1823,7 +1827,7 @@ } DEFUN (octave_core_file_limit, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} octave_core_file_limit ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_limit (@var{new_val})\n\ @deftypefnx {Built-in Function} {} octave_core_file_limit (@var{new_val}, \"local\")\n\ @@ -1846,7 +1850,7 @@ } DEFUN (octave_core_file_name, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} octave_core_file_name ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_name (@var{new_val})\n\ @deftypefnx {Built-in Function} {} octave_core_file_name (@var{new_val}, \"local\")\n\ @@ -1864,7 +1868,7 @@ } DEFUN (octave_core_file_options, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} octave_core_file_options ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} octave_core_file_options (@var{new_val})\n\ @deftypefnx {Built-in Function} {} octave_core_file_options (@var{new_val}, \"local\")\n\ @@ -1884,7 +1888,7 @@ } DEFUN (save_header_format_string, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} save_header_format_string ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} save_header_format_string (@var{new_val})\n\ @deftypefnx {Built-in Function} {} save_header_format_string (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/load-save.h +++ b/libinterp/corefcn/load-save.h @@ -34,18 +34,18 @@ // FIXME: maybe MAT5 and MAT7 should be options to MAT_BINARY. // Similarly, save_as_floats may be an option for LS_BINARY, LS_HDF5 etc. enum load_save_format_type - { - LS_ASCII, - LS_BINARY, - LS_MAT_ASCII, - LS_MAT_BINARY, - LS_MAT5_BINARY, - LS_MAT7_BINARY, +{ + LS_ASCII, + LS_BINARY, + LS_MAT_ASCII, + LS_MAT_BINARY, + LS_MAT5_BINARY, + LS_MAT7_BINARY, #ifdef HAVE_HDF5 - LS_HDF5, + LS_HDF5, #endif /* HAVE_HDF5 */ - LS_UNKNOWN - }; + LS_UNKNOWN +}; enum load_save_format_options { @@ -66,7 +66,7 @@ load_save_format_options o = LS_NO_OPTION) : type (t), opts (o) { } operator int (void) const - { return type; } + { return type; } int type, opts; };
--- a/libinterp/corefcn/lookup.cc +++ b/libinterp/corefcn/lookup.cc @@ -61,8 +61,8 @@ { return std::toupper (x) > std::toupper (y); } }; -// FIXME -- maybe these should go elsewhere? -// FIXME -- are they even needed now? +// FIXME: maybe these should go elsewhere? +// FIXME: are they even needed now? // case-insensitive ascending comparator #if 0 static bool @@ -187,7 +187,7 @@ } DEFUN (lookup, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{idx} =} lookup (@var{table}, @var{y})\n\ @deftypefnx {Built-in Function} {@var{idx} =} lookup (@var{table}, @var{y}, @var{opt})\n\ Lookup values in a sorted table. Usually used as a prelude to\n\ @@ -286,8 +286,8 @@ if (num_case) { - // In the case of a complex array, absolute values will be used for compatibility - // (though it's not too meaningful). + // In the case of a complex array, absolute values will be used for + // compatibility (though it's not too meaningful). if (table.is_complex_type ()) table = table.abs (); @@ -356,7 +356,8 @@ for (octave_idx_type i = 0; i < nval; i++) { octave_idx_type j = idx.xelem (i); - ridx.xelem (i) = (j != 0 && str_y(i) == str_table(j-1)) ? j : 0; + ridx.xelem (i) = (j != 0 && str_y(i) == str_table(j-1)) ? j + : 0; } }
--- a/libinterp/corefcn/ls-ascii-helper.cc +++ b/libinterp/corefcn/ls-ascii-helper.cc @@ -109,7 +109,7 @@ { // Yes, LF following CR, eat it. is.get (d); - } + } // Peek into next character. c = is.peek ();
--- a/libinterp/corefcn/ls-hdf5.cc +++ b/libinterp/corefcn/ls-hdf5.cc @@ -248,8 +248,11 @@ hdf5_read_next_data (hid_t group_id, const char *name, void *dv) { hdf5_callback_data *d = static_cast <hdf5_callback_data *> (dv); - hid_t type_id = -1, type_class_id = -1, data_id = -1, subgroup_id = -1, - space_id = -1; + hid_t type_id = -1; + hid_t type_class_id = -1; + hid_t data_id = -1; + hid_t subgroup_id = -1; + hid_t space_id = -1;; H5G_stat_t info; herr_t retval = 0; @@ -544,7 +547,7 @@ name); } - done: +done: if (retval < 0) error ("load: error while reading hdf5 item %s", name); @@ -580,7 +583,7 @@ // and error. std::string read_hdf5_data (std::istream& is, const std::string& /* filename */, - bool& global, octave_value& tc, std::string& doc, + bool& global, octave_value& tc, std::string& doc, const string_vector& argv, int argv_idx, int argc) { std::string retval; @@ -874,7 +877,8 @@ std::string t = val.type_name (); #if HAVE_HDF5_18 - data_id = H5Gcreate (loc_id, name.c_str (), H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + data_id = H5Gcreate (loc_id, name.c_str (), H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); #else data_id = H5Gcreate (loc_id, name.c_str (), 0); #endif @@ -916,7 +920,7 @@ if (retval) retval = hdf5_add_attr (data_id, "OCTAVE_NEW_FORMAT") >= 0; - error_cleanup: +error_cleanup: if (data_type_id >= 0) H5Dclose (data_type_id);
--- a/libinterp/corefcn/ls-hdf5.h +++ b/libinterp/corefcn/ls-hdf5.h @@ -49,52 +49,52 @@ hdf5_fstreambase (const char *name, int mode, int /* prot */ = 0) : file_id (-1), current_item (-1) - { - if (mode & std::ios::in) - file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); - else if (mode & std::ios::out) - { - if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) - file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT); - else - file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - } - if (file_id < 0) - std::ios::setstate (std::ios::badbit); + { + if (mode & std::ios::in) + file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); + else if (mode & std::ios::out) + { + if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) + file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT); + else + file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + } + if (file_id < 0) + std::ios::setstate (std::ios::badbit); - current_item = 0; - } + current_item = 0; + } void close () - { - if (file_id >= 0) - { - if (H5Fclose (file_id) < 0) - std::ios::setstate (std::ios::badbit); - file_id = -1; - } - } + { + if (file_id >= 0) + { + if (H5Fclose (file_id) < 0) + std::ios::setstate (std::ios::badbit); + file_id = -1; + } + } void open (const char *name, int mode, int) - { - clear (); + { + clear (); - if (mode & std::ios::in) - file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); - else if (mode & std::ios::out) - { - if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) - file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT); - else - file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, - H5P_DEFAULT); - } - if (file_id < 0) - std::ios::setstate (std::ios::badbit); + if (mode & std::ios::in) + file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); + else if (mode & std::ios::out) + { + if (mode & std::ios::app && H5Fis_hdf5 (name) > 0) + file_id = H5Fopen (name, H5F_ACC_RDWR, H5P_DEFAULT); + else + file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, + H5P_DEFAULT); + } + if (file_id < 0) + std::ios::setstate (std::ios::badbit); - current_item = 0; - } + current_item = 0; + } }; // input and output streams, subclassing istream and ostream @@ -112,7 +112,7 @@ void open (const char *name, int mode = std::ios::in|std::ios::binary, int prot = 0) - { hdf5_fstreambase::open (name, mode, prot); } + { hdf5_fstreambase::open (name, mode, prot); } }; class hdf5_ofstream : public hdf5_fstreambase, public std::ostream @@ -127,7 +127,7 @@ void open (const char *name, int mode = std::ios::out|std::ios::binary, int prot = 0) - { hdf5_fstreambase::open (name, mode, prot); } + { hdf5_fstreambase::open (name, mode, prot); } }; // Callback data structure for passing data to hdf5_read_next_data, below. @@ -180,7 +180,7 @@ extern OCTINTERP_API std::string read_hdf5_data (std::istream& is, const std::string& filename, bool& global, - octave_value& tc, std::string& doc, + octave_value& tc, std::string& doc, const string_vector& argv, int argv_idx, int argc); extern OCTINTERP_API bool
--- a/libinterp/corefcn/ls-mat-ascii.cc +++ b/libinterp/corefcn/ls-mat-ascii.cc @@ -133,7 +133,8 @@ // CRLF pair as the line separator. Any other CR in the text // will not be considered as whitespace. - if (beg != std::string::npos && buf[beg] == '\r' && beg == buf.length () - 1) + if (beg != std::string::npos && buf[beg] == '\r' + && beg == buf.length () - 1) { // We had a blank line ending with a CRLF. Handle it the // same as an empty line. @@ -172,7 +173,7 @@ beg = buf.find_first_not_of (", \t", end); if (beg == std::string::npos || (buf[beg] == '\r' && - beg == buf.length () - 1)) + beg == buf.length () - 1)) { // We had a line with trailing spaces and // ending with a CRLF, so this should look like EOL, @@ -210,7 +211,7 @@ if (! quiet && (nr == 0 || nc == 0)) error ("load: file '%s' seems to be empty!", filename.c_str ()); - done: +done: is.clear (); is.seekg (pos); @@ -328,7 +329,7 @@ if (is || is.eof ()) { - // FIXME -- not sure this is best, but it works. + // FIXME: not sure this is best, but it works. if (is.eof ()) is.clear ();
--- a/libinterp/corefcn/ls-mat-ascii.h +++ b/libinterp/corefcn/ls-mat-ascii.h @@ -31,6 +31,7 @@ save_mat_ascii_data (std::ostream& os, const octave_value& val_arg, int precision, bool tabs = false); -extern bool looks_like_mat_ascii_file (std::istream& is, const std::string& filename); +extern bool looks_like_mat_ascii_file (std::istream& is, + const std::string& filename); #endif
--- a/libinterp/corefcn/ls-mat4.cc +++ b/libinterp/corefcn/ls-mat4.cc @@ -171,7 +171,7 @@ return 0; - data_read_error: +data_read_error: return -1; } @@ -358,7 +358,8 @@ for (octave_idx_type i = 0; i < nr - 1; i++) c.xelem (i) = dtmp[i] - 1; nc_new = dtmp[nr - 1]; - read_mat_binary_data (is, data.fortran_vec (), prec, nr - 1, swap, flt_fmt); + read_mat_binary_data (is, data.fortran_vec (), prec, nr - 1, + swap, flt_fmt); read_mat_binary_data (is, dtmp, prec, 1, swap, flt_fmt); SparseMatrix sm = SparseMatrix (data, r, c, nr_new, nc_new); @@ -406,10 +407,10 @@ tc = tc.convert_to_str (false, true, '\''); } - return retval; - } + return retval; + } - data_read_error: +data_read_error: error ("load: trouble reading binary file '%s'", filename.c_str ()); return retval; }
--- a/libinterp/corefcn/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -89,7 +89,7 @@ // The subsystem data block static octave_value subsys_ov; -// FIXME -- the following enum values should be the same as the +// FIXME: the following enum values should be the same as the // mxClassID values in mexproto.h, but it seems they have also changed // over time. What is the correct way to handle this and maintain // backward compatibility with old MAT files? For now, use @@ -97,25 +97,25 @@ // conflict with the mxClassID enum in mexproto.h. enum arrayclasstype - { - MAT_FILE_CELL_CLASS=1, // cell array - MAT_FILE_STRUCT_CLASS, // structure - MAT_FILE_OBJECT_CLASS, // object - MAT_FILE_CHAR_CLASS, // character array - MAT_FILE_SPARSE_CLASS, // sparse array - MAT_FILE_DOUBLE_CLASS, // double precision array - MAT_FILE_SINGLE_CLASS, // single precision floating point - MAT_FILE_INT8_CLASS, // 8 bit signed integer - MAT_FILE_UINT8_CLASS, // 8 bit unsigned integer - MAT_FILE_INT16_CLASS, // 16 bit signed integer - MAT_FILE_UINT16_CLASS, // 16 bit unsigned integer - MAT_FILE_INT32_CLASS, // 32 bit signed integer - MAT_FILE_UINT32_CLASS, // 32 bit unsigned integer - MAT_FILE_INT64_CLASS, // 64 bit signed integer - MAT_FILE_UINT64_CLASS, // 64 bit unsigned integer - MAT_FILE_FUNCTION_CLASS, // Function handle - MAT_FILE_WORKSPACE_CLASS // Workspace (undocumented) - }; +{ + MAT_FILE_CELL_CLASS=1, // cell array + MAT_FILE_STRUCT_CLASS, // structure + MAT_FILE_OBJECT_CLASS, // object + MAT_FILE_CHAR_CLASS, // character array + MAT_FILE_SPARSE_CLASS, // sparse array + MAT_FILE_DOUBLE_CLASS, // double precision array + MAT_FILE_SINGLE_CLASS, // single precision floating point + MAT_FILE_INT8_CLASS, // 8 bit signed integer + MAT_FILE_UINT8_CLASS, // 8 bit unsigned integer + MAT_FILE_INT16_CLASS, // 16 bit signed integer + MAT_FILE_UINT16_CLASS, // 16 bit unsigned integer + MAT_FILE_INT32_CLASS, // 32 bit signed integer + MAT_FILE_UINT32_CLASS, // 32 bit unsigned integer + MAT_FILE_INT64_CLASS, // 64 bit signed integer + MAT_FILE_UINT64_CLASS, // 64 bit unsigned integer + MAT_FILE_FUNCTION_CLASS, // Function handle + MAT_FILE_WORKSPACE_CLASS // Workspace (undocumented) +}; // Read COUNT elements of data from IS in the format specified by TYPE, // placing the result in DATA. If SWAP is TRUE, swap the bytes of @@ -429,7 +429,7 @@ } // Read one element tag from stream IS, -// place the type code in TYPE, the byte count in BYTES and true (false) to +// place the type code in TYPE, the byte count in BYTES and true (false) to // IS_SMALL_DATA_ELEMENT if the tag is 4 (8) bytes long. // return nonzero on error static int @@ -466,7 +466,7 @@ return 0; - data_read_error: +data_read_error: return 1; } @@ -548,9 +548,10 @@ destLen = tmp[1] + 8; std::string outbuf (destLen, ' '); - // FIXME -- find a way to avoid casting away const here! - - int err = uncompress (reinterpret_cast<Bytef *> (const_cast<char *> (outbuf.c_str ())), + // FIXME: find a way to avoid casting away const here! + + int err = uncompress (reinterpret_cast<Bytef *> + (const_cast<char *> (outbuf.c_str ())), &destLen, reinterpret_cast<Bytef *> (inbuf), element_length); @@ -791,7 +792,8 @@ // col indices if (read_mat5_tag (is, swap, type, len, is_small_data_element)) { - error ("load: reading sparse column data for '%s'", retval.c_str ()); + error ("load: reading sparse column data for '%s'", + retval.c_str ()); goto data_read_error; } @@ -802,7 +804,8 @@ if (! is || error_state) { - error ("load: reading sparse column data for '%s'", retval.c_str ()); + error ("load: reading sparse column data for '%s'", + retval.c_str ()); goto data_read_error; } @@ -812,7 +815,8 @@ // real data subelement if (read_mat5_tag (is, swap, type, len, is_small_data_element)) { - error ("load: reading sparse matrix data for '%s'", retval.c_str ()); + error ("load: reading sparse matrix data for '%s'", + retval.c_str ()); goto data_read_error; } @@ -826,11 +830,13 @@ tmp_pos = is.tellg (); read_mat5_binary_data (is, data, nnz, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { - error ("load: reading sparse matrix data for '%s'", retval.c_str ()); + error ("load: reading sparse matrix data for '%s'", + retval.c_str ()); goto data_read_error; } @@ -844,12 +850,14 @@ if (read_mat5_tag (is, swap, type, len, is_small_data_element)) { - error ("load: reading sparse matrix data for '%s'", retval.c_str ()); + error ("load: reading sparse matrix data for '%s'", + retval.c_str ()); goto data_read_error; } read_mat5_binary_data (is, im.fortran_vec (), nnz, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { @@ -881,7 +889,8 @@ // and so can ignore the separator field of m0. I think the // sentinel field is also save to ignore. octave_scalar_map m0 = tc2.scalar_map_value (); - octave_scalar_map m1 = m0.contents ("function_handle").scalar_map_value (); + octave_scalar_map m1 + = m0.contents ("function_handle").scalar_map_value (); std::string ftype = m1.contents ("type").string_value (); std::string fname = m1.contents ("function").string_value (); std::string fpath = m1.contents ("file").string_value (); @@ -909,7 +918,7 @@ // First check if just replacing matlabroot is enough std::string str = OCTAVE_EXEC_PREFIX + - fpath.substr (mroot.length ()); + fpath.substr (mroot.length ()); file_stat fs (str); if (fs.exists ()) @@ -926,7 +935,8 @@ { octave_value tmp (fcn); - tc = octave_value (new octave_fcn_handle (tmp, fname)); + tc = octave_value (new octave_fcn_handle (tmp, + fname)); } } else @@ -939,7 +949,8 @@ dir_path p (load_path::system_path ()); - str = octave_env::make_absolute (p.find_first_of (names)); + str = + octave_env::make_absolute (p.find_first_of (names)); size_t xpos = str.find_last_of (file_ops::dir_sep_chars ()); @@ -953,7 +964,8 @@ { octave_value tmp (fcn); - tc = octave_value (new octave_fcn_handle (tmp, fname)); + tc = octave_value (new octave_fcn_handle (tmp, + fname)); } else { @@ -995,9 +1007,11 @@ } else if (ftype == "anonymous") { - octave_scalar_map m2 = m1.contents ("workspace").scalar_map_value (); + octave_scalar_map m2 + = m1.contents ("workspace").scalar_map_value (); uint32NDArray MCOS = m2.contents ("MCOS").uint32_array_value (); - octave_idx_type off = static_cast<octave_idx_type>(MCOS(4).double_value ()); + octave_idx_type off + = static_cast<octave_idx_type>(MCOS(4).double_value ()); m2 = subsys_ov.scalar_map_value (); m2 = m2.contents ("MCOS").scalar_map_value (); tc2 = m2.contents ("MCOS").cell_value ()(1 + off).cell_value ()(1); @@ -1346,7 +1360,8 @@ octave_idx_type n = re.numel (); tmp_pos = is.tellg (); read_mat5_binary_data (is, re.fortran_vec (), n, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { @@ -1371,7 +1386,8 @@ n = im.numel (); read_mat5_binary_data (is, im.fortran_vec (), n, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { @@ -1413,7 +1429,8 @@ octave_idx_type n = re.numel (); tmp_pos = is.tellg (); read_mat5_binary_data (is, re.fortran_vec (), n, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { @@ -1451,7 +1468,8 @@ n = im.numel (); read_mat5_binary_data (is, im.fortran_vec (), n, swap, - static_cast<enum mat5_data_type> (type), flt_fmt); + static_cast<enum mat5_data_type> (type), + flt_fmt); if (! is || error_state) { @@ -1476,10 +1494,11 @@ bool found_big_char = false; for (octave_idx_type i = 0; i < n; i++) { - if (re(i) > 127) { - re(i) = '?'; - found_big_char = true; - } + if (re(i) > 127) + { + re(i) = '?'; + found_big_char = true; + } } if (found_big_char) @@ -1503,7 +1522,8 @@ warning ("load: can not read multi-byte encoded UTF8 characters; replacing unreadable characters with '?'"); for (octave_idx_type i = 0; i < n; i++) { - unsigned char a = static_cast<unsigned char> (re(i)); + unsigned char a + = static_cast<unsigned char> (re(i)); if (a > 0x7f) re(i) = '?'; } @@ -1525,12 +1545,12 @@ return retval; - data_read_error: - early_read_error: +data_read_error: +early_read_error: error ("load: trouble reading binary file '%s'", filename.c_str ()); return std::string (); - skip_ahead: +skip_ahead: warning ("skipping over '%s'", retval.c_str ()); is.seekg (pos + static_cast<std::streamoff> (element_length)); return read_mat5_binary_element (is, filename, swap, global, tc); @@ -1591,7 +1611,7 @@ // Why should I have to initialize outbuf as just overwrite std::string outbuf (ilen - 7, ' '); - // FIXME -- find a way to avoid casting away const here + // FIXME: find a way to avoid casting away const here char *ctmp = const_cast<char *> (outbuf.c_str ()); for (octave_idx_type j = 8; j < ilen; j++) ctmp[j-8] = itmp(j).char_value (); @@ -1633,7 +1653,7 @@ return 0; - data_write_error: +data_write_error: return 1; } @@ -1973,8 +1993,8 @@ } // The code below is disabled since get_save_type currently doesn't - // deal with integer types. This will need to be activated if get_save_type - // is changed. + // deal with integer types. This will need to be activated if + // get_save_type is changed. // double max_val = val[0]; // double min_val = val[0]; @@ -2028,8 +2048,8 @@ // The code below is disabled since get_save_type currently doesn't - // deal with integer types. This will need to be activated if get_save_type - // is changed. + // deal with integer types. This will need to be activated if + // get_save_type is changed. // float max_val = val[0]; // float min_val = val[0]; @@ -2377,7 +2397,9 @@ OCTAVE_LOCAL_BUFFER (char, out_buf, destLen); if (compress (reinterpret_cast<Bytef *> (out_buf), &destLen, - reinterpret_cast<const Bytef *> (buf_str.c_str ()), srcLen) == Z_OK) + reinterpret_cast<const Bytef *> (buf_str.c_str ()), + srcLen) + == Z_OK) { write_mat5_tag (os, miCOMPRESSED, static_cast<octave_idx_type> (destLen)); @@ -2667,8 +2689,9 @@ octave_map m; - if (tc.is_object () && - load_path::find_method (tc.class_name (), "saveobj") != std::string ()) + if (tc.is_object () + && load_path::find_method (tc.class_name (), + "saveobj") != std::string ()) { octave_value_list tmp = feval ("saveobj", tc, 1); if (! error_state) @@ -2735,10 +2758,10 @@ else gripe_wrong_type_arg ("save", tc, false); - skip_to_next: +skip_to_next: return true; - error_cleanup: +error_cleanup: error ("save: error while writing '%s' to MAT file", name.c_str ()); return false;
--- a/libinterp/corefcn/ls-mat5.h +++ b/libinterp/corefcn/ls-mat5.h @@ -24,26 +24,26 @@ #define octave_ls_mat5_h 1 enum mat5_data_type - { - miINT8 = 1, // 8 bit signed - miUINT8, // 8 bit unsigned - miINT16, // 16 bit signed - miUINT16, // 16 bit unsigned - miINT32, // 32 bit signed - miUINT32, // 32 bit unsigned - miSINGLE, // IEEE 754 single precision float - miRESERVE1, - miDOUBLE, // IEEE 754 double precision float - miRESERVE2, - miRESERVE3, - miINT64, // 64 bit signed - miUINT64, // 64 bit unsigned - miMATRIX, // MATLAB array - miCOMPRESSED, // Compressed data - miUTF8, // Unicode UTF-8 Encoded Character Data - miUTF16, // Unicode UTF-16 Encoded Character Data - miUTF32 // Unicode UTF-32 Encoded Character Data - }; +{ + miINT8 = 1, // 8 bit signed + miUINT8, // 8 bit unsigned + miINT16, // 16 bit signed + miUINT16, // 16 bit unsigned + miINT32, // 32 bit signed + miUINT32, // 32 bit unsigned + miSINGLE, // IEEE 754 single precision float + miRESERVE1, + miDOUBLE, // IEEE 754 double precision float + miRESERVE2, + miRESERVE3, + miINT64, // 64 bit signed + miUINT64, // 64 bit unsigned + miMATRIX, // MATLAB array + miCOMPRESSED, // Compressed data + miUTF8, // Unicode UTF-8 Encoded Character Data + miUTF16, // Unicode UTF-16 Encoded Character Data + miUTF32 // Unicode UTF-32 Encoded Character Data +}; extern int read_mat5_binary_file_header (std::istream& is, bool& swap,
--- a/libinterp/corefcn/ls-oct-ascii.cc +++ b/libinterp/corefcn/ls-oct-ascii.cc @@ -224,7 +224,7 @@ // # length: 5 // array // -// FIXME -- this format is fairly rigid, and doesn't allow for +// FIXME: this format is fairly rigid, and doesn't allow for // arbitrary comments. Someone should fix that. It does allow arbitrary // types however. @@ -306,7 +306,7 @@ // // Returns 1 for success and 0 for failure. -// FIXME -- should probably write the help string here too. +// FIXME: should probably write the help string here too. bool save_ascii_data (std::ostream& os, const octave_value& val_arg, @@ -416,7 +416,7 @@ } DEFUN (save_precision, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} save_precision ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} save_precision (@var{new_val})\n\ @deftypefnx {Built-in Function} {} save_precision (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/lsode.cc +++ b/libinterp/corefcn/lsode.cc @@ -157,7 +157,7 @@ while (0) DEFUN (lsode, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{x}, @var{istate}, @var{msg}] =} lsode (@var{fcn}, @var{x_0}, @var{t})\n\ @deftypefnx {Built-in Function} {[@var{x}, @var{istate}, @var{msg}] =} lsode (@var{fcn}, @var{x_0}, @var{t}, @var{t_crit})\n\ Solve the set of differential equations\n\ @@ -310,8 +310,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, t) y = "); - lsode_fcn = extract_function - (c(0), "lsode", fcn_name, fname, "; endfunction"); + lsode_fcn = extract_function (c(0), "lsode", fcn_name, fname, + "; endfunction"); } if (lsode_fcn) @@ -320,12 +320,12 @@ lsode_jac = c(1).function_value (); else { - jac_name = unique_symbol_name ("__lsode_jac__"); - jname = "function jac = "; - jname.append (jac_name); - jname.append (" (x, t) jac = "); - lsode_jac = extract_function - (c(1), "lsode", jac_name, jname, "; endfunction"); + jac_name = unique_symbol_name ("__lsode_jac__"); + jname = "function jac = "; + jname.append (jac_name); + jname.append (" (x, t) jac = "); + lsode_jac = extract_function (c(1), "lsode", jac_name, + jname, "; endfunction"); if (!lsode_jac) { @@ -355,8 +355,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, t) y = "); - lsode_fcn = extract_function - (f_arg, "lsode", fcn_name, fname, "; endfunction"); + lsode_fcn = extract_function (f_arg, "lsode", fcn_name, + fname, "; endfunction"); } while (0); break; @@ -371,8 +371,8 @@ fname = "function y = "; fname.append (fcn_name); fname.append (" (x, t) y = "); - lsode_fcn = extract_function - (tmp(0), "lsode", fcn_name, fname, "; endfunction"); + lsode_fcn = extract_function (tmp(0), "lsode", fcn_name, + fname, "; endfunction"); if (lsode_fcn) { @@ -380,9 +380,9 @@ jname = "function jac = "; jname.append (jac_name); jname.append (" (x, t) jac = "); - lsode_jac = extract_function - (tmp(1), "lsode", jac_name, jname, - "; endfunction"); + lsode_jac = extract_function (tmp(1), "lsode", + jac_name, jname, + "; endfunction"); if (!lsode_jac) { @@ -397,7 +397,7 @@ default: LSODE_ABORT1 - ("first arg should be a string or 2-element string array"); + ("first arg should be a string or 2-element string array"); } } }
--- a/libinterp/corefcn/lu.cc +++ b/libinterp/corefcn/lu.cc @@ -62,7 +62,7 @@ } DEFUN (lu, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{L}, @var{U}] =} lu (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}] =} lu (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} lu (@var{S})\n\ @@ -235,9 +235,9 @@ retval(1) = octave_value (fact.U (), MatrixType (MatrixType::Upper)); - retval(0) = octave_value (L, - MatrixType (MatrixType::Permuted_Lower, - nr, fact.row_perm ())); + retval(0) + = octave_value (L, MatrixType (MatrixType::Permuted_Lower, + nr, fact.row_perm ())); } } break; @@ -305,9 +305,9 @@ retval(1) = octave_value (fact.U (), MatrixType (MatrixType::Upper)); - retval(0) = octave_value (L, - MatrixType (MatrixType::Permuted_Lower, - nr, fact.row_perm ())); + retval(0) + = octave_value (L, MatrixType (MatrixType::Permuted_Lower, + nr, fact.row_perm ())); } } break; @@ -590,12 +590,12 @@ { octave_idx_type m = l.rows (), k = u.rows (), n = u.columns (); return ((l.ndims () == 2 && u.ndims () == 2 && k == l.columns ()) - && k == std::min (m, n) && - (p.is_undefined () || p.rows () == m)); + && k == std::min (m, n) && + (p.is_undefined () || p.rows () == m)); } DEFUN (luupdate, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{L}, @var{U}] =} luupdate (@var{L}, @var{U}, @var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}] =} luupdate (@var{L}, @var{U}, @var{P}, @var{x}, @var{y})\n\ Given an LU@tie{}factorization of a real or complex matrix\n\
--- a/libinterp/corefcn/luinc.cc +++ b/libinterp/corefcn/luinc.cc @@ -38,7 +38,7 @@ #include "ov-cx-sparse.h" DEFUN (luinc, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, '0')\n\ @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, @var{droptol})\n\ @deftypefnx {Built-in Function} {[@var{L}, @var{U}, @var{P}, @var{Q}] =} luinc (@var{A}, @var{opts})\n\ @@ -217,11 +217,13 @@ { SparseMatrix P = fact.Pr (); SparseMatrix L = P.transpose () * fact.L (); - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (L, MatrixType - (MatrixType::Permuted_Lower, - sm_nr, fact.row_perm ())); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (L, MatrixType + (MatrixType::Permuted_Lower, + sm_nr, fact.row_perm ())); } } break; @@ -237,10 +239,12 @@ retval(2) = fact.Pr_vec (); else retval(2) = fact.Pr_mat (); - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (fact.L (), - MatrixType (MatrixType::Lower)); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (fact.L (), + MatrixType (MatrixType::Lower)); } } break; @@ -263,10 +267,12 @@ retval(3) = fact.Pc_mat (); retval(2) = fact.Pr_mat (); } - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (fact.L (), - MatrixType (MatrixType::Lower)); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (fact.L (), + MatrixType (MatrixType::Lower)); } } break; @@ -300,11 +306,13 @@ { SparseMatrix P = fact.Pr (); SparseComplexMatrix L = P.transpose () * fact.L (); - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (L, MatrixType - (MatrixType::Permuted_Lower, - sm_nr, fact.row_perm ())); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (L, MatrixType + (MatrixType::Permuted_Lower, + sm_nr, fact.row_perm ())); } } break; @@ -320,10 +328,12 @@ retval(2) = fact.Pr_vec (); else retval(2) = fact.Pr_mat (); - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (fact.L (), - MatrixType (MatrixType::Lower)); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (fact.L (), + MatrixType (MatrixType::Lower)); } } break; @@ -346,10 +356,12 @@ retval(3) = fact.Pc_mat (); retval(2) = fact.Pr_mat (); } - retval(1) = octave_value (fact.U (), - MatrixType (MatrixType::Upper)); - retval(0) = octave_value (fact.L (), - MatrixType (MatrixType::Lower)); + retval(1) + = octave_value (fact.U (), + MatrixType (MatrixType::Upper)); + retval(0) + = octave_value (fact.L (), + MatrixType (MatrixType::Lower)); } } break;
--- a/libinterp/corefcn/mappers.cc +++ b/libinterp/corefcn/mappers.cc @@ -37,7 +37,7 @@ #include "variables.h" DEFUN (abs, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} abs (@var{z})\n\ Compute the magnitude of @var{z}, defined as\n\ @tex\n\ @@ -84,7 +84,7 @@ */ DEFUN (acos, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} acos (@var{x})\n\ Compute the inverse cosine in radians for each element of @var{x}.\n\ @seealso{cos, acosd}\n\ @@ -119,7 +119,7 @@ */ DEFUN (acosh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} acosh (@var{x})\n\ Compute the inverse hyperbolic cosine for each element of @var{x}.\n\ @seealso{cosh}\n\ @@ -150,7 +150,7 @@ */ DEFUN (angle, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} angle (@var{z})\n\ See arg.\n\ @end deftypefn") @@ -165,7 +165,7 @@ } DEFUN (arg, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} arg (@var{z})\n\ @deftypefnx {Mapping Function} {} angle (@var{z})\n\ Compute the argument of @var{z}, defined as,\n\ @@ -220,7 +220,7 @@ */ DEFUN (asin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} asin (@var{x})\n\ Compute the inverse sine in radians for each element of @var{x}.\n\ @seealso{sin, asind}\n\ @@ -248,7 +248,7 @@ */ DEFUN (asinh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} asinh (@var{x})\n\ Compute the inverse hyperbolic sine for each element of @var{x}.\n\ @seealso{sinh}\n\ @@ -279,7 +279,7 @@ */ DEFUN (atan, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} atan (@var{x})\n\ Compute the inverse tangent in radians for each element of @var{x}.\n\ @seealso{tan, atand}\n\ @@ -314,7 +314,7 @@ */ DEFUN (atanh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} atanh (@var{x})\n\ Compute the inverse hyperbolic tangent for each element of @var{x}.\n\ @seealso{tanh}\n\ @@ -345,7 +345,7 @@ */ DEFUN (cbrt, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cbrt (@var{x})\n\ Compute the real cube root of each element of @var{x}.\n\ Unlike @code{@var{x}^(1/3)}, the result will be negative if @var{x} is\n\ @@ -377,7 +377,7 @@ */ DEFUN (ceil, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} ceil (@var{x})\n\ Return the smallest integer not less than @var{x}. This is equivalent to\n\ rounding towards positive infinity. If @var{x} is\n\ @@ -419,7 +419,7 @@ */ DEFUN (conj, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} conj (@var{z})\n\ Return the complex conjugate of @var{z}, defined as\n\ @tex\n\ @@ -458,7 +458,7 @@ */ DEFUN (cos, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cos (@var{x})\n\ Compute the cosine for each element of @var{x} in radians.\n\ @seealso{acos, cosd, cosh}\n\ @@ -495,7 +495,7 @@ */ DEFUN (cosh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cosh (@var{x})\n\ Compute the hyperbolic cosine for each element of @var{x}.\n\ @seealso{acosh, sinh, tanh}\n\ @@ -526,7 +526,7 @@ */ DEFUN (erf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erf (@var{z})\n\ Compute the error function,\n\ @tex\n\ @@ -596,7 +596,7 @@ */ DEFUN (erfinv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfinv (@var{x})\n\ Compute the inverse error function, i.e., @var{y} such that\n\ \n\ @@ -634,7 +634,7 @@ */ DEFUN (erfcinv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfcinv (@var{x})\n\ Compute the inverse complementary error function, i.e., @var{y} such that\n\ \n\ @@ -672,7 +672,7 @@ */ DEFUN (erfc, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfc (@var{z})\n\ Compute the complementary error function,\n\ @tex\n\ @@ -703,7 +703,7 @@ */ DEFUN (erfcx, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfcx (@var{z})\n\ Compute the scaled complementary error function,\n\ @tex\n\ @@ -746,7 +746,7 @@ */ DEFUN (erfi, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfi (@var{z})\n\ Compute the imaginary error function,\n\ @tex\n\ @@ -784,7 +784,7 @@ */ DEFUN (dawson, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} dawson (@var{z})\n\ Compute the Dawson (scaled imaginary error) function,\n\ @tex\n\ @@ -824,7 +824,7 @@ */ DEFUN (exp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} exp (@var{x})\n\ Compute\n\ @tex\n\ @@ -861,7 +861,7 @@ */ DEFUN (expm1, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} expm1 (@var{x})\n\ Compute\n\ @tex\n\ @@ -894,7 +894,7 @@ */ DEFUN (isfinite, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isfinite (@var{x})\n\ @deftypefnx {Mapping Function} {} finite (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ @@ -933,7 +933,7 @@ */ DEFUN (fix, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} fix (@var{x})\n\ Truncate fractional portion of @var{x} and return the integer portion. This\n\ is equivalent to rounding towards zero. If @var{x} is complex, return\n\ @@ -968,7 +968,7 @@ */ DEFUN (floor, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} floor (@var{x})\n\ Return the largest integer not greater than @var{x}. This is equivalent to\n\ rounding towards negative infinity. If @var{x} is\n\ @@ -1003,7 +1003,7 @@ */ DEFUN (gamma, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} gamma (@var{z})\n\ Compute the Gamma function,\n\ @tex\n\ @@ -1067,7 +1067,7 @@ */ DEFUN (imag, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} imag (@var{z})\n\ Return the imaginary part of @var{z} as a real number.\n\ @seealso{real, conj}\n\ @@ -1098,7 +1098,7 @@ */ DEFUNX ("isalnum", Fisalnum, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ letters or digits and false where they are not. This is equivalent to\n\ @@ -1129,7 +1129,7 @@ */ DEFUNX ("isalpha", Fisalpha, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ letters and false where they are not. This is equivalent to\n\ @@ -1159,7 +1159,7 @@ */ DEFUNX ("isascii", Fisascii, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isascii (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ ASCII characters (in the range 0 to 127 decimal) and false where they are\n\ @@ -1186,7 +1186,7 @@ */ DEFUNX ("iscntrl", Fiscntrl, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} iscntrl (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ control characters and false where they are not.\n\ @@ -1215,7 +1215,7 @@ */ DEFUNX ("isdigit", Fisdigit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isdigit (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ decimal digits (0-9) and false where they are not.\n\ @@ -1243,7 +1243,7 @@ */ DEFUN (isinf, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isinf (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ are infinite and false where they are not.\n\ @@ -1285,7 +1285,7 @@ */ DEFUNX ("isgraph", Fisgraph, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isgraph (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ printable characters (but not the space character) and false where they are\n\ @@ -1314,7 +1314,7 @@ */ DEFUNX ("islower", Fislower, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} islower (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ lowercase letters and false where they are not.\n\ @@ -1342,7 +1342,7 @@ */ DEFUN (isna, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isna (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ NA (missing) values and false where they are not.\n\ @@ -1384,7 +1384,7 @@ */ DEFUN (isnan, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isnan (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ NaN values and false where they are not.\n\ @@ -1426,7 +1426,7 @@ */ DEFUNX ("isprint", Fisprint, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isprint (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ printable characters (including the space character) and false where they\n\ @@ -1455,7 +1455,7 @@ */ DEFUNX ("ispunct", Fispunct, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} ispunct (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ punctuation characters and false where they are not.\n\ @@ -1486,7 +1486,7 @@ */ DEFUNX ("isspace", Fisspace, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isspace (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ whitespace characters (space, formfeed, newline, carriage return, tab, and\n\ @@ -1515,7 +1515,7 @@ */ DEFUNX ("isupper", Fisupper, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isupper (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ uppercase letters and false where they are not.\n\ @@ -1543,7 +1543,7 @@ */ DEFUNX ("isxdigit", Fisxdigit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isxdigit (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ hexadecimal digits (0-9 and @nospell{a-fA-F}).\n\ @@ -1573,7 +1573,7 @@ */ DEFUN (lgamma, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} lgamma (@var{x})\n\ @deftypefnx {Mapping Function} {} gammaln (@var{x})\n\ Return the natural logarithm of the gamma function of @var{x}.\n\ @@ -1619,7 +1619,7 @@ */ DEFUN (log, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log (@var{x})\n\ Compute the natural logarithm,\n\ @tex\n\ @@ -1654,7 +1654,7 @@ */ DEFUN (log10, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log10 (@var{x})\n\ Compute the base-10 logarithm of each element of @var{x}.\n\ @seealso{log, log2, logspace, exp}\n\ @@ -1678,7 +1678,7 @@ */ DEFUN (log1p, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log1p (@var{x})\n\ Compute\n\ @tex\n\ @@ -1709,7 +1709,7 @@ */ DEFUN (real, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} real (@var{z})\n\ Return the real part of @var{z}.\n\ @seealso{imag, conj}\n\ @@ -1740,7 +1740,7 @@ */ DEFUN (round, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} round (@var{x})\n\ Return the integer nearest to @var{x}. If @var{x} is complex, return\n\ @code{round (real (@var{x})) + round (imag (@var{x})) * I}. If there\n\ @@ -1786,7 +1786,7 @@ */ DEFUN (roundb, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} roundb (@var{x})\n\ Return the integer nearest to @var{x}. If there are two nearest\n\ integers, return the even one (banker's rounding). If @var{x} is complex,\n\ @@ -1827,7 +1827,7 @@ */ DEFUN (sign, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sign (@var{x})\n\ Compute the @dfn{signum} function, which is defined as\n\ @tex\n\ @@ -1881,7 +1881,7 @@ */ DEFUNX ("signbit", Fsignbit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} signbit (@var{x})\n\ Return logical true if the value of @var{x} has its sign bit set.\n\ Otherwise return logical false. This behavior is consistent with the other\n\ @@ -1895,9 +1895,11 @@ @end deftypefn") { octave_value retval; - if (args.length () == 1) { - retval = args(0).xsignbit (); - retval = (retval != 0); } + if (args.length () == 1) + { + retval = args(0).xsignbit (); + retval = (retval != 0); + } else print_usage (); @@ -1920,7 +1922,7 @@ */ DEFUN (sin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sin (@var{x})\n\ Compute the sine for each element of @var{x} in radians.\n\ @seealso{asin, sind, sinh}\n\ @@ -1955,7 +1957,7 @@ */ DEFUN (sinh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sinh (@var{x})\n\ Compute the hyperbolic sine for each element of @var{x}.\n\ @seealso{asinh, cosh, tanh}\n\ @@ -1986,7 +1988,7 @@ */ DEFUN (sqrt, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sqrt (@var{x})\n\ Compute the square root of each element of @var{x}. If @var{x} is negative,\n\ a complex result is returned. To compute the matrix square root, see\n\ @@ -2019,7 +2021,7 @@ */ DEFUN (tan, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tan (@var{z})\n\ Compute the tangent for each element of @var{x} in radians.\n\ @seealso{atan, tand, tanh}\n\ @@ -2054,7 +2056,7 @@ */ DEFUN (tanh, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tanh (@var{x})\n\ Compute hyperbolic tangent for each element of @var{x}.\n\ @seealso{atanh, sinh, cosh}\n\ @@ -2085,7 +2087,7 @@ */ DEFUNX ("toascii", Ftoascii, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} toascii (@var{s})\n\ Return ASCII representation of @var{s} in a matrix. For example:\n\ \n\ @@ -2121,7 +2123,7 @@ */ DEFUNX ("tolower", Ftolower, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tolower (@var{s})\n\ @deftypefnx {Mapping Function} {} lower (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each uppercase\n\ @@ -2172,7 +2174,7 @@ */ DEFUNX ("toupper", Ftoupper, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} toupper (@var{s})\n\ @deftypefnx {Mapping Function} {} upper (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each lowercase\n\
--- a/libinterp/corefcn/matrix_type.cc +++ b/libinterp/corefcn/matrix_type.cc @@ -37,7 +37,7 @@ #include "oct-locbuf.h" DEFUN (matrix_type, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{type} =} matrix_type (@var{A})\n\ @deftypefnx {Built-in Function} {@var{type} =} matrix_type (@var{A}, \"nocompute\")\n\ @deftypefnx {Built-in Function} {@var{A} =} matrix_type (@var{A}, @var{type})\n\ @@ -124,7 +124,8 @@ else { bool autocomp = true; - if (nargin == 2 && args(1).is_string () && args(1).string_value () == "nocompute") + if (nargin == 2 && args(1).is_string () + && args(1).string_value () == "nocompute") { nargin = 1; autocomp = false; @@ -214,7 +215,7 @@ // Ok, we're changing the matrix type std::string str_typ = args(1).string_value (); - // FIXME -- why do I have to explicitly call the constructor? + // FIXME: why do I have to explicitly call the constructor? MatrixType mattyp = MatrixType (); octave_idx_type nl = 0; @@ -236,7 +237,8 @@ mattyp.mark_as_upper_triangular (); else if (str_typ == "lower") mattyp.mark_as_lower_triangular (); - else if (str_typ == "banded" || str_typ == "banded positive definite") + else if (str_typ == "banded" + || str_typ == "banded positive definite") { if (nargin != 4) error ("matrix_type: banded matrix type requires 4 arguments"); @@ -275,7 +277,8 @@ if (! error_state) { - if (nargin == 3 && (str_typ == "upper" || str_typ == "lower")) + if (nargin == 3 + && (str_typ == "upper" || str_typ == "lower")) { const ColumnVector perm = ColumnVector (args (2).vector_value ()); @@ -294,7 +297,9 @@ OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); for (octave_idx_type i = 0; i < len; i++) - p[i] = static_cast<octave_idx_type> (perm (i)) - 1; + p[i] = static_cast<octave_idx_type> + (perm (i)) + - 1; if (str_typ == "upper") mattyp.mark_as_permuted (len, p); @@ -303,8 +308,9 @@ } } } - else if (nargin != 2 && str_typ != "banded positive definite" && - str_typ != "banded") + else if (nargin != 2 + && str_typ != "banded positive definite" + && str_typ != "banded") error ("matrix_type: Invalid number of arguments"); if (! error_state) @@ -315,8 +321,9 @@ octave_value (args(0).sparse_complex_matrix_value (), mattyp); else - retval = octave_value (args(0).sparse_matrix_value (), - mattyp); + retval + = octave_value (args(0).sparse_matrix_value (), + mattyp); } } } @@ -336,7 +343,8 @@ { if (args(0).is_single_type ()) { - FloatComplexMatrix m = args(0).float_complex_matrix_value (); + FloatComplexMatrix m; + m = args(0).float_complex_matrix_value (); if (!error_state) { mattyp = MatrixType (m); @@ -410,7 +418,7 @@ // Ok, we're changing the matrix type std::string str_typ = args(1).string_value (); - // FIXME -- why do I have to explicitly call the constructor? + // FIXME: why do I have to explicitly call the constructor? MatrixType mattyp = MatrixType (MatrixType::Unknown, true); if (error_state) @@ -437,7 +445,8 @@ else if (str_typ == "unknown") mattyp.invalidate_type (); else - error ("matrix_type: Unknown matrix type %s", str_typ.c_str ()); + error ("matrix_type: Unknown matrix type %s", + str_typ.c_str ()); if (! error_state) { @@ -461,7 +470,9 @@ OCTAVE_LOCAL_BUFFER (octave_idx_type, p, len); for (octave_idx_type i = 0; i < len; i++) - p[i] = static_cast<octave_idx_type> (perm (i)) - 1; + p[i] = static_cast<octave_idx_type> + (perm (i)) + - 1; if (str_typ == "upper") mattyp.mark_as_permuted (len, p); @@ -480,23 +491,23 @@ { if (args(0).is_complex_type ()) retval = octave_value - (args(0).float_complex_matrix_value (), - mattyp); + (args(0).float_complex_matrix_value (), + mattyp); else retval = octave_value - (args(0).float_matrix_value (), - mattyp); + (args(0).float_matrix_value (), + mattyp); } else { if (args(0).is_complex_type ()) retval = octave_value - (args(0).complex_matrix_value (), - mattyp); + (args(0).complex_matrix_value (), + mattyp); else retval = octave_value - (args(0).matrix_value (), - mattyp); + (args(0).matrix_value (), + mattyp); } } }
--- a/libinterp/corefcn/max.cc +++ b/libinterp/corefcn/max.cc @@ -294,17 +294,20 @@ { retval(0) = range.min (); if (nargout > 1) - retval(1) = static_cast<double> (range.inc () < 0 ? range.nelem () : 1); + retval(1) = static_cast<double> + (range.inc () < 0 ? range.nelem () : 1); } else { retval(0) = range.max (); if (nargout > 1) - retval(1) = static_cast<double> (range.inc () >= 0 ? range.nelem () : 1); + retval(1) = static_cast<double> + (range.inc () >= 0 ? range.nelem () : 1); } } else if (arg.is_sparse_type ()) - retval = do_minmax_red_op<SparseMatrix> (arg, nargout, dim, ismin); + retval = do_minmax_red_op<SparseMatrix> (arg, nargout, dim, + ismin); else retval = do_minmax_red_op<NDArray> (arg, nargout, dim, ismin); break; @@ -312,16 +315,19 @@ case btyp_complex: { if (arg.is_sparse_type ()) - retval = do_minmax_red_op<SparseComplexMatrix> (arg, nargout, dim, ismin); + retval = do_minmax_red_op<SparseComplexMatrix> (arg, nargout, dim, + ismin); else - retval = do_minmax_red_op<ComplexNDArray> (arg, nargout, dim, ismin); + retval = do_minmax_red_op<ComplexNDArray> (arg, nargout, dim, + ismin); break; } case btyp_float: retval = do_minmax_red_op<FloatNDArray> (arg, nargout, dim, ismin); break; case btyp_float_complex: - retval = do_minmax_red_op<FloatComplexNDArray> (arg, nargout, dim, ismin); + retval = do_minmax_red_op<FloatComplexNDArray> (arg, nargout, dim, + ismin); break; case btyp_char: retval = do_minmax_red_op<charNDArray> (arg, nargout, dim, ismin); @@ -344,7 +350,7 @@ break; default: gripe_wrong_type_arg (func, arg); - } + } } else if (nargin == 2) { @@ -373,7 +379,8 @@ if ((argx.is_sparse_type () && (argy.is_sparse_type () || argy.is_scalar_type ())) || (argy.is_sparse_type () && argx.is_scalar_type ())) - retval = do_minmax_bin_op<SparseComplexMatrix> (argx, argy, ismin); + retval = do_minmax_bin_op<SparseComplexMatrix> (argx, argy, + ismin); else retval = do_minmax_bin_op<ComplexNDArray> (argx, argy, ismin); break; @@ -412,7 +419,7 @@ } DEFUN (min, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} min (@var{x})\n\ @deftypefnx {Built-in Function} {} min (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} min (@var{x}, [], @var{dim})\n\ @@ -487,7 +494,7 @@ */ DEFUN (max, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} max (@var{x})\n\ @deftypefnx {Built-in Function} {} max (@var{x}, @var{y})\n\ @deftypefnx {Built-in Function} {} max (@var{x}, [], @var{dim})\n\ @@ -620,17 +627,20 @@ retval = do_cumminmax_red_op<NDArray> (arg, nargout, dim, ismin); break; case btyp_complex: - retval = do_cumminmax_red_op<ComplexNDArray> (arg, nargout, dim, ismin); + retval = do_cumminmax_red_op<ComplexNDArray> (arg, nargout, dim, + ismin); break; case btyp_float: retval = do_cumminmax_red_op<FloatNDArray> (arg, nargout, dim, ismin); break; case btyp_float_complex: - retval = do_cumminmax_red_op<FloatComplexNDArray> (arg, nargout, dim, ismin); + retval = do_cumminmax_red_op<FloatComplexNDArray> (arg, nargout, dim, + ismin); break; #define MAKE_INT_BRANCH(X) \ case btyp_ ## X: \ - retval = do_cumminmax_red_op<X ## NDArray> (arg, nargout, dim, ismin); \ + retval = do_cumminmax_red_op<X ## NDArray> (arg, nargout, dim, \ + ismin); \ break; MAKE_INT_BRANCH (int8); MAKE_INT_BRANCH (int16); @@ -643,14 +653,15 @@ #undef MAKE_INT_BRANCH case btyp_bool: { - retval = do_cumminmax_red_op<int8NDArray> (arg, nargout, dim, ismin); + retval = do_cumminmax_red_op<int8NDArray> (arg, nargout, dim, + ismin); if (retval.length () > 0) retval(0) = retval(0).bool_array_value (); break; } default: gripe_wrong_type_arg (func, arg); - } + } } else print_usage (); @@ -659,7 +670,7 @@ } DEFUN (cummin, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cummin (@var{x})\n\ @deftypefnx {Built-in Function} {} cummin (@var{x}, @var{dim})\n\ @deftypefnx {Built-in Function} {[@var{w}, @var{iw}] =} cummin (@var{x})\n\ @@ -713,7 +724,7 @@ */ DEFUN (cummax, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cummax (@var{x})\n\ @deftypefnx {Built-in Function} {} cummax (@var{x}, @var{dim})\n\ @deftypefnx {Built-in Function} {[@var{w}, @var{iw}] =} cummax (@dots{})\n\
--- a/libinterp/corefcn/md5sum.cc +++ b/libinterp/corefcn/md5sum.cc @@ -37,7 +37,7 @@ #include "oct-md5.h" DEFUN (md5sum, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} md5sum (@var{file})\n\ @deftypefnx {Built-in Function} {} md5sum (@var{str}, @var{opt})\n\ Calculate the MD5 sum of the file @var{file}. If the second parameter\n\
--- a/libinterp/corefcn/mex.cc +++ b/libinterp/corefcn/mex.cc @@ -97,7 +97,7 @@ } } - done: +done: return retval; } @@ -245,7 +245,8 @@ { ndims = val.ndims (); - dims = static_cast<mwSize *> (mxArray::malloc (ndims * sizeof (mwSize))); + dims = static_cast<mwSize *> (mxArray::malloc (ndims + * sizeof (mwSize))); dim_vector dv = val.dims (); @@ -410,7 +411,8 @@ } // Not allowed. - void set_field_by_number (mwIndex /*index*/, int /*key_num*/, mxArray */*val*/) + void set_field_by_number (mwIndex /*index*/, int /*key_num*/, + mxArray */*val*/) { request_mutation (); } @@ -454,8 +456,7 @@ char *array_to_string (void) const { - // FIXME -- this is suposed to handle multi-byte character - // strings. + // FIXME: this is suposed to handle multi-byte character strings. char *buf = 0; @@ -535,7 +536,9 @@ : mxArray_base (arg), val (arg.val), mutate_flag (arg.mutate_flag), id (arg.id), class_name (mxArray::strsave (arg.class_name)), ndims (arg.ndims), - dims (ndims > 0 ? static_cast<mwSize *> (mxArray::malloc (ndims * sizeof (mwSize))) : 0) + dims (ndims > 0 ? static_cast<mwSize *> + (mxArray::malloc (ndims * sizeof (mwSize))) + : 0) { if (dims) { @@ -559,7 +562,7 @@ mutable mwSize ndims; mutable mwSize *dims; - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_octave_value& operator = (const mxArray_octave_value&); @@ -839,7 +842,8 @@ return 0; } - void set_field_by_number (mwIndex /*index*/, int /*key_num*/, mxArray */*val*/) + void set_field_by_number (mwIndex /*index*/, int /*key_num*/, + mxArray */*val*/) { invalid_type_error (); } @@ -942,7 +946,7 @@ error ("invalid type for operation"); } - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_matlab& operator = (const mxArray_matlab&); @@ -958,18 +962,25 @@ mxComplexity flag = mxREAL) : mxArray_matlab (id_arg, ndims_arg, dims_arg), pr (mxArray::calloc (get_number_of_elements (), get_element_size ())), - pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), get_element_size ()) : 0) { } + pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), + get_element_size ()) + : 0) { } mxArray_number (mxClassID id_arg, const dim_vector& dv, mxComplexity flag = mxREAL) : mxArray_matlab (id_arg, dv), pr (mxArray::calloc (get_number_of_elements (), get_element_size ())), - pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), get_element_size ()) : 0) { } - - mxArray_number (mxClassID id_arg, mwSize m, mwSize n, mxComplexity flag = mxREAL) + pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), + get_element_size ()) + : 0) { } + + mxArray_number (mxClassID id_arg, mwSize m, mwSize n, + mxComplexity flag = mxREAL) : mxArray_matlab (id_arg, m, n), pr (mxArray::calloc (get_number_of_elements (), get_element_size ())), - pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), get_element_size ()) : 0) { } + pi (flag == mxCOMPLEX ? mxArray::calloc (get_number_of_elements (), + get_element_size ()) + : 0) { } mxArray_number (mxClassID id_arg, double val) : mxArray_matlab (id_arg, 1, 1), @@ -993,8 +1004,8 @@ : mxArray_matlab (mxCHAR_CLASS, str ? (strlen (str) ? 1 : 0) : 0, str ? strlen (str) : 0), - pr (mxArray::calloc (get_number_of_elements (), get_element_size ())), - pi (0) + pr (mxArray::calloc (get_number_of_elements (), get_element_size ())), + pi (0) { mxChar *cpr = static_cast<mxChar *> (pr); mwSize nel = get_number_of_elements (); @@ -1135,8 +1146,7 @@ char *array_to_string (void) const { - // FIXME -- this is suposed to handle multi-byte character - // strings. + // FIXME: this is suposed to handle multi-byte character strings. mwSize nel = get_number_of_elements (); @@ -1321,7 +1331,9 @@ mxArray_number (const mxArray_number& val) : mxArray_matlab (val), pr (mxArray::malloc (get_number_of_elements () * get_element_size ())), - pi (val.pi ? mxArray::malloc (get_number_of_elements () * get_element_size ()) : 0) + pi (val.pi ? mxArray::malloc (get_number_of_elements () + * get_element_size ()) + : 0) { size_t nbytes = get_number_of_elements () * get_element_size (); @@ -1337,7 +1349,7 @@ void *pr; void *pi; - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_number& operator = (const mxArray_number&); @@ -1356,7 +1368,7 @@ pi (flag == mxCOMPLEX ? mxArray::calloc (nzmax, get_element_size ()) : 0), ir (static_cast<mwIndex *> (mxArray::calloc (nzmax, sizeof (mwIndex)))), jc (static_cast<mwIndex *> (mxArray::calloc (n + 1, sizeof (mwIndex)))) - { } + { } mxArray_base *dup (void) const { return new mxArray_sparse (*this); } @@ -1504,7 +1516,7 @@ memcpy (jc, val.jc, (val.get_n () + 1) * sizeof (mwIndex)); } - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_sparse& operator = (const mxArray_sparse&); @@ -1518,25 +1530,35 @@ mxArray_struct (mwSize ndims_arg, const mwSize *dims_arg, int num_keys_arg, const char **keys) - : mxArray_matlab (mxSTRUCT_CLASS, ndims_arg, dims_arg), nfields (num_keys_arg), - fields (static_cast<char **> (mxArray::calloc (nfields, sizeof (char *)))), - data (static_cast<mxArray **> (mxArray::calloc (nfields * get_number_of_elements (), sizeof (mxArray *)))) + : mxArray_matlab (mxSTRUCT_CLASS, ndims_arg, dims_arg), + nfields (num_keys_arg), + fields (static_cast<char **> (mxArray::calloc (nfields, + sizeof (char *)))), + data (static_cast<mxArray **> (mxArray::calloc (nfields * + get_number_of_elements (), + sizeof (mxArray *)))) { init (keys); } mxArray_struct (const dim_vector& dv, int num_keys_arg, const char **keys) : mxArray_matlab (mxSTRUCT_CLASS, dv), nfields (num_keys_arg), - fields (static_cast<char **> (mxArray::calloc (nfields, sizeof (char *)))), - data (static_cast<mxArray **> (mxArray::calloc (nfields * get_number_of_elements (), sizeof (mxArray *)))) + fields (static_cast<char **> (mxArray::calloc (nfields, + sizeof (char *)))), + data (static_cast<mxArray **> (mxArray::calloc (nfields * + get_number_of_elements (), + sizeof (mxArray *)))) { init (keys); } mxArray_struct (mwSize m, mwSize n, int num_keys_arg, const char **keys) : mxArray_matlab (mxSTRUCT_CLASS, m, n), nfields (num_keys_arg), - fields (static_cast<char **> (mxArray::calloc (nfields, sizeof (char *)))), - data (static_cast<mxArray **> (mxArray::calloc (nfields * get_number_of_elements (), sizeof (mxArray *)))) + fields (static_cast<char **> (mxArray::calloc (nfields, + sizeof (char *)))), + data (static_cast<mxArray **> (mxArray::calloc (nfields * + get_number_of_elements (), + sizeof (mxArray *)))) { init (keys); } @@ -1572,7 +1594,8 @@ { nfields++; - fields = static_cast<char **> (mxRealloc (fields, nfields * sizeof (char *))); + fields = static_cast<char **> + (mxRealloc (fields, nfields * sizeof (char *))); if (fields) { @@ -1582,7 +1605,9 @@ mwSize ntot = nfields * nel; - mxArray **new_data = static_cast<mxArray **> (mxArray::malloc (ntot * sizeof (mxArray *))); + mxArray **new_data; + new_data = static_cast<mxArray **> + (mxArray::malloc (ntot * sizeof (mxArray *))); if (new_data) { @@ -1623,9 +1648,12 @@ int new_nfields = nfields - 1; - char **new_fields = static_cast<char **> (mxArray::malloc (new_nfields * sizeof (char *))); - - mxArray **new_data = static_cast<mxArray **> (mxArray::malloc (new_nfields * nel * sizeof (mxArray *))); + char **new_fields = static_cast<char **> + (mxArray::malloc (new_nfields * sizeof (char *))); + + mxArray **new_data = static_cast<mxArray **> + (mxArray::malloc (new_nfields * nel + * sizeof (mxArray *))); for (int i = 0; i < key_num; i++) new_fields[i] = fields[i]; @@ -1664,7 +1692,7 @@ mxArray *get_field_by_number (mwIndex index, int key_num) const { return key_num >= 0 && key_num < nfields - ? data[nfields * index + key_num] : 0; + ? data[nfields * index + key_num] : 0; } void set_field_by_number (mwIndex index, int key_num, mxArray *val); @@ -1732,8 +1760,11 @@ mxArray_struct (const mxArray_struct& val) : mxArray_matlab (val), nfields (val.nfields), - fields (static_cast<char **> (mxArray::malloc (nfields * sizeof (char *)))), - data (static_cast<mxArray **> (mxArray::malloc (nfields * get_number_of_elements () * sizeof (mxArray *)))) + fields (static_cast<char **> (mxArray::malloc (nfields + * sizeof (char *)))), + data (static_cast<mxArray **> (mxArray::malloc (nfields * + get_number_of_elements () + * sizeof (mxArray *)))) { for (int i = 0; i < nfields; i++) fields[i] = mxArray::strsave (val.fields[i]); @@ -1747,7 +1778,7 @@ } } - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_struct& operator = (const mxArray_struct& val); @@ -1761,15 +1792,18 @@ mxArray_cell (mwSize ndims_arg, const mwSize *dims_arg) : mxArray_matlab (mxCELL_CLASS, ndims_arg, dims_arg), - data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), sizeof (mxArray *)))) { } + data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), + sizeof (mxArray *)))) { } mxArray_cell (const dim_vector& dv) : mxArray_matlab (mxCELL_CLASS, dv), - data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), sizeof (mxArray *)))) { } + data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), + sizeof (mxArray *)))) { } mxArray_cell (mwSize m, mwSize n) : mxArray_matlab (mxCELL_CLASS, m, n), - data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), sizeof (mxArray *)))) { } + data (static_cast<mxArray **> (mxArray::calloc (get_number_of_elements (), + sizeof (mxArray *)))) { } mxArray_base *dup (void) const { return new mxArray_cell (*this); } @@ -1816,7 +1850,8 @@ mxArray_cell (const mxArray_cell& val) : mxArray_matlab (val), - data (static_cast<mxArray **> (mxArray::malloc (get_number_of_elements () * sizeof (mxArray *)))) + data (static_cast<mxArray **> (mxArray::malloc (get_number_of_elements () + * sizeof (mxArray *)))) { mwSize nel = get_number_of_elements (); @@ -1827,7 +1862,7 @@ } } - // No assignment! FIXME -- should this be implemented? Note that we + // No assignment! FIXME: should this be implemented? Note that we // do have a copy constructor. mxArray_cell& operator = (const mxArray_cell&); @@ -1838,7 +1873,8 @@ mxArray::mxArray (const octave_value& ov) : rep (new mxArray_octave_value (ov)), name (0) { } -mxArray::mxArray (mxClassID id, mwSize ndims, const mwSize *dims, mxComplexity flag) +mxArray::mxArray (mxClassID id, mwSize ndims, const mwSize *dims, + mxComplexity flag) : rep (new mxArray_number (id, ndims, dims, flag)), name (0) { } mxArray::mxArray (mxClassID id, const dim_vector& dv, mxComplexity flag) @@ -1859,10 +1895,12 @@ mxArray::mxArray (mwSize m, const char **str) : rep (new mxArray_number (m, str)), name (0) { } -mxArray::mxArray (mxClassID id, mwSize m, mwSize n, mwSize nzmax, mxComplexity flag) +mxArray::mxArray (mxClassID id, mwSize m, mwSize n, mwSize nzmax, + mxComplexity flag) : rep (new mxArray_sparse (id, m, n, nzmax, flag)), name (0) { } -mxArray::mxArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys) +mxArray::mxArray (mwSize ndims, const mwSize *dims, int num_keys, + const char **keys) : rep (new mxArray_struct (ndims, dims, num_keys, keys)), name (0) { } mxArray::mxArray (const dim_vector& dv, int num_keys, const char **keys) @@ -1992,7 +2030,7 @@ if (! ptr) { - // FIXME -- could use "octave_new_handler();" instead + // FIXME: could use "octave_new_handler();" instead error ("%s: failed to allocate %d bytes of memory", function_name (), n); @@ -2373,7 +2411,8 @@ void * mxRealloc (void *ptr, size_t size) { - return mex_context ? mex_context->realloc (ptr, size) : gnulib::realloc (ptr, size); + return mex_context ? mex_context->realloc (ptr, size) + : gnulib::realloc (ptr, size); } void @@ -2454,7 +2493,8 @@ } mxArray * -mxCreateNumericMatrix (mwSize m, mwSize n, mxClassID class_id, mxComplexity flag) +mxCreateNumericMatrix (mwSize m, mwSize n, mxClassID class_id, + mxComplexity flag) { return maybe_mark_array (new mxArray (class_id, m, n, flag)); } @@ -2478,7 +2518,8 @@ } mxArray * -mxCreateStructArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys) +mxCreateStructArray (mwSize ndims, const mwSize *dims, int num_keys, + const char **keys) { return maybe_mark_array (new mxArray (ndims, dims, num_keys, keys)); } @@ -2922,7 +2963,8 @@ // ------------------------------------------------------------------ typedef void (*cmex_fptr) (int nlhs, mxArray **plhs, int nrhs, mxArray **prhs); -typedef F77_RET_T (*fmex_fptr) (int& nlhs, mxArray **plhs, int& nrhs, mxArray **prhs); +typedef F77_RET_T (*fmex_fptr) (int& nlhs, mxArray **plhs, + int& nrhs, mxArray **prhs); octave_value_list call_mex (bool have_fmex, void *f, const octave_value_list& args, @@ -3014,7 +3056,7 @@ { octave_value_list args; - // FIXME -- do we need unwind protect to clean up args? Off hand, I + // FIXME: do we need unwind protect to clean up args? Off hand, I // would say that this problem is endemic to Octave and we will // continue to have memory leaks after Ctrl-C until proper exception // handling is implemented. longjmp() only clears the stack, so any @@ -3029,7 +3071,7 @@ if (error_state && mex_context->trap_feval_error == 0) { - // FIXME -- is this the correct way to clean up? abort() is + // FIXME: is this the correct way to clean up? abort() is // going to trigger a long jump, so the normal class destructors // will not be called. Hopefully this will reduce things to a // tiny leak. Maybe create a new octave memory tracer type @@ -3048,7 +3090,7 @@ for (int i = 0; i < num_to_copy; i++) { - // FIXME -- it would be nice to avoid copying the value here, + // FIXME: it would be nice to avoid copying the value here, // but there is no way to steal memory from a matrix, never mind // that matrix memory is allocated by new[] and mxArray memory // is allocated by malloc(). @@ -3143,8 +3185,8 @@ void mexWarnMsgIdAndTxt (const char *id, const char *fmt, ...) { - // FIXME -- is this right? What does Matlab do if fmt is NULL or - // an empty string? + // FIXME: is this right? What does Matlab do if fmt is NULL or + // an empty string? if (fmt && strlen (fmt) > 0) { @@ -3181,7 +3223,7 @@ val = get_global_value (name); else { - // FIXME -- should this be in variables.cc? + // FIXME: should this be in variables.cc? unwind_protect frame; @@ -3244,7 +3286,7 @@ set_global_value (name, mxArray::as_octave_value (ptr)); else { - // FIXME -- should this be in variables.cc? + // FIXME: should this be in variables.cc? unwind_protect frame;
--- a/libinterp/corefcn/mexproto.h +++ b/libinterp/corefcn/mexproto.h @@ -74,18 +74,24 @@ /* Interface to the interpreter. */ extern OCTINTERP_API const char *mexFunctionName (void); -extern OCTINTERP_API int mexCallMATLAB (int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname); +extern OCTINTERP_API int mexCallMATLAB (int nargout, mxArray *argout[], + int nargin, mxArray *argin[], + const char *fname); extern OCTINTERP_API void mexSetTrapFlag (int flag); extern OCTINTERP_API int mexEvalString (const char *s); extern OCTINTERP_API void mexErrMsgTxt (const char *s); -extern OCTINTERP_API void mexErrMsgIdAndTxt (const char *id, const char *s, ...); +extern OCTINTERP_API void mexErrMsgIdAndTxt (const char *id, const char *s, + ...); extern OCTINTERP_API void mexWarnMsgTxt (const char *s); -extern OCTINTERP_API void mexWarnMsgIdAndTxt (const char *id, const char *s, ...); +extern OCTINTERP_API void mexWarnMsgIdAndTxt (const char *id, const char *s, + ...); extern OCTINTERP_API int mexPrintf (const char *fmt, ...); -extern OCTINTERP_API mxArray *mexGetVariable (const char *space, const char *name); -extern OCTINTERP_API const mxArray *mexGetVariablePtr (const char *space, const char *name); +extern OCTINTERP_API mxArray *mexGetVariable (const char *space, + const char *name); +extern OCTINTERP_API const mxArray *mexGetVariablePtr (const char *space, + const char *name); extern OCTINTERP_API int mexPutVariable (const char *space, const char *name, const mxArray *ptr); @@ -94,11 +100,13 @@ extern OCTINTERP_API void mexMakeMemoryPersistent (void *ptr); extern OCTINTERP_API int mexAtExit (void (*f) (void)); -extern OCTINTERP_API const mxArray *mexGet (double handle, const char *property); +extern OCTINTERP_API const mxArray *mexGet (double handle, + const char *property); extern OCTINTERP_API int mexIsGlobal (const mxArray *ptr); extern OCTINTERP_API int mexIsLocked (void); extern OCTINTERP_API void mexLock (void); -extern OCTINTERP_API int mexSet (double handle, const char *property, mxArray *val); +extern OCTINTERP_API int mexSet (double handle, const char *property, + mxArray *val); extern OCTINTERP_API void mexUnlock (void); /* Floating point predicates. */ @@ -118,22 +126,39 @@ extern OCTINTERP_API void mxFree (void *ptr); /* Constructors. */ -extern OCTINTERP_API mxArray *mxCreateCellArray (mwSize ndims, const mwSize *dims); +extern OCTINTERP_API mxArray *mxCreateCellArray (mwSize ndims, + const mwSize *dims); extern OCTINTERP_API mxArray *mxCreateCellMatrix (mwSize m, mwSize n); -extern OCTINTERP_API mxArray *mxCreateCharArray (mwSize ndims, const mwSize *dims); -extern OCTINTERP_API mxArray *mxCreateCharMatrixFromStrings (mwSize m, const char **str); -extern OCTINTERP_API mxArray *mxCreateDoubleMatrix (mwSize nr, mwSize nc, mxComplexity flag); +extern OCTINTERP_API mxArray *mxCreateCharArray (mwSize ndims, + const mwSize *dims); +extern OCTINTERP_API mxArray *mxCreateCharMatrixFromStrings (mwSize m, + const char **str); +extern OCTINTERP_API mxArray *mxCreateDoubleMatrix (mwSize nr, mwSize nc, + mxComplexity flag); extern OCTINTERP_API mxArray *mxCreateDoubleScalar (double val); -extern OCTINTERP_API mxArray *mxCreateLogicalArray (mwSize ndims, const mwSize *dims); +extern OCTINTERP_API mxArray *mxCreateLogicalArray (mwSize ndims, + const mwSize *dims); extern OCTINTERP_API mxArray *mxCreateLogicalMatrix (mwSize m, mwSize n); extern OCTINTERP_API mxArray *mxCreateLogicalScalar (mxLogical val); -extern OCTINTERP_API mxArray *mxCreateNumericArray (mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag); -extern OCTINTERP_API mxArray *mxCreateNumericMatrix (mwSize m, mwSize n, mxClassID class_id, mxComplexity flag); -extern OCTINTERP_API mxArray *mxCreateSparse (mwSize m, mwSize n, mwSize nzmax, mxComplexity flag); -extern OCTINTERP_API mxArray *mxCreateSparseLogicalMatrix (mwSize m, mwSize n, mwSize nzmax); +extern OCTINTERP_API mxArray *mxCreateNumericArray (mwSize ndims, + const mwSize *dims, + mxClassID class_id, + mxComplexity flag); +extern OCTINTERP_API mxArray *mxCreateNumericMatrix (mwSize m, mwSize n, + mxClassID class_id, + mxComplexity flag); +extern OCTINTERP_API mxArray *mxCreateSparse (mwSize m, mwSize n, mwSize nzmax, + mxComplexity flag); +extern OCTINTERP_API mxArray *mxCreateSparseLogicalMatrix (mwSize m, mwSize n, + mwSize nzmax); extern OCTINTERP_API mxArray *mxCreateString (const char *str); -extern OCTINTERP_API mxArray *mxCreateStructArray (mwSize ndims, const mwSize *dims, int num_keys, const char **keys); -extern OCTINTERP_API mxArray *mxCreateStructMatrix (mwSize rows, mwSize cols, int num_keys, const char **keys); +extern OCTINTERP_API mxArray *mxCreateStructArray (mwSize ndims, + const mwSize *dims, + int num_keys, + const char **keys); +extern OCTINTERP_API mxArray *mxCreateStructMatrix (mwSize rows, mwSize cols, + int num_keys, + const char **keys); /* Copy constructor. */ extern OCTINTERP_API mxArray *mxDuplicateArray (const mxArray *v); @@ -184,7 +209,8 @@ /* Dimension setters. */ extern OCTINTERP_API void mxSetM (mxArray *ptr, mwSize M); extern OCTINTERP_API void mxSetN (mxArray *ptr, mwSize N); -extern OCTINTERP_API void mxSetDimensions (mxArray *ptr, const mwSize *dims, mwSize ndims); +extern OCTINTERP_API void mxSetDimensions (mxArray *ptr, const mwSize *dims, + mwSize ndims); /* Data extractors. */ extern OCTINTERP_API double *mxGetPi (const mxArray *ptr); @@ -226,18 +252,24 @@ extern OCTINTERP_API void mxRemoveField (mxArray *ptr, int key_num); -extern OCTINTERP_API mxArray *mxGetField (const mxArray *ptr, mwIndex index, const char *key); -extern OCTINTERP_API mxArray *mxGetFieldByNumber (const mxArray *ptr, mwIndex index, int key_num); +extern OCTINTERP_API mxArray *mxGetField (const mxArray *ptr, mwIndex index, + const char *key); +extern OCTINTERP_API mxArray *mxGetFieldByNumber (const mxArray *ptr, + mwIndex index, int key_num); -extern OCTINTERP_API void mxSetField (mxArray *ptr, mwIndex index, const char *key, mxArray *val); -extern OCTINTERP_API void mxSetFieldByNumber (mxArray *ptr, mwIndex index, int key_num, mxArray *val); +extern OCTINTERP_API void mxSetField (mxArray *ptr, mwIndex index, + const char *key, mxArray *val); +extern OCTINTERP_API void mxSetFieldByNumber (mxArray *ptr, mwIndex index, + int key_num, mxArray *val); extern OCTINTERP_API int mxGetNumberOfFields (const mxArray *ptr); -extern OCTINTERP_API const char *mxGetFieldNameByNumber (const mxArray *ptr, int key_num); +extern OCTINTERP_API const char *mxGetFieldNameByNumber (const mxArray *ptr, + int key_num); extern OCTINTERP_API int mxGetFieldNumber (const mxArray *ptr, const char *key); -extern OCTINTERP_API int mxGetString (const mxArray *ptr, char *buf, mwSize buflen); +extern OCTINTERP_API int mxGetString (const mxArray *ptr, char *buf, + mwSize buflen); extern OCTINTERP_API char *mxArrayToString (const mxArray *ptr); /* Miscellaneous. */ @@ -269,7 +301,8 @@ #define mxAssertS(expr, msg) #endif -extern OCTINTERP_API mwIndex mxCalcSingleSubscript (const mxArray *ptr, mwSize nsubs, mwIndex *subs); +extern OCTINTERP_API mwIndex mxCalcSingleSubscript (const mxArray *ptr, + mwSize nsubs, mwIndex *subs); extern OCTINTERP_API size_t mxGetElementSize (const mxArray *ptr);
--- a/libinterp/corefcn/mgorth.cc +++ b/libinterp/corefcn/mgorth.cc @@ -49,7 +49,7 @@ } DEFUN (mgorth, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{y}, @var{h}] =} mgorth (@var{x}, @var{v})\n\ Orthogonalize a given column vector @var{x} with respect to a set of\n\ orthonormal vectors comprising the columns of @var{v}\n\ @@ -71,10 +71,10 @@ int nargin = args.length (); if (nargin != 2 || nargout > 2) - { - print_usage (); - return retval; - } + { + print_usage (); + return retval; + } octave_value arg_x = args(0); octave_value arg_v = args(1); @@ -97,7 +97,8 @@ { if (iscomplex) { - FloatComplexColumnVector x = arg_x.float_complex_column_vector_value (); + FloatComplexColumnVector x + = arg_x.float_complex_column_vector_value (); FloatComplexMatrix V = arg_v.float_complex_matrix_value (); FloatComplexRowVector h; do_mgorth (x, V, h);
--- a/libinterp/corefcn/mxarray.in.h +++ b/libinterp/corefcn/mxarray.in.h @@ -48,33 +48,33 @@ #define MXARRAY_H typedef enum - { - mxREAL = 0, - mxCOMPLEX = 1 - } - mxComplexity; +{ + mxREAL = 0, + mxCOMPLEX = 1 +} +mxComplexity; typedef enum - { - mxUNKNOWN_CLASS = 0, - mxCELL_CLASS, - mxSTRUCT_CLASS, - mxLOGICAL_CLASS, - mxCHAR_CLASS, - mxUNUSED_CLASS, - mxDOUBLE_CLASS, - mxSINGLE_CLASS, - mxINT8_CLASS, - mxUINT8_CLASS, - mxINT16_CLASS, - mxUINT16_CLASS, - mxINT32_CLASS, - mxUINT32_CLASS, - mxINT64_CLASS, - mxUINT64_CLASS, - mxFUNCTION_CLASS - } - mxClassID; +{ + mxUNKNOWN_CLASS = 0, + mxCELL_CLASS, + mxSTRUCT_CLASS, + mxLOGICAL_CLASS, + mxCHAR_CLASS, + mxUNUSED_CLASS, + mxDOUBLE_CLASS, + mxSINGLE_CLASS, + mxINT8_CLASS, + mxUINT8_CLASS, + mxINT16_CLASS, + mxUINT16_CLASS, + mxINT32_CLASS, + mxUINT32_CLASS, + mxINT64_CLASS, + mxUINT64_CLASS, + mxFUNCTION_CLASS +} +mxClassID; typedef unsigned char mxLogical; @@ -252,7 +252,8 @@ virtual mxArray *get_field_by_number (mwIndex index, int key_num) const = 0; - virtual void set_field_by_number (mwIndex index, int key_num, mxArray *val) = 0; + virtual void + set_field_by_number (mwIndex index, int key_num, mxArray *val) = 0; virtual int get_number_of_fields (void) const = 0; @@ -386,7 +387,8 @@ int is_logical_scalar (void) const { return rep->is_logical_scalar (); } - int is_logical_scalar_true (void) const { return rep->is_logical_scalar_true (); } + int is_logical_scalar_true (void) const + { return rep->is_logical_scalar_true (); } mwSize get_m (void) const { return rep->get_m (); } @@ -394,15 +396,18 @@ mwSize *get_dimensions (void) const { return rep->get_dimensions (); } - mwSize get_number_of_dimensions (void) const { return rep->get_number_of_dimensions (); } + mwSize get_number_of_dimensions (void) const + { return rep->get_number_of_dimensions (); } void set_m (mwSize m) { DO_VOID_MUTABLE_METHOD (set_m (m)); } void set_n (mwSize n) { DO_VOID_MUTABLE_METHOD (set_n (n)); } - void set_dimensions (mwSize *dims_arg, mwSize ndims_arg) { DO_VOID_MUTABLE_METHOD (set_dimensions (dims_arg, ndims_arg)); } + void set_dimensions (mwSize *dims_arg, mwSize ndims_arg) + { DO_VOID_MUTABLE_METHOD (set_dimensions (dims_arg, ndims_arg)); } - mwSize get_number_of_elements (void) const { return rep->get_number_of_elements (); } + mwSize get_number_of_elements (void) const + { return rep->get_number_of_elements (); } int is_empty (void) const { return get_number_of_elements () == 0; } @@ -414,17 +419,21 @@ const char *get_class_name (void) const { return rep->get_class_name (); } - void set_class_name (const char *name_arg) { DO_VOID_MUTABLE_METHOD (set_class_name (name_arg)); } + void set_class_name (const char *name_arg) + { DO_VOID_MUTABLE_METHOD (set_class_name (name_arg)); } - mxArray *get_cell (mwIndex idx) const { DO_MUTABLE_METHOD (mxArray *, get_cell (idx)); } + mxArray *get_cell (mwIndex idx) const + { DO_MUTABLE_METHOD (mxArray *, get_cell (idx)); } - void set_cell (mwIndex idx, mxArray *val) { DO_VOID_MUTABLE_METHOD (set_cell (idx, val)); } + void set_cell (mwIndex idx, mxArray *val) + { DO_VOID_MUTABLE_METHOD (set_cell (idx, val)); } double get_scalar (void) const { return rep->get_scalar (); } void *get_data (void) const { DO_MUTABLE_METHOD (void *, get_data ()); } - void *get_imag_data (void) const { DO_MUTABLE_METHOD (void *, get_imag_data ()); } + void *get_imag_data (void) const + { DO_MUTABLE_METHOD (void *, get_imag_data ()); } void set_data (void *pr) { DO_VOID_MUTABLE_METHOD (set_data (pr)); } @@ -444,23 +453,30 @@ int add_field (const char *key) { DO_MUTABLE_METHOD (int, add_field (key)); } - void remove_field (int key_num) { DO_VOID_MUTABLE_METHOD (remove_field (key_num)); } + void remove_field (int key_num) + { DO_VOID_MUTABLE_METHOD (remove_field (key_num)); } - mxArray *get_field_by_number (mwIndex index, int key_num) const { DO_MUTABLE_METHOD (mxArray *, get_field_by_number (index, key_num)); } + mxArray *get_field_by_number (mwIndex index, int key_num) const + { DO_MUTABLE_METHOD (mxArray *, get_field_by_number (index, key_num)); } - void set_field_by_number (mwIndex index, int key_num, mxArray *val) { DO_VOID_MUTABLE_METHOD (set_field_by_number (index, key_num, val)); } + void set_field_by_number (mwIndex index, int key_num, mxArray *val) + { DO_VOID_MUTABLE_METHOD (set_field_by_number (index, key_num, val)); } int get_number_of_fields (void) const { return rep->get_number_of_fields (); } - const char *get_field_name_by_number (int key_num) const { DO_MUTABLE_METHOD (const char*, get_field_name_by_number (key_num)); } + const char *get_field_name_by_number (int key_num) const + { DO_MUTABLE_METHOD (const char*, get_field_name_by_number (key_num)); } - int get_field_number (const char *key) const { DO_MUTABLE_METHOD (int, get_field_number (key)); } + int get_field_number (const char *key) const + { DO_MUTABLE_METHOD (int, get_field_number (key)); } - int get_string (char *buf, mwSize buflen) const { return rep->get_string (buf, buflen); } + int get_string (char *buf, mwSize buflen) const + { return rep->get_string (buf, buflen); } char *array_to_string (void) const { return rep->array_to_string (); } - mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const { return rep->calc_single_subscript (nsubs, subs); } + mwIndex calc_single_subscript (mwSize nsubs, mwIndex *subs) const + { return rep->calc_single_subscript (nsubs, subs); } size_t get_element_size (void) const { return rep->get_element_size (); }
--- a/libinterp/corefcn/nproc.cc +++ b/libinterp/corefcn/nproc.cc @@ -28,7 +28,7 @@ #include "nproc.h" DEFUN (nproc, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nproc ()\n\ @deftypefnx {Built-in Function} {} nproc (@var{query})\n\ Return the current number of available processors.\n\
--- a/libinterp/corefcn/oct-hist.cc +++ b/libinterp/corefcn/oct-hist.cc @@ -170,7 +170,7 @@ || option == "-n") { if (i < nargin - 1) - { + { if (args(i+1).is_string ()) command_history::set_file (args(++i).string_value ()); else @@ -235,7 +235,7 @@ else limit = -tmp; } - + else { if (option.length () > 0 && option[0] == '-') @@ -583,7 +583,7 @@ } DEFUN (edit_history, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} edit_history\n\ @deftypefnx {Command} {} edit_history @var{cmd_number}\n\ @deftypefnx {Command} {} edit_history @var{first} @var{last}\n\ @@ -626,7 +626,7 @@ } DEFUN (history, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} history\n\ @deftypefnx {Command} {} history @var{opt1} @dots{}\n\ @deftypefnx {Built-in Function} {@var{h} =} history ()\n\ @@ -675,7 +675,7 @@ } DEFUN (run_history, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} run_history\n\ @deftypefnx {Command} {} run_history @var{cmd_number}\n\ @deftypefnx {Command} {} run_history @var{first} @var{last}\n\ @@ -733,7 +733,7 @@ } DEFUN (history_control, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_control ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_control (@var{new_val})\n\ Query or set the internal variable that specifies how commands are saved\n\ @@ -770,7 +770,7 @@ } DEFUN (history_size, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_size ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_size (@var{new_val})\n\ Query or set the internal variable that specifies how many entries\n\ @@ -796,7 +796,7 @@ } DEFUN (history_file, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_file ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_file (@var{new_val})\n\ Query or set the internal variable that specifies the name of the\n\ @@ -821,7 +821,7 @@ } DEFUN (history_timestamp_format_string, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_timestamp_format_string ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_timestamp_format_string (@var{new_val})\n\ @deftypefnx {Built-in Function} {} history_timestamp_format_string (@var{new_val}, \"local\")\n\ @@ -844,7 +844,7 @@ } DEFUN (history_save, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} history_save ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} history_save (@var{new_val})\n\ @deftypefnx {Built-in Function} {} history_save (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/oct-lvalue.h +++ b/libinterp/corefcn/oct-lvalue.h @@ -47,17 +47,17 @@ { } octave_lvalue& operator = (const octave_lvalue& vr) - { - if (this != &vr) - { - sym = vr.sym; - type = vr.type; - idx = vr.idx; - nel = vr.nel; - } + { + if (this != &vr) + { + sym = vr.sym; + type = vr.type; + idx = vr.idx; + nel = vr.nel; + } - return *this; - } + return *this; + } ~octave_lvalue (void) { }
--- a/libinterp/corefcn/oct-map.cc +++ b/libinterp/corefcn/oct-map.cc @@ -575,7 +575,8 @@ } void -octave_map::do_cat (int dim, octave_idx_type n, const octave_scalar_map *map_list, +octave_map::do_cat (int dim, octave_idx_type n, + const octave_scalar_map *map_list, octave_map& retval) { octave_idx_type nf = retval.nfields (); @@ -616,8 +617,10 @@ } // This is just a wrapper. -void permute_to_correct_order1 (const octave_scalar_map& ref, const octave_scalar_map& src, - octave_scalar_map& dest, Array<octave_idx_type>& perm) +void permute_to_correct_order1 (const octave_scalar_map& ref, + const octave_scalar_map& src, + octave_scalar_map& dest, + Array<octave_idx_type>& perm) { dest = src.orderfields (ref, perm); } @@ -627,9 +630,9 @@ octave_map& dest, Array<octave_idx_type>& perm) { if (src.nfields () == 0 && src.is_empty ()) - dest = octave_map (src.dims (), ref.keys ()); + dest = octave_map (src.dims (), ref.keys ()); else - dest = src.orderfields (ref, perm); + dest = src.orderfields (ref, perm); } template <class map> @@ -645,9 +648,10 @@ for (octave_idx_type i = 0; i < n; i++) { if (i == idx) - continue; + continue; - permute_to_correct_order1 (map_list[idx], map_list[i], new_map_list[i], perm); + permute_to_correct_order1 (map_list[idx], map_list[i], new_map_list[i], + perm); if (error_state) { @@ -1578,7 +1582,7 @@ } } - done: +done: return retval; }
--- a/libinterp/corefcn/oct-map.h +++ b/libinterp/corefcn/oct-map.h @@ -52,10 +52,10 @@ fields_rep *rep; static fields_rep *nil_rep (void) - { - static fields_rep nr; - return &nr; - } + { + static fields_rep nr; + return &nr; + } public: @@ -64,36 +64,36 @@ octave_fields (const char * const *); ~octave_fields (void) - { - if (--rep->count == 0) - delete rep; - } + { + if (--rep->count == 0) + delete rep; + } void make_unique (void) - { - if (rep->count > 1) - { - fields_rep *r = new fields_rep (*rep); + { + if (rep->count > 1) + { + fields_rep *r = new fields_rep (*rep); - if (--rep->count == 0) - delete rep; + if (--rep->count == 0) + delete rep; - rep = r; - } - } + rep = r; + } + } octave_fields (const octave_fields& o) : rep (o.rep) { rep->count++; } octave_fields& operator = (const octave_fields& o) - { - o.rep->count++; - if (--rep->count == 0) - delete rep; - rep = o.rep; + { + o.rep->count++; + if (--rep->count == 0) + delete rep; + rep = o.rep; - return *this; - } + return *this; + } // constant iteration support. non-const iteration intentionally unsupported. @@ -107,7 +107,7 @@ octave_idx_type index (const_iterator p) const { return p->second; } const_iterator seek (const std::string& k) const - { return rep->find (k); } + { return rep->find (k); } // high-level methods. @@ -138,15 +138,15 @@ Array<octave_idx_type>& perm) const; bool is_same (const octave_fields& other) const - { return rep == other.rep; } + { return rep == other.rep; } // Returns the fields as a vector of strings. string_vector fieldnames (void) const; void clear (void) - { - *this = octave_fields (); - } + { + *this = octave_fields (); + } }; @@ -167,12 +167,12 @@ : xkeys (m.xkeys), xvals(m.xvals) { } octave_scalar_map& operator = (const octave_scalar_map& m) - { - xkeys = m.xkeys; - xvals = m.xvals; + { + xkeys = m.xkeys; + xvals = m.xvals; - return *this; - } + return *this; + } // iteration support. note that both const and non-const iterators are the // same. The const/non-const distinction is made by the key & contents method. @@ -185,37 +185,37 @@ const_iterator seek (const std::string& k) const { return xkeys.seek (k); } std::string key (const_iterator p) const - { return xkeys.key (p); } + { return xkeys.key (p); } octave_idx_type index (const_iterator p) const - { return xkeys.index (p); } + { return xkeys.index (p); } const octave_value& contents (const_iterator p) const - { return xvals[xkeys.index (p)]; } + { return xvals[xkeys.index (p)]; } octave_value& contents (iterator p) - { return xvals[xkeys.index (p)]; } + { return xvals[xkeys.index (p)]; } const octave_value& contents (octave_idx_type i) const - { return xvals[i]; } + { return xvals[i]; } octave_value& contents (octave_idx_type i) - { return xvals[i]; } + { return xvals[i]; } // number of fields. octave_idx_type nfields (void) const { return xkeys.nfields (); } // check whether a field exists. bool isfield (const std::string& name) const - { return xkeys.isfield (name); } + { return xkeys.isfield (name); } bool contains (const std::string& name) const - { return isfield (name); } + { return isfield (name); } string_vector fieldnames (void) const - { return xkeys.fieldnames (); } + { return xkeys.fieldnames (); } string_vector keys (void) const - { return fieldnames (); } + { return fieldnames (); } // get contents of a given field. empty value if not exist. octave_value getfield (const std::string& key) const; @@ -223,7 +223,7 @@ // set contents of a given field. add if not exist. void setfield (const std::string& key, const octave_value& val); void assign (const std::string& k, const octave_value& val) - { setfield (k, val); } + { setfield (k, val); } // remove a given field. do nothing if not exist. void rmfield (const std::string& key); @@ -240,10 +240,10 @@ octave_value& contents (const std::string& k); void clear (void) - { - xkeys.clear (); - xvals.clear (); - } + { + xkeys.clear (); + xvals.clear (); + } friend class octave_map; @@ -255,8 +255,9 @@ }; template<> -inline octave_scalar_map octave_value_extract<octave_scalar_map> (const octave_value& v) - { return v.scalar_map_value (); } +inline octave_scalar_map +octave_value_extract<octave_scalar_map> (const octave_value& v) +{ return v.scalar_map_value (); } class OCTINTERP_API octave_map @@ -289,13 +290,13 @@ octave_map (const Octave_map& m); octave_map& operator = (const octave_map& m) - { - xkeys = m.xkeys; - xvals = m.xvals; - dimensions = m.dimensions; + { + xkeys = m.xkeys; + xvals = m.xvals; + dimensions = m.dimensions; - return *this; - } + return *this; + } // iteration support. note that both const and non-const iterators are the // same. The const/non-const distinction is made by the key & contents method. @@ -308,37 +309,37 @@ const_iterator seek (const std::string& k) const { return xkeys.seek (k); } std::string key (const_iterator p) const - { return xkeys.key (p); } + { return xkeys.key (p); } octave_idx_type index (const_iterator p) const - { return xkeys.index (p); } + { return xkeys.index (p); } const Cell& contents (const_iterator p) const - { return xvals[xkeys.index (p)]; } + { return xvals[xkeys.index (p)]; } Cell& contents (iterator p) - { return xvals[xkeys.index (p)]; } + { return xvals[xkeys.index (p)]; } const Cell& contents (octave_idx_type i) const - { return xvals[i]; } + { return xvals[i]; } Cell& contents (octave_idx_type i) - { return xvals[i]; } + { return xvals[i]; } // number of fields. octave_idx_type nfields (void) const { return xkeys.nfields (); } // check whether a field exists. bool isfield (const std::string& name) const - { return xkeys.isfield (name); } + { return xkeys.isfield (name); } bool contains (const std::string& name) const - { return isfield (name); } + { return isfield (name); } string_vector fieldnames (void) const - { return xkeys.fieldnames (); } + { return xkeys.fieldnames (); } string_vector keys (void) const - { return fieldnames (); } + { return fieldnames (); } // get contents of a given field. empty value if not exist. Cell getfield (const std::string& key) const; @@ -347,7 +348,7 @@ // correct dimensions. void setfield (const std::string& key, const Cell& val); void assign (const std::string& k, const Cell& val) - { setfield (k, val); } + { setfield (k, val); } // remove a given field. do nothing if not exist. void rmfield (const std::string& key); @@ -364,10 +365,10 @@ Cell& contents (const std::string& k); void clear (void) - { - xkeys.clear (); - xvals.clear (); - } + { + xkeys.clear (); + xvals.clear (); + } // The Array-like methods. octave_idx_type numel (void) const { return dimensions.numel (); } @@ -386,13 +387,13 @@ checkelem (const Array<octave_idx_type>& ra_idx) const; octave_scalar_map operator () (octave_idx_type n) const - { return checkelem (n); } + { return checkelem (n); } octave_scalar_map operator () (octave_idx_type i, octave_idx_type j) const - { return checkelem (i, j); } + { return checkelem (i, j); } octave_scalar_map operator () (const Array<octave_idx_type>& ra_idx) const - { return checkelem (ra_idx); } + { return checkelem (ra_idx); } octave_map squeeze (void) const; @@ -446,7 +447,8 @@ void delete_elements (const octave_value_list&); - octave_map concat (const octave_map& rb, const Array<octave_idx_type>& ra_idx); + octave_map concat (const octave_map& rb, + const Array<octave_idx_type>& ra_idx); // like checkelem, but no check. octave_scalar_map fast_elem_extract (octave_idx_type n) const; @@ -471,7 +473,7 @@ template<> inline octave_map octave_value_extract<octave_map> (const octave_value& v) - { return v.map_value (); } +{ return v.map_value (); } // The original Octave_map object which is now deprecated. // It was fully deprecated in version 3.8 and should be removed in 3.12. @@ -481,7 +483,7 @@ OCTINTERP_API Octave_map { - public: +public: typedef std::map<std::string, Cell>::iterator iterator; typedef std::map<std::string, Cell>::const_iterator const_iterator; @@ -533,16 +535,16 @@ Octave_map (const octave_map& m); Octave_map& operator = (const Octave_map& m) - { - if (this != &m) - { - map = m.map; - key_list = m.key_list; - dimensions = m.dimensions; - } + { + if (this != &m) + { + map = m.map; + key_list = m.key_list; + dimensions = m.dimensions; + } - return *this; - } + return *this; + } ~Octave_map (void) { } @@ -554,21 +556,21 @@ octave_idx_type nfields (void) const { return map.size (); } void del (const std::string& k) - { - iterator p = map.find (k); + { + iterator p = map.find (k); - if (p != map.end ()) - { - map.erase (p); + if (p != map.end ()) + { + map.erase (p); - key_list_iterator q - = std::find (key_list.begin (), key_list.end (), k); + key_list_iterator q + = std::find (key_list.begin (), key_list.end (), k); - assert (q != key_list.end ()); + assert (q != key_list.end ()); - key_list.erase (q); - } - } + key_list.erase (q); + } + } iterator begin (void) { return iterator (map.begin ()); } const_iterator begin (void) const { return const_iterator (map.begin ()); } @@ -582,10 +584,10 @@ Cell contents (const std::string& k) const; Cell& contents (iterator p) - { return p->second; } + { return p->second; } Cell contents (const_iterator p) const - { return p->second; } + { return p->second; } int intfield (const std::string& k, int def_val = 0) const; @@ -596,13 +598,13 @@ const_iterator seek (const std::string& k) const { return map.find (k); } bool contains (const std::string& k) const - { return (seek (k) != map.end ()); } + { return (seek (k) != map.end ()); } void clear (void) - { - map.clear (); - key_list.clear (); - } + { + map.clear (); + key_list.clear (); + } string_vector keys (void) const; @@ -622,7 +624,8 @@ octave_idx_type numel (void) const { return dimensions.numel (); } - Octave_map concat (const Octave_map& rb, const Array<octave_idx_type>& ra_idx); + Octave_map concat (const Octave_map& rb, + const Array<octave_idx_type>& ra_idx); Octave_map& maybe_delete_elements (const octave_value_list& idx); @@ -651,10 +654,10 @@ mutable dim_vector dimensions; void maybe_add_to_key_list (const std::string& k) - { - if (! contains (k)) - key_list.push_back (k); - } + { + if (! contains (k)) + key_list.push_back (k); + } } GCC_ATTR_DEPRECATED; #endif
--- a/libinterp/corefcn/oct-obj.h +++ b/libinterp/corefcn/oct-obj.h @@ -67,15 +67,15 @@ ~octave_value_list (void) { } octave_value_list& operator = (const octave_value_list& obj) - { - if (this != &obj) - { - data = obj.data; - names = obj.names; - } + { + if (this != &obj) + { + data = obj.data; + names = obj.names; + } - return *this; - } + return *this; + } Array<octave_value> array_value (void) const { return data; } @@ -106,13 +106,14 @@ octave_value_list slice (octave_idx_type offset, octave_idx_type len, bool tags = false) const - { - octave_value_list retval (data.linear_slice (offset, offset + len)); - if (tags && len > 0 && names.length () > 0) - retval.names = names.linear_slice (offset, std::min (len, names.length ())); + { + octave_value_list retval (data.linear_slice (offset, offset + len)); + if (tags && len > 0 && names.length () > 0) + retval.names = names.linear_slice (offset, + std::min (len, names.length ())); - return retval; - } + return retval; + } octave_value_list splice (octave_idx_type offset, octave_idx_type len, @@ -135,14 +136,14 @@ void make_storable_values (void); octave_value& xelem (octave_idx_type i) - { - return data.xelem (i); - } + { + return data.xelem (i); + } void clear (void) - { - data.clear (); - } + { + data.clear (); + } private: @@ -153,15 +154,15 @@ string_vector names; octave_value& elem (octave_idx_type n) - { - if (n >= length ()) - resize (n + 1); + { + if (n >= length ()) + resize (n + 1); - return data(n); - } + return data(n); + } const octave_value& elem (octave_idx_type n) const - { return data(n); } + { return data(n); } DECLARE_OCTAVE_ALLOCATOR };
--- a/libinterp/corefcn/oct-prcstrm.h +++ b/libinterp/corefcn/oct-prcstrm.h @@ -25,8 +25,8 @@ #include "oct-stdstrm.h" -// FIXME -- why don't these classes use iprocstream and -// oprocstream, which in turn use the octave_procbuf class? +// FIXME: why don't these classes use iprocstream and oprocstream, +// which in turn use the octave_procbuf class? class octave_iprocstream : public octave_stdiostream
--- a/libinterp/corefcn/oct-stdstrm.h +++ b/libinterp/corefcn/oct-stdstrm.h @@ -44,7 +44,7 @@ // Position a stream at OFFSET relative to ORIGIN. int seek (off_t offset, int origin) - { return s ? s->seek (offset, origin) : -1; } + { return s ? s->seek (offset, origin) : -1; } // Return current stream position. @@ -62,9 +62,9 @@ std::ostream *output_stream (void) { return (md & std::ios::out) ? s : 0; } - // FIXME -- should not have to cast away const here. + // FIXME: should not have to cast away const here. BUF_T *rdbuf (void) const - { return s ? (const_cast<STREAM_T *> (s))->rdbuf () : 0; } + { return s ? (const_cast<STREAM_T *> (s))->rdbuf () : 0; } int file_number (void) const { return fnum; } @@ -107,7 +107,8 @@ oct_mach_info::float_format ff = oct_mach_info::native_float_format (), c_file_ptr_buf::close_fcn cf = c_file_ptr_buf::file_close) - : octave_tstdiostream<c_file_ptr_buf, io_c_file_ptr_stream, FILE *> (n, f, f ? fileno (f) : -1, m, ff, cf) { } + : octave_tstdiostream<c_file_ptr_buf, io_c_file_ptr_stream, FILE *> + (n, f, f ? fileno (f) : -1, m, ff, cf) { } static octave_stream create (const std::string& n, FILE *f = 0, @@ -144,8 +145,10 @@ std::ios::openmode m = std::ios::in|std::ios::out, oct_mach_info::float_format ff = oct_mach_info::native_float_format (), - c_zfile_ptr_buf::close_fcn cf = c_zfile_ptr_buf::file_close) - : octave_tstdiostream<c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile> (n, f, fid, m, ff, cf) { } + c_zfile_ptr_buf::close_fcn cf + = c_zfile_ptr_buf::file_close) + : octave_tstdiostream<c_zfile_ptr_buf, io_c_zfile_ptr_stream, gzFile> + (n, f, fid, m, ff, cf) { } static octave_stream create (const std::string& n, gzFile f = 0, int fid = 0,
--- a/libinterp/corefcn/oct-stream.cc +++ b/libinterp/corefcn/oct-stream.cc @@ -112,8 +112,8 @@ } static void -get_size (const Array<double>& size, octave_idx_type& nr, octave_idx_type& nc, bool& one_elt_size_spec, - const std::string& who) +get_size (const Array<double>& size, octave_idx_type& nr, octave_idx_type& nc, + bool& one_elt_size_spec, const std::string& who) { nr = -1; nc = -1; @@ -284,7 +284,8 @@ unsigned char c = s[i++]; if (c == '-' && i > 1 && i < len - && static_cast<unsigned char> (s[i-2]) <= static_cast<unsigned char> (s[i])) + && ( static_cast<unsigned char> (s[i-2]) + <= static_cast<unsigned char> (s[i]))) { // Add all characters from the range except the first (we // already added it below). @@ -477,7 +478,7 @@ { if (beg_idx != std::string::npos && end_idx != std::string::npos) char_class = expand_char_class (s.substr (beg_idx, - end_idx - beg_idx + 1)); + end_idx - beg_idx + 1)); add_elt_to_list (width, discard, type, modifier, num_elts, char_class); } @@ -699,9 +700,10 @@ } void -printf_format_list::process_conversion - (const std::string& s, size_t& i, size_t n, int& args, std::string& flags, - int& fw, int& prec, char& modifier, char& type, octave_idx_type& num_elts) +printf_format_list::process_conversion (const std::string& s, size_t& i, + size_t n, int& args, std::string& flags, + int& fw, int& prec, char& modifier, + char& type, octave_idx_type& num_elts) { args = 0; flags = ""; @@ -802,10 +804,10 @@ } void -printf_format_list::finish_conversion - (const std::string& s, size_t& i, int args, const std::string& flags, - int fw, int prec, char modifier, char& type, octave_idx_type& num_elts) - +printf_format_list::finish_conversion (const std::string& s, size_t& i, + int args, const std::string& flags, + int fw, int prec, char modifier, + char& type, octave_idx_type& num_elts) { switch (s[i]) { @@ -1017,13 +1019,15 @@ } std::string -octave_base_stream::getl (octave_idx_type max_len, bool& err, const std::string& who) +octave_base_stream::getl (octave_idx_type max_len, bool& err, + const std::string& who) { return do_gets (max_len, err, true, who); } std::string -octave_base_stream::gets (octave_idx_type max_len, bool& err, const std::string& who) +octave_base_stream::gets (octave_idx_type max_len, bool& err, + const std::string& who) { return do_gets (max_len, err, false, who); } @@ -1067,7 +1071,7 @@ // Maybe eat the following \n if \r was just met. if (c == '\r' && is.peek () == '\n') - is.get (); + is.get (); if (is.bad ()) { @@ -1227,8 +1231,8 @@ void do_scanf_conv (std::istream& is, const scanf_format_elt& fmt, T valptr, Matrix& mval, double *data, octave_idx_type& idx, - octave_idx_type& conversion_count, octave_idx_type nr, octave_idx_type max_size, - bool discard) + octave_idx_type& conversion_count, octave_idx_type nr, + octave_idx_type max_size, bool discard) { OCTAVE_SCAN (is, fmt, valptr); @@ -1256,7 +1260,8 @@ template void do_scanf_conv (std::istream&, const scanf_format_elt&, double*, - Matrix&, double*, octave_idx_type&, octave_idx_type&, octave_idx_type, octave_idx_type, bool); + Matrix&, double*, octave_idx_type&, octave_idx_type&, + octave_idx_type, octave_idx_type, bool); #define DO_WHITESPACE_CONVERSION() \ do \ @@ -1473,8 +1478,10 @@ octave_value octave_base_stream::do_scanf (scanf_format_list& fmt_list, - octave_idx_type nr, octave_idx_type nc, bool one_elt_size_spec, - octave_idx_type& conversion_count, const std::string& who) + octave_idx_type nr, octave_idx_type nc, + bool one_elt_size_spec, + octave_idx_type& conversion_count, + const std::string& who) { octave_value retval = Matrix (); @@ -1804,7 +1811,7 @@ if (is.rdstate () & std::ios::failbit) is.clear (is.rdstate () & (~std::ios::failbit)); - // FIXME -- is this the right thing to do? + // FIXME: is this the right thing to do? if (interactive && name () == "stdin") { @@ -1860,7 +1867,8 @@ octave_value octave_base_stream::scanf (const std::string& fmt, const Array<double>& size, - octave_idx_type& conversion_count, const std::string& who) + octave_idx_type& conversion_count, + const std::string& who) { octave_value retval = Matrix (); @@ -1876,16 +1884,16 @@ ::error ("%s: invalid format specified", who.c_str ()); else { - octave_idx_type nr = -1; - octave_idx_type nc = -1; - - bool one_elt_size_spec; - - get_size (size, nr, nc, one_elt_size_spec, who); - - if (! error_state) - retval = do_scanf (fmt_list, nr, nc, one_elt_size_spec, - conversion_count, who); + octave_idx_type nr = -1; + octave_idx_type nc = -1; + + bool one_elt_size_spec; + + get_size (size, nr, nc, one_elt_size_spec, who); + + if (! error_state) + retval = do_scanf (fmt_list, nr, nc, one_elt_size_spec, + conversion_count, who); } } else @@ -2028,7 +2036,7 @@ { error ("%s: read error", who.c_str ()); - // FIXME -- is this the right thing to do? + // FIXME: is this the right thing to do? if (interactive && name () == "stdin") { @@ -2460,7 +2468,8 @@ tfmt.replace ((i1 = tfmt.rfind (elt->type)), 1, 1, 's'); - if ((i2 = tfmt.rfind ('.')) != std::string::npos && i2 < i1) + if ((i2 = tfmt.rfind ('.')) != std::string::npos + && i2 < i1) { tfmt.erase (i2, i1-i2); if (elt->prec < 0) @@ -2499,9 +2508,8 @@ case 'f': case 'e': case 'E': case 'g': case 'G': - retval - += do_printf_conv (os, fmt, nsa, sa_1, sa_2, - val, who); + retval += do_printf_conv (os, fmt, nsa, + sa_1, sa_2, val, who); break; default: @@ -2573,7 +2581,7 @@ if (os) { - // FIXME -- why does this seem to be necessary? + // FIXME: why does this seem to be necessary? // Without it, output from a loop like // // for i = 1:100, fputs (stdout, "foo\n"); endfor @@ -2759,7 +2767,8 @@ } off_t -octave_stream::skipl (const octave_value& tc_count, bool& err, const std::string& who) +octave_stream::skipl (const octave_value& tc_count, bool& err, + const std::string& who) { off_t retval = -1; @@ -2866,8 +2875,7 @@ { int retval = -1; - // FIXME -- should we have octave_value methods that handle off_t - // explicitly? + // FIXME: should we have octave_value methods that handle off_t explicitly? octave_int64 val = tc_offset.int64_scalar_value (); off_t xoffset = val.value (); @@ -3146,7 +3154,7 @@ ("read: invalid type specification"); break; } - + return retval; } @@ -3167,9 +3175,9 @@ if (stream_ok ()) { - // FIXME -- we may eventually want to make this extensible. - - // FIXME -- we need a better way to ensure that this + // FIXME: we may eventually want to make this extensible. + + // FIXME: we need a better way to ensure that this // numbering stays consistent with the order of the elements in the // data_type enum in the oct_data_conv class. @@ -3180,7 +3188,8 @@ if (! error_state) { - octave_idx_type elts_to_read = std::numeric_limits<octave_idx_type>::max (); + octave_idx_type elts_to_read + = std::numeric_limits<octave_idx_type>::max (); if (one_elt_size_spec) { @@ -3209,7 +3218,7 @@ nr = nc = 0; } - // FIXME -- ensure that this does not overflow. + // FIXME: ensure that this does not overflow. elts_to_read = nr * nc; @@ -3227,13 +3236,15 @@ else input_buf_elts = block_size; - octave_idx_type input_elt_size = oct_data_conv::data_type_size (input_type); + octave_idx_type input_elt_size + = oct_data_conv::data_type_size (input_type); octave_idx_type input_buf_size = input_buf_elts * input_elt_size; assert (input_buf_size >= 0); - // Must also work and return correct type object for 0 elements to read. + // Must also work and return correct type object + // for 0 elements to read. std::istream *isp = input_stream (); @@ -3245,7 +3256,8 @@ octave_idx_type elts_read = 0; - while (is && ! is.eof () && (read_to_eof || elts_read < elts_to_read)) + while (is && ! is.eof () + && (read_to_eof || elts_read < elts_to_read)) { char *input_buf = new char [input_buf_size]; @@ -3291,8 +3303,8 @@ octave_idx_type octave_stream::write (const octave_value& data, octave_idx_type block_size, - oct_data_conv::data_type output_type, octave_idx_type skip, - oct_mach_info::float_format flt_fmt) + oct_data_conv::data_type output_type, + octave_idx_type skip, oct_mach_info::float_format flt_fmt) { octave_idx_type retval = -1; @@ -3304,7 +3316,7 @@ flt_fmt = float_format (); octave_idx_type status = data.write (*this, block_size, output_type, - skip, flt_fmt); + skip, flt_fmt); if (status < 0) error ("fwrite: write error"); @@ -3484,7 +3496,7 @@ { seek (0, SEEK_END); - // FIXME -- probably should try to write larger blocks... + // FIXME: probably should try to write larger blocks... unsigned char zero = 0; for (size_t j = 0; j < skip - remaining; j++) @@ -3507,14 +3519,12 @@ octave_idx_type skip, oct_mach_info::float_format flt_fmt) { - bool swap - = ((oct_mach_info::words_big_endian () - && flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian) - || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian); - - bool do_data_conversion - = (swap || ! is_equivalent_type<T> (output_type) - || flt_fmt != oct_mach_info::float_format ()); + bool swap = ((oct_mach_info::words_big_endian () + && flt_fmt == oct_mach_info::flt_fmt_ieee_little_endian) + || flt_fmt == oct_mach_info::flt_fmt_ieee_big_endian); + + bool do_data_conversion = (swap || ! is_equivalent_type<T> (output_type) + || flt_fmt != oct_mach_info::float_format ()); octave_idx_type nel = data.numel (); @@ -3720,7 +3730,7 @@ return retval; } -// FIXME -- maybe this should work for string arrays too. +// FIXME: maybe this should work for string arrays too. int octave_stream::puts (const octave_value& tc_s, const std::string& who) @@ -3919,7 +3929,7 @@ octave_stream_list::open_file_numbers (void) { return (instance_ok ()) - ? instance->do_open_file_numbers () : octave_value (); + ? instance->do_open_file_numbers () : octave_value (); } int
--- a/libinterp/corefcn/oct-stream.h +++ b/libinterp/corefcn/oct-stream.h @@ -48,10 +48,10 @@ public: enum special_conversion - { - whitespace_conversion = 1, - literal_conversion = 2 - }; + { + whitespace_conversion = 1, + literal_conversion = 2 + }; scanf_format_elt (const char *txt = 0, int w = 0, bool d = false, char typ = '\0', char mod = '\0', @@ -64,19 +64,19 @@ type (e.type), modifier (e.modifier), char_class (e.char_class) { } scanf_format_elt& operator = (const scanf_format_elt& e) - { - if (this != &e) - { - text = strsave (e.text); - width = e.width; - discard = e.discard; - type = e.type; - modifier = e.modifier; - char_class = e.char_class; - } + { + if (this != &e) + { + text = strsave (e.text); + width = e.width; + discard = e.discard; + type = e.type; + modifier = e.modifier; + char_class = e.char_class; + } - return *this; - } + return *this; + } ~scanf_format_elt (void) { delete [] text; } @@ -120,27 +120,27 @@ octave_idx_type length (void) { return list.length (); } const scanf_format_elt *first (void) - { - curr_idx = 0; - return current (); - } + { + curr_idx = 0; + return current (); + } const scanf_format_elt *current (void) const - { return list.length () > 0 ? list.elem (curr_idx) : 0; } + { return list.length () > 0 ? list.elem (curr_idx) : 0; } const scanf_format_elt *next (bool cycle = true) - { - curr_idx++; + { + curr_idx++; - if (curr_idx >= list.length ()) - { - if (cycle) - curr_idx = 0; - else - return 0; - } - return current (); - } + if (curr_idx >= list.length ()) + { + if (cycle) + curr_idx = 0; + else + return 0; + } + return current (); + } void printme (void) const; @@ -161,7 +161,7 @@ // Index to current element; octave_idx_type curr_idx; - // FIXME -- maybe LIST should be a std::list object? + // FIXME: maybe LIST should be a std::list object? // List of format elements. Array<scanf_format_elt*> list; @@ -202,20 +202,20 @@ flags (e.flags), type (e.type), modifier (e.modifier) { } printf_format_elt& operator = (const printf_format_elt& e) - { - if (this != &e) - { - text = strsave (e.text); - args = e.args; - fw = e.fw; - prec = e.prec; - flags = e.flags; - type = e.type; - modifier = e.modifier; - } + { + if (this != &e) + { + text = strsave (e.text); + args = e.args; + fw = e.fw; + prec = e.prec; + flags = e.flags; + type = e.type; + modifier = e.modifier; + } - return *this; - } + return *this; + } ~printf_format_elt (void) { delete [] text; } @@ -255,28 +255,28 @@ octave_idx_type num_conversions (void) { return nconv; } const printf_format_elt *first (void) - { - curr_idx = 0; - return current (); - } + { + curr_idx = 0; + return current (); + } const printf_format_elt *current (void) const - { return list.length () > 0 ? list.elem (curr_idx) : 0; } + { return list.length () > 0 ? list.elem (curr_idx) : 0; } const printf_format_elt *next (bool cycle = true) - { - curr_idx++; + { + curr_idx++; - if (curr_idx >= list.length ()) - { - if (cycle) - curr_idx = 0; - else - return 0; - } + if (curr_idx >= list.length ()) + { + if (cycle) + curr_idx = 0; + else + return 0; + } - return current (); - } + return current (); + } bool last_elt_p (void) { return (curr_idx + 1 == list.length ()); } @@ -295,7 +295,7 @@ // Index to current element; octave_idx_type curr_idx; - // FIXME -- maybe LIST should be a std::list object? + // FIXME: maybe LIST should be a std::list object? // List of format elements. Array<printf_format_elt*> list; @@ -329,7 +329,7 @@ OCTINTERP_API octave_base_stream { -friend class octave_stream; + friend class octave_stream; public: @@ -380,13 +380,13 @@ virtual void do_close (void) { } void close (void) - { - if (is_open ()) - { - open_state = false; - do_close (); - } - } + { + if (is_open ()) + { + open_state = false; + do_close (); + } + } virtual int file_number (void) const { @@ -454,11 +454,14 @@ std::string do_gets (octave_idx_type max_len, bool& err, bool strip_newline, const std::string& who /* = "gets" */); - std::string getl (octave_idx_type max_len, bool& err, const std::string& who /* = "getl" */); - std::string gets (octave_idx_type max_len, bool& err, const std::string& who /* = "gets" */); + std::string getl (octave_idx_type max_len, bool& err, + const std::string& who /* = "getl" */); + std::string gets (octave_idx_type max_len, bool& err, + const std::string& who /* = "gets" */); off_t skipl (off_t count, bool& err, const std::string& who /* = "skipl" */); - octave_value do_scanf (scanf_format_list& fmt_list, octave_idx_type nr, octave_idx_type nc, + octave_value do_scanf (scanf_format_list& fmt_list, octave_idx_type nr, + octave_idx_type nc, bool one_elt_size_spec, octave_idx_type& count, const std::string& who /* = "scanf" */); @@ -512,16 +515,19 @@ int flush (void); - std::string getl (octave_idx_type max_len, bool& err, const std::string& who /* = "getl" */); + std::string getl (octave_idx_type max_len, bool& err, + const std::string& who /* = "getl" */); std::string getl (const octave_value& max_len, bool& err, const std::string& who /* = "getl" */); - std::string gets (octave_idx_type max_len, bool& err, const std::string& who /* = "gets" */); + std::string gets (octave_idx_type max_len, bool& err, + const std::string& who /* = "gets" */); std::string gets (const octave_value& max_len, bool& err, const std::string& who /* = "gets" */); off_t skipl (off_t count, bool& err, const std::string& who /* = "skipl" */); - off_t skipl (const octave_value& count, bool& err, const std::string& who /* = "skipl" */); + off_t skipl (const octave_value& count, bool& err, + const std::string& who /* = "skipl" */); int seek (off_t offset, int origin); int seek (const octave_value& offset, const octave_value& origin); @@ -581,18 +587,18 @@ std::string error (bool clear, int& err_num); std::string error (bool clear = false) - { - int err_num; - return error (clear, err_num); - } + { + int err_num; + return error (clear, err_num); + } // Set the error message and state. void error (const std::string& msg) - { - if (rep) - rep->error (msg); - } + { + if (rep) + rep->error (msg); + } void error (const char *msg) { error (std::string (msg)); } @@ -630,25 +636,25 @@ octave_base_stream *rep; bool stream_ok (bool clear = true) const - { - bool retval = true; + { + bool retval = true; - if (rep) - { - if (clear) - rep->clear (); - } - else - retval = false; + if (rep) + { + if (clear) + rep->clear (); + } + else + retval = false; - return retval; - } + return retval; + } void invalid_operation (const std::string& who, const char *rw) - { - if (rep) - rep->invalid_operation (who, rw); - } + { + if (rep) + rep->invalid_operation (who, rw); + } octave_value finalize_read (std::list<void *>& input_buf_list, @@ -711,12 +717,14 @@ int do_insert (octave_stream& os); - octave_stream do_lookup (int fid, const std::string& who = std::string ()) const; + octave_stream do_lookup (int fid, + const std::string& who = std::string ()) const; octave_stream do_lookup (const octave_value& fid, const std::string& who = std::string ()) const; int do_remove (int fid, const std::string& who = std::string ()); - int do_remove (const octave_value& fid, const std::string& who = std::string ()); + int do_remove (const octave_value& fid, + const std::string& who = std::string ()); void do_clear (bool flush = true);
--- a/libinterp/corefcn/octave-link.cc +++ b/libinterp/corefcn/octave-link.cc @@ -103,7 +103,7 @@ } DEFUN (__octave_link_enabled__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_enabled__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -112,7 +112,7 @@ } DEFUN (__octave_link_edit_file__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_edit_file__ (@var{file})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -137,7 +137,7 @@ } DEFUN (__octave_link_message_dialog__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_message_dialog__ (@var{dlg}, @var{msg}, @var{title})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -164,7 +164,7 @@ } DEFUN (__octave_link_question_dialog__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_question_dialog__ (@var{msg}, @var{title}, @var{btn1}, @var{btn2}, @var{btn3}, @var{default})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -184,7 +184,8 @@ { flush_octave_stdout (); - retval = octave_link::question_dialog (msg, title, btn1, btn2, btn3, btndef); + retval = octave_link::question_dialog (msg, title, btn1, btn2, btn3, + btndef); } else error ("invalid arguments"); @@ -194,7 +195,7 @@ } DEFUN (__octave_link_file_dialog__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_file_dialog__ (@var{filterlist}, @var{title}, @var{filename}, @var{size} @var{multiselect}, @var{pathname})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -274,7 +275,7 @@ } DEFUN (__octave_link_list_dialog__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_list_dialog__ (@var{list}, @var{mode}, @var{size}, @var{intial}, @var{name}, @var{prompt}, @var{ok_string}, @var{cancel_string})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -342,7 +343,7 @@ } DEFUN (__octave_link_input_dialog__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_input_dialog__ (@var{prompt}, @var{title}, @var{rowscols}, @var{defaults})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -404,7 +405,7 @@ } DEFUN (__octave_link_show_preferences__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_show_preferences__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -417,7 +418,7 @@ } DEFUN (__octave_link_show_doc__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __octave_link_show_doc__ ( @var{filename} )\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/octave-link.h +++ b/libinterp/corefcn/octave-link.h @@ -163,10 +163,10 @@ const std::string& cancel_string) { return enabled () - ? instance->do_list_dialog (list, mode, width, height, - initial_value, name, prompt, - ok_string, cancel_string) - : std::pair<std::list<int>, int> (); + ? instance->do_list_dialog (list, mode, width, height, + initial_value, name, prompt, + ok_string, cancel_string) + : std::pair<std::list<int>, int> (); } static std::list<std::string> @@ -177,8 +177,8 @@ const std::list<std::string>& defaults) { return enabled () - ? instance->do_input_dialog (prompt, title, nr, nc, defaults) - : std::list<std::string> (); + ? instance->do_input_dialog (prompt, title, nr, nc, defaults) + : std::list<std::string> (); } typedef std::list<std::pair<std::string, std::string> > filter_list; @@ -189,8 +189,9 @@ const std::string& multimode) { return enabled () - ? instance->do_file_dialog (filter, title, filename, dirname, multimode) - : std::list<std::string> (); + ? instance->do_file_dialog (filter, title, filename, dirname, + multimode) + : std::list<std::string> (); } @@ -199,7 +200,8 @@ bool addpath_option) { return enabled () - ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option) : 0; + ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option) + : 0; } static void change_directory (const std::string& dir) @@ -311,7 +313,7 @@ show_preferences () { if (enabled ()) - { + { instance->do_show_preferences (); return true; } @@ -319,17 +321,17 @@ return false; } - static bool + static bool show_doc (const std::string & file) { if (enabled ()) - { + { instance->do_show_doc (file); return true; } else return false; - + } private:
--- a/libinterp/corefcn/pager.cc +++ b/libinterp/corefcn/pager.cc @@ -180,7 +180,7 @@ } else { - // FIXME -- omething is not right with the + // FIXME: omething is not right with the // pager. If it died then we should receive a // signal for that. If there is some other problem, // then what? @@ -513,7 +513,7 @@ } DEFUN (diary, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} diary\n\ @deftypefnx {Command} {} diary on\n\ @deftypefnx {Command} {} diary off\n\ @@ -590,7 +590,7 @@ } DEFUN (more, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} more\n\ @deftypefnx {Command} {} more on\n\ @deftypefnx {Command} {} more off\n\ @@ -629,7 +629,7 @@ } DEFUN (terminal_size, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} terminal_size ()\n\ Return a two-element row vector containing the current size of the\n\ terminal window in characters (rows and columns).\n\ @@ -645,7 +645,7 @@ } DEFUN (page_output_immediately, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} page_output_immediately ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} page_output_immediately (@var{new_val})\n\ @deftypefnx {Built-in Function} {} page_output_immediately (@var{new_val}, \"local\")\n\ @@ -664,7 +664,7 @@ } DEFUN (page_screen_output, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} page_screen_output ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} page_screen_output (@var{new_val})\n\ @deftypefnx {Built-in Function} {} page_screen_output (@var{new_val}, \"local\")\n\ @@ -684,7 +684,7 @@ } DEFUN (PAGER, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} PAGER ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} PAGER (@var{new_val})\n\ @deftypefnx {Built-in Function} {} PAGER (@var{new_val}, \"local\")\n\ @@ -704,7 +704,7 @@ } DEFUN (PAGER_FLAGS, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} PAGER_FLAGS ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} PAGER_FLAGS (@var{new_val})\n\ @deftypefnx {Built-in Function} {} PAGER_FLAGS (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/pinv.cc +++ b/libinterp/corefcn/pinv.cc @@ -37,7 +37,7 @@ #include "ov-perm.h" DEFUN (pinv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} pinv (@var{x})\n\ @deftypefnx {Built-in Function} {} pinv (@var{x}, @var{tol})\n\ Return the pseudoinverse of @var{x}. Singular values less than\n\
--- a/libinterp/corefcn/pr-output.cc +++ b/libinterp/corefcn/pr-output.cc @@ -146,22 +146,23 @@ : fw (w), ex (e), prec (p), fmt (f), up (0), sp (0) { } float_format (const float_format& ff) - : fw (ff.fw), ex (ff.ex), prec (ff.prec), fmt (ff.fmt), up (ff.up), sp (ff.sp) { } + : fw (ff.fw), ex (ff.ex), prec (ff.prec), fmt (ff.fmt), up (ff.up), + sp (ff.sp) { } float_format& operator = (const float_format& ff) - { - if (&ff != this) - { - fw = ff.fw; - ex = ff.ex; - prec = ff.prec; - fmt = ff.fmt; - up = ff.up; - sp = ff.sp; - } - - return *this; - } + { + if (&ff != this) + { + fw = ff.fw; + ex = ff.ex; + prec = ff.prec; + fmt = ff.fmt; + up = ff.up; + sp = ff.sp; + } + + return *this; + } ~float_format (void) { } @@ -177,7 +178,7 @@ float_format& width (int w) { fw = w; return *this; } float_format& trailing_zeros (bool tz = true) - { sp = tz ? std::ios::showpoint : 0; return *this; } + { sp = tz ? std::ios::showpoint : 0; return *this; } friend std::ostream& operator << (std::ostream& os, const pr_engineering_float& pef); @@ -387,7 +388,8 @@ double nextd = d; // Have we converged to 1/intmax ? - if (m > 100 || fabs (frac) < 1 / static_cast<double> (std::numeric_limits<int>::max ())) + if (m > 100 + || fabs (frac) < 1 / static_cast<double> (std::numeric_limits<int>::max ())) { lastn = n; lastd = d; @@ -428,7 +430,7 @@ std::ostringstream buf; buf.flags (std::ios::fixed); buf << std::setprecision (0) << static_cast<int>(lastn) - << "/" << static_cast<int>(lastd); + << "/" << static_cast<int>(lastd); s = buf.str (); } } @@ -537,8 +539,7 @@ return result; } -// FIXME -- it would be nice to share more code among these -// functions,.. +// FIXME: it would be nice to share more code among these functions,.. static void set_real_format (int digits, bool inf_or_nan, bool int_only, int &fw) @@ -652,8 +653,7 @@ double d_abs = d < 0.0 ? -d : d; - int digits = (inf_or_nan || d_abs == 0.0) - ? 0 : num_digits (d_abs); + int digits = (inf_or_nan || d_abs == 0.0) ? 0 : num_digits (d_abs); set_real_format (digits, inf_or_nan, int_only, fw); } @@ -812,8 +812,8 @@ int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs); - scale = (x_max == 0 || int_or_inf_or_nan) ? 1.0 - : std::pow (10.0, calc_scale_exp (x_max - 1)); + scale = (x_max == 0 || int_or_inf_or_nan) + ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1)); set_real_matrix_format (x_max, x_min, inf_or_nan, int_or_inf_or_nan, fw); } @@ -1228,8 +1228,8 @@ int x_max = r_x_max > i_x_max ? r_x_max : i_x_max; int x_min = r_x_min > i_x_min ? r_x_min : i_x_min; - scale = (x_max == 0 || int_or_inf_or_nan) ? 1.0 - : std::pow (10.0, calc_scale_exp (x_max - 1)); + scale = (x_max == 0 || int_or_inf_or_nan) + ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1)); set_complex_matrix_format (x_max, x_min, r_x_max, r_x_min, inf_or_nan, int_or_inf_or_nan, r_fw, i_fw); @@ -1384,8 +1384,8 @@ int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs); - scale = (x_max == 0 || all_ints) ? 1.0 - : std::pow (10.0, calc_scale_exp (x_max - 1)); + scale = (x_max == 0 || all_ints) + ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1)); set_range_format (x_max, x_min, all_ints, fw); } @@ -1445,8 +1445,8 @@ { if (fmt) { - // Unless explicitly asked for, always print in big-endian - // format for hex and bit formats. + // Unless explicitly asked for, always print in big-endian format + // for hex and bit formats. // // {bit,hex}_format == 1: print big-endian // {bit,hex}_format == 2: print native @@ -1456,10 +1456,9 @@ equiv tmp; tmp.d = d; - // Unless explicitly asked for, always print in big-endian - // format. - - // FIXME -- will bad things happen if we are + // Unless explicitly asked for, always print in big-endian format. + + // FIXME: will bad things happen if we are // interrupted before resetting the format flags and fill // character? @@ -1600,7 +1599,8 @@ } static void -print_empty_matrix (std::ostream& os, octave_idx_type nr, octave_idx_type nc, bool pr_as_read_syntax) +print_empty_matrix (std::ostream& os, octave_idx_type nr, octave_idx_type nc, + bool pr_as_read_syntax) { assert (nr == 0 || nc == 0); @@ -1939,7 +1939,7 @@ col += inc; if (col >= nc) - os << " ]"; + os << " ]"; else os << " ...\n"; } @@ -1956,11 +1956,11 @@ // kluge. Get the true width of a number. int zero_fw; - { - std::ostringstream tmp_oss; - pr_float (tmp_oss, 0.0, fw, scale); - zero_fw = tmp_oss.str ().length (); - } + { + std::ostringstream tmp_oss; + pr_float (tmp_oss, 0.0, fw, scale); + zero_fw = tmp_oss.str ().length (); + } for (octave_idx_type col = 0; col < nc; col += inc) { @@ -2133,7 +2133,7 @@ octave_idx_type nr = cm.rows (); octave_idx_type nc = cm.columns (); - if (nr == 0 || nc == 0) + if (nr == 0 || nc == 0) print_empty_matrix (os, nr, nc, pr_as_read_syntax); else if (plus_format && ! pr_as_read_syntax) { @@ -2269,7 +2269,7 @@ octave_idx_type nr = cm.rows (); octave_idx_type nc = cm.columns (); - if (nr == 0 || nc == 0) + if (nr == 0 || nc == 0) print_empty_matrix (os, nr, nc, pr_as_read_syntax); else if (plus_format && ! pr_as_read_syntax) { @@ -2355,7 +2355,7 @@ col += inc; if (col >= nc) - os << " ]"; + os << " ]"; else os << " ...\n"; } @@ -2372,11 +2372,11 @@ // kluge. Get the true width of a number. int zero_fw; - { - std::ostringstream tmp_oss; - pr_complex (tmp_oss, Complex (0.0), r_fw, i_fw, scale); - zero_fw = tmp_oss.str ().length (); - } + { + std::ostringstream tmp_oss; + pr_complex (tmp_oss, Complex (0.0), r_fw, i_fw, scale); + zero_fw = tmp_oss.str ().length (); + } for (octave_idx_type col = 0; col < nc; col += inc) { @@ -2502,7 +2502,7 @@ col += inc; if (col >= nc) - os << " ]"; + os << " ]"; else os << " ...\n"; } @@ -2556,8 +2556,8 @@ break; default: - print_nd_array <ComplexNDArray, Complex, - ComplexMatrix> (os, nda, pr_as_read_syntax); + print_nd_array <ComplexNDArray, Complex, ComplexMatrix> + (os, nda, pr_as_read_syntax); break; } } @@ -2568,7 +2568,7 @@ octave_print_internal (os, double (d), pr_as_read_syntax); } -// FIXME -- write single precision versions of the printing functions. +// FIXME: write single precision versions of the printing functions. void octave_print_internal (std::ostream& os, float d, bool pr_as_read_syntax) @@ -2608,21 +2608,24 @@ octave_print_internal (std::ostream& os, const FloatComplexMatrix& cm, bool pr_as_read_syntax, int extra_indent) { - octave_print_internal (os, ComplexMatrix (cm), pr_as_read_syntax, extra_indent); + octave_print_internal (os, ComplexMatrix (cm), pr_as_read_syntax, + extra_indent); } void octave_print_internal (std::ostream& os, const FloatComplexDiagMatrix& cm, bool pr_as_read_syntax, int extra_indent) { - octave_print_internal (os, ComplexDiagMatrix (cm), pr_as_read_syntax, extra_indent); + octave_print_internal (os, ComplexDiagMatrix (cm), pr_as_read_syntax, + extra_indent); } void octave_print_internal (std::ostream& os, const FloatComplexNDArray& nda, bool pr_as_read_syntax, int extra_indent) { - octave_print_internal (os, ComplexNDArray (nda), pr_as_read_syntax, extra_indent); + octave_print_internal (os, ComplexNDArray (nda), pr_as_read_syntax, + extra_indent); } void @@ -2828,8 +2831,8 @@ break; default: - print_nd_array <charNDArray, char, - charMatrix> (os, nda, pr_as_read_syntax); + print_nd_array <charNDArray, char, charMatrix> (os, nda, + pr_as_read_syntax); break; } } @@ -2847,7 +2850,7 @@ octave_print_internal (std::ostream& os, const Array<std::string>& nda, bool pr_as_read_syntax, int /* extra_indent */) { - // FIXME -- this mostly duplicates the code in the print_nd_array<> + // FIXME: this mostly duplicates the code in the print_nd_array<> // function. Can fix this with std::is_same from C++11. if (nda.is_empty ()) @@ -2905,8 +2908,8 @@ Array<std::string> page (nda.index (idx), dim_vector (nr, nc)); - // FIXME -- need to do some more work to put these - // in neatly aligned columns... + // FIXME: need to do some more work to put these + // in neatly aligned columns... octave_idx_type n_rows = page.rows (); octave_idx_type n_cols = page.cols (); @@ -3019,11 +3022,11 @@ } } -// FIXME -- all this mess with abs is an attempt to avoid seeing +// FIXME: all this mess with abs is an attempt to avoid seeing // // warning: comparison of unsigned expression < 0 is always false // -// from GCC. Isn't there a better way +// from GCC. Isn't there a better way? template <class T> /* static */ inline T @@ -3118,7 +3121,7 @@ octave_print_internal_template (std::ostream& os, const intNDArray<T>& nda, bool pr_as_read_syntax, int extra_indent) { - // FIXME -- this mostly duplicates the code in the print_nd_array<> + // FIXME: this mostly duplicates the code in the print_nd_array<> // function. Can fix this with std::is_same from C++11. if (nda.is_empty ()) @@ -3224,14 +3227,15 @@ for (octave_idx_type i = 0; i < dims.numel (); i++) { - int new_digits = static_cast<int> - (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0)); + int new_digits + = static_cast<int> + (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0)); if (new_digits > digits) digits = new_digits; if (! isneg) - isneg = (abs (nda(i).value ()) != nda(i).value ()); + isneg = (abs (nda(i).value ()) != nda(i).value ()); } fw = digits + isneg; @@ -3363,7 +3367,7 @@ } DEFUN (rats, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rats (@var{x}, @var{len})\n\ Convert @var{x} into a rational approximation represented as a string.\n\ You can convert the string back into a matrix as follows:\n\ @@ -3443,7 +3447,7 @@ } DEFUN (disp, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} disp (@var{x})\n\ Display the value of @var{x}. For example:\n\ \n\ @@ -3487,7 +3491,7 @@ } DEFUN (fdisp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} fdisp (@var{fid}, @var{x})\n\ Display the value of @var{x} on the stream @var{fid}. For example:\n\ \n\ @@ -3759,7 +3763,7 @@ } DEFUN (format, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} format\n\ @deftypefnx {Command} {} format options\n\ Reset or specify the format of the output produced by @code{disp} and\n\ @@ -3943,7 +3947,7 @@ } DEFUN (fixed_point_format, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} fixed_point_format ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} fixed_point_format (@var{new_val})\n\ @deftypefnx {Built-in Function} {} fixed_point_format (@var{new_val}, \"local\")\n\ @@ -3982,7 +3986,7 @@ } DEFUN (print_empty_dimensions, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} print_empty_dimensions ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} print_empty_dimensions (@var{new_val})\n\ @deftypefnx {Built-in Function} {} print_empty_dimensions (@var{new_val}, \"local\")\n\ @@ -4011,7 +4015,7 @@ } DEFUN (split_long_rows, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} split_long_rows ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} split_long_rows (@var{new_val})\n\ @deftypefnx {Built-in Function} {} split_long_rows (@var{new_val}, \"local\")\n\ @@ -4049,7 +4053,7 @@ } DEFUN (output_max_field_width, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} output_max_field_width ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} output_max_field_width (@var{new_val})\n\ @deftypefnx {Built-in Function} {} output_max_field_width (@var{new_val}, \"local\")\n\ @@ -4067,7 +4071,7 @@ } DEFUN (output_precision, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} output_precision ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} output_precision (@var{new_val})\n\ @deftypefnx {Built-in Function} {} output_precision (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/procstream.h +++ b/libinterp/corefcn/procstream.h @@ -45,7 +45,7 @@ ~procstreambase (void) { close (); } void open (const std::string& name, int mode) - { open (name.c_str (), mode); } + { open (name.c_str (), mode); } void open (const char *name, int mode); @@ -86,10 +86,10 @@ ~iprocstream (void) { } void open (const std::string& name, int mode = std::ios::in) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } void open (const char *name, int mode = std::ios::in) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } private: @@ -116,10 +116,10 @@ ~oprocstream (void) { } void open (const std::string& name, int mode = std::ios::out) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } void open (const char *name, int mode = std::ios::out) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } private: @@ -146,10 +146,10 @@ ~procstream (void) { } void open (const std::string& name, int mode) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } void open (const char *name, int mode) - { procstreambase::open (name, mode); } + { procstreambase::open (name, mode); } private:
--- a/libinterp/corefcn/profiler.cc +++ b/libinterp/corefcn/profiler.cc @@ -337,15 +337,15 @@ else { static const char *fn[] = - { - "FunctionName", - "TotalTime", - "NumCalls", - "IsRecursive", - "Parents", - "Children", - 0 - }; + { + "FunctionName", + "TotalTime", + "NumCalls", + "IsRecursive", + "Parents", + "Children", + 0 + }; static octave_map m (dim_vector (0, 1), string_vector (fn)); @@ -365,13 +365,13 @@ else { static const char *fn[] = - { - "Index", - "SelfTime", - "NumCalls", - "Children", - 0 - }; + { + "Index", + "SelfTime", + "NumCalls", + "Children", + 0 + }; static octave_map m (dim_vector (0, 1), string_vector (fn)); @@ -386,7 +386,7 @@ { octave_time now; - // FIXME -- is this volatile declaration really needed? + // FIXME: is this volatile declaration really needed? // See bug #34210 for additional details. volatile double dnow = now.double_value (); @@ -407,7 +407,7 @@ // Enable or disable the profiler data collection. DEFUN (__profiler_enable__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __profiler_enable ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -433,7 +433,7 @@ // Clear all collected profiling data. DEFUN (__profiler_reset__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __profiler_reset ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -451,7 +451,7 @@ // Query the timings collected by the profiler. DEFUN (__profiler_data__, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} __profiler_data ()\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/corefcn/pt-jit.cc +++ b/libinterp/corefcn/pt-jit.cc @@ -108,7 +108,7 @@ visit (tee); } catch (const jit_break_exception&) - {} + { } // breaks must have been handled by the top level loop assert (breaks.empty ()); @@ -170,7 +170,7 @@ retval = visit (expr); } catch (const jit_break_exception&) - {} + { } if (breaks.size () || continues.size ()) throw jit_fail_exception ("break/continue not supported in " @@ -264,9 +264,11 @@ jit_block *short_cont = factory.create<jit_block> ("short_cont"); if (is_and) - block->append (factory.create<jit_cond_branch> (lhsv, short_cont, short_early)); + block->append (factory.create<jit_cond_branch> (lhsv, short_cont, + short_early)); else - block->append (factory.create<jit_cond_branch> (lhsv, short_early, short_cont)); + block->append (factory.create<jit_cond_branch> (lhsv, short_early, + short_cont)); block = short_early; @@ -321,8 +323,8 @@ else increment = factory.create<jit_const_scalar> (1); - result = block->append (factory.create<jit_call> (jit_typeinfo::make_range, base, - limit, increment)); + result = block->append (factory.create<jit_call> (jit_typeinfo::make_range, + base, limit, increment)); } void @@ -581,7 +583,7 @@ jit_call *check = create_checked (&jit_typeinfo::logically_true, cond); jit_block *body = factory.create<jit_block> (i == 0 ? "if_body" - : "ifelse_body"); + : "ifelse_body"); blocks.push_back (body); jit_instruction *br = factory.create<jit_cond_branch> (check, body, @@ -599,8 +601,8 @@ ++num_incomming; block->append (factory.create<jit_branch> (tail)); } - catch(const jit_break_exception&) - {} + catch (const jit_break_exception&) + { } current_breaks.splice (current_breaks.end (), breaks); current_continues.splice (current_continues.end (), continues); @@ -780,7 +782,8 @@ // FIXME: ugly hack, we need to come up with a way to pass // nargout to visit_identifier const jit_operation& fn = jit_typeinfo::print_value (); - jit_const_string *name = factory.create<jit_const_string> (expr->name ()); + jit_const_string *name = factory.create<jit_const_string> + (expr->name ()); block->append (factory.create<jit_call> (fn, name, expr_result)); } } @@ -1046,7 +1049,7 @@ call_args[call_args.size () - 1] = extra_arg; const jit_operation& fres = lhs ? jit_typeinfo::paren_subsasgn () - : jit_typeinfo::paren_subsref (); + : jit_typeinfo::paren_subsref (); return create_checked (fres, call_args); } @@ -1136,8 +1139,9 @@ // argument is an array of octave_base_value*, or octave_base_value** llvm::Type *arg_type = any->to_llvm (); // this is octave_base_value* arg_type = arg_type->getPointerTo (); - llvm::FunctionType *ft = llvm::FunctionType::get (llvm::Type::getVoidTy (context), - arg_type, false); + llvm::FunctionType *ft; + ft = llvm::FunctionType::get (llvm::Type::getVoidTy (context), arg_type, + false); function = llvm::Function::Create (ft, llvm::Function::ExternalLinkage, "foobar", module); @@ -1154,7 +1158,8 @@ } convert (blocks, constants); - } catch (const jit_fail_exception& e) + } + catch (const jit_fail_exception& e) { function->eraseFromParent (); throw; @@ -1200,7 +1205,8 @@ } convert (blocks, constants); - } catch (const jit_fail_exception& e) + } + catch (const jit_fail_exception& e) { function->eraseFromParent (); throw; @@ -1467,7 +1473,7 @@ // -------------------- jit_infer -------------------- jit_infer::jit_infer (jit_factory& afactory, jit_block_list& ablocks, const variable_map& avmap) - : blocks (ablocks), factory (afactory), vmap (avmap) {} + : blocks (ablocks), factory (afactory), vmap (avmap) { } void jit_infer::infer (void) @@ -1522,8 +1528,8 @@ if (term->alive (i)) { jit_block *succ = term->successor (i); - for (jit_block::iterator iter = succ->begin (); iter != succ->end () - && isa<jit_phi> (*iter); ++iter) + for (jit_block::iterator iter = succ->begin (); + iter != succ->end () && isa<jit_phi> (*iter); ++iter) push_worklist (*iter); jit_terminator *sterm = succ->terminator (); @@ -1563,7 +1569,7 @@ if (! added_phi.count (dblock)) { jit_phi *phi = factory.create<jit_phi> (iter->second, - dblock->use_count ()); + dblock->use_count ()); dblock->prepend (phi); added_phi.insert (dblock); } @@ -1600,8 +1606,8 @@ { jit_block *finish = ablock.successor (i); - for (jit_block::iterator iter = finish->begin (); iter != finish->end () - && isa<jit_phi> (*iter);) + for (jit_block::iterator iter = finish->begin (); + iter != finish->end () && isa<jit_phi> (*iter);) { jit_phi *phi = static_cast<jit_phi *> (*iter); jit_variable *var = phi->dest (); @@ -1660,8 +1666,8 @@ jit_block *b = *biter; if (b->alive ()) { - for (jit_block::iterator iter = b->begin (); iter != b->end () - && isa<jit_phi> (*iter);) + for (jit_block::iterator iter = b->begin (); + iter != b->end () && isa<jit_phi> (*iter);) { jit_phi *phi = static_cast<jit_phi *> (*iter); if (phi->prune ()) @@ -1775,8 +1781,8 @@ if (! temp.size () || ! isa<jit_error_check> (ablock.terminator ())) return; - // FIXME: If we support try/catch or unwind_protect final_block may not be the - // destination + // FIXME: If we support try/catch or unwind_protect final_block + // may not be the destination jit_block *split = ablock.maybe_split (factory, blocks, final_block ()); jit_terminator *term = split->terminator (); for (std::set<jit_value *>::const_iterator iter = temp.begin (); @@ -1797,8 +1803,8 @@ ++biter) { jit_block &ablock = **biter; - for (jit_block::iterator iter = ablock.begin (); iter != ablock.end () - && isa<jit_phi> (*iter); ++iter) + for (jit_block::iterator iter = ablock.begin (); + iter != ablock.end () && isa<jit_phi> (*iter); ++iter) simplify_phi (*static_cast<jit_phi *> (*iter)); } } @@ -1954,14 +1960,14 @@ return false; jit_function_info *info = fcn.get_info (); - if (! info || ! info->match (args)) - { - delete info; - info = new jit_function_info (*this, fcn, args); - fcn.stash_info (info); - } + if (! info || ! info->match (args)) + { + delete info; + info = new jit_function_info (*this, fcn, args); + fcn.stash_info (info); + } - return info->execute (args, retval); + return info->execute (args, retval); } bool @@ -1971,7 +1977,7 @@ // are about to run. However, we can't figure this out in O(1) time, so we // conservatively check for the existence of any breakpoints. return Vjit_enable && ! bp_table::have_breakpoints () - && ! Vdebug_on_interrupt && ! Vdebug_on_error; + && ! Vdebug_on_interrupt && ! Vdebug_on_error; } size_t @@ -2303,13 +2309,13 @@ { vmap::const_iterator iter = extra_vars.find (vname); return iter == extra_vars.end () ? symbol_table::varval (vname) - : *iter->second; + : *iter->second; } #endif DEFUN (debug_jit, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_jit ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_jit (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_jit (@var{new_val}, \"local\")\n\ @@ -2331,7 +2337,7 @@ } DEFUN (jit_enable, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} jit_enable ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} jit_enable (@var{new_val})\n\ @deftypefnx {Built-in Function} {} jit_enable (@var{new_val}, \"local\")\n\ @@ -2352,7 +2358,7 @@ } DEFUN (jit_startcnt, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} jit_startcnt ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} jit_startcnt (@var{new_val})\n\ @deftypefnx {Built-in Function} {} jit_startcnt (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/pt-jit.h +++ b/libinterp/corefcn/pt-jit.h @@ -365,7 +365,7 @@ llvm::Module *get_module (void) const { return module; } void optimize (llvm::Function *fn); - private: +private: tree_jit (void); static tree_jit& instance (void);
--- a/libinterp/corefcn/quad.cc +++ b/libinterp/corefcn/quad.cc @@ -173,7 +173,7 @@ while (0) DEFUN (quad, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b})\n\ @deftypefnx {Built-in Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol})\n\ @deftypefnx {Built-in Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ @@ -259,7 +259,8 @@ QUAD_ABORT1 ("expecting third argument to be a scalar"); int indefinite = 0; - FloatIndefQuad::IntegralType indef_type = FloatIndefQuad::doubly_infinite; + FloatIndefQuad::IntegralType indef_type + = FloatIndefQuad::doubly_infinite; float bound = 0.0; if (xisinf (a) && xisinf (b)) {
--- a/libinterp/corefcn/quadcc.cc +++ b/libinterp/corefcn/quadcc.cc @@ -38,7 +38,7 @@ #define DEBUG_QUADCC 0 /* Define the minimum size of the interval heap. */ -#define min_cquad_heapsize 200 +#define min_cquad_heapsize 200 /* Data of a single interval */ @@ -53,7 +53,8 @@ /* Some constants and matrices that we'll need. */ -static const double xi[33] = { +static const double xi[33] = +{ -1., -0.99518472667219688624, -0.98078528040323044912, -0.95694033573220886493, -0.92387953251128675612, -0.88192126434835502970, -0.83146961230254523708, @@ -69,7 +70,8 @@ 0.98078528040323044912, 0.99518472667219688624, 1. }; -static const double bee[68] = { +static const double bee[68] = +{ 0.00000000000000e+00, 2.28868854108532e-01, 0.00000000000000e+00, -8.15740215243451e-01, 0.00000000000000e+00, 5.31212715259731e-01, 0.00000000000000e+00, 1.38538036812454e-02, 0.00000000000000e+00, @@ -95,7 +97,8 @@ 0.00000000000000e+00, 5.40679930965238e-01 }; -static const double Lalpha[33] = { +static const double Lalpha[33] = +{ 5.77350269189626e-01, 5.16397779494322e-01, 5.07092552837110e-01, 5.03952630678970e-01, 5.02518907629606e-01, 5.01745206004255e-01, 5.01280411827603e-01, 5.00979432868120e-01, 5.00773395667191e-01, @@ -109,7 +112,8 @@ 5.00065049112355e-01, 5.00061046334395e-01, 5.00057401986298e-01 }; -static const double Lgamma[33] = { +static const double Lgamma[33] = +{ 0.0, 0.0, 5.16397779494322e-01, 5.07092552837110e-01, 5.03952630678970e-01, 5.02518907629606e-01, 5.01745206004255e-01, 5.01280411827603e-01, 5.00979432868120e-01, 5.00773395667191e-01, 5.00626174321759e-01, @@ -123,7 +127,8 @@ 5.00061046334395e-01 }; -static const double V1inv[5 * 5] = { +static const double V1inv[5 * 5] = +{ .47140452079103168293e-1, .37712361663282534635, .56568542494923801952, .37712361663282534635, .47140452079103168293e-1, -.81649658092772603273e-1, -.46188021535170061160, 0, @@ -135,7 +140,8 @@ .10774960475223581324 }; -static const double V2inv[9 * 9] = { +static const double V2inv[9 * 9] = +{ .11223917161691230546e-1, .10339219839658349826, .19754094204576565761, .25577315077753587922, .27835314560994251755, .25577315077753587922, .19754094204576565761, .10339219839658349826, .11223917161691230546e-1, @@ -169,7 +175,8 @@ .10916211417928767644, -.10916211417928767644, .54581057089643838221e-1 }; -static const double V3inv[17 * 17] = { +static const double V3inv[17 * 17] = +{ .27729677693590098996e-2, .26423663180333065153e-1, .53374068493933898312e-1, .77007854739523195947e-1, .98257061072911596869e-1, .11538049741786835604, .12832134344120884559, @@ -306,7 +313,8 @@ -.54971216929497681146e-1, .27485608464748840573e-1 }; -static const double V4inv[33 * 33] = { +static const double V4inv[33 * 33] = +{ .69120897476690862600e-3, .66419939766331555194e-2, .13600665164323186111e-1, .20122785860913684493e-1, .26583214101668429944e-1, .32712713318999268739e-1, @@ -882,7 +890,8 @@ -.27588282524939131481e-1, .13794141262469565740e-1 }; -static const double Tleft[33 * 33] = { +static const double Tleft[33 * 33] = +{ 1., -.86602540378443864678, 0., .33071891388307382381, 0., -.20728904939721249057, 0., .15128841196122722208, 0., -.11918864298744029244, 0., .98352013661686631224e-1, 0., @@ -1136,253 +1145,254 @@ 0., 0., .23283064365386962891e-9 }; -static const double Tright[33 * 33] = { +static const double Tright[33 * 33] = +{ 1., .86602540378443864678, 0., -.33071891388307382381, 0., - .20728904939721249057, 0., -.15128841196122722208, 0., - .11918864298744029244, 0., -.98352013661686631224e-1, 0., - .83727065404940845733e-1, 0., -.72893399403505841203e-1, 0., - .64544632643375022436e-1, 0., -.57913170372415565639e-1, 0., - .52518242575729562263e-1, 0., -.48043311993977520457e-1, 0., - .44271433659733990243e-1, 0., -.41048928022856771981e-1, 0., - .38263878662008271459e-1, 0., -.35832844026365304501e-1, 0., 0., - .50000000000000000000, .96824583655185422130, .57282196186948000082, - -.21650635094610966169, -.35903516540862679125, .97578093724974971969e-1, - .26203921611325660506, -.55792409597991015609e-1, -.20644078533943456204, - .36172381205961199479e-1, .17035068468874958194, - -.25371838001497225980e-1, -.14501953125000000000, - .18786835250972344757e-1, .12625507130328301066, - -.14473795929590520582e-1, -.11179458309419422675, - .11494434254897626155e-1, .10030855351241635862, - -.93498556820544479096e-2, -.90964264465390582629e-1, - .77546391824364392762e-2, .83213457337452292745e-1, - -.65358085945588638605e-2, -.76680372422574234569e-1, - .55835321940047427169e-2, .71098828931825789428e-1, - -.48253327982967591019e-2, -.66274981937248958553e-1, - .42118078245337801387e-2, .62064306433355646267e-1, - -.37083386598903548973e-2, 0., 0., .25000000000000000000, - .73950997288745200531, .83852549156242113615, .23175620272173946716, - -.37791833195149451496, -.25710129174850522325, .21608307321780204633, - .22844049245646009157, -.14009503000335388415, -.19897685605518413847, - .98264706042471226893e-1, .17445445004279014046, - -.72761100054958328401e-1, -.15463589893742108388, - .56056770591708784481e-1, .13855313872640495158, - -.44517752443294564781e-1, -.12534277657695128850, - .36211835346039665762e-1, .11434398255136139683, - -.30033588409423828125e-1, -.10506705408753910481, - .25313077840725783008e-1, .97149327637744872155e-1, - -.21624927200393328444e-1, -.90319582367202122625e-1, - .18688433567711780666e-1, .84372291635345108584e-1, - -.16312261561845420752e-1, -.79149526894804751586e-1, - .14362333871852474757e-1, 0., 0., 0., .12500000000000000000, - .49607837082461073572, .82265291131801144317, .59621200088559103072, - -.80054302859059362371e-1, -.42612156697795759420, - -.90098145270865592887e-1, .29769623255090078484, .13630307904779758221, - -.21638835185708931831, -.14600247270306082052, .16348801804014290453, - .14340708728599057249, -.12755243353979286190, -.13661523715071346961, - .10215585947881057394, .12864248070157166547, -.83592528025348693602e-1, - -.12066728689302565222, .69633728678718053052e-1, .11314245177331919532, - -.58882939251410088028e-1, -.10621835858758221487, - .50432266865187597572e-1, .99916834723527771581e-1, - -.43672094283057258509e-1, -.94206380251950852413e-1, - .38181356812697746418e-1, .89035739656537771225e-1, - -.33661934598216332678e-1, 0., 0., 0., 0., .62500000000000000000e-1, - .31093357409581873586, .67604086414949799246, .75644205980613611039, - .28990586430124175741, -.30648508196770360914, -.35801372616842500052, - .91326869828709014708e-1, .31127929687500000000, .90915752838698393094e-2, - -.25637381283965534330, -.57601077850322797594e-1, .21019685709225757945, - .81244992138514014256e-1, -.17375078516720988858, - -.92289437277967051125e-1, .14527351914265391374, - .96675340792832019889e-1, -.12289485697108543415, - -.97448175340011084006e-1, .10511755943298339844, - .96242247086378239657e-1, -.90822942272780513537e-1, - -.93966350452322132384e-1, .79189411876493712558e-1, - .91139307067989309325e-1, -.69613039934383197265e-1, - -.88062491671135767870e-1, .61646331729340817494e-1, 0., 0., 0., 0., 0., - .31250000000000000000e-1, .18684782411095934408, .50176689760410660236, - .74784031498626095398, .56472001151566251186, -.14842464993721351203e-1, - -.41162920273003120936, -.20243071230196532282, .23772054897172750436, - .24963810923972235950, -.12116179938394678936, -.24330535483519110663, - .47903849781124471359e-1, .22133299683101224293, - -.20542915138527200983e-2, -.19653465717678146728, - -.26818172626509178444e-1, .17319122357631210944, - .45065391411065545445e-1, -.15253391395444065941, - -.56543897711725408302e-1, .13469154928743585367, - .63632471400208840155e-1, -.11941684923913523817, - -.67828850207933293098e-1, .10636309084510652670, - .70095786922999181504e-1, -.95187373095150709082e-1, 0., 0., 0., 0., 0., - 0., .15625000000000000000e-1, .10909562534194485289, - .34842348626527747318, .64461114561628111443, .69382480527334683659, - .29551102358528827763, -.25527584713978439819, -.38878771718544715394, - -.82956185835347407489e-2, .31183177761966943912, .12831420840372374767, - -.22067618205599434368, -.17569196937129496961, .14598057000132284135, - .18864406621763419484, -.89921002550386645767e-1, -.18571835020187122114, - .48967672227195481777e-1, .17584685670380332798, - -.19267984545067426324e-1, -.16335437520503462738, - -.22598055455032407594e-2, .15032800884170631129, - .17883358353754640871e-1, -.13774837869432209951, - -.29227555960587143675e-1, .12604194747513151053, 0., 0., 0., 0., 0., 0., - 0., .78125000000000000000e-2, .62377810244809812496e-1, - .23080781467370883845, .50841310636012325368, .69834547012574056043, - .52572723156526459672, .11464215704954976471e-1, -.38698869011491210342, - -.26125646622255207507, .16951698812361607510, .29773875898928782269, - -.20130501202570367491e-1, -.26332493149159310198, - -.67734613690401207009e-1, .21207315477103762715, .11541543390889415193, - -.16249634759782417533, -.13885887405041735068, .11996491328010275427, - .14810432001630926895, -.85177658352556243411e-1, -.14918860659904380587, - .57317789510444151564e-1, .14569827645586660151, - -.35213090145965327390e-1, -.13975998126844578198, 0., 0., 0., 0., 0., 0., - 0., 0., .39062500000000000000e-2, .35101954600803571207e-1, - .14761284084133737720, .37655033076080192966, .62410290231517322776, - .64335622317683389875, .28188168266139524244, -.22488495672137010675, - -.39393811089283576186, -.75184777995770096714e-1, .28472023119398293003, - .20410910833705899572, -.15590046962908511750, -.23814567544617953125, - .54442805556829031204e-1, .22855930338589720954, .16303223615756629897e-1, - -.20172722433875559213, -.62723406421217419404e-1, .17012230831020922010, - .91754642766136561612e-1, -.13927644821381121197, -.10886600968068418181, - .11139075654373395292, .11797455976331702879, 0., 0., 0., 0., 0., 0., 0., - 0., 0., .19531250000000000000e-2, .19506820659607596598e-1, - .91865676095362231937e-1, .26604607809696493849, .51425874205091288223, - .66047561132505329292, .48660109511591303851, .17575661168678285615e-1, - -.36594333408055703366, -.29088854695378694533, .11318677346656537927, - .31110645235730182168, .60733219161008787341e-1, -.24333848233620420826, - -.15254312332655419708, .15995968483455388613, .19010344455215289289, - -.86040636766440260000e-1, -.19652589954665259945, - .27633388517205837713e-1, .18660848552712880387, .15942583868416775867e-1, - -.16902042462382064786, -.47278526495327740646e-1, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., .97656250000000000000e-3, .10731084460857378207e-1, - .55939644713816406331e-1, .18118487371914493668, .39914857299829864263, - .60812322949933902435, .60011887183061967583, .26002695805835928795, - -.20883922404786010096, -.38988130966114638081, -.11797833550782589082, - .25231824756239520077, .24817859972953934712, -.90516417677868996417e-1, - -.26079073291293066798, -.30259468817169480161e-1, .22178195264114178432, - .10569877864302048175, -.16679648389266977455, -.14637718550245050850, - .11219272032739559870, .16359363640525750353, -.64358194509092101393e-1, - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .48828125000000000000e-3, - .58542865274813470967e-2, .33461741635290096452e-1, .11979993155896201271, - .29580223766987206958, .51874761979436016742, .62861483498014306968, - .44868895761051453296, .12567502628371529386e-1, -.35040366183235474275, - -.30466868455569500886, .70903913601490112666e-1, .30822791893032512740, - .11969443264190207736, -.20764760317621313946, -.20629838355452128532, - .95269702915334718507e-1, .22432624768705133300, - -.33103381593477797101e-2, -.20570036048155716333, - -.62208282720094518964e-1, .17095309330441436348, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., .24414062500000000000e-3, - .31714797501871532475e-2, .19721062526127334100e-1, - .77311181185536498246e-1, .21124871792841566575, .41777980401893650886, - .59401977834943551650, .56132417807488349048, .23433675061367565951, - -.20222775295220942126, -.38280372496506190127, -.14443804214023095767, - .22268950939178466797, .27211314150777981984, -.34184876506180717313e-1, - -.26006498895669734842, -.97650425186005090107e-1, .19024527660129101293, - .16789164198044635671, -.10875811641651905252, -.19276785058805921298, 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .12207031250000000000e-3, - .17078941137247586143e-2, .11477733754843910060e-1, - .48887017020924625462e-1, .14634927241421789683, .32156282683019547854, - .52165811920227223937, .60001958466396926460, .41208501541480733755, - .11366945503190350975e-2, -.33968093962672089159, -.30955190935923386766, - .40657421856578262210e-1, .29873400409871531764, .16094481791768257440, - -.16876122436206497694, -.23650217045022161255, .33070260090574765012e-1, - .22985258456375907796, .68645651043827097771e-1, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., .61035156250000000000e-4, - .91501857608428649078e-3, .66085179496951987952e-2, - .30383171695850355404e-1, .98840838845366876117e-1, .23855447246420318989, - .43322017468145613917, .58049033744876107191, .52533893203742699346, - .20681056202371946180, -.20180000924562504384, -.37503922291962681797, - -.15988102869837429062, .19823558102762374094, .28393023878803799622, - .11188133439357510403e-1, -.24730368377168229255, -.14731529061377942839, - .14878558042884266021, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., .30517578125000000000e-4, .48804277318479845551e-3, - .37696080990601968396e-2, .18603912108994738255e-1, - .65325006755649582964e-1, .17162960707938819795, .34411527956476971322, - .52289350347082497959, .57319653625674910592, .37662253421045430413, - -.14099055105384663902e-1, -.33265570610216904208, -.30921265572647566661, - .19911390594166455281e-1, .28738590811031797718, .18912130469738472647, - -.13235936203215819193, -.25076406142356675279, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .15258789062500000000e-4, - .25928719280954633249e-3, .21327398937568540428e-2, - .11244626133630732010e-1, .42375605740664331966e-1, .12031130345907846211, - .26352562258934426830, .44590628258512682078, .56682835613700749379, - .49116715128261660395, .17845943097110339078, -.20541650677432497477, - -.36739803642257458221, -.16776034069210108273, .17920950989905112908, - .28867732805385066532, .46473465543376206337e-1, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .76293945312500000000e-5, - .13727610943181290891e-3, .11979683091449349286e-2, - .67195313034570709806e-2, .27044920779931968175e-1, - .82472196498517457862e-1, .19570475044896150093, .36391620788543817693, - .52241392782736588032, .54727504974907879912, .34211551468813581183, - -.31580472732719957762e-1, -.32830006549176759667, -.30563797665254420769, - .64905014620683140120e-2, .27642986248995073032, 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .38146972656250000000e-5, - .72454147007837596854e-4, .66859847582761390285e-3, - .39751311980366118437e-2, .17015198650201528366e-1, - .55443621868993855715e-1, .14157060481641692131, .28641242619559616836, - .45610665490966615415, .55262786406029265394, .45818352706035500108, - .14984403004611673047, -.21163807462970713245, -.36007252928843413718, - -.17030961385712954159, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., .19073486328125000000e-5, - .38135049864067468562e-4, .37101393638555730015e-3, - .23305339886279723213e-2, .10569913448297127219e-1, - .36640175162216897547e-1, .10010476414320235508, .21860074212675559892, - .38124757096345313719, .52020999209879669177, .52172632730659212045, - .30841620620308814614, -.50322546186721500184e-1, -.32577618885114899053, - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., .95367431640625000000e-6, .20021483206955925244e-4, - .20481807322420625431e-3, .13553476938058909882e-2, - .64919676350791905019e-2, .23848725425069251903e-1, - .69384632678886421292e-1, .16249711393618776934, .30736618106830314788, - .46399909601971539157, .53765031034002467225, .42598991476520183929, - .12130445348350215652, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., .47683715820312500000e-6, - .10487707828484902486e-4, .11254146162337528943e-3, - .78248929534271987118e-3, .39468337145306794566e-2, - .15313546659475671763e-1, .47249070825218564146e-1, .11804374107101480543, - .24031796927792491122, .39629215049166341285, .51629108968402548545, - .49622372075429782915, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., .23841857910156250000e-6, - .54823314130625337326e-5, .61575377321535518154e-4, - .44877834366497538134e-3, .23774612048621955857e-2, - .97136347645161687796e-2, .31671599547606636717e-1, - .84028665767000747480e-1, .18298487576742964949, .32647878537696945218, - .46970971486488895077, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .11920928955078125000e-6, - .28604020001177375838e-5, .33559227978295551013e-4, - .25583821662860610560e-3, .14201552747787302339e-2, - .60938046986874414969e-2, .20930869247951926793e-1, - .58745021125678072911e-1, .13613725780285953720, .26083988356030237586, - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., .59604644775390625000e-7, - .14898180663526043291e-5, .18224991282807693921e-4, - .14504433444608833821e-3, .84184722720281809548e-3, - .37846965430000478789e-2, .13656355548211376864e-1, - .40409541997718853934e-1, .99226988101858325902e-1, 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., .29802322387695312500e-7, .77471708843445529468e-6, - .98649879372606876995e-5, .81814934772838523887e-4, - .49554483992403011328e-3, .23290922072351413938e-2, - .88068134250844034186e-2, .27393666952485719070e-1, 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., .14901161193847656250e-7, .40226235946098233685e-6, - .53236418690561306700e-5, .45933829691164002269e-4, - .28982005232838857913e-3, .14212974043211018374e-2, - .56192363087488842264e-2, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - .74505805969238281250e-8, .20858299254133430408e-6, - .28648457300134381744e-5, .25677535898258910850e-4, - .16849420429491355445e-3, .86062824010315834002e-3, 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., .37252902984619140625e-8, .10801736017613096861e-6, - .15376606719887104015e-5, .14296523739727437959e-4, - .97419023656050887203e-4, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - .18626451492309570312e-8, .55871592916438890146e-7, - .82331193828137454068e-6, .79302250528382787666e-5, 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., .93132257461547851562e-9, - .28867244235852488244e-7, .43982811713864556957e-6, 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., .46566128730773925781e-9, - .14899342093408253335e-7, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., - 0., 0., .23283064365386962891e-9 + .20728904939721249057, 0., -.15128841196122722208, 0., + .11918864298744029244, 0., -.98352013661686631224e-1, 0., + .83727065404940845733e-1, 0., -.72893399403505841203e-1, 0., + .64544632643375022436e-1, 0., -.57913170372415565639e-1, 0., + .52518242575729562263e-1, 0., -.48043311993977520457e-1, 0., + .44271433659733990243e-1, 0., -.41048928022856771981e-1, 0., + .38263878662008271459e-1, 0., -.35832844026365304501e-1, 0., 0., + .50000000000000000000, .96824583655185422130, .57282196186948000082, + -.21650635094610966169, -.35903516540862679125, .97578093724974971969e-1, + .26203921611325660506, -.55792409597991015609e-1, -.20644078533943456204, + .36172381205961199479e-1, .17035068468874958194, + -.25371838001497225980e-1, -.14501953125000000000, + .18786835250972344757e-1, .12625507130328301066, + -.14473795929590520582e-1, -.11179458309419422675, + .11494434254897626155e-1, .10030855351241635862, + -.93498556820544479096e-2, -.90964264465390582629e-1, + .77546391824364392762e-2, .83213457337452292745e-1, + -.65358085945588638605e-2, -.76680372422574234569e-1, + .55835321940047427169e-2, .71098828931825789428e-1, + -.48253327982967591019e-2, -.66274981937248958553e-1, + .42118078245337801387e-2, .62064306433355646267e-1, + -.37083386598903548973e-2, 0., 0., .25000000000000000000, + .73950997288745200531, .83852549156242113615, .23175620272173946716, + -.37791833195149451496, -.25710129174850522325, .21608307321780204633, + .22844049245646009157, -.14009503000335388415, -.19897685605518413847, + .98264706042471226893e-1, .17445445004279014046, + -.72761100054958328401e-1, -.15463589893742108388, + .56056770591708784481e-1, .13855313872640495158, + -.44517752443294564781e-1, -.12534277657695128850, + .36211835346039665762e-1, .11434398255136139683, + -.30033588409423828125e-1, -.10506705408753910481, + .25313077840725783008e-1, .97149327637744872155e-1, + -.21624927200393328444e-1, -.90319582367202122625e-1, + .18688433567711780666e-1, .84372291635345108584e-1, + -.16312261561845420752e-1, -.79149526894804751586e-1, + .14362333871852474757e-1, 0., 0., 0., .12500000000000000000, + .49607837082461073572, .82265291131801144317, .59621200088559103072, + -.80054302859059362371e-1, -.42612156697795759420, + -.90098145270865592887e-1, .29769623255090078484, .13630307904779758221, + -.21638835185708931831, -.14600247270306082052, .16348801804014290453, + .14340708728599057249, -.12755243353979286190, -.13661523715071346961, + .10215585947881057394, .12864248070157166547, -.83592528025348693602e-1, + -.12066728689302565222, .69633728678718053052e-1, .11314245177331919532, + -.58882939251410088028e-1, -.10621835858758221487, + .50432266865187597572e-1, .99916834723527771581e-1, + -.43672094283057258509e-1, -.94206380251950852413e-1, + .38181356812697746418e-1, .89035739656537771225e-1, + -.33661934598216332678e-1, 0., 0., 0., 0., .62500000000000000000e-1, + .31093357409581873586, .67604086414949799246, .75644205980613611039, + .28990586430124175741, -.30648508196770360914, -.35801372616842500052, + .91326869828709014708e-1, .31127929687500000000, .90915752838698393094e-2, + -.25637381283965534330, -.57601077850322797594e-1, .21019685709225757945, + .81244992138514014256e-1, -.17375078516720988858, + -.92289437277967051125e-1, .14527351914265391374, + .96675340792832019889e-1, -.12289485697108543415, + -.97448175340011084006e-1, .10511755943298339844, + .96242247086378239657e-1, -.90822942272780513537e-1, + -.93966350452322132384e-1, .79189411876493712558e-1, + .91139307067989309325e-1, -.69613039934383197265e-1, + -.88062491671135767870e-1, .61646331729340817494e-1, 0., 0., 0., 0., 0., + .31250000000000000000e-1, .18684782411095934408, .50176689760410660236, + .74784031498626095398, .56472001151566251186, -.14842464993721351203e-1, + -.41162920273003120936, -.20243071230196532282, .23772054897172750436, + .24963810923972235950, -.12116179938394678936, -.24330535483519110663, + .47903849781124471359e-1, .22133299683101224293, + -.20542915138527200983e-2, -.19653465717678146728, + -.26818172626509178444e-1, .17319122357631210944, + .45065391411065545445e-1, -.15253391395444065941, + -.56543897711725408302e-1, .13469154928743585367, + .63632471400208840155e-1, -.11941684923913523817, + -.67828850207933293098e-1, .10636309084510652670, + .70095786922999181504e-1, -.95187373095150709082e-1, 0., 0., 0., 0., 0., + 0., .15625000000000000000e-1, .10909562534194485289, + .34842348626527747318, .64461114561628111443, .69382480527334683659, + .29551102358528827763, -.25527584713978439819, -.38878771718544715394, + -.82956185835347407489e-2, .31183177761966943912, .12831420840372374767, + -.22067618205599434368, -.17569196937129496961, .14598057000132284135, + .18864406621763419484, -.89921002550386645767e-1, -.18571835020187122114, + .48967672227195481777e-1, .17584685670380332798, + -.19267984545067426324e-1, -.16335437520503462738, + -.22598055455032407594e-2, .15032800884170631129, + .17883358353754640871e-1, -.13774837869432209951, + -.29227555960587143675e-1, .12604194747513151053, 0., 0., 0., 0., 0., 0., + 0., .78125000000000000000e-2, .62377810244809812496e-1, + .23080781467370883845, .50841310636012325368, .69834547012574056043, + .52572723156526459672, .11464215704954976471e-1, -.38698869011491210342, + -.26125646622255207507, .16951698812361607510, .29773875898928782269, + -.20130501202570367491e-1, -.26332493149159310198, + -.67734613690401207009e-1, .21207315477103762715, .11541543390889415193, + -.16249634759782417533, -.13885887405041735068, .11996491328010275427, + .14810432001630926895, -.85177658352556243411e-1, -.14918860659904380587, + .57317789510444151564e-1, .14569827645586660151, + -.35213090145965327390e-1, -.13975998126844578198, 0., 0., 0., 0., 0., 0., + 0., 0., .39062500000000000000e-2, .35101954600803571207e-1, + .14761284084133737720, .37655033076080192966, .62410290231517322776, + .64335622317683389875, .28188168266139524244, -.22488495672137010675, + -.39393811089283576186, -.75184777995770096714e-1, .28472023119398293003, + .20410910833705899572, -.15590046962908511750, -.23814567544617953125, + .54442805556829031204e-1, .22855930338589720954, .16303223615756629897e-1, + -.20172722433875559213, -.62723406421217419404e-1, .17012230831020922010, + .91754642766136561612e-1, -.13927644821381121197, -.10886600968068418181, + .11139075654373395292, .11797455976331702879, 0., 0., 0., 0., 0., 0., 0., + 0., 0., .19531250000000000000e-2, .19506820659607596598e-1, + .91865676095362231937e-1, .26604607809696493849, .51425874205091288223, + .66047561132505329292, .48660109511591303851, .17575661168678285615e-1, + -.36594333408055703366, -.29088854695378694533, .11318677346656537927, + .31110645235730182168, .60733219161008787341e-1, -.24333848233620420826, + -.15254312332655419708, .15995968483455388613, .19010344455215289289, + -.86040636766440260000e-1, -.19652589954665259945, + .27633388517205837713e-1, .18660848552712880387, .15942583868416775867e-1, + -.16902042462382064786, -.47278526495327740646e-1, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., .97656250000000000000e-3, .10731084460857378207e-1, + .55939644713816406331e-1, .18118487371914493668, .39914857299829864263, + .60812322949933902435, .60011887183061967583, .26002695805835928795, + -.20883922404786010096, -.38988130966114638081, -.11797833550782589082, + .25231824756239520077, .24817859972953934712, -.90516417677868996417e-1, + -.26079073291293066798, -.30259468817169480161e-1, .22178195264114178432, + .10569877864302048175, -.16679648389266977455, -.14637718550245050850, + .11219272032739559870, .16359363640525750353, -.64358194509092101393e-1, + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .48828125000000000000e-3, + .58542865274813470967e-2, .33461741635290096452e-1, .11979993155896201271, + .29580223766987206958, .51874761979436016742, .62861483498014306968, + .44868895761051453296, .12567502628371529386e-1, -.35040366183235474275, + -.30466868455569500886, .70903913601490112666e-1, .30822791893032512740, + .11969443264190207736, -.20764760317621313946, -.20629838355452128532, + .95269702915334718507e-1, .22432624768705133300, + -.33103381593477797101e-2, -.20570036048155716333, + -.62208282720094518964e-1, .17095309330441436348, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., .24414062500000000000e-3, + .31714797501871532475e-2, .19721062526127334100e-1, + .77311181185536498246e-1, .21124871792841566575, .41777980401893650886, + .59401977834943551650, .56132417807488349048, .23433675061367565951, + -.20222775295220942126, -.38280372496506190127, -.14443804214023095767, + .22268950939178466797, .27211314150777981984, -.34184876506180717313e-1, + -.26006498895669734842, -.97650425186005090107e-1, .19024527660129101293, + .16789164198044635671, -.10875811641651905252, -.19276785058805921298, 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .12207031250000000000e-3, + .17078941137247586143e-2, .11477733754843910060e-1, + .48887017020924625462e-1, .14634927241421789683, .32156282683019547854, + .52165811920227223937, .60001958466396926460, .41208501541480733755, + .11366945503190350975e-2, -.33968093962672089159, -.30955190935923386766, + .40657421856578262210e-1, .29873400409871531764, .16094481791768257440, + -.16876122436206497694, -.23650217045022161255, .33070260090574765012e-1, + .22985258456375907796, .68645651043827097771e-1, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., .61035156250000000000e-4, + .91501857608428649078e-3, .66085179496951987952e-2, + .30383171695850355404e-1, .98840838845366876117e-1, .23855447246420318989, + .43322017468145613917, .58049033744876107191, .52533893203742699346, + .20681056202371946180, -.20180000924562504384, -.37503922291962681797, + -.15988102869837429062, .19823558102762374094, .28393023878803799622, + .11188133439357510403e-1, -.24730368377168229255, -.14731529061377942839, + .14878558042884266021, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., .30517578125000000000e-4, .48804277318479845551e-3, + .37696080990601968396e-2, .18603912108994738255e-1, + .65325006755649582964e-1, .17162960707938819795, .34411527956476971322, + .52289350347082497959, .57319653625674910592, .37662253421045430413, + -.14099055105384663902e-1, -.33265570610216904208, -.30921265572647566661, + .19911390594166455281e-1, .28738590811031797718, .18912130469738472647, + -.13235936203215819193, -.25076406142356675279, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .15258789062500000000e-4, + .25928719280954633249e-3, .21327398937568540428e-2, + .11244626133630732010e-1, .42375605740664331966e-1, .12031130345907846211, + .26352562258934426830, .44590628258512682078, .56682835613700749379, + .49116715128261660395, .17845943097110339078, -.20541650677432497477, + -.36739803642257458221, -.16776034069210108273, .17920950989905112908, + .28867732805385066532, .46473465543376206337e-1, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .76293945312500000000e-5, + .13727610943181290891e-3, .11979683091449349286e-2, + .67195313034570709806e-2, .27044920779931968175e-1, + .82472196498517457862e-1, .19570475044896150093, .36391620788543817693, + .52241392782736588032, .54727504974907879912, .34211551468813581183, + -.31580472732719957762e-1, -.32830006549176759667, -.30563797665254420769, + .64905014620683140120e-2, .27642986248995073032, 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .38146972656250000000e-5, + .72454147007837596854e-4, .66859847582761390285e-3, + .39751311980366118437e-2, .17015198650201528366e-1, + .55443621868993855715e-1, .14157060481641692131, .28641242619559616836, + .45610665490966615415, .55262786406029265394, .45818352706035500108, + .14984403004611673047, -.21163807462970713245, -.36007252928843413718, + -.17030961385712954159, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., .19073486328125000000e-5, + .38135049864067468562e-4, .37101393638555730015e-3, + .23305339886279723213e-2, .10569913448297127219e-1, + .36640175162216897547e-1, .10010476414320235508, .21860074212675559892, + .38124757096345313719, .52020999209879669177, .52172632730659212045, + .30841620620308814614, -.50322546186721500184e-1, -.32577618885114899053, + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., .95367431640625000000e-6, .20021483206955925244e-4, + .20481807322420625431e-3, .13553476938058909882e-2, + .64919676350791905019e-2, .23848725425069251903e-1, + .69384632678886421292e-1, .16249711393618776934, .30736618106830314788, + .46399909601971539157, .53765031034002467225, .42598991476520183929, + .12130445348350215652, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., .47683715820312500000e-6, + .10487707828484902486e-4, .11254146162337528943e-3, + .78248929534271987118e-3, .39468337145306794566e-2, + .15313546659475671763e-1, .47249070825218564146e-1, .11804374107101480543, + .24031796927792491122, .39629215049166341285, .51629108968402548545, + .49622372075429782915, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., .23841857910156250000e-6, + .54823314130625337326e-5, .61575377321535518154e-4, + .44877834366497538134e-3, .23774612048621955857e-2, + .97136347645161687796e-2, .31671599547606636717e-1, + .84028665767000747480e-1, .18298487576742964949, .32647878537696945218, + .46970971486488895077, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .11920928955078125000e-6, + .28604020001177375838e-5, .33559227978295551013e-4, + .25583821662860610560e-3, .14201552747787302339e-2, + .60938046986874414969e-2, .20930869247951926793e-1, + .58745021125678072911e-1, .13613725780285953720, .26083988356030237586, + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., .59604644775390625000e-7, + .14898180663526043291e-5, .18224991282807693921e-4, + .14504433444608833821e-3, .84184722720281809548e-3, + .37846965430000478789e-2, .13656355548211376864e-1, + .40409541997718853934e-1, .99226988101858325902e-1, 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., .29802322387695312500e-7, .77471708843445529468e-6, + .98649879372606876995e-5, .81814934772838523887e-4, + .49554483992403011328e-3, .23290922072351413938e-2, + .88068134250844034186e-2, .27393666952485719070e-1, 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., .14901161193847656250e-7, .40226235946098233685e-6, + .53236418690561306700e-5, .45933829691164002269e-4, + .28982005232838857913e-3, .14212974043211018374e-2, + .56192363087488842264e-2, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + .74505805969238281250e-8, .20858299254133430408e-6, + .28648457300134381744e-5, .25677535898258910850e-4, + .16849420429491355445e-3, .86062824010315834002e-3, 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., .37252902984619140625e-8, .10801736017613096861e-6, + .15376606719887104015e-5, .14296523739727437959e-4, + .97419023656050887203e-4, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + .18626451492309570312e-8, .55871592916438890146e-7, + .82331193828137454068e-6, .79302250528382787666e-5, 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., .93132257461547851562e-9, + .28867244235852488244e-7, .43982811713864556957e-6, 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., .46566128730773925781e-9, + .14899342093408253335e-7, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., + 0., 0., .23283064365386962891e-9 }; /* Allocates a workspace for the given maximum number of intervals. @@ -1476,7 +1486,7 @@ /* The actual integration routine. */ DEFUN (quadcc, args, nargout, -"-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {@var{q} =} quadcc (@var{f}, @var{a}, @var{b})\n\ @deftypefnx {Function File} {@var{q} =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol})\n\ @deftypefnx {Function File} {@var{q} =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ @@ -1585,12 +1595,12 @@ fcn = args(0).function_value (); else { - std::string fcn_name = unique_symbol_name ("__quadcc_fcn__"); - std::string fname = "function y = "; - fname.append (fcn_name); - fname.append ("(x) y = "); - fcn = extract_function (args(0), "quadcc", fcn_name, fname, - "; endfunction"); + std::string fcn_name = unique_symbol_name ("__quadcc_fcn__"); + std::string fname = "function y = "; + fname.append (fcn_name); + fname.append ("(x) y = "); + fcn = extract_function (args(0), "quadcc", fcn_name, fname, + "; endfunction"); } if (! args(1).is_real_scalar ()) @@ -1788,9 +1798,8 @@ h = (iv->b - iv->a) / 2; #if (DEBUG_QUADCC) - printf - ("quadcc: processing ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", - heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); + printf ("quadcc: processing ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); #endif /* Should we try to increase the degree? */ @@ -1891,14 +1900,13 @@ /* Should we drop this interval? */ if ((m + h * xi[0]) >= (m + h * xi[1]) || (m + h * xi[31]) >= (m + h * xi[32]) - || iv->err < fabs (iv->igral) * std::numeric_limits<double>::epsilon () * 10) + || iv->err < fabs (iv->igral) + * std::numeric_limits<double>::epsilon () * 10) { #if (DEBUG_QUADCC) - printf - ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", - heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, - iv->depth); + printf ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); #endif /* Keep this interval's contribution */ @@ -2207,10 +2215,8 @@ { iv = &(ivals[heap[nivals - 1]]); #if (DEBUG_QUADCC) - printf - ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", - heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, - iv->depth); + printf ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); #endif err_final += iv->err; igral_final += iv->igral; @@ -2233,10 +2239,9 @@ for (i = 0; i < nivals; i++) { iv = &(ivals[heap[i]]); - printf - ("quadcc: ival %i (%i) with [%e,%e], int=%e, err=%e, depth=%i, rdepth=%i, ndiv=%i\n", - i, heap[i], iv->a, iv->b, iv->igral, iv->err, iv->depth, - iv->rdepth, iv->ndiv); + printf ("quadcc: ival %i (%i) with [%e,%e], int=%e, err=%e, depth=%i, rdepth=%i, ndiv=%i\n", + i, heap[i], iv->a, iv->b, iv->igral, iv->err, iv->depth, + iv->rdepth, iv->ndiv); } #endif @@ -2264,16 +2269,16 @@ %!assert (quadcc (@(x) exp (-x .^ 2), -Inf, Inf), sqrt (pi), 1e-6) %!assert (quadcc (@(x) exp (-x .^ 2), -Inf, 0), sqrt (pi)/2, 1e-6) -## Test function with NaNs in interval +## Test function with NaNs in interval %!function y = __nansin (x) %! nan_locs = [-3*pi/4, -pi/4, 0, pi/3, pi/2, pi]; %! y = sin (x); -%! idx = min (abs (bsxfun (@minus, x(:), nan_locs)), [], 2); +%! idx = min (abs (bsxfun (@minus, x(:), nan_locs)), [], 2); %! y(idx < 1e-10) = NaN; -%!endfunction +%!endfunction %!test -%! [q, err, npoints] = quadcc ("__nansin", -pi, pi); +%! [q, err, npoints] = quadcc ("__nansin", -pi, pi); %! assert (q, 0, 1e-6); %! assert (err, 0, 15*eps);
--- a/libinterp/corefcn/qz.cc +++ b/libinterp/corefcn/qz.cc @@ -58,9 +58,10 @@ #include "utils.h" #include "variables.h" -typedef octave_idx_type (*sort_function) (const octave_idx_type& LSIZE, const double& ALPHA, - const double& BETA, const double& S, - const double& P); +typedef octave_idx_type (*sort_function) (const octave_idx_type& LSIZE, + const double& ALPHA, + const double& BETA, const double& S, + const double& P); extern "C" { @@ -291,7 +292,7 @@ //FIXME: Matlab does not produce lambda as the first output argument. // Compatibility problem? DEFUN (qz, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{lambda} =} qz (@var{A}, @var{B})\n\ @deftypefnx {Built-in Function} {@var{lambda} =} qz (@var{A}, @var{B}, @var{opt})\n\ QZ@tie{}decomposition of the generalized eigenvalue problem\n\ @@ -376,7 +377,8 @@ int nargin = args.length (); #ifdef DEBUG - std::cout << "qz: nargin = " << nargin << ", nargout = " << nargout << std::endl; + std::cout << "qz: nargin = " << nargin + << ", nargout = " << nargout << std::endl; #endif if (nargin < 2 || nargin > 3 || nargout > 7) @@ -427,8 +429,9 @@ F77_CHAR_ARG_LEN (1)); #ifdef DEBUG_EIG - std::cout << "qz: initial value of safmin=" << setiosflags (std::ios::scientific) - << safmin << std::endl; + std::cout << "qz: initial value of safmin=" + << setiosflags (std::ios::scientific) + << safmin << std::endl; #endif // Some machines (e.g., DEC alpha) get safmin = 0; @@ -444,8 +447,9 @@ F77_CHAR_ARG_LEN (1)); #ifdef DEBUG_EIG - std::cout << "qz: safmin set to " << setiosflags (std::ios::scientific) - << safmin << std::endl; + std::cout << "qz: safmin set to " + << setiosflags (std::ios::scientific) + << safmin << std::endl; #endif } } @@ -458,8 +462,9 @@ octave_idx_type nn = args(0).rows (); #ifdef DEBUG - std::cout << "argument 1 dimensions: (" << nn << "," << args(0).columns () << ")" - << std::endl; + std::cout << "argument 1 dimensions: (" + << nn << "," << args(0).columns () << ")" + << std::endl; #endif int arg_is_empty = empty_arg ("qz", nn, args(0).columns ()); @@ -553,7 +558,8 @@ { #ifdef DEBUG if (compq == 'V') - std::cout << "qz: performing balancing; CQ=" << std::endl << CQ << std::endl; + std::cout << "qz: performing balancing; CQ=" << std::endl + << CQ << std::endl; #endif if (args(0).is_real_type ()) caa = ComplexMatrix (aa); @@ -578,7 +584,8 @@ { #ifdef DEBUG if (compq == 'V') - std::cout << "qz: performing balancing; QQ=" << std::endl << QQ << std::endl; + std::cout << "qz: performing balancing; QQ=" << std::endl + << QQ << std::endl; #endif F77_XFCN (dggbal, DGGBAL, @@ -703,7 +710,8 @@ QR bqr (bb); #ifdef DEBUG - std::cout << "qz: qr (bb) done; now peforming qz decomposition" << std::endl; + std::cout << "qz: qr (bb) done; now peforming qz decomposition" + << std::endl; #endif bb = bqr.R (); @@ -730,7 +738,8 @@ #endif #ifdef DEBUG - std::cout << "qz: compq = " << compq << ", compz = " << compz << std::endl; + std::cout << "qz: compq = " << compq << ", compz = " << compz + << std::endl; #endif // Reduce to generalized hessenberg form. @@ -771,24 +780,26 @@ #ifdef DEBUG if (compq == 'V') - std::cout << "qz: balancing done; QQ=" << std::endl << QQ << std::endl; + std::cout << "qz: balancing done; QQ=" << std::endl + << QQ << std::endl; #endif } - // then right + // then right if (compz == 'V') { - F77_XFCN (dggbak, DGGBAK, - (F77_CONST_CHAR_ARG2 (&bal_job, 1), - F77_CONST_CHAR_ARG2 ("R", 1), - nn, ilo, ihi, lscale.data (), rscale.data (), - nn, ZZ.fortran_vec (), nn, info - F77_CHAR_ARG_LEN (1) - F77_CHAR_ARG_LEN (1))); + F77_XFCN (dggbak, DGGBAK, + (F77_CONST_CHAR_ARG2 (&bal_job, 1), + F77_CONST_CHAR_ARG2 ("R", 1), + nn, ilo, ihi, lscale.data (), rscale.data (), + nn, ZZ.fortran_vec (), nn, info + F77_CHAR_ARG_LEN (1) + F77_CHAR_ARG_LEN (1))); #ifdef DEBUG - if (compz == 'V') - std::cout << "qz: balancing done; ZZ=" << std::endl << ZZ << std::endl; + if (compz == 'V') + std::cout << "qz: balancing done; ZZ=" << std::endl + << ZZ << std::endl; #endif } @@ -915,8 +926,10 @@ // Real zero. #ifdef DEBUG_EIG std::cout << " single gen eig:" << std::endl; - std::cout << " alphar(" << jj << ") = " << aa(jj,jj) << std::endl; - std::cout << " betar( " << jj << ") = " << bb(jj,jj) << std::endl; + std::cout << " alphar(" << jj << ") = " << aa(jj,jj) + << std::endl; + std::cout << " betar( " << jj << ") = " << bb(jj,jj) + << std::endl; std::cout << " alphai(" << jj << ") = 0" << std::endl; #endif @@ -930,21 +943,22 @@ #ifdef DEBUG_EIG std::cout << "qz: calling dlag2:" << std::endl; std::cout << "safmin=" - << setiosflags (std::ios::scientific) << safmin << std::endl; + << setiosflags (std::ios::scientific) + << safmin << std::endl; for (int idr = jj; idr <= jj+1; idr++) { for (int idc = jj; idc <= jj+1; idc++) { std::cout << "aa(" << idr << "," << idc << ")=" - << aa(idr,idc) << std::endl; + << aa(idr,idc) << std::endl; std::cout << "bb(" << idr << "," << idc << ")=" - << bb(idr,idc) << std::endl; + << bb(idr,idc) << std::endl; } } #endif - // FIXME -- probably should be using + // FIXME: probably should be using // fortran_vec instead of &aa(jj,jj) here. double scale1, scale2, wr1, wr2, wi; @@ -956,9 +970,9 @@ #ifdef DEBUG_EIG std::cout << "dlag2 returns: scale1=" << scale1 - << "\tscale2=" << scale2 << std::endl - << "\twr1=" << wr1 << "\twr2=" << wr2 - << "\twi=" << wi << std::endl; + << "\tscale2=" << scale2 << std::endl + << "\twr1=" << wr1 << "\twr2=" << wr2 + << "\twi=" << wi << std::endl; #endif // Just to be safe, check if it's a real pair. @@ -995,7 +1009,7 @@ octave_print_internal (std::cout, ZZ, 0); } std::cout << std::endl << "qz: ndim=" << ndim << std::endl - << "fail=" << fail << std::endl; + << "fail=" << fail << std::endl; std::cout << "alphar = " << std::endl; octave_print_internal (std::cout, (Matrix) alphar, 0); std::cout << std::endl << "alphai = " << std::endl; @@ -1210,18 +1224,18 @@ retval(1) = cbb; retval(0) = caa; } - else - { + else + { #ifdef DEBUG - std::cout << "qz: retval(1) = bb = " << std::endl; - octave_print_internal (std::cout, bb, 0); - std::cout << std::endl << "qz: retval(0) = aa = " <<std::endl; - octave_print_internal (std::cout, aa, 0); - std::cout << std::endl; + std::cout << "qz: retval(1) = bb = " << std::endl; + octave_print_internal (std::cout, bb, 0); + std::cout << std::endl << "qz: retval(0) = aa = " <<std::endl; + octave_print_internal (std::cout, aa, 0); + std::cout << std::endl; #endif - retval(1) = bb; - retval(0) = aa; - } + retval(1) = bb; + retval(0) = aa; + } } break;
--- a/libinterp/corefcn/rand.cc +++ b/libinterp/corefcn/rand.cc @@ -305,11 +305,11 @@ break; } - done: +done: return retval; - gen_matrix: +gen_matrix: dims.chop_trailing_singletons (); @@ -364,7 +364,7 @@ } DEFUN (rand, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rand (@var{n})\n\ @deftypefnx {Built-in Function} {} rand (@var{n}, @var{m}, @dots{})\n\ @deftypefnx {Built-in Function} {} rand ([@var{n} @var{m} @dots{}])\n\ @@ -463,7 +463,7 @@ return retval; } -// FIXME -- The old generator (selected when "seed" is set) will not +// FIXME: The old generator (selected when "seed" is set) will not // work properly if compiled to use 64-bit integers. /* @@ -551,7 +551,7 @@ static std::string current_distribution = octave_rand::distribution (); DEFUN (randn, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} randn (@var{n})\n\ @deftypefnx {Built-in Function} {} randn (@var{n}, @var{m}, @dots{})\n\ @deftypefnx {Built-in Function} {} randn ([@var{n} @var{m} @dots{}])\n\ @@ -623,7 +623,7 @@ */ DEFUN (rande, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} rande (@var{n})\n\ @deftypefnx {Built-in Function} {} rande (@var{n}, @var{m}, @dots{})\n\ @deftypefnx {Built-in Function} {} rande ([@var{n} @var{m} @dots{}])\n\ @@ -696,7 +696,7 @@ */ DEFUN (randg, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} randg (@var{n})\n\ @deftypefnx {Built-in Function} {} randg (@var{n}, @var{m}, @dots{})\n\ @deftypefnx {Built-in Function} {} randg ([@var{n} @var{m} @dots{}])\n\ @@ -968,7 +968,7 @@ */ DEFUN (randp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} randp (@var{l}, @var{n})\n\ @deftypefnx {Built-in Function} {} randp (@var{l}, @var{n}, @var{m}, @dots{})\n\ @deftypefnx {Built-in Function} {} randp (@var{l}, [@var{n} @var{m} @dots{}])\n\ @@ -1116,7 +1116,7 @@ */ DEFUN (randperm, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} randperm (@var{n})\n\ @deftypefnx {Built-in Function} {} randperm (@var{n}, @var{m})\n\ Return a row vector containing a random permutation of @code{1:@var{n}}.\n\ @@ -1171,7 +1171,7 @@ { idx = Array<octave_idx_type> (dim_vector (1, idx_len)); } - catch(std::bad_alloc) + catch (std::bad_alloc) { // Looks like n is too big and short_shuffle is false. // Let's try again, but this time with the alternative. @@ -1194,7 +1194,7 @@ for (octave_idx_type i = 0; i < m; i++) { octave_idx_type k = i + - gnulib::floor (rvec[i] * (n - i)); + gnulib::floor (rvec[i] * (n - i)); //For shuffling first m entries, no need to use extra //storage @@ -1218,7 +1218,7 @@ for (octave_idx_type i = 0; i < m; i++) { octave_idx_type k = i + - gnulib::floor (rvec[i] * (n - i)); + gnulib::floor (rvec[i] * (n - i)); std::swap (ivec[i], ivec[k]); } }
--- a/libinterp/corefcn/rcond.cc +++ b/libinterp/corefcn/rcond.cc @@ -31,7 +31,7 @@ #include "utils.h" DEFUN (rcond, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{c} =} rcond (@var{A})\n\ Compute the 1-norm estimate of the reciprocal condition number as returned\n\ by @sc{lapack}. If the matrix is well-conditioned then @var{c} will be near\n\
--- a/libinterp/corefcn/regexp.cc +++ b/libinterp/corefcn/regexp.cc @@ -151,14 +151,14 @@ break; #if 0 -// FIXME -- to be complete, we need to handle \oN, \o{N}, \xN, and +// FIXME: to be complete, we need to handle \oN, \o{N}, \xN, and // \x{N}. Hex digits may be upper or lower case. Brackets are // optional, so \x5Bz is the same as \x{5B}z. case 'o': // octal number case 'x': // hex number #endif - + default: // pass escape sequence through retval[i] = '\\'; retval[++i] = s[j]; @@ -585,7 +585,7 @@ } DEFUN (regexp, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{s}, @var{e}, @var{te}, @var{m}, @var{t}, @var{nm}, @var{sp}] =} regexp (@var{str}, @var{pat})\n\ @deftypefnx {Built-in Function} {[@dots{}] =} regexp (@var{str}, @var{pat}, \"@var{opt1}\", @dots{})\n\ Regular expression string matching. Search for @var{pat} in @var{str} and\n\ @@ -1066,7 +1066,7 @@ */ DEFUN (regexpi, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{s}, @var{e}, @var{te}, @var{m}, @var{t}, @var{nm}, @var{sp}] =} regexpi (@var{str}, @var{pat})\n\ @deftypefnx {Built-in Function} {[@dots{}] =} regexpi (@var{str}, @var{pat}, \"@var{opt1}\", @dots{})\n\ \n\ @@ -1278,7 +1278,7 @@ } DEFUN (regexprep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{outstr} =} regexprep (@var{string}, @var{pat}, @var{repstr})\n\ @deftypefnx {Built-in Function} {@var{outstr} =} regexprep (@var{string}, @var{pat}, @var{repstr}, \"@var{opt1}\", @dots{})\n\ Replace occurrences of pattern @var{pat} in @var{string} with @var{repstr}.\n\ @@ -1390,8 +1390,8 @@ } if (!error_state) - retval = args(0).is_cell () - ? octave_value (ret) : octave_value (ret(0)); + retval = args(0).is_cell () ? octave_value (ret) + : octave_value (ret(0)); } } else
--- a/libinterp/corefcn/schur.cc +++ b/libinterp/corefcn/schur.cc @@ -58,7 +58,7 @@ } DEFUN (schur, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{S} =} schur (@var{A})\n\ @deftypefnx {Built-in Function} {@var{S} =} schur (@var{A}, \"real\")\n\ @deftypefnx {Built-in Function} {@var{S} =} schur (@var{A}, \"complex\")\n\ @@ -294,7 +294,7 @@ */ DEFUN (rsf2csf, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {[@var{U}, @var{T}] =} rsf2csf (@var{UR}, @var{TR})\n\ Convert a real, upper quasi-triangular Schur@tie{}form @var{TR} to a complex,\n\ upper triangular Schur@tie{}form @var{T}.\n\
--- a/libinterp/corefcn/sighandlers.cc +++ b/libinterp/corefcn/sighandlers.cc @@ -872,7 +872,7 @@ } DEFUN (SIG, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} SIG ()\n\ Return a structure containing Unix signal names and their defined values.\n\ @end deftypefn") @@ -899,7 +899,7 @@ */ DEFUN (debug_on_interrupt, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_interrupt ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_interrupt (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_interrupt (@var{new_val}, \"local\")\n\ @@ -930,7 +930,7 @@ */ DEFUN (sighup_dumps_octave_core, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sighup_dumps_octave_core ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sighup_dumps_octave_core (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sighup_dumps_octave_core (@var{new_val}, \"local\")\n\ @@ -959,7 +959,7 @@ */ DEFUN (sigterm_dumps_octave_core, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sigterm_dumps_octave_core ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sigterm_dumps_octave_core (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sigterm_dumps_octave_core (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/sighandlers.h +++ b/libinterp/corefcn/sighandlers.h @@ -45,7 +45,7 @@ typedef void sig_handler (int); -// FIXME -- the data should probably be private... +// FIXME: the data should probably be private... struct octave_interrupt_handler @@ -66,8 +66,9 @@ // TRUE means we can be interrupted. extern OCTINTERP_API bool can_interrupt; -extern OCTINTERP_API sig_handler *octave_set_signal_handler (int, sig_handler *, - bool restart_syscalls = true); +extern OCTINTERP_API +sig_handler *octave_set_signal_handler (int, sig_handler *, + bool restart_syscalls = true); extern OCTINTERP_API void install_signal_handlers (void); @@ -107,16 +108,16 @@ have_status (oc.have_status), status (oc.status) { } octave_child& operator = (const octave_child& oc) - { - if (&oc != this) - { - pid = oc.pid; - handler = oc.handler; - have_status = oc.have_status; - status = oc.status; - } - return *this; - } + { + if (&oc != this) + { + pid = oc.pid; + handler = oc.handler; + have_status = oc.have_status; + status = oc.status; + } + return *this; + } ~octave_child (void) { }
--- a/libinterp/corefcn/sparse-xdiv.cc +++ b/libinterp/corefcn/sparse-xdiv.cc @@ -272,7 +272,8 @@ // -*- 8 -*- SparseComplexMatrix -xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, MatrixType &typ) +xdiv (const SparseComplexMatrix& a, const SparseComplexMatrix& b, + MatrixType &typ) { if (! mx_div_conform (a, b)) return SparseComplexMatrix (); @@ -627,7 +628,8 @@ // -*- 12 -*- SparseComplexMatrix -xleftdiv (const ComplexDiagMatrix& d, const SparseComplexMatrix& a, MatrixType&) +xleftdiv (const ComplexDiagMatrix& d, const SparseComplexMatrix& a, + MatrixType&) { return do_leftdiv_dm_sm<SparseComplexMatrix> (d, a); }
--- a/libinterp/corefcn/sparse-xdiv.h +++ b/libinterp/corefcn/sparse-xdiv.h @@ -76,18 +76,24 @@ extern SparseMatrix xleftdiv (const SparseMatrix& a, const SparseMatrix& b, MatrixType &typ); extern SparseComplexMatrix xleftdiv (const SparseMatrix& a, - const SparseComplexMatrix& b, MatrixType &typ); + const SparseComplexMatrix& b, + MatrixType &typ); extern SparseComplexMatrix xleftdiv (const SparseComplexMatrix& a, const SparseMatrix& b, MatrixType &typ); extern SparseComplexMatrix xleftdiv (const SparseComplexMatrix& a, - const SparseComplexMatrix& b, MatrixType &typ); + const SparseComplexMatrix& b, + MatrixType &typ); -extern SparseMatrix xleftdiv (const DiagMatrix&, const SparseMatrix&, MatrixType&); -extern SparseComplexMatrix xleftdiv (const ComplexDiagMatrix&, const SparseMatrix&, +extern SparseMatrix xleftdiv (const DiagMatrix&, const SparseMatrix&, + MatrixType&); +extern SparseComplexMatrix xleftdiv (const ComplexDiagMatrix&, + const SparseMatrix&, MatrixType&); -extern SparseComplexMatrix xleftdiv (const DiagMatrix&, const SparseComplexMatrix&, +extern SparseComplexMatrix xleftdiv (const DiagMatrix&, + const SparseComplexMatrix&, MatrixType&); -extern SparseComplexMatrix xleftdiv (const ComplexDiagMatrix&, const SparseComplexMatrix&, +extern SparseComplexMatrix xleftdiv (const ComplexDiagMatrix&, + const SparseComplexMatrix&, MatrixType&); #endif
--- a/libinterp/corefcn/sparse-xpow.cc +++ b/libinterp/corefcn/sparse-xpow.cc @@ -216,7 +216,7 @@ // // * -> not needed. -// FIXME -- these functions need to be fixed so that things +// FIXME: these functions need to be fixed so that things // like // // a = -1; b = [ 0, 0.5, 1 ]; r = a .^ b @@ -342,7 +342,7 @@ { ComplexMatrix result (nr, nc, Complex (std::pow (0.0, b))); - // FIXME -- avoid apparent GNU libm bug by + // FIXME: avoid apparent GNU libm bug by // converting A and B to complex instead of just A. Complex btmp (b); @@ -380,7 +380,7 @@ { octave_quit (); - // FIXME -- avoid apparent GNU libm bug by + // FIXME: avoid apparent GNU libm bug by // converting A and B to complex instead of just A. Complex atmp (a.data (i)); @@ -757,7 +757,8 @@ for (octave_idx_type i = a.cidx (j); i < a.cidx (j+1); i++) { octave_quit (); - result.xelem (a.ridx (i), j) = std::pow (a.data (i), b(a.ridx (i), j)); + result.xelem (a.ridx (i), j) = std::pow (a.data (i), + b(a.ridx (i), j)); } } result.maybe_compress (true);
--- a/libinterp/corefcn/sparse.cc +++ b/libinterp/corefcn/sparse.cc @@ -42,23 +42,23 @@ #include "ov-bool-sparse.h" DEFUN (issparse, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} issparse (@var{x})\n\ Return true if @var{x} is a sparse matrix.\n\ @seealso{ismatrix}\n\ @end deftypefn") { - if (args.length () != 1) - { - print_usage (); - return octave_value (); - } - else - return octave_value (args(0).is_sparse_type ()); + if (args.length () != 1) + { + print_usage (); + return octave_value (); + } + else + return octave_value (args(0).is_sparse_type ()); } DEFUN (sparse, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} sparse (@var{a})\n\ @deftypefnx {Built-in Function} {@var{s} =} sparse (@var{i}, @var{j}, @var{sv}, @var{m}, @var{n}, @var{nzmax})\n\ @deftypefnx {Built-in Function} {@var{s} =} sparse (@var{i}, @var{j}, @var{sv})\n\ @@ -103,113 +103,113 @@ @seealso{full, accumarray}\n\ @end deftypefn") { - octave_value retval; - int nargin = args.length (); + octave_value retval; + int nargin = args.length (); - // Temporarily disable sparse_auto_mutate if set (it's obsolete anyway). - unwind_protect frame; - frame.protect_var (Vsparse_auto_mutate); - Vsparse_auto_mutate = false; + // Temporarily disable sparse_auto_mutate if set (it's obsolete anyway). + unwind_protect frame; + frame.protect_var (Vsparse_auto_mutate); + Vsparse_auto_mutate = false; - if (nargin == 1) - { - octave_value arg = args (0); - if (arg.is_bool_type ()) - retval = arg.sparse_bool_matrix_value (); - else if (arg.is_complex_type ()) - retval = arg.sparse_complex_matrix_value (); - else if (arg.is_numeric_type ()) - retval = arg.sparse_matrix_value (); - else - gripe_wrong_type_arg ("sparse", arg); - } - else if (nargin == 2) - { - octave_idx_type m = 0, n = 0; - if (args(0).is_scalar_type () && args(1).is_scalar_type ()) - { - m = args(0).idx_type_value (); - n = args(1).idx_type_value (); - } - else - error ("sparse: dimensions M,N must be scalar"); + if (nargin == 1) + { + octave_value arg = args (0); + if (arg.is_bool_type ()) + retval = arg.sparse_bool_matrix_value (); + else if (arg.is_complex_type ()) + retval = arg.sparse_complex_matrix_value (); + else if (arg.is_numeric_type ()) + retval = arg.sparse_matrix_value (); + else + gripe_wrong_type_arg ("sparse", arg); + } + else if (nargin == 2) + { + octave_idx_type m = 0, n = 0; + if (args(0).is_scalar_type () && args(1).is_scalar_type ()) + { + m = args(0).idx_type_value (); + n = args(1).idx_type_value (); + } + else + error ("sparse: dimensions M,N must be scalar"); - if (! error_state) - { - if (m >= 0 && n >= 0) - retval = SparseMatrix (m, n); - else - error ("sparse: dimensions M,N must be positive or zero"); - } - } - else if (nargin >= 3) - { - bool summation = true; - if (nargin > 3 && args(nargin-1).is_string ()) - { - std::string opt = args(nargin-1).string_value (); - if (opt == "unique") - summation = false; - else if (opt == "sum" || opt == "summation") - summation = true; - else - error ("sparse: invalid option: %s", opt.c_str ()); + if (! error_state) + { + if (m >= 0 && n >= 0) + retval = SparseMatrix (m, n); + else + error ("sparse: dimensions M,N must be positive or zero"); + } + } + else if (nargin >= 3) + { + bool summation = true; + if (nargin > 3 && args(nargin-1).is_string ()) + { + std::string opt = args(nargin-1).string_value (); + if (opt == "unique") + summation = false; + else if (opt == "sum" || opt == "summation") + summation = true; + else + error ("sparse: invalid option: %s", opt.c_str ()); - nargin -= 1; - } + nargin -= 1; + } - if (! error_state) - { - octave_idx_type m = -1, n = -1, nzmax = -1; - if (nargin == 6) - { - nzmax = args(5).idx_type_value (); - nargin --; - } + if (! error_state) + { + octave_idx_type m = -1, n = -1, nzmax = -1; + if (nargin == 6) + { + nzmax = args(5).idx_type_value (); + nargin --; + } - if (nargin == 5) - { - if (args(3).is_scalar_type () && args(4).is_scalar_type ()) - { - m = args(3).idx_type_value (); - n = args(4).idx_type_value (); - } - else - error ("sparse: expecting scalar dimensions"); + if (nargin == 5) + { + if (args(3).is_scalar_type () && args(4).is_scalar_type ()) + { + m = args(3).idx_type_value (); + n = args(4).idx_type_value (); + } + else + error ("sparse: expecting scalar dimensions"); - if (! error_state && (m < 0 || n < 0)) - error ("sparse: dimensions must be non-negative"); - } - else if (nargin != 3) - print_usage (); + if (! error_state && (m < 0 || n < 0)) + error ("sparse: dimensions must be non-negative"); + } + else if (nargin != 3) + print_usage (); - if (! error_state) - { - idx_vector i = args(0).index_vector (); - idx_vector j = args(1).index_vector (); + if (! error_state) + { + idx_vector i = args(0).index_vector (); + idx_vector j = args(1).index_vector (); - if (args(2).is_bool_type ()) - retval = SparseBoolMatrix (args(2).bool_array_value (), i, j, - m, n, summation, nzmax); - else if (args(2).is_complex_type ()) - retval = SparseComplexMatrix (args(2).complex_array_value (), - i, j, m, n, summation, nzmax); - else if (args(2).is_numeric_type ()) - retval = SparseMatrix (args(2).array_value (), i, j, - m, n, summation, nzmax); - else - gripe_wrong_type_arg ("sparse", args(2)); - } + if (args(2).is_bool_type ()) + retval = SparseBoolMatrix (args(2).bool_array_value (), i, j, + m, n, summation, nzmax); + else if (args(2).is_complex_type ()) + retval = SparseComplexMatrix (args(2).complex_array_value (), + i, j, m, n, summation, nzmax); + else if (args(2).is_numeric_type ()) + retval = SparseMatrix (args(2).array_value (), i, j, + m, n, summation, nzmax); + else + gripe_wrong_type_arg ("sparse", args(2)); + } - } - } + } + } - return retval; + return retval; } DEFUN (spalloc, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} spalloc (@var{m}, @var{n}, @var{nz})\n\ Create an @var{m}-by-@var{n} sparse matrix with pre-allocated space for at\n\ most @var{nz} nonzero elements. This is useful for building the matrix\n\ @@ -245,25 +245,25 @@ @seealso{nzmax, sparse}\n\ @end deftypefn") { - octave_value retval; - int nargin = args.length (); + octave_value retval; + int nargin = args.length (); - if (nargin == 2 || nargin == 3) - { - octave_idx_type m = args(0).idx_type_value (); - octave_idx_type n = args(1).idx_type_value (); - octave_idx_type nz = 0; - if (nargin == 3) - nz = args(2).idx_type_value (); - if (error_state) - ; - else if (m >= 0 && n >= 0 && nz >= 0) - retval = SparseMatrix (dim_vector (m, n), nz); - else - error ("spalloc: M,N,NZ must be non-negative"); - } - else - print_usage (); + if (nargin == 2 || nargin == 3) + { + octave_idx_type m = args(0).idx_type_value (); + octave_idx_type n = args(1).idx_type_value (); + octave_idx_type nz = 0; + if (nargin == 3) + nz = args(2).idx_type_value (); + if (error_state) + ; + else if (m >= 0 && n >= 0 && nz >= 0) + retval = SparseMatrix (dim_vector (m, n), nz); + else + error ("spalloc: M,N,NZ must be non-negative"); + } + else + print_usage (); - return retval; + return retval; }
--- a/libinterp/corefcn/spparms.cc +++ b/libinterp/corefcn/spparms.cc @@ -34,7 +34,7 @@ #include "oct-spparms.h" DEFUN (spparms, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} { } spparms ()\n\ @deftypefnx {Built-in Function} {@var{vals} =} spparms ()\n\ @deftypefnx {Built-in Function} {[@var{keys}, @var{vals}] =} spparms ()\n\
--- a/libinterp/corefcn/sqrtm.cc +++ b/libinterp/corefcn/sqrtm.cc @@ -200,7 +200,7 @@ } DEFUN (sqrtm, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} sqrtm (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{s}, @var{error_estimate}] =} sqrtm (@var{A})\n\ Compute the matrix square root of the square matrix @var{A}.\n\ @@ -242,7 +242,8 @@ // sqrtm of a diagonal matrix is just sqrt. retval(0) = arg.sqrt (); else if (arg.is_single_type ()) - retval(0) = do_sqrtm<FloatMatrix, FloatComplexMatrix, FloatComplexSCHUR> (arg); + retval(0) = do_sqrtm<FloatMatrix, FloatComplexMatrix, FloatComplexSCHUR> + (arg); else if (arg.is_numeric_type ()) retval(0) = do_sqrtm<Matrix, ComplexMatrix, ComplexSCHUR> (arg);
--- a/libinterp/corefcn/str2double.cc +++ b/libinterp/corefcn/str2double.cc @@ -210,7 +210,7 @@ c = is.peek (); } else - is.setstate (std::ios::failbit); // indicate that read has failed. + is.setstate (std::ios::failbit); // indicate read has failed. } else if (is_imag_unit (c)) { @@ -294,7 +294,7 @@ } DEFUN (str2double, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} str2double (@var{s})\n\ Convert a string to a real or complex number.\n\ \n\ @@ -366,15 +366,15 @@ const Cell cell = args(0).cell_value (); if (! error_state) - { - ComplexNDArray output (cell.dims (), octave_NaN); - for (octave_idx_type i = 0; i < cell.numel (); i++) { - if (cell(i).is_string ()) - output(i) = str2double1 (cell(i).string_value ()); + ComplexNDArray output (cell.dims (), octave_NaN); + for (octave_idx_type i = 0; i < cell.numel (); i++) + { + if (cell(i).is_string ()) + output(i) = str2double1 (cell(i).string_value ()); + } + retval = output; } - retval = output; - } } else retval = Matrix (1, 1, octave_NaN);
--- a/libinterp/corefcn/strfind.cc +++ b/libinterp/corefcn/strfind.cc @@ -37,7 +37,8 @@ #include "gripes.h" #include "utils.h" -// This allows safe indexing with char. In C++, char may be (and often is) signed! +// This allows safe indexing with char. +// In C++, char may be (and often is) signed! #define ORD(ch) static_cast<unsigned char>(ch) #define TABSIZE (std::numeric_limits<unsigned char>::max () + 1) @@ -50,10 +51,10 @@ const char *x = needle.data (); octave_idx_type m = needle.numel (); - for (octave_idx_type i = 0; i < TABSIZE; i++) - table[i] = m + 1; - for (octave_idx_type i = 0; i < m; i++) - table[ORD(x[i])] = m - i; + for (octave_idx_type i = 0; i < TABSIZE; i++) + table[i] = m + 1; + for (octave_idx_type i = 0; i < m; i++) + table[ORD(x[i])] = m - i; } @@ -146,7 +147,7 @@ } DEFUN (strfind, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{idx} =} strfind (@var{str}, @var{pattern})\n\ @deftypefnx {Built-in Function} {@var{idx} =} strfind (@var{cellstr}, @var{pattern})\n\ @deftypefnx {Built-in Function} {@var{idx} =} strfind (@dots{}, \"overlaps\", @var{val})\n\ @@ -216,7 +217,8 @@ qs_preprocess (needle, table); if (argstr.is_string ()) - retval = octave_value (qs_search (needle, argstr.char_array_value (), + retval = octave_value (qs_search (needle, + argstr.char_array_value (), table, overlaps), true, true); else if (argstr.is_cell ()) @@ -229,9 +231,11 @@ { octave_value argse = argsc(i); if (argse.is_string ()) - retc(i) = octave_value (qs_search (needle, argse.char_array_value (), - table, overlaps), - true, true); + retc(i) + = octave_value (qs_search (needle, + argse.char_array_value (), + table, overlaps), + true, true); else { error ("strfind: each element of CELLSTR must be a string"); @@ -329,7 +333,7 @@ } DEFUN (strrep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{newstr} =} strrep (@var{str}, @var{ptn}, @var{rep})\n\ @deftypefnx {Built-in Function} {@var{newstr} =} strrep (@var{cellstr}, @var{ptn}, @var{rep})\n\ @deftypefnx {Built-in Function} {@var{newstr} =} strrep (@dots{}, \"overlaps\", @var{val})\n\ @@ -386,7 +390,8 @@ qs_preprocess (pat, table); if (argstr.is_string ()) - retval = qs_replace (argstr.char_array_value (), pat, rep, table, overlaps); + retval = qs_replace (argstr.char_array_value (), pat, rep, + table, overlaps); else if (argstr.is_cell ()) { const Cell argsc = argstr.cell_value (); @@ -397,7 +402,8 @@ { octave_value argse = argsc(i); if (argse.is_string ()) - retc(i) = qs_replace (argse.char_array_value (), pat, rep, table, overlaps); + retc(i) = qs_replace (argse.char_array_value (), pat, rep, + table, overlaps); else { error ("strrep: each element of S must be a string");
--- a/libinterp/corefcn/strfns.cc +++ b/libinterp/corefcn/strfns.cc @@ -41,7 +41,7 @@ #include "utils.h" DEFUN (char, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} char (@var{x})\n\ @deftypefnx {Built-in Function} {} char (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} char (@var{s1}, @var{s2}, @dots{})\n\ @@ -172,7 +172,7 @@ */ DEFUN (strvcat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strvcat (@var{x})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{x}, @dots{})\n\ @deftypefnx {Built-in Function} {} strvcat (@var{s1}, @var{s2}, @dots{})\n\ @@ -303,7 +303,7 @@ DEFUN (ischar, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ischar (@var{x})\n\ Return true if @var{x} is a character array.\n\ @seealso{isfloat, isinteger, islogical, isnumeric, iscellstr, isa}\n\ @@ -341,8 +341,10 @@ static octave_value do_strcmp_fun (const octave_value& arg0, const octave_value& arg1, octave_idx_type n, const char *fcn_name, - bool (*array_op) (const charNDArray&, const charNDArray&, octave_idx_type), - bool (*str_op) (const std::string&, const std::string&, octave_idx_type)) + bool (*array_op) (const charNDArray&, const charNDArray&, + octave_idx_type), + bool (*str_op) (const std::string&, const std::string&, + octave_idx_type)) { octave_value retval; @@ -428,7 +430,8 @@ { if (cell_val.is_cellstr ()) { - const Array<std::string> cellstr = cell_val.cellstr_value (); + const Array<std::string> cellstr + = cell_val.cellstr_value (); for (octave_idx_type i = 0; i < cellstr.length (); i++) output(i) = str_op (str[i], cellstr(i), n); } @@ -438,7 +441,8 @@ for (octave_idx_type i = 0; i < r; i++) { if (cell(i).is_string ()) - output(i) = str_op (str[i], cell(i).string_value (), n); + output(i) = str_op (str[i], + cell(i).string_value (), n); } } @@ -560,7 +564,7 @@ } DEFUN (strcmp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strcmp (@var{s1}, @var{s2})\n\ Return 1 if the character strings @var{s1} and @var{s2} are the same,\n\ and 0 otherwise.\n\ @@ -640,7 +644,8 @@ // Apparently, Matlab ignores the dims with strncmp. It also static bool -strncmp_array_op (const charNDArray& s1, const charNDArray& s2, octave_idx_type n) +strncmp_array_op (const charNDArray& s1, const charNDArray& s2, + octave_idx_type n) { octave_idx_type l1 = s1.numel (), l2 = s2.numel (); return (n > 0 && n <= l1 && n <= l2 @@ -659,7 +664,7 @@ } DEFUN (strncmp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strncmp (@var{s1}, @var{s2}, @var{n})\n\ Return 1 if the first @var{n} characters of strings @var{s1} and @var{s2} are\n\ the same, and 0 otherwise.\n\ @@ -745,7 +750,7 @@ // Ditto for string. static bool strcmpi_str_op (const std::string& s1, const std::string& s2, - octave_idx_type) + octave_idx_type) { return (s1.size () == s2.size () && std::equal (s1.data (), s1.data () + s1.size (), s2.data (), @@ -753,7 +758,7 @@ } DEFUNX ("strcmpi", Fstrcmpi, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strcmpi (@var{s1}, @var{s2})\n\ Return 1 if the character strings @var{s1} and @var{s2} are the same,\n\ disregarding case of alphabetic characters, and 0 otherwise.\n\ @@ -791,7 +796,8 @@ // Like strncmp. static bool -strncmpi_array_op (const charNDArray& s1, const charNDArray& s2, octave_idx_type n) +strncmpi_array_op (const charNDArray& s1, const charNDArray& s2, + octave_idx_type n) { octave_idx_type l1 = s1.numel (), l2 = s2.numel (); return (n > 0 && n <= l1 && n <= l2 @@ -801,7 +807,8 @@ // Ditto. static bool -strncmpi_str_op (const std::string& s1, const std::string& s2, octave_idx_type n) +strncmpi_str_op (const std::string& s1, const std::string& s2, + octave_idx_type n) { octave_idx_type l1 = s1.length (), l2 = s2.length (); return (n > 0 && n <= l1 && n <= l2 @@ -810,7 +817,7 @@ } DEFUNX ("strncmpi", Fstrncmpi, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strncmpi (@var{s1}, @var{s2}, @var{n})\n\ Return 1 if the first @var{n} character of @var{s1} and @var{s2} are the\n\ same, disregarding case of alphabetic characters, and 0 otherwise.\n\ @@ -857,7 +864,7 @@ */ DEFUN (list_in_columns, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} list_in_columns (@var{arg}, @var{width}, @var{prefix})\n\ Return a string containing the elements of @var{arg} listed in\n\ columns with an overall maximum width of @var{width} and optional\n\ @@ -921,7 +928,7 @@ return retval; } } - + std::string prefix; if (nargin > 2)
--- a/libinterp/corefcn/sub2ind.cc +++ b/libinterp/corefcn/sub2ind.cc @@ -62,7 +62,7 @@ } DEFUN (sub2ind, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{i}, @var{j})\n\ @deftypefnx {Function File} {@var{ind} =} sub2ind (@var{dims}, @var{s1}, @var{s2}, @dots{}, @var{sN})\n\ Convert subscripts to a linear index.\n\ @@ -168,7 +168,7 @@ */ DEFUN (ind2sub, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {[@var{s1}, @var{s2}, @dots{}, @var{sN}] =} ind2sub (@var{dims}, @var{ind})\n\ Convert a linear index to subscripts.\n\ \n\
--- a/libinterp/corefcn/svd.cc +++ b/libinterp/corefcn/svd.cc @@ -40,7 +40,7 @@ static int Vsvd_driver = SVD::GESVD; DEFUN (svd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{s} =} svd (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A})\n\ @deftypefnx {Built-in Function} {[@var{U}, @var{S}, @var{V}] =} svd (@var{A}, @var{econ})\n\ @@ -169,7 +169,7 @@ retval(1) = FloatMatrix (0, 0); retval(0) = FloatDiagMatrix (nr, 0, 1.0f); break; - case SVD::sigma_only: default: + case SVD::sigma_only: default: retval(0) = FloatMatrix (0, 1); break; } @@ -188,7 +188,7 @@ retval(1) = Matrix (0, 0); retval(0) = DiagMatrix (nr, 0, 1.0); break; - case SVD::sigma_only: default: + case SVD::sigma_only: default: retval(0) = Matrix (0, 1); break; } @@ -403,7 +403,7 @@ */ DEFUN (svd_driver, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} svd_driver ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} svd_driver (@var{new_val})\n\ @deftypefnx {Built-in Function} {} svd_driver (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/syl.cc +++ b/libinterp/corefcn/syl.cc @@ -33,7 +33,7 @@ #include "utils.h" DEFUN (syl, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{x} =} syl (@var{A}, @var{B}, @var{C})\n\ Solve the Sylvester equation\n\ @tex\n\ @@ -85,8 +85,8 @@ int arg_b_is_empty = empty_arg ("syl", b_nr, b_nc); int arg_c_is_empty = empty_arg ("syl", c_nr, c_nc); - bool isfloat = arg_a.is_single_type () || arg_b.is_single_type () || - arg_c.is_single_type (); + bool isfloat = arg_a.is_single_type () || arg_b.is_single_type () + || arg_c.is_single_type (); if (arg_a_is_empty > 0 && arg_b_is_empty > 0 && arg_c_is_empty > 0) if (isfloat)
--- a/libinterp/corefcn/symtab.cc +++ b/libinterp/corefcn/symtab.cc @@ -55,7 +55,8 @@ std::map<std::string, symbol_table::fcn_info> symbol_table::fcn_table; -std::map<std::string, std::set<std::string> > symbol_table::class_precedence_table; +std::map<std::string, std::set<std::string> > + symbol_table::class_precedence_table; std::map<std::string, std::list<std::string> > symbol_table::parent_map; @@ -83,13 +84,13 @@ { octave_user_function *fcn = curr_fcn; - // FIXME -- If active_context () == -1, then it does not make much + // FIXME: If active_context () == -1, then it does not make much // sense to use this symbol_record. This means an attempt at accessing // a variable from a function that has not been called yet is // happening. This should be cleared up when an implementing closures. return fcn && fcn->active_context () != static_cast<context_id> (-1) - ? fcn->active_context () : xcurrent_context; + ? fcn->active_context () : xcurrent_context; } void @@ -155,7 +156,7 @@ // elements, we also check if the working directory has changed // since the last time the function was loaded/parsed). // -// FIXME -- perhaps this should be done for all loaded functions when +// FIXME: perhaps this should be done for all loaded functions when // the prompt is printed or the directory has changed, and then we // would not check for it when finding symbol definitions. @@ -191,7 +192,7 @@ if (fcn) { - // FIXME -- we need to handle subfunctions properly here. + // FIXME: we need to handle subfunctions properly here. if (! fcn->is_subfunction ()) { @@ -218,10 +219,10 @@ { int nm_len = nm.length (); - if (octave_env::absolute_pathname (nm) - && ((nm_len > 4 && (nm.substr (nm_len-4) == ".oct" - || nm.substr (nm_len-4) == ".mex")) - || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) + if (octave_env::absolute_pathname (nm) && + ((nm_len > 4 && (nm.substr (nm_len-4) == ".oct" + || nm.substr (nm_len-4) == ".mex")) + || (nm_len > 2 && nm.substr (nm_len-2) == ".m"))) file = nm; else { @@ -243,7 +244,8 @@ while (it != plist.end ()) { - file = load_path::find_method (*it, nm, dir_name); + file = load_path::find_method (*it, nm, + dir_name); if (! file.empty ()) break; @@ -451,7 +453,7 @@ } void -symbol_table::fcn_info::fcn_info_rep:: mark_subfunction_in_scope_as_private +symbol_table::fcn_info::fcn_info_rep::mark_subfunction_in_scope_as_private (scope_id scope, const std::string& class_name) { scope_val_iterator p = subfunctions.find (scope); @@ -518,8 +520,10 @@ || (btyp_isarray (ityp) && (! btyp_isarray (jtyp) || (btyp_isinteger (jtyp) && ! btyp_isinteger (ityp)) - || ((ityp == btyp_double || ityp == btyp_complex || ityp == btyp_char) - && (jtyp == btyp_float || jtyp == btyp_float_complex))))); + || ((ityp == btyp_double || ityp == btyp_complex + || ityp == btyp_char) + && (jtyp == btyp_float + || jtyp == btyp_float_complex))))); sup_table[i][j] = use_j ? jtyp : ityp; } @@ -646,7 +650,7 @@ scope_val_iterator r = subfunctions.find (scope); if (r != subfunctions.end ()) { - // FIXME -- out-of-date check here. + // FIXME: out-of-date check here. return r->second; } @@ -898,7 +902,7 @@ scope_val_iterator r = subfunctions.find (scope); if (r != subfunctions.end ()) { - // FIXME -- out-of-date check here. + // FIXME: out-of-date check here. return r->second; } @@ -914,7 +918,8 @@ } octave_value -symbol_table::fcn_info::fcn_info_rep::find_method (const std::string& dispatch_type) +symbol_table::fcn_info::fcn_info_rep::find_method + (const std::string& dispatch_type) { octave_value retval; @@ -1059,8 +1064,8 @@ } void -symbol_table::fcn_info::fcn_info_rep::dump - (std::ostream& os, const std::string& prefix) const +symbol_table::fcn_info::fcn_info_rep::dump (std::ostream& os, + const std::string& prefix) const { os << prefix << name << " [" @@ -1145,8 +1150,8 @@ symbol_table *inst = get_instance (xcurrent_scope); return inst - ? inst->do_find (name, args, skip_variables, local_funcs) - : octave_value (); + ? inst->do_find (name, args, skip_variables, local_funcs) + : octave_value (); } octave_value @@ -1231,7 +1236,8 @@ { os << " subfunctions defined in this scope:\n"; - for (std::map<std::string, octave_value>::const_iterator p = sfuns.begin (); + for (std::map<std::string, + octave_value>::const_iterator p = sfuns.begin (); p != sfuns.end (); p++) os << " " << p->first << "\n"; @@ -1283,7 +1289,7 @@ symbol_table::stash_dir_name_for_subfunctions (scope_id scope, const std::string& dir_name) { - // FIXME -- is this the best way to do this? Maybe it would be + // FIXME: is this the best way to do this? Maybe it would be // better if we had a map from scope to list of subfunctions // stored with the function. Do we? @@ -1522,7 +1528,7 @@ } DEFUN (ignore_function_time_stamp, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} ignore_function_time_stamp ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} ignore_function_time_stamp (@var{new_val})\n\ Query or set the internal variable that controls whether Octave checks\n\ @@ -1603,7 +1609,7 @@ */ DEFUN (__current_scope__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{scope}, @var{context}]} __dump_symtab_info__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -1617,7 +1623,7 @@ } DEFUN (__dump_symtab_info__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __dump_symtab_info__ ()\n\ @deftypefnx {Built-in Function} {} __dump_symtab_info__ (@var{scope})\n\ @deftypefnx {Built-in Function} {} __dump_symtab_info__ (\"scopes\")\n\ @@ -1657,8 +1663,8 @@ octave_idx_type k = 0; - for (std::list<symbol_table::scope_id>::const_iterator p = lst.begin (); - p != lst.end (); p++) + for (std::list<symbol_table::scope_id>::const_iterator + p = lst.begin (); p != lst.end (); p++) v.xelem (k++) = *p; retval = v; @@ -1688,7 +1694,7 @@ #if 0 -// FIXME -- should we have functions like this in Octave? +// FIXME: should we have functions like this in Octave? DEFUN (set_variable, args, , "set_variable (NAME, VALUE)") {
--- a/libinterp/corefcn/symtab.h +++ b/libinterp/corefcn/symtab.h @@ -262,7 +262,7 @@ = symbol_table::global_table.find (name); return (p == symbol_table::global_table.end ()) - ? symbol_table::global_table[name] : p->second; + ? symbol_table::global_table[name] : p->second; } else if (is_persistent ()) { @@ -428,7 +428,7 @@ assign (symbol_table::persistent_varval (name)); } - // FIXME -- this causes trouble with recursive calls. + // FIXME: this causes trouble with recursive calls. // else // error ("unable to declare existing variable persistent"); } @@ -737,10 +737,12 @@ typedef std::map<std::string, std::string> dispatch_map_type; - typedef std::map<scope_id, octave_value>::const_iterator scope_val_const_iterator; + typedef std::map<scope_id, octave_value>::const_iterator + scope_val_const_iterator; typedef std::map<scope_id, octave_value>::iterator scope_val_iterator; - typedef std::map<std::string, octave_value>::const_iterator str_val_const_iterator; + typedef std::map<std::string, octave_value>::const_iterator + str_val_const_iterator; typedef std::map<std::string, octave_value>::iterator str_val_iterator; typedef dispatch_map_type::const_iterator dispatch_map_const_iterator; @@ -780,7 +782,8 @@ return function_on_path.is_defined (); } - octave_value find_function (const octave_value_list& args, bool local_funcs) + octave_value find_function (const octave_value_list& args, + bool local_funcs) { return find (args, local_funcs); } @@ -807,8 +810,8 @@ scope_val_const_iterator p = subfunctions.find (scope); return p == subfunctions.end () - ? std::pair<std::string, octave_value> () - : std::pair<std::string, octave_value> (name, p->second); + ? std::pair<std::string, octave_value> () + : std::pair<std::string, octave_value> (name, p->second); } void erase_subfunction (scope_id scope) @@ -1023,7 +1026,8 @@ return rep->is_user_function_defined (); } - octave_value find_function (const octave_value_list& args = octave_value_list (), + octave_value find_function (const octave_value_list& args + = octave_value_list (), bool local_funcs = true) { return rep->find_function (args, local_funcs); @@ -1105,7 +1109,8 @@ rep->print_dispatch (os); } - std::string help_for_dispatch (void) const { return rep->help_for_dispatch (); } + std::string help_for_dispatch (void) const + { return rep->help_for_dispatch (); } dispatch_map_type get_dispatch (void) const { @@ -1201,8 +1206,7 @@ static void erase_subfunctions_in_scope (scope_id scope) { - for (fcn_table_iterator q = fcn_table.begin (); - q != fcn_table.end (); q++) + for (fcn_table_iterator q = fcn_table.begin (); q != fcn_table.end (); q++) q->second.erase_subfunction (scope); } @@ -1210,8 +1214,7 @@ mark_subfunctions_in_scope_as_private (scope_id scope, const std::string& class_name) { - for (fcn_table_iterator q = fcn_table.begin (); - q != fcn_table.end (); q++) + for (fcn_table_iterator q = fcn_table.begin (); q != fcn_table.end (); q++) q->second.mark_subfunction_in_scope_as_private (scope, class_name); } @@ -1491,7 +1494,7 @@ fcn_table_const_iterator p = fcn_table.find (name); return (p != fcn_table.end ()) - ? p->second.find_built_in_function () : octave_value (); + ? p->second.find_built_in_function () : octave_value (); } static octave_value @@ -1500,7 +1503,7 @@ fcn_table_iterator p = fcn_table.find (name); return (p != fcn_table.end ()) - ? p->second.find_autoload () : octave_value (); + ? p->second.find_autoload () : octave_value (); } static octave_value @@ -1513,7 +1516,7 @@ fcn_table_iterator p = fcn_table.find (name); return (p != fcn_table.end ()) - ? p->second.find_user_function () : octave_value (); + ? p->second.find_user_function () : octave_value (); } static void install_cmdline_function (const std::string& name, @@ -1680,7 +1683,7 @@ static void clear_symbol (const std::string& name) { - // FIXME -- are we supposed to do both here? + // FIXME: are we supposed to do both here? clear_variable (name); clear_function (name); @@ -1723,7 +1726,7 @@ static void clear_symbol_pattern (const std::string& pat) { - // FIXME -- are we supposed to do both here? + // FIXME: are we supposed to do both here? clear_variable_pattern (pat); clear_function_pattern (pat); @@ -1739,7 +1742,7 @@ finfo.clear_user_function (); } - // FIXME -- is this necessary, or even useful? + // FIXME: is this necessary, or even useful? // else // error ("clear: no such function '%s'", name.c_str ()); } @@ -1930,8 +1933,8 @@ symbol_table *inst = get_instance (scope); return inst - ? inst->do_all_variables (context, defined_only, exclude) - : std::list<symbol_record> (); + ? inst->do_all_variables (context, defined_only, exclude) + : std::list<symbol_record> (); } static std::list<symbol_record> glob (const std::string& pattern) @@ -1977,7 +1980,7 @@ // may be handled the same way. if (pat.match (p->first)) - retval.push_back (symbol_record (xglobal_scope, + retval.push_back (symbol_record (xglobal_scope, p->first, p->second, symbol_record::global)); } @@ -2152,7 +2155,7 @@ symbol_table *inst = get_instance (xcurrent_scope); return inst - ? inst->do_workspace_info () : std::list<workspace_element> (); + ? inst->do_workspace_info () : std::list<workspace_element> (); } static void dump (std::ostream& os, scope_id scope = xcurrent_scope); @@ -2235,7 +2238,7 @@ { // Search for parents of parents and append them to the list. - // FIXME -- should we worry about a circular inheritance graph? + // FIXME: should we worry about a circular inheritance graph? std::list<std::string> parents = parent_classes (*lit); @@ -2247,23 +2250,23 @@ } static octave_user_function *get_curr_fcn (scope_id scope = xcurrent_scope) - { - symbol_table *inst = get_instance (scope); - return inst->curr_fcn; - } + { + symbol_table *inst = get_instance (scope); + return inst->curr_fcn; + } static void set_curr_fcn (octave_user_function *curr_fcn, scope_id scope = xcurrent_scope) - { - assert (scope != xtop_scope && scope != xglobal_scope); - symbol_table *inst = get_instance (scope); - // FIXME: normally, functions should not usurp each other's scope. - // If for any incredible reason this is needed, call - // set_user_function (0, scope) first. This may cause problems with - // nested functions, as the curr_fcn of symbol_records must be updated. - assert (inst->curr_fcn == 0 || curr_fcn == 0); - inst->curr_fcn = curr_fcn; - } + { + assert (scope != xtop_scope && scope != xglobal_scope); + symbol_table *inst = get_instance (scope); + // FIXME: normally, functions should not usurp each other's scope. + // If for any incredible reason this is needed, call + // set_user_function (0, scope) first. This may cause problems with + // nested functions, as the curr_fcn of symbol_records must be updated. + assert (inst->curr_fcn == 0 || curr_fcn == 0); + inst->curr_fcn = curr_fcn; + } static void cleanup (void); @@ -2275,21 +2278,31 @@ symbol_table& operator = (const symbol_table&); - typedef std::map<std::string, symbol_record>::const_iterator table_const_iterator; - typedef std::map<std::string, symbol_record>::iterator table_iterator; - - typedef std::map<std::string, octave_value>::const_iterator global_table_const_iterator; - typedef std::map<std::string, octave_value>::iterator global_table_iterator; - - typedef std::map<std::string, octave_value>::const_iterator persistent_table_const_iterator; - typedef std::map<std::string, octave_value>::iterator persistent_table_iterator; - - typedef std::map<scope_id, symbol_table*>::const_iterator all_instances_const_iterator; - typedef std::map<scope_id, symbol_table*>::iterator all_instances_iterator; - - typedef std::map<std::string, fcn_info>::const_iterator fcn_table_const_iterator; - typedef std::map<std::string, fcn_info>::iterator fcn_table_iterator; - + typedef std::map<std::string, symbol_record>::const_iterator + table_const_iterator; + typedef std::map<std::string, symbol_record>::iterator + table_iterator; + + typedef std::map<std::string, octave_value>::const_iterator + global_table_const_iterator; + typedef std::map<std::string, octave_value>::iterator + global_table_iterator; + + typedef std::map<std::string, octave_value>::const_iterator + persistent_table_const_iterator; + typedef std::map<std::string, octave_value>::iterator + persistent_table_iterator; + + typedef std::map<scope_id, symbol_table*>::const_iterator + all_instances_const_iterator; + typedef std::map<scope_id, symbol_table*>::iterator + all_instances_iterator; + + typedef std::map<std::string, fcn_info>::const_iterator + fcn_table_const_iterator; + typedef std::map<std::string, fcn_info>::iterator + fcn_table_iterator; + // The scope of this symbol table. scope_id my_scope; @@ -2332,14 +2345,18 @@ // precedence. static std::map<std::string, std::set<std::string> > class_precedence_table; - typedef std::map<std::string, std::set<std::string> >::const_iterator class_precedence_table_const_iterator; - typedef std::map<std::string, std::set<std::string> >::iterator class_precedence_table_iterator; + typedef std::map<std::string, std::set<std::string> >::const_iterator + class_precedence_table_const_iterator; + typedef std::map<std::string, std::set<std::string> >::iterator + class_precedence_table_iterator; // Map from class names to parent class names. static std::map<std::string, std::list<std::string> > parent_map; - typedef std::map<std::string, std::list<std::string> >::const_iterator const_parent_map_iterator; - typedef std::map<std::string, std::list<std::string> >::iterator parent_map_iterator; + typedef std::map<std::string, std::list<std::string> >::const_iterator + const_parent_map_iterator; + typedef std::map<std::string, std::list<std::string> >::iterator + parent_map_iterator; static const scope_id xglobal_scope; static const scope_id xtop_scope; @@ -2351,8 +2368,9 @@ static const context_id xdefault_context = static_cast<context_id> (-1); symbol_table (scope_id scope) - : my_scope (scope), table_name (), table (), nest_children (), nest_parent (0), - curr_fcn (0), static_workspace (false), persistent_table () { } + : my_scope (scope), table_name (), table (), nest_children (), + nest_parent (0), curr_fcn (0), static_workspace (false), + persistent_table () { } ~symbol_table (void) { } @@ -2430,7 +2448,8 @@ do_dup_scope (symbol_table& new_symbol_table) const { for (table_const_iterator p = table.begin (); p != table.end (); p++) - new_symbol_table.insert_symbol_record (p->second.dup (new_symbol_table.my_scope)); + new_symbol_table.insert_symbol_record (p->second.dup (new_symbol_table + .my_scope)); } symbol_record do_find_symbol (const std::string& name) @@ -2469,10 +2488,10 @@ } static fcn_info *get_fcn_info (const std::string& name) - { - fcn_table_iterator p = fcn_table.find (name); - return p != fcn_table.end () ? &p->second : 0; - } + { + fcn_table_iterator p = fcn_table.find (name); + return p != fcn_table.end () ? &p->second : 0; + } octave_value do_find (const std::string& name, const octave_value_list& args, @@ -2557,8 +2576,7 @@ return (p != table.end ()) ? p->second.varval (context) : octave_value (); } - void do_persistent_assign (const std::string& name, - const octave_value& value) + void do_persistent_assign (const std::string& name, const octave_value& value) { persistent_table_iterator p = persistent_table.find (name); @@ -2575,7 +2593,7 @@ persistent_table_iterator p = persistent_table.find (name); return (p == persistent_table.end ()) - ? persistent_table[name] : p->second; + ? persistent_table[name] : p->second; } octave_value do_persistent_varval (const std::string& name)
--- a/libinterp/corefcn/syscalls.cc +++ b/libinterp/corefcn/syscalls.cc @@ -110,7 +110,7 @@ } DEFUNX ("dup2", Fdup2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} dup2 (@var{old}, @var{new})\n\ Duplicate a file descriptor.\n\ \n\ @@ -162,7 +162,7 @@ } DEFUNX ("exec", Fexec, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} exec (@var{file}, @var{args})\n\ Replace current process with a new process. Calling @code{exec} without\n\ first calling @code{fork} will terminate your current Octave process and\n\ @@ -245,7 +245,7 @@ } DEFUNX ("popen2", Fpopen2, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{in}, @var{out}, @var{pid}] =} popen2 (@var{command}, @var{args})\n\ Start a subprocess with two-way communication. The name of the process\n\ is given by @var{command}, and @var{args} is an array of strings\n\ @@ -339,7 +339,8 @@ std::string msg; pid_t pid; - pid = octave_syscalls::popen2 (exec_file, arg_list, sync_mode, fildes, msg, interactive); + pid = octave_syscalls::popen2 (exec_file, arg_list, sync_mode, + fildes, msg, interactive); if (pid >= 0) { FILE *ifile = fdopen (fildes[1], "r"); @@ -348,10 +349,10 @@ std::string nm; octave_stream is = octave_stdiostream::create (nm, ifile, - std::ios::in); + std::ios::in); octave_stream os = octave_stdiostream::create (nm, ofile, - std::ios::out); + std::ios::out); Cell file_ids (1, 2); @@ -359,7 +360,7 @@ retval(1) = octave_stream_list::insert (is); retval(0) = octave_stream_list::insert (os); } - else + else error (msg.c_str ()); } } @@ -417,7 +418,7 @@ */ DEFUNX ("fcntl", Ffcntl, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} fcntl (@var{fid}, @var{request}, @var{arg})\n\ Change the properties of the open file @var{fid}. The following values\n\ may be passed as @var{request}:\n\ @@ -493,7 +494,7 @@ if (! error_state) { - // FIXME -- Need better checking here? + // FIXME: Need better checking here? if (fid < 0) error ("fcntl: invalid file id"); else @@ -517,7 +518,7 @@ } DEFUNX ("fork", Ffork, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{pid}, @var{msg}] =} fork ()\n\ Create a copy of the current process.\n\ \n\ @@ -562,7 +563,7 @@ } DEFUNX ("getpgrp", Fgetpgrp, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {pgid =} getpgrp ()\n\ Return the process group id of the current process.\n\ @end deftypefn") @@ -588,7 +589,7 @@ } DEFUNX ("getpid", Fgetpid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {pid =} getpid ()\n\ Return the process id of the current process.\n\ @end deftypefn") @@ -606,7 +607,7 @@ } DEFUNX ("getppid", Fgetppid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {pid =} getppid ()\n\ Return the process id of the parent process.\n\ @end deftypefn") @@ -624,7 +625,7 @@ } DEFUNX ("getegid", Fgetegid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {egid =} getegid ()\n\ Return the effective group id of the current process.\n\ @end deftypefn") @@ -642,7 +643,7 @@ } DEFUNX ("getgid", Fgetgid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {gid =} getgid ()\n\ Return the real group id of the current process.\n\ @end deftypefn") @@ -660,7 +661,7 @@ } DEFUNX ("geteuid", Fgeteuid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {euid =} geteuid ()\n\ Return the effective user id of the current process.\n\ @end deftypefn") @@ -678,7 +679,7 @@ } DEFUNX ("getuid", Fgetuid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {uid =} getuid ()\n\ Return the real user id of the current process.\n\ @end deftypefn") @@ -696,7 +697,7 @@ } DEFUNX ("kill", Fkill, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} kill (@var{pid}, @var{sig})\n\ Send signal @var{sig} to process @var{pid}.\n\ \n\ @@ -748,7 +749,7 @@ } DEFUNX ("lstat", Flstat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{info} =} lstat (@var{symlink})\n\ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{symlink})\n\ Return a structure @var{info} containing information about the symbolic link\n\ @@ -778,7 +779,7 @@ } DEFUNX ("mkfifo", Fmkfifo, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mkfifo (@var{name}, @var{mode})\n\ @deftypefnx {Built-in Function} {[@var{err}, @var{msg}] =} mkfifo (@var{name}, @var{mode})\n\ Create a FIFO special file named @var{name} with file mode @var{mode}\n\ @@ -833,7 +834,7 @@ } DEFUNX ("pipe", Fpipe, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{read_fd}, @var{write_fd}, @var{err}, @var{msg}] =} pipe ()\n\ Create a pipe and return the reading and writing ends of the pipe\n\ into @var{read_fd} and @var{write_fd} respectively.\n\ @@ -888,7 +889,7 @@ } DEFUNX ("stat", Fstat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{file})\n\ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{fid})\n\ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})\n\ @@ -1017,7 +1018,7 @@ } DEFUNX ("S_ISREG", FS_ISREG, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISREG (@var{mode})\n\ Return true if @var{mode} corresponds to a regular file.\n\ \n\ @@ -1043,7 +1044,7 @@ } DEFUNX ("S_ISDIR", FS_ISDIR, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISDIR (@var{mode})\n\ Return true if @var{mode} corresponds to a directory.\n\ \n\ @@ -1069,7 +1070,7 @@ } DEFUNX ("S_ISCHR", FS_ISCHR, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISCHR (@var{mode})\n\ Return true if @var{mode} corresponds to a character device.\n\ \n\ @@ -1095,7 +1096,7 @@ } DEFUNX ("S_ISBLK", FS_ISBLK, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISBLK (@var{mode})\n\ Return true if @var{mode} corresponds to a block device.\n\ \n\ @@ -1121,7 +1122,7 @@ } DEFUNX ("S_ISFIFO", FS_ISFIFO, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISFIFO (@var{mode})\n\ Return true if @var{mode} corresponds to a fifo.\n\ \n\ @@ -1147,7 +1148,7 @@ } DEFUNX ("S_ISLNK", FS_ISLNK, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISLNK (@var{mode})\n\ Return true if @var{mode} corresponds to a symbolic link.\n\ \n\ @@ -1173,7 +1174,7 @@ } DEFUNX ("S_ISSOCK", FS_ISSOCK, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} S_ISSOCK (@var{mode})\n\ Return true if @var{mode} corresponds to a socket.\n\ \n\ @@ -1199,7 +1200,7 @@ } DEFUN (gethostname, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} gethostname ()\n\ Return the hostname of the system where Octave is running.\n\ @end deftypefn") @@ -1215,7 +1216,7 @@ } DEFUN (uname, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{uts}, @var{err}, @var{msg}] =} uname ()\n\ Return system information in the structure. For example:\n\ \n\ @@ -1262,7 +1263,7 @@ } DEFUNX ("unlink", Funlink, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{err}, @var{msg}] =} unlink (@var{file})\n\ Delete the file named @var{file}.\n\ \n\ @@ -1301,7 +1302,7 @@ } DEFUNX ("waitpid", Fwaitpid, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{pid}, @var{status}, @var{msg}] =} waitpid (@var{pid}, @var{options})\n\ Wait for process @var{pid} to terminate. The @var{pid} argument can be:\n\ \n\ @@ -1370,7 +1371,8 @@ int status = 0; - pid_t result = octave_syscalls::waitpid (pid, &status, options, msg); + pid_t result = octave_syscalls::waitpid (pid, &status, + options, msg); retval(2) = msg; retval(1) = status; @@ -1389,7 +1391,7 @@ } DEFUNX ("WIFEXITED", FWIFEXITED, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WIFEXITED (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return true if the\n\ child terminated normally.\n\ @@ -1412,7 +1414,7 @@ } DEFUNX ("WEXITSTATUS", FWEXITSTATUS, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WEXITSTATUS (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return the exit\n\ status of the child. This function should only be employed if\n\ @@ -1436,7 +1438,7 @@ } DEFUNX ("WIFSIGNALED", FWIFSIGNALED, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WIFSIGNALED (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return true if the\n\ child process was terminated by a signal.\n\ @@ -1459,7 +1461,7 @@ } DEFUNX ("WTERMSIG", FWTERMSIG, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WTERMSIG (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return the number of\n\ the signal that caused the child process to terminate. This function\n\ @@ -1483,7 +1485,7 @@ } DEFUNX ("WCOREDUMP", FWCOREDUMP, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WCOREDUMP (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return true if the\n\ child produced a core dump. This function should only be employed if\n\ @@ -1509,7 +1511,7 @@ } DEFUNX ("WIFSTOPPED", FWIFSTOPPED, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WIFSTOPPED (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return true if the\n\ child process was stopped by delivery of a signal; this is only\n\ @@ -1534,7 +1536,7 @@ } DEFUNX ("WSTOPSIG", FWSTOPSIG, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WSTOPSIG (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return the number of\n\ the signal which caused the child to stop. This function should only\n\ @@ -1558,7 +1560,7 @@ } DEFUNX ("WIFCONTINUED", FWIFCONTINUED, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WIFCONTINUED (@var{status})\n\ Given @var{status} from a call to @code{waitpid}, return true if the\n\ child process was resumed by delivery of @code{SIGCONT}.\n\ @@ -1581,7 +1583,7 @@ } DEFUNX ("canonicalize_file_name", Fcanonicalize_file_name, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{cname}, @var{status}, @var{msg}] =} canonicalize_file_name (@var{fname})\n\ Return the canonical name of file @var{fname}. If the file does not exist\n\ the empty string (\"\") is returned.\n\ @@ -1633,7 +1635,7 @@ #endif DEFUNX ("F_DUPFD", FF_DUPFD, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_DUPFD ()\n\ Return the numerical value to pass to @code{fcntl} to return a\n\ duplicate file descriptor.\n\ @@ -1649,7 +1651,7 @@ } DEFUNX ("F_GETFD", FF_GETFD, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_GETFD ()\n\ Return the numerical value to pass to @code{fcntl} to return the\n\ file descriptor flags.\n\ @@ -1665,7 +1667,7 @@ } DEFUNX ("F_GETFL", FF_GETFL, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_GETFL ()\n\ Return the numerical value to pass to @code{fcntl} to return the\n\ file status flags.\n\ @@ -1681,7 +1683,7 @@ } DEFUNX ("F_SETFD", FF_SETFD, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_SETFD ()\n\ Return the numerical value to pass to @code{fcntl} to set the file\n\ descriptor flags.\n\ @@ -1697,7 +1699,7 @@ } DEFUNX ("F_SETFL", FF_SETFL, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_SETFL ()\n\ Return the numerical value to pass to @code{fcntl} to set the file\n\ status flags.\n\ @@ -1713,7 +1715,7 @@ } DEFUNX ("O_APPEND", FO_APPEND, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_APPEND ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate each write operation appends,\n\ @@ -1730,7 +1732,7 @@ } DEFUNX ("O_ASYNC", FO_ASYNC, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_ASYNC ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate asynchronous I/O.\n\ @@ -1746,7 +1748,7 @@ } DEFUNX ("O_CREAT", FO_CREAT, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_CREAT ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that a file should be\n\ @@ -1763,7 +1765,7 @@ } DEFUNX ("O_EXCL", FO_EXCL, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_EXCL ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that file locking is used.\n\ @@ -1779,7 +1781,7 @@ } DEFUNX ("O_NONBLOCK", FO_NONBLOCK, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_NONBLOCK ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that non-blocking I/O is in use,\n\ @@ -1796,7 +1798,7 @@ } DEFUNX ("O_RDONLY", FO_RDONLY, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_RDONLY ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that a file is open for\n\ @@ -1813,7 +1815,7 @@ } DEFUNX ("O_RDWR", FO_RDWR, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_RDWR ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that a file is open for both\n\ @@ -1830,7 +1832,7 @@ } DEFUNX ("O_SYNC", FO_SYNC, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_SYNC ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that a file is open for\n\ @@ -1847,7 +1849,7 @@ } DEFUNX ("O_TRUNC", FO_TRUNC, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} O_TRUNC ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that if file exists, it should\n\ @@ -1864,7 +1866,7 @@ } DEFUNX ("O_WRONLY", FO_WRONLY, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_WRONLY ()\n\ Return the numerical value of the file status flag that may be\n\ returned by @code{fcntl} to indicate that a file is open for\n\ @@ -1885,7 +1887,7 @@ #endif DEFUNX ("WNOHANG", FWNOHANG, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WNOHANG ()\n\ Return the numerical value of the option argument that may be\n\ passed to @code{waitpid} to indicate that it should return its\n\ @@ -1901,7 +1903,7 @@ #endif DEFUNX ("WUNTRACED", FWUNTRACED, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WUNTRACED ()\n\ Return the numerical value of the option argument that may be\n\ passed to @code{waitpid} to indicate that it should also return\n\ @@ -1918,7 +1920,7 @@ #endif DEFUNX ("WCONTINUE", FWCONTINUE, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} WCONTINUE ()\n\ Return the numerical value of the option argument that may be\n\ passed to @code{waitpid} to indicate that it should also return\n\
--- a/libinterp/corefcn/sysdep.cc +++ b/libinterp/corefcn/sysdep.cc @@ -139,7 +139,7 @@ } } while (Module32Next (h, &mod_info)); - } + } CloseHandle (h); } @@ -159,7 +159,7 @@ // Let the user close the console window or shutdown without the // pesky dialog. // - // FIXME -- should this be user configurable? + // FIXME: should this be user configurable? SetProcessShutdownParameters (0x280, SHUTDOWN_NORETRY); } @@ -528,7 +528,7 @@ } DEFUN (clc, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} clc ()\n\ @deftypefnx {Built-in Function} {} home ()\n\ Clear the terminal screen and move the cursor to the upper left corner.\n\ @@ -544,7 +544,7 @@ DEFALIAS (home, clc); DEFUN (getenv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} getenv (@var{var})\n\ Return the value of the environment variable @var{var}. For example,\n\ \n\ @@ -574,7 +574,7 @@ } DEFUN (putenv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} putenv (@var{var}, @var{value})\n\ @deftypefnx {Built-in Function} {} setenv (@var{var}, @var{value})\n\ Set the value of the environment variable @var{var} to @var{value}.\n\ @@ -616,10 +616,10 @@ %! assert (getenv ("dummy_variable_that_cannot_matter"), "foobar"); */ -// FIXME -- perhaps kbhit should also be able to print a prompt? +// FIXME: perhaps kbhit should also be able to print a prompt? DEFUN (kbhit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} kbhit ()\n\ @deftypefnx {Built-in Function} {} kbhit (1)\n\ Read a single keystroke from the keyboard. If called with an\n\ @@ -645,7 +645,7 @@ { octave_value retval; - // FIXME -- add timeout and default value args? + // FIXME: add timeout and default value args? if (interactive || forced_interactive) { @@ -665,7 +665,7 @@ } DEFUN (pause, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} pause (@var{seconds})\n\ Suspend the execution of the program. If invoked without any arguments,\n\ Octave waits until you type a character. With a numeric argument, it\n\ @@ -732,7 +732,7 @@ */ DEFUN (sleep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sleep (@var{seconds})\n\ Suspend the execution of the program for the given number of seconds.\n\ @end deftypefn") @@ -769,7 +769,7 @@ */ DEFUN (usleep, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} usleep (@var{microseconds})\n\ Suspend the execution of the program for the given number of\n\ microseconds. On systems where it is not possible to sleep for periods\n\ @@ -812,11 +812,11 @@ %!error (usleep (1, 2)) */ -// FIXME -- maybe this should only return 1 if IEEE floating +// FIXME: maybe this should only return 1 if IEEE floating // point functions really work. DEFUN (isieee, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isieee ()\n\ Return true if your computer @emph{claims} to conform to the IEEE standard\n\ for floating point calculations. No actual tests are performed.\n\ @@ -833,7 +833,7 @@ */ DEFUN (native_float_format, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} native_float_format ()\n\ Return the native floating point format as a string\n\ @end deftypefn") @@ -848,7 +848,7 @@ */ DEFUN (tilde_expand, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} tilde_expand (@var{string})\n\ Perform tilde expansion on @var{string}. If @var{string} begins with a\n\ tilde character, (@samp{~}), all of the characters preceding the first\n\
--- a/libinterp/corefcn/sysdep.h +++ b/libinterp/corefcn/sysdep.h @@ -52,6 +52,7 @@ #define MINGW_SIGNAL_CLEANUP() do { } while (0) #endif -extern OCTINTERP_API bool same_file_internal (const std::string&, const std::string&); +extern OCTINTERP_API bool same_file_internal (const std::string&, + const std::string&); #endif
--- a/libinterp/corefcn/time.cc +++ b/libinterp/corefcn/time.cc @@ -102,7 +102,7 @@ } DEFUN (time, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{seconds} =} time ()\n\ Return the current time as the number of seconds since the epoch. The\n\ epoch is referenced to 00:00:00 CUT (Coordinated Universal Time) 1 Jan\n\ @@ -126,7 +126,7 @@ */ DEFUN (gmtime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{tm_struct} =} gmtime (@var{t})\n\ Given a value returned from @code{time}, or any non-negative integer,\n\ return a time structure corresponding to CUT (Coordinated Universal Time).\n\ @@ -188,7 +188,7 @@ */ DEFUN (localtime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{tm_struct} =} localtime (@var{t})\n\ Given a value returned from @code{time}, or any non-negative integer,\n\ return a time structure corresponding to the local time zone.\n\ @@ -249,7 +249,7 @@ */ DEFUN (mktime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{seconds} =} mktime (@var{tm_struct})\n\ Convert a time structure corresponding to the local time to the number\n\ of seconds since the epoch. For example:\n\ @@ -303,7 +303,7 @@ */ DEFUN (strftime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} strftime (@var{fmt}, @var{tm_struct})\n\ Format the time structure @var{tm_struct} in a flexible way using the\n\ format string @var{fmt} that contains @samp{%} substitutions\n\ @@ -498,7 +498,7 @@ */ DEFUN (strptime, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{tm_struct}, @var{nchars}] =} strptime (@var{str}, @var{fmt})\n\ Convert the string @var{str} to the time structure @var{tm_struct} under\n\ the control of the format string @var{fmt}.\n\
--- a/libinterp/corefcn/toplev.cc +++ b/libinterp/corefcn/toplev.cc @@ -198,7 +198,8 @@ } size_t -octave_call_stack::do_num_user_code_frames (octave_idx_type& curr_user_frame) const +octave_call_stack::do_num_user_code_frames + (octave_idx_type& curr_user_frame) const { size_t retval = 0; @@ -265,7 +266,8 @@ // Use static fields for the best efficiency. // NOTE: C++0x will allow these two to be merged into one. static const char *bt_fieldnames[] = { "file", "name", "line", - "column", "scope", "context", 0 }; + "column", "scope", "context", 0 + }; static const octave_fields bt_fields (bt_fieldnames); octave_map @@ -614,16 +616,14 @@ catch (octave_execution_exception) { recover_from_exception (); - std::cerr - << "error: unhandled execution exception -- trying to return to prompt" - << std::endl; + std::cerr << "error: unhandled execution exception -- trying to return to prompt" + << std::endl; } catch (std::bad_alloc) { recover_from_exception (); - std::cerr - << "error: out of memory -- trying to return to prompt" - << std::endl; + std::cerr << "error: out of memory -- trying to return to prompt" + << std::endl; } } while (retval == 0); @@ -674,7 +674,7 @@ OCTAVE_SAFE_CALL (command_editor::restore_terminal_state, ()); - // FIXME -- is this needed? Can it cause any trouble? + // FIXME: is this needed? Can it cause any trouble? OCTAVE_SAFE_CALL (raw_mode, (0)); OCTAVE_SAFE_CALL (octave_history_write_timestamp, ()); @@ -755,7 +755,7 @@ } DEFUN (quit, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} exit (@var{status})\n\ @deftypefnx {Built-in Function} {} quit (@var{status})\n\ Exit the current Octave session. If the optional integer value\n\ @@ -799,7 +799,7 @@ DEFALIAS (exit, quit); DEFUN (warranty, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} warranty ()\n\ Describe the conditions for copying and distributing Octave.\n\ @end deftypefn") @@ -905,7 +905,7 @@ enum system_exec_type { et_sync, et_async }; DEFUN (system, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} system (\"@var{string}\")\n\ @deftypefnx {Built-in Function} {} system (\"@var{string}\", @var{return_output})\n\ @deftypefnx {Built-in Function} {} system (\"@var{string}\", @var{return_output}, @var{type})\n\ @@ -1019,7 +1019,7 @@ if (type == et_async) { - // FIXME -- maybe this should go in sysdep.cc? + // FIXME: maybe this should go in sysdep.cc? #ifdef HAVE_FORK pid_t pid = fork (); @@ -1027,7 +1027,7 @@ error ("system: fork failed -- can't create child process"); else if (pid == 0) { - // FIXME -- should probably replace this + // FIXME: should probably replace this // call with something portable. execl (SHELL_PATH, "sh", "-c", cmd_str.c_str (), @@ -1122,7 +1122,7 @@ DEFUN (atexit, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} atexit (@var{fcn})\n\ @deftypefnx {Built-in Function} {} atexit (@var{fcn}, @var{flag})\n\ Register a function to be called when Octave exits. For example,\n\ @@ -1202,7 +1202,7 @@ } DEFUN (octave_config_info, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} octave_config_info ()\n\ @deftypefnx {Built-in Function} {} octave_config_info (@var{option})\n\ Return a structure containing configuration and installation\n\ @@ -1232,186 +1232,186 @@ }; static const conf_info_struct conf_info[] = - { - { false, "ALL_CFLAGS", OCTAVE_CONF_ALL_CFLAGS }, - { false, "ALL_CXXFLAGS", OCTAVE_CONF_ALL_CXXFLAGS }, - { false, "ALL_FFLAGS", OCTAVE_CONF_ALL_FFLAGS }, - { false, "ALL_LDFLAGS", OCTAVE_CONF_ALL_LDFLAGS }, - { false, "AMD_CPPFLAGS", OCTAVE_CONF_AMD_CPPFLAGS }, - { false, "AMD_LDFLAGS", OCTAVE_CONF_AMD_LDFLAGS }, - { false, "AMD_LIBS", OCTAVE_CONF_AMD_LIBS }, - { false, "AR", OCTAVE_CONF_AR }, - { false, "ARFLAGS", OCTAVE_CONF_ARFLAGS }, - { false, "ARPACK_CPPFLAGS", OCTAVE_CONF_ARPACK_CPPFLAGS }, - { false, "ARPACK_LDFLAGS", OCTAVE_CONF_ARPACK_LDFLAGS }, - { false, "ARPACK_LIBS", OCTAVE_CONF_ARPACK_LIBS }, - { false, "BLAS_LIBS", OCTAVE_CONF_BLAS_LIBS }, - { false, "CAMD_CPPFLAGS", OCTAVE_CONF_CAMD_CPPFLAGS }, - { false, "CAMD_LDFLAGS", OCTAVE_CONF_CAMD_LDFLAGS }, - { false, "CAMD_LIBS", OCTAVE_CONF_CAMD_LIBS }, - { false, "CARBON_LIBS", OCTAVE_CONF_CARBON_LIBS }, - { false, "CC", OCTAVE_CONF_CC }, - // FIXME: CC_VERSION is deprecated. Remove in version 3.12 - { false, "CC_VERSION", OCTAVE_CONF_CC_VERSION }, - { false, "CCOLAMD_CPPFLAGS", OCTAVE_CONF_CCOLAMD_CPPFLAGS }, - { false, "CCOLAMD_LDFLAGS", OCTAVE_CONF_CCOLAMD_LDFLAGS }, - { false, "CCOLAMD_LIBS", OCTAVE_CONF_CCOLAMD_LIBS }, - { false, "CFLAGS", OCTAVE_CONF_CFLAGS }, - { false, "CHOLMOD_CPPFLAGS", OCTAVE_CONF_CHOLMOD_CPPFLAGS }, - { false, "CHOLMOD_LDFLAGS", OCTAVE_CONF_CHOLMOD_LDFLAGS }, - { false, "CHOLMOD_LIBS", OCTAVE_CONF_CHOLMOD_LIBS }, - { false, "COLAMD_CPPFLAGS", OCTAVE_CONF_COLAMD_CPPFLAGS }, - { false, "COLAMD_LDFLAGS", OCTAVE_CONF_COLAMD_LDFLAGS }, - { false, "COLAMD_LIBS", OCTAVE_CONF_COLAMD_LIBS }, - { false, "CPICFLAG", OCTAVE_CONF_CPICFLAG }, - { false, "CPPFLAGS", OCTAVE_CONF_CPPFLAGS }, - { false, "CURL_CPPFLAGS", OCTAVE_CONF_CURL_CPPFLAGS }, - { false, "CURL_LDFLAGS", OCTAVE_CONF_CURL_LDFLAGS }, - { false, "CURL_LIBS", OCTAVE_CONF_CURL_LIBS }, - { false, "CXSPARSE_CPPFLAGS", OCTAVE_CONF_CXSPARSE_CPPFLAGS }, - { false, "CXSPARSE_LDFLAGS", OCTAVE_CONF_CXSPARSE_LDFLAGS }, - { false, "CXSPARSE_LIBS", OCTAVE_CONF_CXSPARSE_LIBS }, - { false, "CXX", OCTAVE_CONF_CXX }, - { false, "CXXCPP", OCTAVE_CONF_CXXCPP }, - { false, "CXXFLAGS", OCTAVE_CONF_CXXFLAGS }, - { false, "CXXPICFLAG", OCTAVE_CONF_CXXPICFLAG }, - // FIXME: CXX_VERSION is deprecated. Remove in version 3.12 - { false, "CXX_VERSION", OCTAVE_CONF_CXX_VERSION }, - { false, "DEFAULT_PAGER", OCTAVE_DEFAULT_PAGER }, - { false, "DEFS", OCTAVE_CONF_DEFS }, - { false, "DL_LD", OCTAVE_CONF_DL_LD }, - { false, "DL_LDFLAGS", OCTAVE_CONF_DL_LDFLAGS }, - { false, "DL_LIBS", OCTAVE_CONF_DL_LIBS }, - { false, "GCC_VERSION", OCTAVE_CONF_GCC_VERSION }, - { false, "GXX_VERSION", OCTAVE_CONF_GXX_VERSION }, - { false, "ENABLE_DYNAMIC_LINKING", OCTAVE_CONF_ENABLE_DYNAMIC_LINKING }, - { false, "EXEEXT", OCTAVE_CONF_EXEEXT }, - { false, "F77", OCTAVE_CONF_F77 }, - { false, "F77_FLOAT_STORE_FLAG", OCTAVE_CONF_F77_FLOAT_STORE_FLAG }, - { false, "F77_INTEGER_8_FLAG", OCTAVE_CONF_F77_INTEGER_8_FLAG }, - { false, "FC", OCTAVE_CONF_FC }, - { false, "FFLAGS", OCTAVE_CONF_FFLAGS }, - { false, "FFTW3_CPPFLAGS", OCTAVE_CONF_FFTW3_CPPFLAGS }, - { false, "FFTW3_LDFLAGS", OCTAVE_CONF_FFTW3_LDFLAGS }, - { false, "FFTW3_LIBS", OCTAVE_CONF_FFTW3_LIBS }, - { false, "FFTW3F_CPPFLAGS", OCTAVE_CONF_FFTW3F_CPPFLAGS }, - { false, "FFTW3F_LDFLAGS", OCTAVE_CONF_FFTW3F_LDFLAGS }, - { false, "FFTW3F_LIBS", OCTAVE_CONF_FFTW3F_LIBS }, - { false, "FLIBS", OCTAVE_CONF_FLIBS }, - { false, "FPICFLAG", OCTAVE_CONF_FPICFLAG }, - { false, "FT2_CFLAGS", OCTAVE_CONF_FT2_CFLAGS }, - { false, "FT2_LIBS", OCTAVE_CONF_FT2_LIBS }, - { false, "GLPK_CPPFLAGS", OCTAVE_CONF_GLPK_CPPFLAGS }, - { false, "GLPK_LDFLAGS", OCTAVE_CONF_GLPK_LDFLAGS }, - { false, "GLPK_LIBS", OCTAVE_CONF_GLPK_LIBS }, - { false, "GNUPLOT", OCTAVE_CONF_GNUPLOT }, - { false, "GRAPHICS_CFLAGS", OCTAVE_CONF_GRAPHICS_CFLAGS }, - { false, "GRAPHICS_LIBS", OCTAVE_CONF_GRAPHICS_LIBS }, - { false, "HDF5_CPPFLAGS", OCTAVE_CONF_HDF5_CPPFLAGS }, - { false, "HDF5_LDFLAGS", OCTAVE_CONF_HDF5_LDFLAGS }, - { false, "HDF5_LIBS", OCTAVE_CONF_HDF5_LIBS }, - { false, "LAPACK_LIBS", OCTAVE_CONF_LAPACK_LIBS }, - { false, "LDFLAGS", OCTAVE_CONF_LDFLAGS }, - { false, "LD_CXX", OCTAVE_CONF_LD_CXX }, - { false, "LD_STATIC_FLAG", OCTAVE_CONF_LD_STATIC_FLAG }, - { false, "LEX", OCTAVE_CONF_LEX }, - { false, "LEXLIB", OCTAVE_CONF_LEXLIB }, - { false, "LFLAGS", OCTAVE_CONF_LFLAGS }, - { false, "LIBEXT", OCTAVE_CONF_LIBEXT }, - { false, "LIBFLAGS", OCTAVE_CONF_LIBFLAGS }, - { false, "LIBOCTAVE", OCTAVE_CONF_LIBOCTAVE }, - { false, "LIBOCTINTERP", OCTAVE_CONF_LIBOCTINTERP }, - { false, "LIBS", OCTAVE_CONF_LIBS }, - { false, "LLVM_CPPFLAGS", OCTAVE_CONF_LLVM_CPPFLAGS }, - { false, "LLVM_LDFLAGS", OCTAVE_CONF_LLVM_LDFLAGS }, - { false, "LLVM_LIBS", OCTAVE_CONF_LLVM_LIBS }, - { false, "LN_S", OCTAVE_CONF_LN_S }, - { false, "MAGICK_CPPFLAGS", OCTAVE_CONF_MAGICK_CPPFLAGS }, - { false, "MAGICK_LDFLAGS", OCTAVE_CONF_MAGICK_LDFLAGS }, - { false, "MAGICK_LIBS", OCTAVE_CONF_MAGICK_LIBS }, - { false, "MKOCTFILE_DL_LDFLAGS", OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS }, - { false, "OCTAVE_LINK_DEPS", OCTAVE_CONF_OCTAVE_LINK_DEPS }, - { false, "OCTAVE_LINK_OPTS", OCTAVE_CONF_OCTAVE_LINK_OPTS }, - { false, "OCT_LINK_DEPS", OCTAVE_CONF_OCT_LINK_DEPS }, - { false, "OCT_LINK_OPTS", OCTAVE_CONF_OCT_LINK_OPTS }, - { false, "OPENGL_LIBS", OCTAVE_CONF_OPENGL_LIBS }, - { false, "PTHREAD_CFLAGS", OCTAVE_CONF_PTHREAD_CFLAGS }, - { false, "PTHREAD_LIBS", OCTAVE_CONF_PTHREAD_LIBS }, - { false, "QHULL_CPPFLAGS", OCTAVE_CONF_QHULL_CPPFLAGS }, - { false, "QHULL_LDFLAGS", OCTAVE_CONF_QHULL_LDFLAGS }, - { false, "QHULL_LIBS", OCTAVE_CONF_QHULL_LIBS }, - { false, "QRUPDATE_CPPFLAGS", OCTAVE_CONF_QRUPDATE_CPPFLAGS }, - { false, "QRUPDATE_LDFLAGS", OCTAVE_CONF_QRUPDATE_LDFLAGS }, - { false, "QRUPDATE_LIBS", OCTAVE_CONF_QRUPDATE_LIBS }, - { false, "QT_CPPFLAGS", OCTAVE_CONF_QT_CPPFLAGS }, - { false, "QT_LDFLAGS", OCTAVE_CONF_QT_LDFLAGS }, - { false, "QT_LIBS", OCTAVE_CONF_QT_LIBS }, - { false, "RANLIB", OCTAVE_CONF_RANLIB }, - { false, "RDYNAMIC_FLAG", OCTAVE_CONF_RDYNAMIC_FLAG }, - { false, "READLINE_LIBS", OCTAVE_CONF_READLINE_LIBS }, - { false, "REGEX_LIBS", OCTAVE_CONF_REGEX_LIBS }, - { false, "SED", OCTAVE_CONF_SED }, - { false, "SHARED_LIBS", OCTAVE_CONF_SHARED_LIBS }, - { false, "SHLEXT", OCTAVE_CONF_SHLEXT }, - { false, "SHLEXT_VER", OCTAVE_CONF_SHLEXT_VER }, - { false, "SH_LD", OCTAVE_CONF_SH_LD }, - { false, "SH_LDFLAGS", OCTAVE_CONF_SH_LDFLAGS }, - { false, "SONAME_FLAGS", OCTAVE_CONF_SONAME_FLAGS }, - { false, "STATIC_LIBS", OCTAVE_CONF_STATIC_LIBS }, - { false, "TERM_LIBS", OCTAVE_CONF_TERM_LIBS }, - { false, "UMFPACK_CPPFLAGS", OCTAVE_CONF_UMFPACK_CPPFLAGS }, - { false, "UMFPACK_LDFLAGS", OCTAVE_CONF_UMFPACK_LDFLAGS }, - { false, "UMFPACK_LIBS", OCTAVE_CONF_UMFPACK_LIBS }, - { false, "USE_64_BIT_IDX_T", OCTAVE_CONF_USE_64_BIT_IDX_T }, - { false, "WARN_CFLAGS", OCTAVE_CONF_WARN_CFLAGS }, - { false, "WARN_CXXFLAGS", OCTAVE_CONF_WARN_CXXFLAGS }, - { false, "X11_INCFLAGS", OCTAVE_CONF_X11_INCFLAGS }, - { false, "X11_LIBS", OCTAVE_CONF_X11_LIBS }, - { false, "XTRA_CFLAGS", OCTAVE_CONF_XTRA_CFLAGS }, - { false, "XTRA_CXXFLAGS", OCTAVE_CONF_XTRA_CXXFLAGS }, - { false, "YACC", OCTAVE_CONF_YACC }, - { false, "YFLAGS", OCTAVE_CONF_YFLAGS }, - { false, "Z_CPPFLAGS", OCTAVE_CONF_Z_CPPFLAGS }, - { false, "Z_LDFLAGS", OCTAVE_CONF_Z_LDFLAGS }, - { false, "Z_LIBS", OCTAVE_CONF_Z_LIBS }, - { false, "api_version", OCTAVE_API_VERSION }, - { true, "archlibdir", OCTAVE_ARCHLIBDIR }, - { true, "bindir", OCTAVE_BINDIR }, - { false, "canonical_host_type", OCTAVE_CANONICAL_HOST_TYPE }, - { false, "config_opts", OCTAVE_CONF_config_opts }, - { true, "datadir", OCTAVE_DATADIR }, - { true, "datarootdir", OCTAVE_DATAROOTDIR }, - { true, "exec_prefix", OCTAVE_EXEC_PREFIX }, - { true, "fcnfiledir", OCTAVE_FCNFILEDIR }, - { true, "imagedir", OCTAVE_IMAGEDIR }, - { true, "includedir", OCTAVE_INCLUDEDIR }, - { true, "infodir", OCTAVE_INFODIR }, - { true, "infofile", OCTAVE_INFOFILE }, - { true, "libdir", OCTAVE_LIBDIR }, - { true, "libexecdir", OCTAVE_LIBEXECDIR }, - { true, "localapiarchlibdir", OCTAVE_LOCALAPIARCHLIBDIR }, - { true, "localapifcnfiledir", OCTAVE_LOCALAPIFCNFILEDIR }, - { true, "localapioctfiledir", OCTAVE_LOCALAPIOCTFILEDIR }, - { true, "localarchlibdir", OCTAVE_LOCALARCHLIBDIR }, - { true, "localfcnfiledir", OCTAVE_LOCALFCNFILEDIR }, - { true, "localoctfiledir", OCTAVE_LOCALOCTFILEDIR }, - { true, "localstartupfiledir", OCTAVE_LOCALSTARTUPFILEDIR }, - { true, "localverarchlibdir", OCTAVE_LOCALVERARCHLIBDIR }, - { true, "localverfcnfiledir", OCTAVE_LOCALVERFCNFILEDIR }, - { true, "localveroctfiledir", OCTAVE_LOCALVEROCTFILEDIR }, - { true, "man1dir", OCTAVE_MAN1DIR }, - { false, "man1ext", OCTAVE_MAN1EXT }, - { true, "mandir", OCTAVE_MANDIR }, - { true, "octfiledir", OCTAVE_OCTFILEDIR }, - { true, "octetcdir", OCTAVE_OCTETCDIR }, - { true, "octincludedir", OCTAVE_OCTINCLUDEDIR }, - { true, "octlibdir", OCTAVE_OCTLIBDIR }, - { true, "octtestsdir", OCTAVE_OCTTESTSDIR }, - { true, "prefix", OCTAVE_PREFIX }, - { true, "startupfiledir", OCTAVE_STARTUPFILEDIR }, - { false, "version", OCTAVE_VERSION }, - { false, 0, 0 } - }; + { + { false, "ALL_CFLAGS", OCTAVE_CONF_ALL_CFLAGS }, + { false, "ALL_CXXFLAGS", OCTAVE_CONF_ALL_CXXFLAGS }, + { false, "ALL_FFLAGS", OCTAVE_CONF_ALL_FFLAGS }, + { false, "ALL_LDFLAGS", OCTAVE_CONF_ALL_LDFLAGS }, + { false, "AMD_CPPFLAGS", OCTAVE_CONF_AMD_CPPFLAGS }, + { false, "AMD_LDFLAGS", OCTAVE_CONF_AMD_LDFLAGS }, + { false, "AMD_LIBS", OCTAVE_CONF_AMD_LIBS }, + { false, "AR", OCTAVE_CONF_AR }, + { false, "ARFLAGS", OCTAVE_CONF_ARFLAGS }, + { false, "ARPACK_CPPFLAGS", OCTAVE_CONF_ARPACK_CPPFLAGS }, + { false, "ARPACK_LDFLAGS", OCTAVE_CONF_ARPACK_LDFLAGS }, + { false, "ARPACK_LIBS", OCTAVE_CONF_ARPACK_LIBS }, + { false, "BLAS_LIBS", OCTAVE_CONF_BLAS_LIBS }, + { false, "CAMD_CPPFLAGS", OCTAVE_CONF_CAMD_CPPFLAGS }, + { false, "CAMD_LDFLAGS", OCTAVE_CONF_CAMD_LDFLAGS }, + { false, "CAMD_LIBS", OCTAVE_CONF_CAMD_LIBS }, + { false, "CARBON_LIBS", OCTAVE_CONF_CARBON_LIBS }, + { false, "CC", OCTAVE_CONF_CC }, + // FIXME: CC_VERSION is deprecated. Remove in version 3.12 + { false, "CC_VERSION", OCTAVE_CONF_CC_VERSION }, + { false, "CCOLAMD_CPPFLAGS", OCTAVE_CONF_CCOLAMD_CPPFLAGS }, + { false, "CCOLAMD_LDFLAGS", OCTAVE_CONF_CCOLAMD_LDFLAGS }, + { false, "CCOLAMD_LIBS", OCTAVE_CONF_CCOLAMD_LIBS }, + { false, "CFLAGS", OCTAVE_CONF_CFLAGS }, + { false, "CHOLMOD_CPPFLAGS", OCTAVE_CONF_CHOLMOD_CPPFLAGS }, + { false, "CHOLMOD_LDFLAGS", OCTAVE_CONF_CHOLMOD_LDFLAGS }, + { false, "CHOLMOD_LIBS", OCTAVE_CONF_CHOLMOD_LIBS }, + { false, "COLAMD_CPPFLAGS", OCTAVE_CONF_COLAMD_CPPFLAGS }, + { false, "COLAMD_LDFLAGS", OCTAVE_CONF_COLAMD_LDFLAGS }, + { false, "COLAMD_LIBS", OCTAVE_CONF_COLAMD_LIBS }, + { false, "CPICFLAG", OCTAVE_CONF_CPICFLAG }, + { false, "CPPFLAGS", OCTAVE_CONF_CPPFLAGS }, + { false, "CURL_CPPFLAGS", OCTAVE_CONF_CURL_CPPFLAGS }, + { false, "CURL_LDFLAGS", OCTAVE_CONF_CURL_LDFLAGS }, + { false, "CURL_LIBS", OCTAVE_CONF_CURL_LIBS }, + { false, "CXSPARSE_CPPFLAGS", OCTAVE_CONF_CXSPARSE_CPPFLAGS }, + { false, "CXSPARSE_LDFLAGS", OCTAVE_CONF_CXSPARSE_LDFLAGS }, + { false, "CXSPARSE_LIBS", OCTAVE_CONF_CXSPARSE_LIBS }, + { false, "CXX", OCTAVE_CONF_CXX }, + { false, "CXXCPP", OCTAVE_CONF_CXXCPP }, + { false, "CXXFLAGS", OCTAVE_CONF_CXXFLAGS }, + { false, "CXXPICFLAG", OCTAVE_CONF_CXXPICFLAG }, + // FIXME: CXX_VERSION is deprecated. Remove in version 3.12 + { false, "CXX_VERSION", OCTAVE_CONF_CXX_VERSION }, + { false, "DEFAULT_PAGER", OCTAVE_DEFAULT_PAGER }, + { false, "DEFS", OCTAVE_CONF_DEFS }, + { false, "DL_LD", OCTAVE_CONF_DL_LD }, + { false, "DL_LDFLAGS", OCTAVE_CONF_DL_LDFLAGS }, + { false, "DL_LIBS", OCTAVE_CONF_DL_LIBS }, + { false, "GCC_VERSION", OCTAVE_CONF_GCC_VERSION }, + { false, "GXX_VERSION", OCTAVE_CONF_GXX_VERSION }, + { false, "ENABLE_DYNAMIC_LINKING", OCTAVE_CONF_ENABLE_DYNAMIC_LINKING }, + { false, "EXEEXT", OCTAVE_CONF_EXEEXT }, + { false, "F77", OCTAVE_CONF_F77 }, + { false, "F77_FLOAT_STORE_FLAG", OCTAVE_CONF_F77_FLOAT_STORE_FLAG }, + { false, "F77_INTEGER_8_FLAG", OCTAVE_CONF_F77_INTEGER_8_FLAG }, + { false, "FC", OCTAVE_CONF_FC }, + { false, "FFLAGS", OCTAVE_CONF_FFLAGS }, + { false, "FFTW3_CPPFLAGS", OCTAVE_CONF_FFTW3_CPPFLAGS }, + { false, "FFTW3_LDFLAGS", OCTAVE_CONF_FFTW3_LDFLAGS }, + { false, "FFTW3_LIBS", OCTAVE_CONF_FFTW3_LIBS }, + { false, "FFTW3F_CPPFLAGS", OCTAVE_CONF_FFTW3F_CPPFLAGS }, + { false, "FFTW3F_LDFLAGS", OCTAVE_CONF_FFTW3F_LDFLAGS }, + { false, "FFTW3F_LIBS", OCTAVE_CONF_FFTW3F_LIBS }, + { false, "FLIBS", OCTAVE_CONF_FLIBS }, + { false, "FPICFLAG", OCTAVE_CONF_FPICFLAG }, + { false, "FT2_CFLAGS", OCTAVE_CONF_FT2_CFLAGS }, + { false, "FT2_LIBS", OCTAVE_CONF_FT2_LIBS }, + { false, "GLPK_CPPFLAGS", OCTAVE_CONF_GLPK_CPPFLAGS }, + { false, "GLPK_LDFLAGS", OCTAVE_CONF_GLPK_LDFLAGS }, + { false, "GLPK_LIBS", OCTAVE_CONF_GLPK_LIBS }, + { false, "GNUPLOT", OCTAVE_CONF_GNUPLOT }, + { false, "GRAPHICS_CFLAGS", OCTAVE_CONF_GRAPHICS_CFLAGS }, + { false, "GRAPHICS_LIBS", OCTAVE_CONF_GRAPHICS_LIBS }, + { false, "HDF5_CPPFLAGS", OCTAVE_CONF_HDF5_CPPFLAGS }, + { false, "HDF5_LDFLAGS", OCTAVE_CONF_HDF5_LDFLAGS }, + { false, "HDF5_LIBS", OCTAVE_CONF_HDF5_LIBS }, + { false, "LAPACK_LIBS", OCTAVE_CONF_LAPACK_LIBS }, + { false, "LDFLAGS", OCTAVE_CONF_LDFLAGS }, + { false, "LD_CXX", OCTAVE_CONF_LD_CXX }, + { false, "LD_STATIC_FLAG", OCTAVE_CONF_LD_STATIC_FLAG }, + { false, "LEX", OCTAVE_CONF_LEX }, + { false, "LEXLIB", OCTAVE_CONF_LEXLIB }, + { false, "LFLAGS", OCTAVE_CONF_LFLAGS }, + { false, "LIBEXT", OCTAVE_CONF_LIBEXT }, + { false, "LIBFLAGS", OCTAVE_CONF_LIBFLAGS }, + { false, "LIBOCTAVE", OCTAVE_CONF_LIBOCTAVE }, + { false, "LIBOCTINTERP", OCTAVE_CONF_LIBOCTINTERP }, + { false, "LIBS", OCTAVE_CONF_LIBS }, + { false, "LLVM_CPPFLAGS", OCTAVE_CONF_LLVM_CPPFLAGS }, + { false, "LLVM_LDFLAGS", OCTAVE_CONF_LLVM_LDFLAGS }, + { false, "LLVM_LIBS", OCTAVE_CONF_LLVM_LIBS }, + { false, "LN_S", OCTAVE_CONF_LN_S }, + { false, "MAGICK_CPPFLAGS", OCTAVE_CONF_MAGICK_CPPFLAGS }, + { false, "MAGICK_LDFLAGS", OCTAVE_CONF_MAGICK_LDFLAGS }, + { false, "MAGICK_LIBS", OCTAVE_CONF_MAGICK_LIBS }, + { false, "MKOCTFILE_DL_LDFLAGS", OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS }, + { false, "OCTAVE_LINK_DEPS", OCTAVE_CONF_OCTAVE_LINK_DEPS }, + { false, "OCTAVE_LINK_OPTS", OCTAVE_CONF_OCTAVE_LINK_OPTS }, + { false, "OCT_LINK_DEPS", OCTAVE_CONF_OCT_LINK_DEPS }, + { false, "OCT_LINK_OPTS", OCTAVE_CONF_OCT_LINK_OPTS }, + { false, "OPENGL_LIBS", OCTAVE_CONF_OPENGL_LIBS }, + { false, "PTHREAD_CFLAGS", OCTAVE_CONF_PTHREAD_CFLAGS }, + { false, "PTHREAD_LIBS", OCTAVE_CONF_PTHREAD_LIBS }, + { false, "QHULL_CPPFLAGS", OCTAVE_CONF_QHULL_CPPFLAGS }, + { false, "QHULL_LDFLAGS", OCTAVE_CONF_QHULL_LDFLAGS }, + { false, "QHULL_LIBS", OCTAVE_CONF_QHULL_LIBS }, + { false, "QRUPDATE_CPPFLAGS", OCTAVE_CONF_QRUPDATE_CPPFLAGS }, + { false, "QRUPDATE_LDFLAGS", OCTAVE_CONF_QRUPDATE_LDFLAGS }, + { false, "QRUPDATE_LIBS", OCTAVE_CONF_QRUPDATE_LIBS }, + { false, "QT_CPPFLAGS", OCTAVE_CONF_QT_CPPFLAGS }, + { false, "QT_LDFLAGS", OCTAVE_CONF_QT_LDFLAGS }, + { false, "QT_LIBS", OCTAVE_CONF_QT_LIBS }, + { false, "RANLIB", OCTAVE_CONF_RANLIB }, + { false, "RDYNAMIC_FLAG", OCTAVE_CONF_RDYNAMIC_FLAG }, + { false, "READLINE_LIBS", OCTAVE_CONF_READLINE_LIBS }, + { false, "REGEX_LIBS", OCTAVE_CONF_REGEX_LIBS }, + { false, "SED", OCTAVE_CONF_SED }, + { false, "SHARED_LIBS", OCTAVE_CONF_SHARED_LIBS }, + { false, "SHLEXT", OCTAVE_CONF_SHLEXT }, + { false, "SHLEXT_VER", OCTAVE_CONF_SHLEXT_VER }, + { false, "SH_LD", OCTAVE_CONF_SH_LD }, + { false, "SH_LDFLAGS", OCTAVE_CONF_SH_LDFLAGS }, + { false, "SONAME_FLAGS", OCTAVE_CONF_SONAME_FLAGS }, + { false, "STATIC_LIBS", OCTAVE_CONF_STATIC_LIBS }, + { false, "TERM_LIBS", OCTAVE_CONF_TERM_LIBS }, + { false, "UMFPACK_CPPFLAGS", OCTAVE_CONF_UMFPACK_CPPFLAGS }, + { false, "UMFPACK_LDFLAGS", OCTAVE_CONF_UMFPACK_LDFLAGS }, + { false, "UMFPACK_LIBS", OCTAVE_CONF_UMFPACK_LIBS }, + { false, "USE_64_BIT_IDX_T", OCTAVE_CONF_USE_64_BIT_IDX_T }, + { false, "WARN_CFLAGS", OCTAVE_CONF_WARN_CFLAGS }, + { false, "WARN_CXXFLAGS", OCTAVE_CONF_WARN_CXXFLAGS }, + { false, "X11_INCFLAGS", OCTAVE_CONF_X11_INCFLAGS }, + { false, "X11_LIBS", OCTAVE_CONF_X11_LIBS }, + { false, "XTRA_CFLAGS", OCTAVE_CONF_XTRA_CFLAGS }, + { false, "XTRA_CXXFLAGS", OCTAVE_CONF_XTRA_CXXFLAGS }, + { false, "YACC", OCTAVE_CONF_YACC }, + { false, "YFLAGS", OCTAVE_CONF_YFLAGS }, + { false, "Z_CPPFLAGS", OCTAVE_CONF_Z_CPPFLAGS }, + { false, "Z_LDFLAGS", OCTAVE_CONF_Z_LDFLAGS }, + { false, "Z_LIBS", OCTAVE_CONF_Z_LIBS }, + { false, "api_version", OCTAVE_API_VERSION }, + { true, "archlibdir", OCTAVE_ARCHLIBDIR }, + { true, "bindir", OCTAVE_BINDIR }, + { false, "canonical_host_type", OCTAVE_CANONICAL_HOST_TYPE }, + { false, "config_opts", OCTAVE_CONF_config_opts }, + { true, "datadir", OCTAVE_DATADIR }, + { true, "datarootdir", OCTAVE_DATAROOTDIR }, + { true, "exec_prefix", OCTAVE_EXEC_PREFIX }, + { true, "fcnfiledir", OCTAVE_FCNFILEDIR }, + { true, "imagedir", OCTAVE_IMAGEDIR }, + { true, "includedir", OCTAVE_INCLUDEDIR }, + { true, "infodir", OCTAVE_INFODIR }, + { true, "infofile", OCTAVE_INFOFILE }, + { true, "libdir", OCTAVE_LIBDIR }, + { true, "libexecdir", OCTAVE_LIBEXECDIR }, + { true, "localapiarchlibdir", OCTAVE_LOCALAPIARCHLIBDIR }, + { true, "localapifcnfiledir", OCTAVE_LOCALAPIFCNFILEDIR }, + { true, "localapioctfiledir", OCTAVE_LOCALAPIOCTFILEDIR }, + { true, "localarchlibdir", OCTAVE_LOCALARCHLIBDIR }, + { true, "localfcnfiledir", OCTAVE_LOCALFCNFILEDIR }, + { true, "localoctfiledir", OCTAVE_LOCALOCTFILEDIR }, + { true, "localstartupfiledir", OCTAVE_LOCALSTARTUPFILEDIR }, + { true, "localverarchlibdir", OCTAVE_LOCALVERARCHLIBDIR }, + { true, "localverfcnfiledir", OCTAVE_LOCALVERFCNFILEDIR }, + { true, "localveroctfiledir", OCTAVE_LOCALVEROCTFILEDIR }, + { true, "man1dir", OCTAVE_MAN1DIR }, + { false, "man1ext", OCTAVE_MAN1EXT }, + { true, "mandir", OCTAVE_MANDIR }, + { true, "octfiledir", OCTAVE_OCTFILEDIR }, + { true, "octetcdir", OCTAVE_OCTETCDIR }, + { true, "octincludedir", OCTAVE_OCTINCLUDEDIR }, + { true, "octlibdir", OCTAVE_OCTLIBDIR }, + { true, "octtestsdir", OCTAVE_OCTTESTSDIR }, + { true, "prefix", OCTAVE_PREFIX }, + { true, "startupfiledir", OCTAVE_STARTUPFILEDIR }, + { false, "version", OCTAVE_VERSION }, + { false, 0, 0 } + }; if (! initialized) {
--- a/libinterp/corefcn/toplev.h +++ b/libinterp/corefcn/toplev.h @@ -107,11 +107,13 @@ typedef std::deque<call_stack_elt>::iterator iterator; typedef std::deque<call_stack_elt>::const_iterator const_iterator; - typedef std::deque<call_stack_elt>::reverse_iterator reverse_iterator; - typedef std::deque<call_stack_elt>::const_reverse_iterator const_reverse_iterator; + typedef std::deque<call_stack_elt>::reverse_iterator + reverse_iterator; + typedef std::deque<call_stack_elt>::const_reverse_iterator + const_reverse_iterator; static void create_instance (void); - + static bool instance_ok (void) { bool retval = true; @@ -178,7 +180,7 @@ static size_t num_user_code_frames (octave_idx_type& curr_user_frame) { return instance_ok () - ? instance->do_num_user_code_frames (curr_user_frame) : 0; + ? instance->do_num_user_code_frames (curr_user_frame) : 0; } static symbol_table::scope_id current_scope (void) @@ -252,7 +254,7 @@ static bool goto_frame_relative (int n, bool verbose = false) { return instance_ok () - ? instance->do_goto_frame_relative (n, verbose) : false; + ? instance->do_goto_frame_relative (n, verbose) : false; } static void goto_caller_frame (void) @@ -270,7 +272,7 @@ static octave_map backtrace (size_t nskip, octave_idx_type& curr_user_frame) { return instance_ok () - ? instance->do_backtrace (nskip, curr_user_frame) : octave_map (); + ? instance->do_backtrace (nskip, curr_user_frame) : octave_map (); } static octave_map empty_backtrace (void); @@ -326,13 +328,13 @@ symbol_table::scope_id do_current_scope (void) const { return curr_frame > 0 && curr_frame < cs.size () - ? cs[curr_frame].scope : 0; + ? cs[curr_frame].scope : 0; } symbol_table::context_id do_current_context (void) const { return curr_frame > 0 && curr_frame < cs.size () - ? cs[curr_frame].context : 0; + ? cs[curr_frame].context : 0; } octave_function *do_element (size_t n)
--- a/libinterp/corefcn/tril.cc +++ b/libinterp/corefcn/tril.cc @@ -91,7 +91,8 @@ { octave_idx_type j1 = std::min (std::max (zero, k), nc); octave_idx_type j2 = std::min (std::max (zero, nr + k), nc); - octave_idx_type n = ((j2 - j1) * ((j1+1-k) + (j2-k))) / 2 + (nc - j2) * nr; + octave_idx_type n + = ((j2 - j1) * ((j1+1-k) + (j2-k))) / 2 + (nc - j2) * nr; Array<T> r (dim_vector (n, 1)); T *rvec = r.fortran_vec (); for (octave_idx_type j = 0; j < nc; j++) @@ -229,13 +230,15 @@ break; case btyp_complex: if (arg.is_sparse_type ()) - retval = do_trilu (arg.sparse_complex_matrix_value (), k, lower, pack); + retval = do_trilu (arg.sparse_complex_matrix_value (), k, lower, + pack); else retval = do_trilu (arg.complex_array_value (), k, lower, pack); break; case btyp_bool: if (arg.is_sparse_type ()) - retval = do_trilu (arg.sparse_bool_matrix_value (), k, lower, pack); + retval = do_trilu (arg.sparse_bool_matrix_value (), k, lower, + pack); else retval = do_trilu (arg.bool_array_value (), k, lower, pack); break; @@ -340,7 +343,7 @@ } DEFUN (tril, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {} tril (@var{A})\n\ @deftypefnx {Function File} {} tril (@var{A}, @var{k})\n\ @deftypefnx {Function File} {} tril (@var{A}, @var{k}, @var{pack})\n\ @@ -396,7 +399,7 @@ } DEFUN (triu, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {} triu (@var{A})\n\ @deftypefnx {Function File} {} triu (@var{A}, @var{k})\n\ @deftypefnx {Function File} {} triu (@var{A}, @var{k}, @var{pack})\n\ @@ -418,7 +421,7 @@ %! lm3 = [0, 0, 0; 0, 0, 0; 0, 0, 0; 10, 0, 0]; %! lm4 = [0, 0, 0; 0, 0, 0; 0, 0, 0; 0, 0, 0]; %! -%! assert (tril (a, -4), lm4); +%! assert (tril (a, -4), lm4); %! assert (tril (a, -3), lm3); %! assert (tril (a, -2), lm2); %! assert (tril (a, -1), lm1);
--- a/libinterp/corefcn/txt-eng-ft.cc +++ b/libinterp/corefcn/txt-eng-ft.cc @@ -77,40 +77,42 @@ { public: static bool instance_ok (void) - { - bool retval = true; + { + bool retval = true; - if (! instance) - { - instance = new ft_manager (); + if (! instance) + { + instance = new ft_manager (); - if (instance) - singleton_cleanup_list::add (cleanup_instance); - } + if (instance) + singleton_cleanup_list::add (cleanup_instance); + } - if (! instance) - { - ::error ("unable to create ft_manager!"); + if (! instance) + { + ::error ("unable to create ft_manager!"); - retval = false; - } + retval = false; + } - return retval; - } + return retval; + } static void cleanup_instance (void) { delete instance; instance = 0; } static FT_Face get_font (const std::string& name, const std::string& weight, const std::string& angle, double size) - { return (instance_ok () - ? instance->do_get_font (name, weight, angle, size) - : 0); } + { + return (instance_ok () + ? instance->do_get_font (name, weight, angle, size) + : 0); + } static void font_destroyed (FT_Face face) - { - if (instance_ok ()) - instance->do_font_destroyed (face); - } + { + if (instance_ok ()) + instance->do_font_destroyed (face); + } private: @@ -134,162 +136,162 @@ ft_manager (void) : library (), freetype_initialized (false), fontconfig_initialized (false) - { - if (FT_Init_FreeType (&library)) - ::error ("unable to initialize freetype library"); - else - freetype_initialized = true; + { + if (FT_Init_FreeType (&library)) + ::error ("unable to initialize freetype library"); + else + freetype_initialized = true; #if defined (HAVE_FONTCONFIG) - if (! FcInit ()) - ::error ("unable to initialize fontconfig library"); - else - fontconfig_initialized = true; + if (! FcInit ()) + ::error ("unable to initialize fontconfig library"); + else + fontconfig_initialized = true; #endif - } + } ~ft_manager (void) - { - if (freetype_initialized) - FT_Done_FreeType (library); + { + if (freetype_initialized) + FT_Done_FreeType (library); #if defined (HAVE_FONTCONFIG) - // FIXME: Skip the call to FcFini because it can trigger the assertion - // - // octave: fccache.c:507: FcCacheFini: Assertion 'fcCacheChains[i] == ((void *)0)' failed. - // - // if (fontconfig_initialized) - // FcFini (); + // FIXME: Skip the call to FcFini because it can trigger the assertion + // + // octave: fccache.c:507: FcCacheFini: Assertion 'fcCacheChains[i] == ((void *)0)' failed. + // + // if (fontconfig_initialized) + // FcFini (); #endif - } + } FT_Face do_get_font (const std::string& name, const std::string& weight, const std::string& angle, double size) - { - FT_Face retval = 0; + { + FT_Face retval = 0; #if HAVE_FT_REFERENCE_FACE - // Look first into the font cache, then use fontconfig. If the font - // is present in the cache, simply add a reference and return it. + // Look first into the font cache, then use fontconfig. If the font + // is present in the cache, simply add a reference and return it. - ft_key key (name + ":" + weight + ":" + angle, size); - ft_cache::const_iterator it = cache.find (key); + ft_key key (name + ":" + weight + ":" + angle, size); + ft_cache::const_iterator it = cache.find (key); - if (it != cache.end ()) - { - FT_Reference_Face (it->second); - return it->second; - } + if (it != cache.end ()) + { + FT_Reference_Face (it->second); + return it->second; + } #endif - std::string file; + std::string file; #if defined (HAVE_FONTCONFIG) - if (fontconfig_initialized) - { - int fc_weight, fc_angle; + if (fontconfig_initialized) + { + int fc_weight, fc_angle; - if (weight == "bold") - fc_weight = FC_WEIGHT_BOLD; - else if (weight == "light") - fc_weight = FC_WEIGHT_LIGHT; - else if (weight == "demi") - fc_weight = FC_WEIGHT_DEMIBOLD; - else - fc_weight = FC_WEIGHT_NORMAL; + if (weight == "bold") + fc_weight = FC_WEIGHT_BOLD; + else if (weight == "light") + fc_weight = FC_WEIGHT_LIGHT; + else if (weight == "demi") + fc_weight = FC_WEIGHT_DEMIBOLD; + else + fc_weight = FC_WEIGHT_NORMAL; - if (angle == "italic") - fc_angle = FC_SLANT_ITALIC; - else if (angle == "oblique") - fc_angle = FC_SLANT_OBLIQUE; - else - fc_angle = FC_SLANT_ROMAN; + if (angle == "italic") + fc_angle = FC_SLANT_ITALIC; + else if (angle == "oblique") + fc_angle = FC_SLANT_OBLIQUE; + else + fc_angle = FC_SLANT_ROMAN; - FcPattern *pat = FcPatternCreate (); + FcPattern *pat = FcPatternCreate (); - FcPatternAddString (pat, FC_FAMILY, - (reinterpret_cast<const FcChar8*> - (name == "*" ? "sans" : name.c_str ()))); + FcPatternAddString (pat, FC_FAMILY, + (reinterpret_cast<const FcChar8*> + (name == "*" ? "sans" : name.c_str ()))); - FcPatternAddInteger (pat, FC_WEIGHT, fc_weight); - FcPatternAddInteger (pat, FC_SLANT, fc_angle); - FcPatternAddDouble (pat, FC_PIXEL_SIZE, size); + FcPatternAddInteger (pat, FC_WEIGHT, fc_weight); + FcPatternAddInteger (pat, FC_SLANT, fc_angle); + FcPatternAddDouble (pat, FC_PIXEL_SIZE, size); - if (FcConfigSubstitute (0, pat, FcMatchPattern)) - { - FcResult res; - FcPattern *match; + if (FcConfigSubstitute (0, pat, FcMatchPattern)) + { + FcResult res; + FcPattern *match; - FcDefaultSubstitute (pat); - match = FcFontMatch (0, pat, &res); + FcDefaultSubstitute (pat); + match = FcFontMatch (0, pat, &res); - // FIXME: originally, this test also required that - // res != FcResultNoMatch. Is that really needed? - if (match) - { - unsigned char *tmp; + // FIXME: originally, this test also required that + // res != FcResultNoMatch. Is that really needed? + if (match) + { + unsigned char *tmp; - FcPatternGetString (match, FC_FILE, 0, &tmp); - file = reinterpret_cast<char*> (tmp); - } - else - ::warning ("could not match any font: %s-%s-%s-%g", + FcPatternGetString (match, FC_FILE, 0, &tmp); + file = reinterpret_cast<char*> (tmp); + } + else + ::warning ("could not match any font: %s-%s-%s-%g", name.c_str (), weight.c_str (), angle.c_str (), size); - if (match) - FcPatternDestroy (match); - } + if (match) + FcPatternDestroy (match); + } - FcPatternDestroy (pat); - } + FcPatternDestroy (pat); + } #endif - if (file.empty ()) - { + if (file.empty ()) + { #ifdef __WIN32__ - file = "C:/WINDOWS/Fonts/verdana.ttf"; + file = "C:/WINDOWS/Fonts/verdana.ttf"; #else - // FIXME: find a "standard" font for UNIX platforms + // FIXME: find a "standard" font for UNIX platforms #endif - } + } - if (! file.empty ()) - { - if (FT_New_Face (library, file.c_str (), 0, &retval)) - ::warning ("ft_manager: unable to load font: %s", file.c_str ()); + if (! file.empty ()) + { + if (FT_New_Face (library, file.c_str (), 0, &retval)) + ::warning ("ft_manager: unable to load font: %s", file.c_str ()); #if HAVE_FT_REFERENCE_FACE - else - { - // Install a finalizer to notify ft_manager that the font is - // being destroyed. The class ft_manager only keeps weak - // references to font objects. + else + { + // Install a finalizer to notify ft_manager that the font is + // being destroyed. The class ft_manager only keeps weak + // references to font objects. - retval->generic.data = new ft_key (key); - retval->generic.finalizer = ft_face_destroyed; + retval->generic.data = new ft_key (key); + retval->generic.finalizer = ft_face_destroyed; - // Insert loaded font into the cache. + // Insert loaded font into the cache. - cache[key] = retval; - } + cache[key] = retval; + } #endif - } + } - return retval; - } + return retval; + } void do_font_destroyed (FT_Face face) - { - if (face->generic.data) - { - ft_key* pkey = reinterpret_cast<ft_key*> (face->generic.data); + { + if (face->generic.data) + { + ft_key* pkey = reinterpret_cast<ft_key*> (face->generic.data); - cache.erase (*pkey); - delete pkey; - face->generic.data = 0; - } - } + cache.erase (*pkey); + delete pkey; + face->generic.data = 0; + } + } private: FT_Library library; @@ -306,9 +308,9 @@ // --------------------------------------------------------------------------- ft_render::ft_render (void) - : text_processor (), font (), bbox (1, 4, 0.0), halign (0), xoffset (0), - line_yoffset (0), yoffset (0), mode (MODE_BBOX), - color (dim_vector (1, 3), 0) + : text_processor (), font (), bbox (1, 4, 0.0), halign (0), xoffset (0), + line_yoffset (0), yoffset (0), mode (MODE_BBOX), + color (dim_vector (1, 3), 0) { } @@ -331,43 +333,43 @@ switch (mode) { case MODE_BBOX: - { - // Create a new bbox entry based on the current font. + { + // Create a new bbox entry based on the current font. - FT_Face face = font.get_face (); + FT_Face face = font.get_face (); - if (face) - { - int asc = face->size->metrics.ascender >> 6; - int desc = face->size->metrics.descender >> 6; - int h = face->size->metrics.height >> 6; + if (face) + { + int asc = face->size->metrics.ascender >> 6; + int desc = face->size->metrics.descender >> 6; + int h = face->size->metrics.height >> 6; - Matrix bb (1, 5, 0.0); + Matrix bb (1, 5, 0.0); - bb(1) = desc; - bb(3) = asc - desc; - bb(4) = h; + bb(1) = desc; + bb(3) = asc - desc; + bb(4) = h; - line_bbox.push_back (bb); + line_bbox.push_back (bb); - xoffset = yoffset = 0; - } - } + xoffset = yoffset = 0; + } + } break; case MODE_RENDER: - { - // Move to the next line bbox, adjust xoffset based on alignment - // and yoffset based on the old and new line bbox. + { + // Move to the next line bbox, adjust xoffset based on alignment + // and yoffset based on the old and new line bbox. - Matrix old_bbox = line_bbox.front (); - line_bbox.pop_front (); - Matrix new_bbox = line_bbox.front (); + Matrix old_bbox = line_bbox.front (); + line_bbox.pop_front (); + Matrix new_bbox = line_bbox.front (); - xoffset = compute_line_xoffset (new_bbox); - line_yoffset += (old_bbox(1) - (new_bbox(1) + new_bbox(3))); - yoffset = 0; - } + xoffset = compute_line_xoffset (new_bbox); + line_yoffset += (old_bbox(1) - (new_bbox(1) + new_bbox(3))); + yoffset = 0; + } break; } } @@ -520,7 +522,8 @@ if (code == '\n') { glyph_index = FT_Get_Char_Index (face, ' '); - if (!glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)) + if (! glyph_index + || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)) { glyph_index = 0; gripe_missing_glyph (' '); @@ -542,7 +545,8 @@ { FT_Vector delta; - FT_Get_Kerning (face, previous, glyph_index, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning (face, previous, glyph_index, + FT_KERNING_DEFAULT, &delta); xoffset += (delta.x >> 6); } @@ -861,43 +865,43 @@ case ROTATION_0: break; case ROTATION_90: - { - Array<octave_idx_type> perm (dim_vector (3, 1)); - perm(0) = 0; - perm(1) = 2; - perm(2) = 1; - pixels = pixels.permute (perm); + { + Array<octave_idx_type> perm (dim_vector (3, 1)); + perm(0) = 0; + perm(1) = 2; + perm(2) = 1; + pixels = pixels.permute (perm); - Array<idx_vector> idx (dim_vector (3, 1)); - idx(0) = idx_vector (':'); - idx(1) = idx_vector (pixels.dim2 ()-1, -1, -1); - idx(2) = idx_vector (':'); - pixels = uint8NDArray (pixels.index (idx)); - } + Array<idx_vector> idx (dim_vector (3, 1)); + idx(0) = idx_vector (':'); + idx(1) = idx_vector (pixels.dim2 ()-1, -1, -1); + idx(2) = idx_vector (':'); + pixels = uint8NDArray (pixels.index (idx)); + } break; case ROTATION_180: - { - Array<idx_vector> idx (dim_vector (3, 1)); - idx(0) = idx_vector (':'); - idx(1) = idx_vector (pixels.dim2 ()-1, -1, -1); - idx(2)= idx_vector (pixels.dim3 ()-1, -1, -1); - pixels = uint8NDArray (pixels.index (idx)); - } + { + Array<idx_vector> idx (dim_vector (3, 1)); + idx(0) = idx_vector (':'); + idx(1) = idx_vector (pixels.dim2 ()-1, -1, -1); + idx(2)= idx_vector (pixels.dim3 ()-1, -1, -1); + pixels = uint8NDArray (pixels.index (idx)); + } break; case ROTATION_270: - { - Array<octave_idx_type> perm (dim_vector (3, 1)); - perm(0) = 0; - perm(1) = 2; - perm(2) = 1; - pixels = pixels.permute (perm); + { + Array<octave_idx_type> perm (dim_vector (3, 1)); + perm(0) = 0; + perm(1) = 2; + perm(2) = 1; + pixels = pixels.permute (perm); - Array<idx_vector> idx (dim_vector (3, 1)); - idx(0) = idx_vector (':'); - idx(1) = idx_vector (':'); - idx(2) = idx_vector (pixels.dim3 ()-1, -1, -1); - pixels = uint8NDArray (pixels.index (idx)); - } + Array<idx_vector> idx (dim_vector (3, 1)); + idx(0) = idx_vector (':'); + idx(1) = idx_vector (':'); + idx(2) = idx_vector (pixels.dim3 ()-1, -1, -1); + pixels = uint8NDArray (pixels.index (idx)); + } break; } } @@ -1022,8 +1026,8 @@ } ft_render::ft_font::ft_font (const ft_font& ft) - : name (ft.name), weight (ft.weight), angle (ft.angle), size (ft.size), - face (0) + : name (ft.name), weight (ft.weight), angle (ft.angle), size (ft.size), + face (0) { #if HAVE_FT_REFERENCE_FACE FT_Face ft_face = ft.get_face ();
--- a/libinterp/corefcn/txt-eng-ft.h +++ b/libinterp/corefcn/txt-eng-ft.h @@ -40,16 +40,18 @@ ft_render : public text_processor { public: - enum { - MODE_BBOX = 0, - MODE_RENDER = 1 + enum + { + MODE_BBOX = 0, + MODE_RENDER = 1 }; - enum { - ROTATION_0 = 0, - ROTATION_90 = 1, - ROTATION_180 = 2, - ROTATION_270 = 3 + enum + { + ROTATION_0 = 0, + ROTATION_90 = 1, + ROTATION_180 = 2, + ROTATION_270 = 3 }; public: @@ -114,44 +116,44 @@ // Class to hold information about fonts and a strong // reference to the font objects loaded by freetype. class ft_font - { - public: - ft_font (void) - : name (), weight (), angle (), size (0), face (0) { } + { + public: + ft_font (void) + : name (), weight (), angle (), size (0), face (0) { } - ft_font (const std::string& nm, const std::string& wt, - const std::string& ang, double sz, FT_Face f = 0) - : name (nm), weight (wt), angle (ang), size (sz), face (f) { } + ft_font (const std::string& nm, const std::string& wt, + const std::string& ang, double sz, FT_Face f = 0) + : name (nm), weight (wt), angle (ang), size (sz), face (f) { } - ft_font (const ft_font& ft); + ft_font (const ft_font& ft); - ~ft_font (void) - { - if (face) - FT_Done_Face (face); - } + ~ft_font (void) + { + if (face) + FT_Done_Face (face); + } - ft_font& operator = (const ft_font& ft); + ft_font& operator = (const ft_font& ft); - bool is_valid (void) const { return get_face (); } + bool is_valid (void) const { return get_face (); } - std::string get_name (void) const { return name; } + std::string get_name (void) const { return name; } - std::string get_weight (void) const { return weight; } + std::string get_weight (void) const { return weight; } - std::string get_angle (void) const { return angle; } + std::string get_angle (void) const { return angle; } - double get_size (void) const { return size; } + double get_size (void) const { return size; } - FT_Face get_face (void) const; + FT_Face get_face (void) const; - private: - std::string name; - std::string weight; - std::string angle; - double size; - mutable FT_Face face; - }; + private: + std::string name; + std::string weight; + std::string angle; + double size; + mutable FT_Face face; + }; void push_new_line (void);
--- a/libinterp/corefcn/txt-eng.h +++ b/libinterp/corefcn/txt-eng.h @@ -105,9 +105,8 @@ class OCTINTERP_API -text_element_list : - public text_element, - public octave_base_list<text_element *> +text_element_list + : public text_element, public octave_base_list<text_element *> { public: text_element_list (void) @@ -115,17 +114,17 @@ text_element_list (text_element* e) : text_element (), octave_base_list<text_element*> () - { push_back (e); } + { push_back (e); } ~text_element_list (void) - { - while (! empty ()) - { - iterator it = begin (); - delete (*it); - erase (it); - } - } + { + while (! empty ()) + { + iterator it = begin (); + delete (*it); + erase (it); + } + } void accept (text_processor& p); }; @@ -140,10 +139,10 @@ text_element_subscript (char c) : text_element () - { elem = new text_element_string (std::string (1, c)); } + { elem = new text_element_string (std::string (1, c)); } ~text_element_subscript (void) - { delete elem; } + { delete elem; } void accept (text_processor& p); @@ -166,10 +165,10 @@ text_element_superscript (char c) : text_element () - { elem = new text_element_string (std::string (1, c)); } + { elem = new text_element_string (std::string (1, c)); } ~text_element_superscript (void) - { delete elem; } + { delete elem; } void accept (text_processor& p); @@ -192,7 +191,7 @@ text_element_combined (text_element* e1, text_element* e2) : text_element_list(e1) - { push_back (e2); } + { push_back (e2); } void accept (text_processor& p); }; @@ -203,12 +202,12 @@ { public: enum fontstyle - { - normal, - bold, - italic, - oblique - }; + { + normal, + bold, + italic, + oblique + }; text_element_fontstyle (fontstyle st) : text_element (), style (st) { } @@ -275,29 +274,29 @@ public: text_element_color (double r, double g, double b) : text_element (), rgb (1, 3, 0.0) - { - rgb(0) = r; - rgb(1) = g; - rgb(2) = b; - } + { + rgb(0) = r; + rgb(1) = g; + rgb(2) = b; + } text_element_color (const std::string& cname) : text_element (), rgb (1, 3, 0.0) - { + { #define ASSIGN_COLOR(r,g,b) { rgb(0) = r; rgb(1) = g; rgb(2) = b; } - if (cname == "red") ASSIGN_COLOR(1, 0, 0) + if (cname == "red") ASSIGN_COLOR(1, 0, 0) else if (cname == "green") ASSIGN_COLOR(0, 1, 0) - else if (cname == "yellow") ASSIGN_COLOR(1, 1, 0) - else if (cname == "magenta") ASSIGN_COLOR(1, 0, 1) - else if (cname == "blue") ASSIGN_COLOR(0, 0, 1) - else if (cname == "black") ASSIGN_COLOR(0, 0, 0) - else if (cname == "white") ASSIGN_COLOR(1, 1, 1) - else if (cname == "gray") ASSIGN_COLOR(.5, .5, .5) - else if (cname == "darkGreen") ASSIGN_COLOR(0, .5, 0) - else if (cname == "orange") ASSIGN_COLOR(1, .65, 0) - else if (cname == "lightBlue") ASSIGN_COLOR(0.68, .85, .9) + else if (cname == "yellow") ASSIGN_COLOR(1, 1, 0) + else if (cname == "magenta") ASSIGN_COLOR(1, 0, 1) + else if (cname == "blue") ASSIGN_COLOR(0, 0, 1) + else if (cname == "black") ASSIGN_COLOR(0, 0, 0) + else if (cname == "white") ASSIGN_COLOR(1, 1, 1) + else if (cname == "gray") ASSIGN_COLOR(.5, .5, .5) + else if (cname == "darkGreen") ASSIGN_COLOR(0, .5, 0) + else if (cname == "orange") ASSIGN_COLOR(1, .65, 0) + else if (cname == "lightBlue") ASSIGN_COLOR(0.68, .85, .9) #undef ASSIGN_COLOR - } + } ~text_element_color (void) { } @@ -319,19 +318,19 @@ virtual void visit (text_element_symbol&) { } virtual void visit (text_element_list& e) - { - for (text_element_list::iterator it = e.begin (); - it != e.end (); ++it) - { - (*it)->accept (*this); - } - } + { + for (text_element_list::iterator it = e.begin (); + it != e.end (); ++it) + { + (*it)->accept (*this); + } + } virtual void visit (text_element_subscript& e) - { e.get_element ()->accept (*this); } + { e.get_element ()->accept (*this); } virtual void visit (text_element_superscript& e) - { e.get_element ()->accept (*this); } + { e.get_element ()->accept (*this); } virtual void visit (text_element_combined&) { } @@ -398,9 +397,9 @@ // creates... text_element* parse (const std::string& s) - { - return new text_element_string (s); - } + { + return new text_element_string (s); + } }; class @@ -410,10 +409,10 @@ public: text_parser_tex (void) : text_parser (), scanner (0), buffer_state (0), result (0) - { } + { } ~text_parser_tex (void) - { destroy_lexer (); } + { destroy_lexer (); } text_element* parse (const std::string& s);
--- a/libinterp/corefcn/typecast.cc +++ b/libinterp/corefcn/typecast.cc @@ -89,7 +89,7 @@ DEFUN (typecast, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} typecast (@var{x}, @var{class})\n\ Return a new array @var{y} resulting from interpreting the data of\n\ @var{x} in memory as data of the numeric class @var{class}. Both the class\n\ @@ -150,53 +150,69 @@ octave_value array = args(0); if (array.is_bool_type ()) - get_data_and_bytesize (array.bool_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.bool_array_value (), data, byte_size, + old_dims, frame); else if (array.is_string ()) - get_data_and_bytesize (array.char_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.char_array_value (), data, byte_size, + old_dims, frame); else if (array.is_integer_type ()) { if (array.is_int8_type ()) - get_data_and_bytesize (array.int8_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.int8_array_value (), data, byte_size, + old_dims, frame); else if (array.is_int16_type ()) - get_data_and_bytesize (array.int16_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.int16_array_value (), data, byte_size, + old_dims, frame); else if (array.is_int32_type ()) - get_data_and_bytesize (array.int32_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.int32_array_value (), data, byte_size, + old_dims, frame); else if (array.is_int64_type ()) - get_data_and_bytesize (array.int64_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.int64_array_value (), data, byte_size, + old_dims, frame); else if (array.is_uint8_type ()) - get_data_and_bytesize (array.uint8_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.uint8_array_value (), data, byte_size, + old_dims, frame); else if (array.is_uint16_type ()) - get_data_and_bytesize (array.uint16_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.uint16_array_value (), data, byte_size, + old_dims, frame); else if (array.is_uint32_type ()) - get_data_and_bytesize (array.uint32_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.uint32_array_value (), data, byte_size, + old_dims, frame); else if (array.is_uint64_type ()) - get_data_and_bytesize (array.uint64_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.uint64_array_value (), data, byte_size, + old_dims, frame); else assert (0); } else if (array.is_complex_type ()) { if (array.is_single_type ()) - get_data_and_bytesize (array.float_complex_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.float_complex_array_value (), data, + byte_size, old_dims, frame); else - get_data_and_bytesize (array.complex_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.complex_array_value (), data, + byte_size, old_dims, frame); } else if (array.is_real_type ()) { if (array.is_single_type ()) - get_data_and_bytesize (array.float_array_value (), data, byte_size, old_dims, frame); + get_data_and_bytesize (array.float_array_value (), data, byte_size, + old_dims, frame); else - get_data_and_bytesize (array.array_value (), data, byte_size, old_dims, frame); - } + get_data_and_bytesize (array.array_value (), data, byte_size, + old_dims, frame); } else - error ("typecast: invalid input class: %s", array.class_name ().c_str ()); + error ("typecast: invalid input class: %s", + array.class_name ().c_str ()); std::string numclass = args(1).string_value (); if (error_state || numclass.size () == 0) ; else if (numclass == "char") - retval = octave_value (reinterpret_copy<charNDArray> (data, byte_size, old_dims), array.is_dq_string () ? '"' : '\''); + retval = octave_value (reinterpret_copy<charNDArray> + (data, byte_size, old_dims), array.is_dq_string () ? '"' + : '\''); else if (numclass[0] == 'i') { if (numclass == "int8") @@ -213,18 +229,22 @@ if (numclass == "uint8") retval = reinterpret_copy<uint8NDArray> (data, byte_size, old_dims); else if (numclass == "uint16") - retval = reinterpret_copy<uint16NDArray> (data, byte_size, old_dims); + retval = reinterpret_copy<uint16NDArray> (data, byte_size, + old_dims); else if (numclass == "uint32") - retval = reinterpret_copy<uint32NDArray> (data, byte_size, old_dims); + retval = reinterpret_copy<uint32NDArray> (data, byte_size, + old_dims); else if (numclass == "uint64") - retval = reinterpret_copy<uint64NDArray> (data, byte_size, old_dims); + retval = reinterpret_copy<uint64NDArray> (data, byte_size, + old_dims); } else if (numclass == "single") retval = reinterpret_copy<FloatNDArray> (data, byte_size, old_dims); else if (numclass == "double") retval = reinterpret_copy<NDArray> (data, byte_size, old_dims); else if (numclass == "single complex") - retval = reinterpret_copy<FloatComplexNDArray> (data, byte_size, old_dims); + retval = reinterpret_copy<FloatComplexNDArray> (data, byte_size, + old_dims); else if (numclass == "double complex") retval = reinterpret_copy<ComplexNDArray> (data, byte_size, old_dims); @@ -242,7 +262,8 @@ do_bitpack (const boolNDArray& bitp) { typedef typename ArrayType::element_type T; - octave_idx_type n = bitp.numel () / (sizeof (T) * std::numeric_limits<unsigned char>::digits); + octave_idx_type n + = bitp.numel () / (sizeof (T) * std::numeric_limits<unsigned char>::digits); if (n * static_cast<int> (sizeof (T)) * std::numeric_limits<unsigned char>::digits == bitp.numel ()) { @@ -274,7 +295,7 @@ } DEFUN (bitpack, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{y} =} bitpack (@var{x}, @var{class})\n\ Return a new array @var{y} resulting from interpreting an array\n\ @var{x} as raw bit patterns for data of the numeric class @var{class}.\n\ @@ -361,7 +382,8 @@ do_bitunpack (const ArrayType& array) { typedef typename ArrayType::element_type T; - octave_idx_type n = array.numel () * sizeof (T) * std::numeric_limits<unsigned char>::digits; + octave_idx_type n = array.numel () * sizeof (T) + * std::numeric_limits<unsigned char>::digits; boolNDArray retval (get_vec_dims (array.dims (), n)); @@ -383,7 +405,7 @@ } DEFUN (bitunpack, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{y} =} bitunpack (@var{x})\n\ Return an array @var{y} corresponding to the raw bit patterns of\n\ @var{x}. @var{x} must belong to one of the built-in numeric classes:\n\ @@ -411,7 +433,8 @@ { octave_value retval; - if (args.length () == 1 && (args(0).is_numeric_type () || args(0).is_string ())) + if (args.length () == 1 + && (args(0).is_numeric_type () || args(0).is_string ())) { octave_value array = args(0); @@ -453,7 +476,8 @@ retval = do_bitunpack (array.array_value ()); } else - error ("bitunpack: invalid input class: %s", array.class_name ().c_str ()); + error ("bitunpack: invalid input class: %s", + array.class_name ().c_str ()); } else print_usage ();
--- a/libinterp/corefcn/urlwrite.cc +++ b/libinterp/corefcn/urlwrite.cc @@ -93,8 +93,7 @@ static curl_handle get_handle (void) { - return instance_ok () - ? instance->do_get_handle () : curl_handle (); + return instance_ok () ? instance->do_get_handle () : curl_handle (); } static void free (const curl_handle& h) @@ -110,8 +109,8 @@ static curl_handle lookup (const octave_value& val) { - return val.is_real_scalar () - ? lookup (val.double_value ()) : curl_handle (); + return val.is_real_scalar () ? lookup (val.double_value ()) + : curl_handle (); } static url_transfer get_object (double val) @@ -135,7 +134,8 @@ std::ostream& os) { return instance_ok () - ? instance->do_make_curl_handle (host, user, passwd, os) : curl_handle (); + ? instance->do_make_curl_handle (host, user, passwd, os) + : curl_handle (); } static Matrix handle_list (void) @@ -273,7 +273,8 @@ handle_map.erase (p); if (h.value () < 0) - handle_free_list.insert (std::ceil (h.value ()) - make_handle_fraction ()); + handle_free_list.insert + (std::ceil (h.value ()) - make_handle_fraction ()); } else error ("ch_manager::free: invalid object %g", h.value ()); @@ -283,7 +284,7 @@ ch_manager *ch_manager::instance = 0; DEFUN (urlwrite, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} urlwrite (@var{url}, @var{localfile})\n\ @deftypefnx {Loadable Function} {@var{f} =} urlwrite (@var{url}, @var{localfile})\n\ @deftypefnx {Loadable Function} {[@var{f}, @var{success}] =} urlwrite (@var{url}, @var{localfile})\n\ @@ -442,7 +443,7 @@ } DEFUN (urlread, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{s} =} urlread (@var{url})\n\ @deftypefnx {Loadable Function} {[@var{s}, @var{success}] =} urlread (@var{url})\n\ @deftypefnx {Loadable Function} {[@var{s}, @var{success}, @var{message}] =} urlread (@var{url})\n\ @@ -559,7 +560,7 @@ } DEFUN (__ftp__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{handle} =} __ftp__ (@var{host})\n\ @deftypefnx {Loadable Function} {@var{handle} =} __ftp__ (@var{host}, @var{username}, @var{password})\n\ Undocumented internal function\n\ @@ -601,7 +602,7 @@ } DEFUN (__ftp_pwd__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_pwd__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -629,7 +630,7 @@ } DEFUN (__ftp_cwd__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_cwd__ (@var{handle}, @var{path})\n\ Undocumented internal function\n\ @end deftypefn") @@ -667,7 +668,7 @@ } DEFUN (__ftp_dir__, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_dir__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -748,7 +749,7 @@ } DEFUN (__ftp_ascii__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_ascii__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -776,7 +777,7 @@ } DEFUN (__ftp_binary__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_binary__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -804,7 +805,7 @@ } DEFUN (__ftp_close__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_close__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -832,7 +833,7 @@ } DEFUN (__ftp_mode__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_mode__ (@var{handle})\n\ Undocumented internal function\n\ @end deftypefn") @@ -860,7 +861,7 @@ } DEFUN (__ftp_delete__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_delete__ (@var{handle}, @var{path})\n\ Undocumented internal function\n\ @end deftypefn") @@ -895,7 +896,7 @@ } DEFUN (__ftp_rmdir__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_rmdir__ (@var{handle}, @var{path})\n\ Undocumented internal function\n\ @end deftypefn") @@ -930,7 +931,7 @@ } DEFUN (__ftp_mkdir__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_mkdir__ (@var{handle}, @var{path})\n\ Undocumented internal function\n\ @end deftypefn") @@ -965,7 +966,7 @@ } DEFUN (__ftp_rename__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_rename__ (@var{handle}, @var{path})\n\ Undocumented internal function\n\ @end deftypefn") @@ -1001,7 +1002,7 @@ } DEFUN (__ftp_mput__, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_mput__ (@var{handle}, @var{files})\n\ Undocumented internal function\n\ @end deftypefn") @@ -1092,7 +1093,7 @@ } DEFUN (__ftp_mget__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __ftp_mget__ (@var{handle}, @var{files})\n\ Undocumented internal function\n\ @end deftypefn")
--- a/libinterp/corefcn/utils.cc +++ b/libinterp/corefcn/utils.cc @@ -77,7 +77,7 @@ valid_identifier (const char *s) { if (! s || ! (isalpha (*s) || *s == '_' || *s == '$')) - return false; + return false; while (*++s != '\0') if (! (isalnum (*s) || *s == '_' || *s == '$')) @@ -93,7 +93,7 @@ } DEFUN (isvarname, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isvarname (@var{name})\n\ Return true if @var{name} is a valid variable name.\n\ @seealso{iskeyword, exist, who}\n\ @@ -151,7 +151,8 @@ // Ugh. int -keyword_almost_match (const char * const *std, int *min_len, const std::string& s, +keyword_almost_match (const char * const *std, int *min_len, + const std::string& s, int min_toks_to_match, int max_toks) { int status = 0; @@ -229,7 +230,7 @@ goto done; } - done: +done: delete [] kw; delete [] to_match; @@ -287,7 +288,7 @@ } DEFUN (file_in_loadpath, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} file_in_loadpath (@var{file})\n\ @deftypefnx {Built-in Function} {} file_in_loadpath (@var{file}, \"all\")\n\ \n\ @@ -316,7 +317,8 @@ if (! error_state && names.length () > 0) { if (nargin == 1) - retval = octave_env::make_absolute (load_path::find_first_of (names)); + retval = + octave_env::make_absolute (load_path::find_first_of (names)); else if (nargin == 2) { std::string opt = args(1).string_value (); @@ -356,7 +358,7 @@ */ DEFUN (file_in_path, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} file_in_path (@var{path}, @var{file})\n\ @deftypefnx {Built-in Function} {} file_in_path (@var{path}, @var{file}, \"all\")\n\ Return the absolute name of @var{file} if it can be found in\n\ @@ -650,7 +652,7 @@ } DEFUN (do_string_escapes, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} do_string_escapes (@var{string})\n\ Convert special characters in @var{string} to their escaped forms.\n\ @end deftypefn") @@ -748,7 +750,7 @@ } DEFUN (undo_string_escapes, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} undo_string_escapes (@var{s})\n\ Convert special characters in strings back to their escaped forms. For\n\ example, the expression\n\ @@ -809,7 +811,7 @@ */ DEFUN (is_absolute_filename, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} is_absolute_filename (@var{file})\n\ Return true if @var{file} is an absolute filename.\n\ @seealso{is_rooted_relative_filename, make_absolute_filename, isdir}\n\ @@ -834,7 +836,7 @@ */ DEFUN (is_rooted_relative_filename, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} is_rooted_relative_filename (@var{file})\n\ Return true if @var{file} is a rooted-relative filename.\n\ @seealso{is_absolute_filename, make_absolute_filename, isdir}\n\ @@ -859,7 +861,7 @@ */ DEFUN (make_absolute_filename, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} make_absolute_filename (@var{file})\n\ Return the full name of @var{file} beginning from the root of the file\n\ system. No check is done for the existence of @var{file}.\n\ @@ -891,7 +893,7 @@ */ DEFUN (find_dir_in_path, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} find_dir_in_path (@var{dir})\n\ @deftypefnx {Built-in Function} {} find_dir_in_path (@var{dir}, \"all\")\n\ Return the full name of the path element matching @var{dir}. The\n\ @@ -939,7 +941,7 @@ */ DEFUNX ("errno", Ferrno, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{err} =} errno ()\n\ @deftypefnx {Built-in Function} {@var{err} =} errno (@var{val})\n\ @deftypefnx {Built-in Function} {@var{err} =} errno (@var{name})\n\ @@ -998,7 +1000,7 @@ */ DEFUN (errno_list, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} errno_list ()\n\ Return a structure containing the system-dependent errno values.\n\ @end deftypefn") @@ -1280,7 +1282,7 @@ } DEFUN (isindex, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isindex (@var{ind})\n\ @deftypefnx {Built-in Function} {} isindex (@var{ind}, @var{n})\n\ Return true if @var{ind} is a valid index. Valid indices are\n\
--- a/libinterp/corefcn/variables.cc +++ b/libinterp/corefcn/variables.cc @@ -291,8 +291,7 @@ return names; } -// FIXME -- this will have to be much smarter to work -// "correctly". +// FIXME: this will have to be much smarter to work "correctly". bool looks_like_struct (const std::string& text) @@ -353,7 +352,7 @@ } DEFUN (isglobal, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isglobal (@var{name})\n\ Return true if @var{name} is a globally visible variable.\n\ For example:\n\ @@ -518,7 +517,7 @@ } DEFUN (exist, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} exist (@var{name}, @var{type})\n\ Return 1 if the name exists as a variable, 2 if the name is an\n\ absolute file name, an ordinary file in Octave's @code{path}, or (after\n\ @@ -951,13 +950,17 @@ switch (param.modifier) { case 'l': - os << std::setiosflags (std::ios::left) << std::setw (param.parameter_length); - param_buf << std::setiosflags (std::ios::left) << std::setw (param.parameter_length); + os << std::setiosflags (std::ios::left) + << std::setw (param.parameter_length); + param_buf << std::setiosflags (std::ios::left) + << std::setw (param.parameter_length); break; case 'r': - os << std::setiosflags (std::ios::right) << std::setw (param.parameter_length); - param_buf << std::setiosflags (std::ios::right) << std::setw (param.parameter_length); + os << std::setiosflags (std::ios::right) + << std::setw (param.parameter_length); + param_buf << std::setiosflags (std::ios::right) + << std::setw (param.parameter_length); break; case 'c': @@ -971,8 +974,10 @@ break; default: - os << std::setiosflags (std::ios::left) << std::setw (param.parameter_length); - param_buf << std::setiosflags (std::ios::left) << std::setw (param.parameter_length); + os << std::setiosflags (std::ios::left) + << std::setw (param.parameter_length); + param_buf << std::setiosflags (std::ios::left) + << std::setw (param.parameter_length); } if (param.command == 's' && param.modifier == 'c') @@ -990,11 +995,13 @@ << std::setiosflags (std::ios::left) << std::setw (b) << "" << std::resetiosflags (std::ios::left); - param_buf << std::setiosflags (std::ios::left) << std::setw (a) - << "" << std::resetiosflags (std::ios::left) << param.line - << std::setiosflags (std::ios::left) - << std::setw (b) << "" - << std::resetiosflags (std::ios::left); + param_buf << std::setiosflags (std::ios::left) + << std::setw (a) + << "" << std::resetiosflags (std::ios::left) + << param.line + << std::setiosflags (std::ios::left) + << std::setw (b) << "" + << std::resetiosflags (std::ios::left); } } else @@ -1019,7 +1026,7 @@ os << param_buf.str (); } -// FIXME -- This is a bit of a kluge. We'd like to just use val.dims() +// FIXME: This is a bit of a kluge. We'd like to just use val.dims() // and if val is an object, expect that dims will call size if it is // overloaded by a user-defined method. But there are currently some // unresolved const issues that prevent that solution from working. @@ -1088,10 +1095,10 @@ if (param.command == 's') { int front = param.first_parameter_length - - dims_str.find ('x'); + - dims_str.find ('x'); int back = param.parameter_length - - dims_str.length () - - front; + - dims_str.length () + - front; front = (front > 0) ? front : 0; back = (back > 0) ? back : 0; @@ -1408,7 +1415,7 @@ idx += cmd.length (); - // FIXME -- use iostream functions instead of sscanf! + // FIXME: use iostream functions instead of sscanf! if (cmd.find_first_of ("crl") != 1) items = sscanf (cmd.c_str (), "%c%c:%d:%d:%d;", @@ -1583,7 +1590,7 @@ if (! error_state) { std::string newmsg = std::string ("Variables in the file ") + - nm + ":\n\n"; + nm + ":\n\n"; retval = do_who (i, argv, return_list, verbose, newmsg); } @@ -1629,8 +1636,8 @@ ? symbol_table::regexp_global_variables (pat) : symbol_table::regexp_variables (pat); - for (std::list<symbol_table::symbol_record>::const_iterator p = tmp.begin (); - p != tmp.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = tmp.begin (); p != tmp.end (); p++) { if (p->is_variable ()) { @@ -1684,8 +1691,8 @@ ? symbol_table::glob_global_variables (pat) : symbol_table::glob_variables (pat); - for (std::list<symbol_table::symbol_record>::const_iterator p = tmp.begin (); - p != tmp.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = tmp.begin (); p != tmp.end (); p++) { if (p->is_variable ()) { @@ -1739,7 +1746,7 @@ } DEFUN (who, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} who\n\ @deftypefnx {Command} {} who pattern @dots{}\n\ @deftypefnx {Command} {} who option pattern @dots{}\n\ @@ -1789,7 +1796,7 @@ } DEFUN (whos, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} whos\n\ @deftypefnx {Command} {} whos pattern @dots{}\n\ @deftypefnx {Command} {} whos option pattern @dots{}\n\ @@ -1946,7 +1953,7 @@ } DEFUN (mlock, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mlock ()\n\ Lock the current function into memory so that it can't be cleared.\n\ @seealso{munlock, mislocked, persistent}\n\ @@ -1970,7 +1977,7 @@ } DEFUN (munlock, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} munlock ()\n\ @deftypefnx {Built-in Function} {} munlock (@var{fcn})\n\ Unlock the named function @var{fcn}. If no function is named\n\ @@ -2006,7 +2013,7 @@ DEFUN (mislocked, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} mislocked ()\n\ @deftypefnx {Built-in Function} {} mislocked (@var{fcn})\n\ Return true if the named function @var{fcn} is locked. If no function is\n\ @@ -2195,7 +2202,7 @@ { if (exclusive) { - // FIXME -- is this really what we want, or do we + // FIXME: is this really what we want, or do we // somehow want to only clear the functions that are not // shadowed by local variables? It seems that would be a // bit harder to do. @@ -2263,7 +2270,7 @@ while (0) DEFUN (clear, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Command} {} clear [options] pattern @dots{}\n\ Delete the names matching the given patterns from the symbol table. The\n\ pattern may contain the following special characters:\n\ @@ -2468,7 +2475,7 @@ } DEFUN (whos_line_format, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} whos_line_format ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} whos_line_format (@var{new_val})\n\ @deftypefnx {Built-in Function} {} whos_line_format (@var{new_val}, \"local\")\n\ @@ -2546,7 +2553,7 @@ static std::string Vmissing_function_hook = "__unimplemented__"; DEFUN (missing_function_hook, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} missing_function_hook ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} missing_function_hook (@var{new_val})\n\ @deftypefnx {Built-in Function} {} missing_function_hook (@var{new_val}, \"local\")\n\ @@ -2586,7 +2593,7 @@ } DEFUN (__varval__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __varval__ (@var{name})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2611,7 +2618,7 @@ static std::string Vmissing_component_hook; DEFUN (missing_component_hook, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} missing_component_hook ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} missing_component_hook (@var{new_val})\n\ @deftypefnx {Built-in Function} {} missing_component_hook (@var{new_val}, \"local\")\n\
--- a/libinterp/corefcn/variables.h +++ b/libinterp/corefcn/variables.h @@ -74,7 +74,8 @@ extern OCTINTERP_API std::string unique_symbol_name (const std::string& basename); -extern OCTINTERP_API octave_value lookup_function_handle (const std::string& nm); +extern OCTINTERP_API octave_value +lookup_function_handle (const std::string& nm); extern OCTINTERP_API octave_value get_global_value (const std::string& nm, bool silent = false); @@ -130,7 +131,8 @@ set_internal_variable (V ## NM, args, nargout, #NM, CHOICES) extern OCTINTERP_API std::string builtin_string_variable (const std::string&); -extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, double&); +extern OCTINTERP_API int builtin_real_scalar_variable (const std::string&, + double&); extern OCTINTERP_API octave_value builtin_any_variable (const std::string&); extern OCTINTERP_API void bind_ans (const octave_value& val, bool print);
--- a/libinterp/corefcn/xdiv.cc +++ b/libinterp/corefcn/xdiv.cc @@ -71,7 +71,8 @@ if (a_nr != b_nr) { - octave_idx_type a_nc = blas_trans == blas_no_trans ? a.cols () : a.rows (); + octave_idx_type a_nc = blas_trans == blas_no_trans ? a.cols () + : a.rows (); octave_idx_type b_nc = b.cols (); gripe_nonconformant ("operator \\", a_nr, a_nc, b_nr, b_nc); @@ -350,7 +351,8 @@ // -*- 1 -*- Matrix -xleftdiv (const Matrix& a, const Matrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const Matrix& a, const Matrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return Matrix (); @@ -362,7 +364,8 @@ // -*- 2 -*- ComplexMatrix -xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const Matrix& a, const ComplexMatrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return ComplexMatrix (); @@ -375,7 +378,8 @@ // -*- 3 -*- ComplexMatrix -xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const ComplexMatrix& a, const Matrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return ComplexMatrix (); @@ -387,7 +391,8 @@ // -*- 4 -*- ComplexMatrix -xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return ComplexMatrix (); @@ -648,7 +653,8 @@ // -*- 1 -*- FloatMatrix -xleftdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return FloatMatrix (); @@ -660,7 +666,8 @@ // -*- 2 -*- FloatComplexMatrix -xleftdiv (const FloatMatrix& a, const FloatComplexMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const FloatMatrix& a, const FloatComplexMatrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return FloatComplexMatrix (); @@ -673,7 +680,8 @@ // -*- 3 -*- FloatComplexMatrix -xleftdiv (const FloatComplexMatrix& a, const FloatMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const FloatComplexMatrix& a, const FloatMatrix& b, MatrixType &typ, + blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return FloatComplexMatrix (); @@ -685,7 +693,8 @@ // -*- 4 -*- FloatComplexMatrix -xleftdiv (const FloatComplexMatrix& a, const FloatComplexMatrix& b, MatrixType &typ, blas_trans_type transt) +xleftdiv (const FloatComplexMatrix& a, const FloatComplexMatrix& b, + MatrixType &typ, blas_trans_type transt) { if (! mx_leftdiv_conform (a, b, transt)) return FloatComplexMatrix ();
--- a/libinterp/corefcn/xdiv.h +++ b/libinterp/corefcn/xdiv.h @@ -48,38 +48,55 @@ extern Matrix xleftdiv (const Matrix& a, const Matrix& b, MatrixType &typ, blas_trans_type transt = blas_no_trans); extern ComplexMatrix xleftdiv (const Matrix& a, const ComplexMatrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); + MatrixType &typ, + blas_trans_type transt = blas_no_trans); extern ComplexMatrix xleftdiv (const ComplexMatrix& a, const Matrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); + MatrixType &typ, + blas_trans_type transt = blas_no_trans); extern ComplexMatrix xleftdiv (const ComplexMatrix& a, const ComplexMatrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); + MatrixType &typ, + blas_trans_type transt = blas_no_trans); -extern FloatMatrix xdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType &typ); -extern FloatComplexMatrix xdiv (const FloatMatrix& a, const FloatComplexMatrix& b, - MatrixType &typ); -extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, const FloatMatrix& b, - MatrixType &typ); -extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, const FloatComplexMatrix& b, - MatrixType &typ); +extern FloatMatrix xdiv (const FloatMatrix& a, const FloatMatrix& b, + MatrixType &typ); +extern FloatComplexMatrix xdiv (const FloatMatrix& a, + const FloatComplexMatrix& b, + MatrixType &typ); +extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, + const FloatMatrix& b, + MatrixType &typ); +extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, + const FloatComplexMatrix& b, + MatrixType &typ); extern FloatMatrix x_el_div (float a, const FloatMatrix& b); extern FloatComplexMatrix x_el_div (float a, const FloatComplexMatrix& b); extern FloatComplexMatrix x_el_div (const FloatComplex a, const FloatMatrix& b); -extern FloatComplexMatrix x_el_div (const FloatComplex a, const FloatComplexMatrix& b); +extern FloatComplexMatrix x_el_div (const FloatComplex a, + const FloatComplexMatrix& b); extern FloatNDArray x_el_div (float a, const FloatNDArray& b); extern FloatComplexNDArray x_el_div (float a, const FloatComplexNDArray& b); -extern FloatComplexNDArray x_el_div (const FloatComplex a, const FloatNDArray& b); -extern FloatComplexNDArray x_el_div (const FloatComplex a, const FloatComplexNDArray& b); +extern FloatComplexNDArray x_el_div (const FloatComplex a, + const FloatNDArray& b); +extern FloatComplexNDArray x_el_div (const FloatComplex a, + const FloatComplexNDArray& b); -extern FloatMatrix xleftdiv (const FloatMatrix& a, const FloatMatrix& b, MatrixType &typ, +extern FloatMatrix xleftdiv (const FloatMatrix& a, const FloatMatrix& b, + MatrixType &typ, blas_trans_type transt = blas_no_trans); -extern FloatComplexMatrix xleftdiv (const FloatMatrix& a, const FloatComplexMatrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); -extern FloatComplexMatrix xleftdiv (const FloatComplexMatrix& a, const FloatMatrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); -extern FloatComplexMatrix xleftdiv (const FloatComplexMatrix& a, const FloatComplexMatrix& b, - MatrixType &typ, blas_trans_type transt = blas_no_trans); +extern FloatComplexMatrix xleftdiv (const FloatMatrix& a, + const FloatComplexMatrix& b, + MatrixType &typ, + blas_trans_type transt = blas_no_trans); +extern FloatComplexMatrix xleftdiv (const FloatComplexMatrix& a, + const FloatMatrix& b, + MatrixType &typ, + blas_trans_type transt = blas_no_trans); +extern FloatComplexMatrix xleftdiv (const FloatComplexMatrix& a, + const FloatComplexMatrix& b, + MatrixType &typ, + blas_trans_type transt = blas_no_trans); extern Matrix xdiv (const Matrix& a, const DiagMatrix& b); @@ -88,7 +105,8 @@ extern DiagMatrix xdiv (const DiagMatrix& a, const DiagMatrix& b); extern ComplexDiagMatrix xdiv (const ComplexDiagMatrix& a, const DiagMatrix& b); -extern ComplexDiagMatrix xdiv (const ComplexDiagMatrix& a, const ComplexDiagMatrix& b); +extern ComplexDiagMatrix xdiv (const ComplexDiagMatrix& a, + const ComplexDiagMatrix& b); extern FloatMatrix xdiv (const FloatMatrix& a, const FloatDiagMatrix& b); extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, @@ -98,7 +116,8 @@ extern FloatComplexMatrix xdiv (const FloatComplexMatrix& a, const FloatComplexDiagMatrix& b); -extern FloatDiagMatrix xdiv (const FloatDiagMatrix& a, const FloatDiagMatrix& b); +extern FloatDiagMatrix xdiv (const FloatDiagMatrix& a, + const FloatDiagMatrix& b); extern FloatComplexDiagMatrix xdiv (const FloatComplexDiagMatrix& a, const FloatDiagMatrix& b); extern FloatComplexDiagMatrix xdiv (const FloatComplexDiagMatrix& a, @@ -106,11 +125,14 @@ extern Matrix xleftdiv (const DiagMatrix& a, const Matrix& b); extern ComplexMatrix xleftdiv (const DiagMatrix& a, const ComplexMatrix& b); -extern ComplexMatrix xleftdiv (const ComplexDiagMatrix& a, const ComplexMatrix& b); +extern ComplexMatrix xleftdiv (const ComplexDiagMatrix& a, + const ComplexMatrix& b); extern DiagMatrix xleftdiv (const DiagMatrix& a, const DiagMatrix& b); -extern ComplexDiagMatrix xleftdiv (const DiagMatrix& a, const ComplexDiagMatrix& b); -extern ComplexDiagMatrix xleftdiv (const ComplexDiagMatrix& a, const ComplexDiagMatrix& b); +extern ComplexDiagMatrix xleftdiv (const DiagMatrix& a, + const ComplexDiagMatrix& b); +extern ComplexDiagMatrix xleftdiv (const ComplexDiagMatrix& a, + const ComplexDiagMatrix& b); extern FloatMatrix xleftdiv (const FloatDiagMatrix& a, const FloatMatrix& b);
--- a/libinterp/corefcn/xnorm.h +++ b/libinterp/corefcn/xnorm.h @@ -29,9 +29,16 @@ class octave_value; -extern OCTINTERP_API octave_value xnorm (const octave_value& x, const octave_value& p); -extern OCTINTERP_API octave_value xcolnorms (const octave_value& x, const octave_value& p); -extern OCTINTERP_API octave_value xrownorms (const octave_value& x, const octave_value& p); -extern OCTINTERP_API octave_value xfrobnorm (const octave_value& x); +extern OCTINTERP_API octave_value +xnorm (const octave_value& x, const octave_value& p); + +extern OCTINTERP_API octave_value +xcolnorms (const octave_value& x, const octave_value& p); + +extern OCTINTERP_API octave_value +xrownorms (const octave_value& x, const octave_value& p); + +extern OCTINTERP_API octave_value +xfrobnorm (const octave_value& x); #endif
--- a/libinterp/corefcn/xpow.cc +++ b/libinterp/corefcn/xpow.cc @@ -208,8 +208,7 @@ else { // Too much copying? - // FIXME -- we shouldn't do this if the exponent is - // large... + // FIXME: we shouldn't do this if the exponent is large... Matrix atmp; if (btmp < 0) @@ -473,8 +472,7 @@ else { // Too much copying? - // FIXME -- we shouldn't do this if the exponent is - // large... + // FIXME: we shouldn't do this if the exponent is large... ComplexMatrix atmp; if (btmp < 0) @@ -621,8 +619,7 @@ // // * -> not needed. -// FIXME -- these functions need to be fixed so that things -// like +// FIXME: these functions need to be fixed so that things like // // a = -1; b = [ 0, 0.5, 1 ]; r = a .^ b // @@ -1103,8 +1100,7 @@ // // * -> not needed. -// FIXME -- these functions need to be fixed so that things -// like +// FIXME: these functions need to be fixed so that things like // // a = -1; b = [ 0, 0.5, 1 ]; r = a .^ b // @@ -1658,8 +1654,7 @@ else { // Too much copying? - // FIXME -- we shouldn't do this if the exponent is - // large... + // FIXME: we shouldn't do this if the exponent is large... FloatMatrix atmp; if (btmp < 0) @@ -1745,7 +1740,8 @@ { FloatComplexDiagMatrix r (nr, nc); for (octave_idx_type i = 0; i < nc; i++) - r.dgelem (i) = std::pow (static_cast<FloatComplex> (a.dgelem (i)), b); + r.dgelem (i) = std::pow (static_cast<FloatComplex> (a.dgelem (i)), + b); retval = r; } } @@ -1911,8 +1907,7 @@ else { // Too much copying? - // FIXME -- we shouldn't do this if the exponent is - // large... + // FIXME: we shouldn't do this if the exponent is large... FloatComplexMatrix atmp; if (btmp < 0) @@ -2058,8 +2053,7 @@ // // * -> not needed. -// FIXME -- these functions need to be fixed so that things -// like +// FIXME: these functions need to be fixed so that things like // // a = -1; b = [ 0, 0.5, 1 ]; r = a .^ b // @@ -2456,8 +2450,7 @@ // // * -> not needed. -// FIXME -- these functions need to be fixed so that things -// like +// FIXME: these functions need to be fixed so that things like // // a = -1; b = [ 0, 0.5, 1 ]; r = a .^ b //
--- a/libinterp/corefcn/xpow.h +++ b/libinterp/corefcn/xpow.h @@ -57,13 +57,16 @@ extern OCTINTERP_API octave_value xpow (const Complex& a, double b); extern OCTINTERP_API octave_value xpow (const Complex& a, const Matrix& b); extern OCTINTERP_API octave_value xpow (const Complex& a, const Complex& b); -extern OCTINTERP_API octave_value xpow (const Complex& a, const ComplexMatrix& b); +extern OCTINTERP_API octave_value xpow (const Complex& a, + const ComplexMatrix& b); extern OCTINTERP_API octave_value xpow (const ComplexMatrix& a, double b); -extern OCTINTERP_API octave_value xpow (const ComplexMatrix& a, const Complex& b); +extern OCTINTERP_API octave_value xpow (const ComplexMatrix& a, + const Complex& b); extern OCTINTERP_API octave_value xpow (const ComplexDiagMatrix& a, double b); -extern OCTINTERP_API octave_value xpow (const ComplexDiagMatrix& a, const Complex& b); +extern OCTINTERP_API octave_value xpow (const ComplexDiagMatrix& a, + const Complex& b); extern OCTINTERP_API octave_value elem_xpow (double a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (double a, const ComplexMatrix& b); @@ -72,33 +75,47 @@ extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, double b); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, const Matrix& b); extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, const Complex& b); -extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, const ComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const Matrix& a, + const ComplexMatrix& b); extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const Matrix& b); -extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const ComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const Complex& a, + const ComplexMatrix& b); extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const Range& r); extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, double b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, const Matrix& b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, const Complex& b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, const ComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, + const Matrix& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, + const Complex& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexMatrix& a, + const ComplexMatrix& b); extern OCTINTERP_API octave_value elem_xpow (double a, const NDArray& b); extern OCTINTERP_API octave_value elem_xpow (double a, const ComplexNDArray& b); extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, double b); -extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, const NDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, const Complex& b); -extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, const ComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, + const NDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, + const Complex& b); +extern OCTINTERP_API octave_value elem_xpow (const NDArray& a, + const ComplexNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const NDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const Complex& a, const ComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const Complex& a, + const NDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const Complex& a, + const ComplexNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, double b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, const NDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, const Complex& b); -extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, const ComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, + double b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, + const NDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, + const Complex& b); +extern OCTINTERP_API octave_value elem_xpow (const ComplexNDArray& a, + const ComplexNDArray& b); extern OCTINTERP_API octave_value xpow (float a, float b); extern OCTINTERP_API octave_value xpow (float a, const FloatMatrix& b); @@ -106,53 +123,81 @@ extern OCTINTERP_API octave_value xpow (float a, const FloatComplexMatrix& b); extern OCTINTERP_API octave_value xpow (const FloatMatrix& a, float b); -extern OCTINTERP_API octave_value xpow (const FloatMatrix& a, const FloatComplex& b); +extern OCTINTERP_API octave_value xpow (const FloatMatrix& a, + const FloatComplex& b); extern OCTINTERP_API octave_value xpow (const FloatDiagMatrix& a, float b); -extern OCTINTERP_API octave_value xpow (const FloatDiagMatrix& a, const FloatComplex& b); +extern OCTINTERP_API octave_value xpow (const FloatDiagMatrix& a, + const FloatComplex& b); extern OCTINTERP_API octave_value xpow (const FloatComplex& a, float b); -extern OCTINTERP_API octave_value xpow (const FloatComplex& a, const FloatMatrix& b); -extern OCTINTERP_API octave_value xpow (const FloatComplex& a, const FloatComplex& b); -extern OCTINTERP_API octave_value xpow (const FloatComplex& a, const FloatComplexMatrix& b); +extern OCTINTERP_API octave_value xpow (const FloatComplex& a, + const FloatMatrix& b); +extern OCTINTERP_API octave_value xpow (const FloatComplex& a, + const FloatComplex& b); +extern OCTINTERP_API octave_value xpow (const FloatComplex& a, + const FloatComplexMatrix& b); extern OCTINTERP_API octave_value xpow (const FloatComplexMatrix& a, float b); -extern OCTINTERP_API octave_value xpow (const FloatComplexMatrix& a, const FloatComplex& b); +extern OCTINTERP_API octave_value xpow (const FloatComplexMatrix& a, + const FloatComplex& b); -extern OCTINTERP_API octave_value xpow (const FloatComplexDiagMatrix& a, float b); -extern OCTINTERP_API octave_value xpow (const FloatComplexDiagMatrix& a, const FloatComplex& b); +extern OCTINTERP_API octave_value xpow (const FloatComplexDiagMatrix& a, + float b); +extern OCTINTERP_API octave_value xpow (const FloatComplexDiagMatrix& a, + const FloatComplex& b); extern OCTINTERP_API octave_value elem_xpow (float a, const FloatMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (float a, const FloatComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (float a, + const FloatComplexMatrix& b); extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, float b); -extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, const FloatMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, const FloatComplex& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, const FloatComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, + const FloatMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, + const FloatComplex& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatMatrix& a, + const FloatComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, const FloatMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, const FloatComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, + const FloatMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, + const FloatComplexMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, float b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, const FloatMatrix& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, const FloatComplex& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, const FloatComplexMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, + float b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, + const FloatMatrix& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, + const FloatComplex& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexMatrix& a, + const FloatComplexMatrix& b); extern OCTINTERP_API octave_value elem_xpow (float a, const FloatNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (float a, const FloatComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (float a, + const FloatComplexNDArray& b); extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, float b); -extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, const FloatNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, const FloatComplex& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, const FloatComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, + const FloatNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, + const FloatComplex& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatNDArray& a, + const FloatComplexNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, const FloatNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, const FloatComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, + const FloatNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplex& a, + const FloatComplexNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, float b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, const FloatNDArray& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, const FloatComplex& b); -extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, const FloatComplexNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, + float b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, + const FloatNDArray& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, + const FloatComplex& b); +extern OCTINTERP_API octave_value elem_xpow (const FloatComplexNDArray& a, + const FloatComplexNDArray& b); #endif
--- a/libinterp/corefcn/zfstream.cc +++ b/libinterp/corefcn/zfstream.cc @@ -53,8 +53,8 @@ // Default constructor gzfilebuf::gzfilebuf () -: file(0), io_mode(std::ios_base::openmode(0)), own_fd(false), - buffer(0), buffer_size(BIGBUFSIZE), own_buffer(true) + : file(0), io_mode(std::ios_base::openmode(0)), own_fd(false), + buffer(0), buffer_size(BIGBUFSIZE), own_buffer(true) { // No buffers to start with this->disable_buffer (); @@ -74,16 +74,14 @@ // Set compression level and strategy int -gzfilebuf::setcompression (int comp_level, - int comp_strategy) +gzfilebuf::setcompression (int comp_level, int comp_strategy) { return gzsetparams (file, comp_level, comp_strategy); } // Open gzipped file gzfilebuf* -gzfilebuf::open (const char *name, - std::ios_base::openmode mode) +gzfilebuf::open (const char *name, std::ios_base::openmode mode) { // Fail if file already open if (this->is_open ()) @@ -110,8 +108,7 @@ // Attach to gzipped file gzfilebuf* -gzfilebuf::attach (int fd, - std::ios_base::openmode mode) +gzfilebuf::attach (int fd, std::ios_base::openmode mode) { // Fail if file already open if (this->is_open ()) @@ -162,10 +159,9 @@ // Convert int open mode to mode string bool -gzfilebuf::open_mode (std::ios_base::openmode mode, - char* c_mode) const +gzfilebuf::open_mode (std::ios_base::openmode mode, char* c_mode) const { - // FIXME -- do we need testb? + // FIXME: do we need testb? // bool testb = mode & std::ios_base::binary; bool testi = mode & std::ios_base::in; bool testo = mode & std::ios_base::out; @@ -186,10 +182,10 @@ if (testi && !testo && !testt && !testa) strcpy (c_mode, "r"); // No read/write mode yet -// if (testi && testo && !testt && !testa) -// strcpy(c_mode, "r+"); -// if (testi && testo && testt && !testa) -// strcpy(c_mode, "w+"); + // if (testi && testo && !testt && !testa) + // strcpy(c_mode, "r+"); + // if (testi && testo && testt && !testa) + // strcpy(c_mode, "w+"); // Mode string should be empty for invalid combination of flags if (strlen (c_mode) == 0) @@ -286,11 +282,11 @@ // Indicates error or EOF if (bytes_read <= 0) - { - // Reset get area - this->setg (buffer, buffer, buffer); - return traits_type::eof (); - } + { + // Reset get area + this->setg (buffer, buffer, buffer); + return traits_type::eof (); + } // Make all bytes read from file plus the stash available as get area this->setg (buffer, buffer + stash, buffer + bytes_read + stash); @@ -304,43 +300,43 @@ { // Determine whether put area is in use if (this->pbase ()) - { - // Double-check pointer range - if (this->pptr () > this->epptr () || this->pptr () < this->pbase ()) - return traits_type::eof (); - // Add extra character to buffer if not EOF - if (! traits_type::eq_int_type (c, traits_type::eof ())) { - *(this->pptr ()) = traits_type::to_char_type (c); - this->pbump (1); + // Double-check pointer range + if (this->pptr () > this->epptr () || this->pptr () < this->pbase ()) + return traits_type::eof (); + // Add extra character to buffer if not EOF + if (! traits_type::eq_int_type (c, traits_type::eof ())) + { + *(this->pptr ()) = traits_type::to_char_type (c); + this->pbump (1); + } + // Number of characters to write to file + int bytes_to_write = this->pptr () - this->pbase (); + // Overflow doesn't fail if nothing is to be written + if (bytes_to_write > 0) + { + // If the file hasn't been opened for writing, produce error + if (! this->is_open () || !(io_mode & std::ios_base::out)) + return traits_type::eof (); + // If gzipped file won't accept all bytes written to it, fail + if (gzwrite (file, this->pbase (), bytes_to_write) != bytes_to_write) + return traits_type::eof (); + // Reset next pointer to point to pbase on success + this->pbump (-bytes_to_write); + } } - // Number of characters to write to file - int bytes_to_write = this->pptr () - this->pbase (); - // Overflow doesn't fail if nothing is to be written - if (bytes_to_write > 0) + // Write extra character to file if not EOF + else if (! traits_type::eq_int_type (c, traits_type::eof ())) { // If the file hasn't been opened for writing, produce error if (! this->is_open () || !(io_mode & std::ios_base::out)) return traits_type::eof (); - // If gzipped file won't accept all bytes written to it, fail - if (gzwrite (file, this->pbase (), bytes_to_write) != bytes_to_write) + // Impromptu char buffer (allows "unbuffered" output) + char_type last_char = traits_type::to_char_type (c); + // If gzipped file won't accept this character, fail + if (gzwrite (file, &last_char, 1) != 1) return traits_type::eof (); - // Reset next pointer to point to pbase on success - this->pbump (-bytes_to_write); } - } - // Write extra character to file if not EOF - else if (! traits_type::eq_int_type (c, traits_type::eof ())) - { - // If the file hasn't been opened for writing, produce error - if (! this->is_open () || !(io_mode & std::ios_base::out)) - return traits_type::eof (); - // Impromptu char buffer (allows "unbuffered" output) - char_type last_char = traits_type::to_char_type (c); - // If gzipped file won't accept this character, fail - if (gzwrite (file, &last_char, 1) != 1) - return traits_type::eof (); - } // If you got here, you have succeeded (even if c was EOF) // The return value should therefore be non-EOF @@ -352,34 +348,34 @@ // Assign new buffer std::streambuf* -gzfilebuf::setbuf (char_type* p, - std::streamsize n) +gzfilebuf::setbuf (char_type* p, std::streamsize n) { // First make sure stuff is sync'ed, for safety if (this->sync () == -1) return 0; - // If buffering is turned off on purpose via setbuf(0,0), still allocate one... + // If buffering is turned off on purpose via setbuf(0,0), still allocate one. // "Unbuffered" only really refers to put [27.8.1.4.10], while get needs at - // least a buffer of size 1 (very inefficient though, therefore make it bigger?) - // This follows from [27.5.2.4.3]/12 (gptr needs to point at something, it seems) + // least a buffer of size 1 (very inefficient though, therefore make it + // bigger?). This follows from [27.5.2.4.3]/12 (gptr needs to point at + // something, it seems). if (!p || !n) - { - // Replace existing buffer (if any) with small internal buffer - this->disable_buffer (); - buffer = 0; - buffer_size = 0; - own_buffer = true; - this->enable_buffer (); - } + { + // Replace existing buffer (if any) with small internal buffer + this->disable_buffer (); + buffer = 0; + buffer_size = 0; + own_buffer = true; + this->enable_buffer (); + } else - { - // Replace existing buffer (if any) with external buffer - this->disable_buffer (); - buffer = p; - buffer_size = n; - own_buffer = false; - this->enable_buffer (); - } + { + // Replace existing buffer (if any) with external buffer + this->disable_buffer (); + buffer = p; + buffer_size = n; + own_buffer = false; + this->enable_buffer (); + } return this; } @@ -387,7 +383,8 @@ int gzfilebuf::sync () { - return traits_type::eq_int_type (this->overflow (), traits_type::eof ()) ? -1 : 0; + return traits_type::eq_int_type (this->overflow (), + traits_type::eof ()) ? -1 : 0; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -398,37 +395,38 @@ { // If internal buffer required, allocate one if (own_buffer && !buffer) - { - // Check for buffered vs. "unbuffered" - if (buffer_size > 0) { - // Allocate internal buffer - buffer = new char_type [buffer_size]; - // Get area starts empty and will be expanded by underflow as need arises + // Check for buffered vs. "unbuffered" + if (buffer_size > 0) + { + // Allocate internal buffer + buffer = new char_type [buffer_size]; + // Get area starts empty and will be expanded by underflow as needed + this->setg (buffer, buffer, buffer); + // Setup entire internal buffer as put area. + // The one-past-end pointer actually points to the last element of + // the buffer, so that overflow(c) can safely add the extra character + // c to the sequence. These pointers remain in place for the + // duration of the buffer + this->setp (buffer, buffer + buffer_size - 1); + } + else + { + // Even in "unbuffered" case, (small?) get buffer is still required + buffer_size = SMALLBUFSIZE; + buffer = new char_type [buffer_size]; + this->setg (buffer, buffer, buffer); + // "Unbuffered" means no put buffer + this->setp (0, 0); + } + } + else + { + // If buffer already allocated, reset buffer pointers just to make sure no + // stale chars are lying around this->setg (buffer, buffer, buffer); - // Setup entire internal buffer as put area. - // The one-past-end pointer actually points to the last element of the buffer, - // so that overflow(c) can safely add the extra character c to the sequence. - // These pointers remain in place for the duration of the buffer this->setp (buffer, buffer + buffer_size - 1); } - else - { - // Even in "unbuffered" case, (small?) get buffer is still required - buffer_size = SMALLBUFSIZE; - buffer = new char_type [buffer_size]; - this->setg (buffer, buffer, buffer); - // "Unbuffered" means no put buffer - this->setp (0, 0); - } - } - else - { - // If buffer already allocated, reset buffer pointers just to make sure no - // stale chars are lying around - this->setg (buffer, buffer, buffer); - this->setp (buffer, buffer + buffer_size - 1); - } } // Destroy internal buffer @@ -437,24 +435,24 @@ { // If internal buffer exists, deallocate it if (own_buffer && buffer) - { - // Preserve unbuffered status by zeroing size - if (! this->pbase ()) - buffer_size = 0; - delete[] buffer; - buffer = 0; - this->setg (0, 0, 0); - this->setp (0, 0); - } + { + // Preserve unbuffered status by zeroing size + if (! this->pbase ()) + buffer_size = 0; + delete[] buffer; + buffer = 0; + this->setg (0, 0, 0); + this->setp (0, 0); + } else - { - // Reset buffer pointers to initial state if external buffer exists - this->setg (buffer, buffer, buffer); - if (buffer) - this->setp (buffer, buffer + buffer_size - 1); - else - this->setp (0, 0); - } + { + // Reset buffer pointers to initial state if external buffer exists + this->setg (buffer, buffer, buffer); + if (buffer) + this->setp (buffer, buffer + buffer_size - 1); + else + this->setp (0, 0); + } } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -462,7 +460,7 @@ // Seek functions gzfilebuf::pos_type gzfilebuf::seekoff (off_type off, std::ios_base::seekdir way, - std::ios_base::openmode) + std::ios_base::openmode) { pos_type ret = pos_type (off_type (-1)); @@ -521,22 +519,20 @@ // Default constructor initializes stream buffer gzifstream::gzifstream () -: std::istream (0), sb () + : std::istream (0), sb () { this->init (&sb); } // Initialize stream buffer and open file -gzifstream::gzifstream (const char* name, - std::ios_base::openmode mode) -: std::istream (0), sb () +gzifstream::gzifstream (const char* name, std::ios_base::openmode mode) + : std::istream (0), sb () { this->init (&sb); this->open (name, mode); } // Initialize stream buffer and attach to file -gzifstream::gzifstream (int fd, - std::ios_base::openmode mode) -: std::istream (0), sb () +gzifstream::gzifstream (int fd, std::ios_base::openmode mode) + : std::istream (0), sb () { this->init (&sb); this->attach (fd, mode); @@ -544,8 +540,7 @@ // Open file and go into fail() state if unsuccessful void -gzifstream::open (const char* name, - std::ios_base::openmode mode) +gzifstream::open (const char* name, std::ios_base::openmode mode) { if (! sb.open (name, mode | std::ios_base::in)) this->setstate (std::ios_base::failbit); @@ -555,8 +550,7 @@ // Attach to file and go into fail() state if unsuccessful void -gzifstream::attach (int fd, - std::ios_base::openmode mode) +gzifstream::attach (int fd, std::ios_base::openmode mode) { if (! sb.attach (fd, mode | std::ios_base::in)) this->setstate (std::ios_base::failbit); @@ -576,22 +570,20 @@ // Default constructor initializes stream buffer gzofstream::gzofstream () -: std::ostream (0), sb () + : std::ostream (0), sb () { this->init (&sb); } // Initialize stream buffer and open file -gzofstream::gzofstream (const char* name, - std::ios_base::openmode mode) -: std::ostream (0), sb () +gzofstream::gzofstream (const char* name, std::ios_base::openmode mode) + : std::ostream (0), sb () { this->init (&sb); this->open (name, mode); } // Initialize stream buffer and attach to file -gzofstream::gzofstream (int fd, - std::ios_base::openmode mode) -: std::ostream (0), sb () +gzofstream::gzofstream (int fd, std::ios_base::openmode mode) + : std::ostream (0), sb () { this->init (&sb); this->attach (fd, mode); @@ -599,8 +591,7 @@ // Open file and go into fail() state if unsuccessful void -gzofstream::open (const char* name, - std::ios_base::openmode mode) +gzofstream::open (const char* name, std::ios_base::openmode mode) { if (! sb.open (name, mode | std::ios_base::out)) this->setstate (std::ios_base::failbit); @@ -610,8 +601,7 @@ // Attach to file and go into fail() state if unsuccessful void -gzofstream::attach (int fd, - std::ios_base::openmode mode) +gzofstream::attach (int fd, std::ios_base::openmode mode) { if (! sb.attach (fd, mode | std::ios_base::out)) this->setstate (std::ios_base::failbit);
--- a/libinterp/corefcn/zfstream.h +++ b/libinterp/corefcn/zfstream.h @@ -44,10 +44,10 @@ /** * @brief Gzipped file stream buffer class. * - * This class implements basic_filebuf for gzipped files. It doesn't yet support - * seeking (allowed by zlib but slow/limited), putback and read/write access - * (tricky). Otherwise, it attempts to be a drop-in replacement for the standard - * file streambuf. + * This class implements basic_filebuf for gzipped files. It doesn't yet + * support seeking (allowed by zlib but slow/limited), putback and read/write + * access * (tricky). Otherwise, it attempts to be a drop-in replacement for + * the standard file streambuf. */ class gzfilebuf : public std::streambuf { @@ -457,28 +457,28 @@ * as base for the setcompression(int,int) manipulator. */ template<typename T1, typename T2> - class gzomanip2 - { - public: - // Allows insertor to peek at internals - template <typename Ta, typename Tb> - friend gzofstream& - operator<<(gzofstream&, - const gzomanip2<Ta,Tb>&); +class gzomanip2 +{ +public: + // Allows insertor to peek at internals + template <typename Ta, typename Tb> + friend gzofstream& + operator<<(gzofstream&, + const gzomanip2<Ta,Tb>&); - // Constructor - gzomanip2 (gzofstream& (*f)(gzofstream&, T1, T2), - T1 v1, - T2 v2); - private: - // Underlying manipulator function - gzofstream& - (*func)(gzofstream&, T1, T2); + // Constructor + gzomanip2 (gzofstream& (*f)(gzofstream&, T1, T2), + T1 v1, + T2 v2); +private: + // Underlying manipulator function + gzofstream& + (*func)(gzofstream&, T1, T2); - // Arguments for manipulator function - T1 val1; - T2 val2; - }; + // Arguments for manipulator function + T1 val1; + T2 val2; +}; /*****************************************************************************/ @@ -492,18 +492,18 @@ // Manipulator constructor stores arguments template<typename T1, typename T2> - inline - gzomanip2<T1,T2>::gzomanip2 (gzofstream &(*f)(gzofstream &, T1, T2), - T1 v1, - T2 v2) +inline +gzomanip2<T1,T2>::gzomanip2 (gzofstream &(*f)(gzofstream &, T1, T2), + T1 v1, + T2 v2) : func(f), val1(v1), val2(v2) - { } +{ } // Insertor applies underlying manipulator function to stream template<typename T1, typename T2> - inline gzofstream& - operator<<(gzofstream& s, const gzomanip2<T1,T2>& m) - { return (*m.func)(s, m.val1, m.val2); } +inline gzofstream& +operator<<(gzofstream& s, const gzomanip2<T1,T2>& m) +{ return (*m.func)(s, m.val1, m.val2); } // Insert this onto stream to simplify setting of compression level inline gzomanip2<int,int>
--- a/libinterp/dldfcn/__delaunayn__.cc +++ b/libinterp/dldfcn/__delaunayn__.cc @@ -146,7 +146,7 @@ return retval; } - int exitcode = qh_new_qhull (dim, n, pt_array, + int exitcode = qh_new_qhull (dim, n, pt_array, ismalloc, flags, outfile, errfile); if (! exitcode) {
--- a/libinterp/dldfcn/__dsearchn__.cc +++ b/libinterp/dldfcn/__dsearchn__.cc @@ -35,7 +35,7 @@ #include "oct-obj.h" DEFUN_DLD (__dsearchn__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{idx}, @var{d}] =} dsearch (@var{x}, @var{xi})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/dldfcn/__eigs__.cc +++ b/libinterp/dldfcn/__eigs__.cc @@ -130,7 +130,7 @@ } DEFUN_DLD (__eigs__, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{d} =} __eigs__ (@var{A})\n\ @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{k})\n\ @deftypefnx {Loadable Function} {@var{d} =} __eigs__ (@var{A}, @var{k}, @var{sigma})\n\ @@ -437,30 +437,34 @@ if (have_a_fun) nconv = EigsComplexNonSymmetricFunc - (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec, eig_val, - cresid, octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec, + eig_val, cresid, octave_stdout, tol, (nargout > 1), cholB, + disp, maxit); else if (have_sigma) { if (a_is_sparse) nconv = EigsComplexNonSymmetricMatrixShift - (ascm, sigma, k, p, info, eig_vec, eig_val, bscm, permB, - cresid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (ascm, sigma, k, p, info, eig_vec, eig_val, bscm, permB, + cresid, octave_stdout, tol, (nargout > 1), cholB, disp, + maxit); else nconv = EigsComplexNonSymmetricMatrixShift - (acm, sigma, k, p, info, eig_vec, eig_val, bcm, permB, cresid, - octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (acm, sigma, k, p, info, eig_vec, eig_val, bcm, permB, + cresid, octave_stdout, tol, (nargout > 1), cholB, disp, + maxit); } else { if (a_is_sparse) nconv = EigsComplexNonSymmetricMatrix - (ascm, typ, k, p, info, eig_vec, eig_val, bscm, permB, cresid, - octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (ascm, typ, k, p, info, eig_vec, eig_val, bscm, permB, + cresid, octave_stdout, tol, (nargout > 1), cholB, disp, + maxit); else nconv = EigsComplexNonSymmetricMatrix - (acm, typ, k, p, info, eig_vec, eig_val, bcm, permB, cresid, - octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (acm, typ, k, p, info, eig_vec, eig_val, bcm, permB, + cresid, octave_stdout, tol, (nargout > 1), cholB, disp, + maxit); } if (nargout < 2) @@ -480,20 +484,21 @@ if (have_a_fun) nconv = EigsComplexNonSymmetricFunc - (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec, eig_val, - cresid, octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (eigs_complex_func, n, typ, sigma, k, p, info, eig_vec, + eig_val, cresid, octave_stdout, tol, (nargout > 1), cholB, + disp, maxit); else { if (a_is_sparse) nconv = EigsComplexNonSymmetricMatrixShift - (SparseComplexMatrix (asmm), sigma, k, p, info, eig_vec, - eig_val, SparseComplexMatrix (bsmm), permB, cresid, - octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (SparseComplexMatrix (asmm), sigma, k, p, info, eig_vec, + eig_val, SparseComplexMatrix (bsmm), permB, cresid, + octave_stdout, tol, (nargout > 1), cholB, disp, maxit); else nconv = EigsComplexNonSymmetricMatrixShift - (ComplexMatrix (amm), sigma, k, p, info, eig_vec, - eig_val, ComplexMatrix (bmm), permB, cresid, - octave_stdout, tol, (nargout > 1), cholB, disp, maxit); + (ComplexMatrix (amm), sigma, k, p, info, eig_vec, + eig_val, ComplexMatrix (bmm), permB, cresid, + octave_stdout, tol, (nargout > 1), cholB, disp, maxit); } if (nargout < 2) @@ -514,34 +519,34 @@ if (have_a_fun) nconv = EigsRealSymmetricFunc - (eigs_func, n, typ, sigmar, k, p, info, eig_vec, eig_val, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (eigs_func, n, typ, sigmar, k, p, info, eig_vec, + eig_val, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else if (have_sigma) { if (a_is_sparse) nconv = EigsRealSymmetricMatrixShift - (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else nconv = EigsRealSymmetricMatrixShift - (amm, sigmar, k, p, info, eig_vec, eig_val, bmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (amm, sigmar, k, p, info, eig_vec, eig_val, bmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); } else { if (a_is_sparse) nconv = EigsRealSymmetricMatrix - (asmm, typ, k, p, info, eig_vec, eig_val, bsmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (asmm, typ, k, p, info, eig_vec, eig_val, bsmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else nconv = EigsRealSymmetricMatrix - (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB, + resid, octave_stdout, tol, (nargout > 1), cholB, + disp, maxit); } if (nargout < 2) @@ -560,34 +565,34 @@ if (have_a_fun) nconv = EigsRealNonSymmetricFunc - (eigs_func, n, typ, sigmar, k, p, info, eig_vec, eig_val, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (eigs_func, n, typ, sigmar, k, p, info, eig_vec, + eig_val, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else if (have_sigma) { if (a_is_sparse) nconv = EigsRealNonSymmetricMatrixShift - (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (asmm, sigmar, k, p, info, eig_vec, eig_val, bsmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else nconv = EigsRealNonSymmetricMatrixShift - (amm, sigmar, k, p, info, eig_vec, eig_val, bmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (amm, sigmar, k, p, info, eig_vec, eig_val, bmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); } else { if (a_is_sparse) nconv = EigsRealNonSymmetricMatrix - (asmm, typ, k, p, info, eig_vec, eig_val, bsmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (asmm, typ, k, p, info, eig_vec, eig_val, bsmm, + permB, resid, octave_stdout, tol, (nargout > 1), + cholB, disp, maxit); else nconv = EigsRealNonSymmetricMatrix - (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB, - resid, octave_stdout, tol, (nargout > 1), cholB, disp, - maxit); + (amm, typ, k, p, info, eig_vec, eig_val, bmm, permB, + resid, octave_stdout, tol, (nargout > 1), cholB, + disp, maxit); } if (nargout < 2)
--- a/libinterp/dldfcn/__fltk_uigetfile__.cc +++ b/libinterp/dldfcn/__fltk_uigetfile__.cc @@ -45,7 +45,7 @@ #include "file-ops.h" DEFUN_DLD (__fltk_uigetfile__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __fltk_uigetfile__ (@dots{})\n\ Undocumented internal function.\n\ @end deftypefn")
--- a/libinterp/dldfcn/__glpk__.cc +++ b/libinterp/dldfcn/__glpk__.cc @@ -292,9 +292,9 @@ *time = (clock () - t_start) / CLOCKS_PER_SEC; } - glp_delete_prob (lp); + glp_delete_prob (lp); - return errnum; + return errnum; } #endif @@ -352,7 +352,7 @@ while (0) DEFUN_DLD (__glpk__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{values}] =} __glpk__ (@var{args})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -481,15 +481,15 @@ //-- LB argument, default: Free Array<int> freeLB (dim_vector (mrowsc, 1)); for (int i = 0; i < mrowsc; i++) - { - if (xisinf (lb[i])) - { - freeLB(i) = 1; - lb[i] = -octave_Inf; - } - else - freeLB(i) = 0; - } + { + if (xisinf (lb[i])) + { + freeLB(i) = 1; + lb[i] = -octave_Inf; + } + else + freeLB(i) = 0; + } //-- 5th Input. An array of at least length numcols containing the upper //-- bound on each of the variables. @@ -724,9 +724,9 @@ errnum = glpk (sense, mrowsc, mrowsA, c, nz, rn.fortran_vec (), cn.fortran_vec (), a.fortran_vec (), b, ctype, freeLB.fortran_vec (), lb, freeUB.fortran_vec (), ub, - vartype.fortran_vec (), isMIP, lpsolver, save_pb, scale, &par, - xmin.fortran_vec (), &fmin, &status, lambda.fortran_vec (), - redcosts.fortran_vec (), &time); + vartype.fortran_vec (), isMIP, lpsolver, save_pb, scale, + &par, xmin.fortran_vec (), &fmin, &status, + lambda.fortran_vec (), redcosts.fortran_vec (), &time); octave_scalar_map extra;
--- a/libinterp/dldfcn/__init_fltk__.cc +++ b/libinterp/dldfcn/__init_fltk__.cc @@ -260,119 +260,120 @@ static enum { pan_zoom, rotate_zoom, none } gui_mode; void script_cb (Fl_Widget*, void* data) - { - static_cast<uimenu::properties*> (data)->execute_callback (); - } +{ + static_cast<uimenu::properties*> (data)->execute_callback (); +} class fltk_uimenu { public: fltk_uimenu (int xx, int yy, int ww, int hh) - { - menubar = new - Fl_Menu_Bar (xx, yy, ww, hh); - } + { + menubar = new + Fl_Menu_Bar (xx, yy, ww, hh); + } int items_to_show (void) - { - //returns the number of visible menu items - int len = menubar->size (); - int n = 0; - for (int t = 0; t < len; t++ ) - { - const Fl_Menu_Item *m = static_cast<const Fl_Menu_Item*> (&(menubar->menu ()[t])); - if ((m->label () != NULL) && m->visible ()) - n++; - } + { + //returns the number of visible menu items + int len = menubar->size (); + int n = 0; + for (int t = 0; t < len; t++ ) + { + const Fl_Menu_Item *m = static_cast<const Fl_Menu_Item*> (& + (menubar->menu ()[t])); + if ((m->label () != NULL) && m->visible ()) + n++; + } - return n; - } + return n; + } void show (void) - { - menubar->show (); - } + { + menubar->show (); + } void hide (void) - { - menubar->hide (); - } + { + menubar->hide (); + } - bool is_visible (void) - { - return menubar->visible (); - } + bool is_visible (void) + { + return menubar->visible (); + } int find_index_by_name (const std::string& findname) - { - // This function is derived from Greg Ercolano's function - // int GetIndexByName(...), see: - // http://seriss.com/people/erco/fltk/#Menu_ChangeLabel - // He agreed via PM that it can be included in octave using GPLv3 - // Kai Habel (14.10.2010) + { + // This function is derived from Greg Ercolano's function + // int GetIndexByName(...), see: + // http://seriss.com/people/erco/fltk/#Menu_ChangeLabel + // He agreed via PM that it can be included in octave using GPLv3 + // Kai Habel (14.10.2010) - std::string menupath; - for (int t = 0; t < menubar->size (); t++ ) - { - Fl_Menu_Item *m = const_cast<Fl_Menu_Item*> (&(menubar->menu ()[t])); - if (m->submenu ()) - { - // item has submenu - if (!menupath.empty ()) - menupath += "/"; - menupath += m->label (); + std::string menupath; + for (int t = 0; t < menubar->size (); t++ ) + { + Fl_Menu_Item *m = const_cast<Fl_Menu_Item*> (&(menubar->menu ()[t])); + if (m->submenu ()) + { + // item has submenu + if (!menupath.empty ()) + menupath += "/"; + menupath += m->label (); - if (menupath.compare (findname) == 0 ) - return (t); - } - else - { - // End of submenu? Pop back one level. - if (m->label () == NULL) - { - std::size_t idx = menupath.find_last_of ("/"); - if (idx != std::string::npos) - menupath.erase (idx); - else - menupath.clear (); - continue; - } - // Menu item? - std::string itempath = menupath; - if (!itempath.empty ()) - itempath += "/"; - itempath += m->label (); + if (menupath.compare (findname) == 0 ) + return (t); + } + else + { + // End of submenu? Pop back one level. + if (m->label () == NULL) + { + std::size_t idx = menupath.find_last_of ("/"); + if (idx != std::string::npos) + menupath.erase (idx); + else + menupath.clear (); + continue; + } + // Menu item? + std::string itempath = menupath; + if (!itempath.empty ()) + itempath += "/"; + itempath += m->label (); - if (itempath.compare (findname) == 0) - return (t); - } - } - return (-1); - } + if (itempath.compare (findname) == 0) + return (t); + } + } + return (-1); + } Matrix find_uimenu_children (uimenu::properties& uimenup) const - { - Matrix uimenu_childs = uimenup.get_all_children (); - Matrix retval = do_find_uimenu_children (uimenu_childs); - return retval; - } + { + Matrix uimenu_childs = uimenup.get_all_children (); + Matrix retval = do_find_uimenu_children (uimenu_childs); + return retval; + } Matrix find_uimenu_children (figure::properties& figp) const - { - Matrix uimenu_childs = figp.get_all_children (); - Matrix retval = do_find_uimenu_children (uimenu_childs); - return retval; - } + { + Matrix uimenu_childs = figp.get_all_children (); + Matrix retval = do_find_uimenu_children (uimenu_childs); + return retval; + } Matrix do_find_uimenu_children (Matrix uimenu_childs) const - { - octave_idx_type k = 0; + { + octave_idx_type k = 0; - Matrix pos = Matrix (uimenu_childs.numel (), 1); + Matrix pos = Matrix (uimenu_childs.numel (), 1); - for (octave_idx_type ii = 0; ii < uimenu_childs.numel (); ii++) + for (octave_idx_type ii = 0; ii < uimenu_childs.numel (); ii++) { graphics_object kidgo = gh_manager::get_object (uimenu_childs (ii)); @@ -380,271 +381,280 @@ { uimenu_childs(k) = uimenu_childs(ii); pos(k++) = - dynamic_cast<uimenu::properties&> (kidgo.get_properties ()).get_position (); + dynamic_cast<uimenu::properties&> + (kidgo.get_properties ()).get_position (); } } - uimenu_childs.resize (k, 1); - pos.resize (k, 1); - Matrix retval = Matrix (k, 1); - // Don't know if this is the best method to sort. - // Can we avoid the for loop? - Array<octave_idx_type> sidx = pos.sort_rows_idx (DESCENDING); - for (octave_idx_type ii = 0; ii < k; ii++) - retval(ii) = uimenu_childs (sidx(ii)); + uimenu_childs.resize (k, 1); + pos.resize (k, 1); + Matrix retval = Matrix (k, 1); + // Don't know if this is the best method to sort. + // Can we avoid the for loop? + Array<octave_idx_type> sidx = pos.sort_rows_idx (DESCENDING); + for (octave_idx_type ii = 0; ii < k; ii++) + retval(ii) = uimenu_childs (sidx(ii)); - return retval; - } + return retval; + } void delete_entry (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - int idx = find_index_by_name (fltk_label.c_str ()); + { + std::string fltk_label = uimenup.get_fltk_label (); + int idx = find_index_by_name (fltk_label.c_str ()); - if (idx >= 0) - menubar->remove (idx); - } + if (idx >= 0) + menubar->remove (idx); + } void update_accelerator (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); - if (item != NULL) - { - std::string acc = uimenup.get_accelerator (); - if (acc.length () > 0) - { - int key = FL_CTRL + acc[0]; - item->shortcut (key); - } - } - } - } + { + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item ( + fltk_label.c_str ())); + if (item != NULL) + { + std::string acc = uimenup.get_accelerator (); + if (acc.length () > 0) + { + int key = FL_CTRL + acc[0]; + item->shortcut (key); + } + } + } + } void update_callback (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); - if (item != NULL) - { - if (!uimenup.get_callback ().is_empty ()) - item->callback (static_cast<Fl_Callback*> (script_cb), - static_cast<void*> (&uimenup)); - else - item->callback (NULL, static_cast<void*> (0)); - } - } - } + { + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item ( + fltk_label.c_str ())); + if (item != NULL) + { + if (!uimenup.get_callback ().is_empty ()) + item->callback (static_cast<Fl_Callback*> (script_cb), + static_cast<void*> (&uimenup)); + else + item->callback (NULL, static_cast<void*> (0)); + } + } + } void update_enable (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); - if (item != NULL) - { - if (uimenup.is_enable ()) - item->activate (); - else - item->deactivate (); - } - } - } + { + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item ( + fltk_label.c_str ())); + if (item != NULL) + { + if (uimenup.is_enable ()) + item->activate (); + else + item->deactivate (); + } + } + } void update_foregroundcolor (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); - if (item != NULL) - { - Matrix rgb = uimenup.get_foregroundcolor_rgb (); + { + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (menubar->find_item ( + fltk_label.c_str ())); + if (item != NULL) + { + Matrix rgb = uimenup.get_foregroundcolor_rgb (); - uchar r = static_cast<uchar> (gnulib::floor (rgb (0) * 255)); - uchar g = static_cast<uchar> (gnulib::floor (rgb (1) * 255)); - uchar b = static_cast<uchar> (gnulib::floor (rgb (2) * 255)); + uchar r = static_cast<uchar> (gnulib::floor (rgb (0) * 255)); + uchar g = static_cast<uchar> (gnulib::floor (rgb (1) * 255)); + uchar b = static_cast<uchar> (gnulib::floor (rgb (2) * 255)); - item->labelcolor (fl_rgb_color (r, g, b)); - } - } - } + item->labelcolor (fl_rgb_color (r, g, b)); + } + } + } void update_seperator (const uimenu::properties& uimenup) - { - // Matlab places the separator before the current - // menu entry, while fltk places it after. So we need to find - // the previous item in this menu/submenu. (Kai) - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - int itemflags = 0, idx; - int curr_idx = find_index_by_name (fltk_label.c_str ()); + { + // Matlab places the separator before the current + // menu entry, while fltk places it after. So we need to find + // the previous item in this menu/submenu. (Kai) + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + int itemflags = 0, idx; + int curr_idx = find_index_by_name (fltk_label.c_str ()); - for (idx = curr_idx - 1; idx >= 0; idx--) - { - Fl_Menu_Item* item = const_cast<Fl_Menu_Item*> (&menubar->menu () [idx]); - itemflags = item->flags; - if (item->label () != NULL) - break; - } + for (idx = curr_idx - 1; idx >= 0; idx--) + { + Fl_Menu_Item* item + = const_cast<Fl_Menu_Item*> (&menubar->menu () [idx]); + itemflags = item->flags; + if (item->label () != NULL) + break; + } - if (idx >= 0 && idx < menubar->size ()) - { - if (uimenup.is_separator ()) - { - if (idx >= 0 && !(itemflags & FL_SUBMENU)) - menubar->mode (idx, itemflags | FL_MENU_DIVIDER); - } - else - menubar->mode (idx, itemflags & (~FL_MENU_DIVIDER)); - } - } - } + if (idx >= 0 && idx < menubar->size ()) + { + if (uimenup.is_separator ()) + { + if (idx >= 0 && !(itemflags & FL_SUBMENU)) + menubar->mode (idx, itemflags | FL_MENU_DIVIDER); + } + else + menubar->mode (idx, itemflags & (~FL_MENU_DIVIDER)); + } + } + } void update_visible (uimenu::properties& uimenup) - { - std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - Fl_Menu_Item* item - = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); - if (item != NULL) - { - if (uimenup.is_visible ()) - item->show (); - else - item->hide (); - } - } - } + { + std::string fltk_label = uimenup.get_fltk_label (); + if (!fltk_label.empty ()) + { + Fl_Menu_Item* item + = const_cast<Fl_Menu_Item*> (menubar->find_item (fltk_label.c_str ())); + if (item != NULL) + { + if (uimenup.is_visible ()) + item->show (); + else + item->hide (); + } + } + } void add_entry (uimenu::properties& uimenup) - { + { - std::string fltk_label = uimenup.get_fltk_label (); + std::string fltk_label = uimenup.get_fltk_label (); - if (!fltk_label.empty ()) - { - bool item_added = false; - do - { - const Fl_Menu_Item* item - = menubar->find_item (fltk_label.c_str ()); + if (!fltk_label.empty ()) + { + bool item_added = false; + do + { + const Fl_Menu_Item* item + = menubar->find_item (fltk_label.c_str ()); - if (item == NULL) - { - Matrix uimenu_ch = find_uimenu_children (uimenup); - int len = uimenu_ch.numel (); - int flags = 0; - if (len > 0) - flags = FL_SUBMENU; - if (len == 0 && uimenup.is_checked ()) - flags += FL_MENU_TOGGLE + FL_MENU_VALUE; - menubar->add (fltk_label.c_str (), 0, 0, 0, flags); - item_added = true; - } - else - { - //avoid duplicate menulabels - std::size_t idx1 = fltk_label.find_last_of ("("); - std::size_t idx2 = fltk_label.find_last_of (")"); - int len = idx2 - idx1; - int val = 1; - if (len > 0) - { - std::string valstr = fltk_label.substr (idx1 + 1, len - 1); - fltk_label.erase (idx1, len + 1); - val = atoi (valstr.c_str ()); - if (val > 0 && val < 99) - val++; - } - std::ostringstream valstream; - valstream << val; - fltk_label += "(" + valstream.str () + ")"; - } - } - while (!item_added); - uimenup.set_fltk_label (fltk_label); - } - } + if (item == NULL) + { + Matrix uimenu_ch = find_uimenu_children (uimenup); + int len = uimenu_ch.numel (); + int flags = 0; + if (len > 0) + flags = FL_SUBMENU; + if (len == 0 && uimenup.is_checked ()) + flags += FL_MENU_TOGGLE + FL_MENU_VALUE; + menubar->add (fltk_label.c_str (), 0, 0, 0, flags); + item_added = true; + } + else + { + //avoid duplicate menulabels + std::size_t idx1 = fltk_label.find_last_of ("("); + std::size_t idx2 = fltk_label.find_last_of (")"); + int len = idx2 - idx1; + int val = 1; + if (len > 0) + { + std::string valstr = fltk_label.substr (idx1 + 1, len - 1); + fltk_label.erase (idx1, len + 1); + val = atoi (valstr.c_str ()); + if (val > 0 && val < 99) + val++; + } + std::ostringstream valstream; + valstream << val; + fltk_label += "(" + valstream.str () + ")"; + } + } + while (!item_added); + uimenup.set_fltk_label (fltk_label); + } + } void add_to_menu (uimenu::properties& uimenup) - { - Matrix kids = find_uimenu_children (uimenup); - int len = kids.length (); - std::string fltk_label = uimenup.get_fltk_label (); + { + Matrix kids = find_uimenu_children (uimenup); + int len = kids.length (); + std::string fltk_label = uimenup.get_fltk_label (); - add_entry (uimenup); - update_foregroundcolor (uimenup); - update_callback (uimenup); - update_accelerator (uimenup); - update_enable (uimenup); - update_visible (uimenup); - update_seperator (uimenup); + add_entry (uimenup); + update_foregroundcolor (uimenup); + update_callback (uimenup); + update_accelerator (uimenup); + update_enable (uimenup); + update_visible (uimenup); + update_seperator (uimenup); - for (octave_idx_type ii = 0; ii < len; ii++) - { - graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); - if (kgo.valid_object ()) - { - uimenu::properties& kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); - add_to_menu (kprop); - } - } - } + for (octave_idx_type ii = 0; ii < len; ii++) + { + graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); + if (kgo.valid_object ()) + { + uimenu::properties& kprop = dynamic_cast<uimenu::properties&> + (kgo.get_properties ()); + add_to_menu (kprop); + } + } + } void add_to_menu (figure::properties& figp) - { - Matrix kids = find_uimenu_children (figp); - int len = kids.length (); - menubar->clear (); - for (octave_idx_type ii = 0; ii < len; ii++) - { - graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); + { + Matrix kids = find_uimenu_children (figp); + int len = kids.length (); + menubar->clear (); + for (octave_idx_type ii = 0; ii < len; ii++) + { + graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); - if (kgo.valid_object ()) - { - uimenu::properties& kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); - add_to_menu (kprop); - } - } - } + if (kgo.valid_object ()) + { + uimenu::properties& kprop = dynamic_cast<uimenu::properties&> + (kgo.get_properties ()); + add_to_menu (kprop); + } + } + } template <class T_prop> void remove_from_menu (T_prop& prop) - { - Matrix kids; - std::string type = prop.get_type (); - kids = find_uimenu_children (prop); - int len = kids.length (); + { + Matrix kids; + std::string type = prop.get_type (); + kids = find_uimenu_children (prop); + int len = kids.length (); - for (octave_idx_type ii = 0; ii < len; ii++) - { - graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); + for (octave_idx_type ii = 0; ii < len; ii++) + { + graphics_object kgo = gh_manager::get_object (kids (len - (ii + 1))); - if (kgo.valid_object ()) - { - uimenu::properties kprop = dynamic_cast<uimenu::properties&> (kgo.get_properties ()); - remove_from_menu (kprop); - } - } + if (kgo.valid_object ()) + { + uimenu::properties kprop = dynamic_cast<uimenu::properties&> + (kgo.get_properties ()); + remove_from_menu (kprop); + } + } - if (type.compare ("uimenu") == 0) - delete_entry (dynamic_cast<uimenu::properties&> (prop)); - else if (type.compare ("figure") == 0) - menubar->clear (); - } + if (type.compare ("uimenu") == 0) + delete_entry (dynamic_cast<uimenu::properties&> (prop)); + else if (type.compare ("figure") == 0) + menubar->clear (); + } ~fltk_uimenu (void) - { - delete menubar; - } + { + delete menubar; + } private: @@ -1086,20 +1096,20 @@ void view2status (graphics_object ax) { - if (ax && ax.isa ("axes")) - { - axes::properties& ap = - dynamic_cast<axes::properties&> (ax.get_properties ()); - std::stringstream cbuf; - cbuf.precision (4); - cbuf.width (6); - Matrix v (1,2,0); - v = ap.get ("view").matrix_value (); - cbuf << "[azimuth: " << v(0) << ", elevation: " << v(1) << "]"; + if (ax && ax.isa ("axes")) + { + axes::properties& ap = + dynamic_cast<axes::properties&> (ax.get_properties ()); + std::stringstream cbuf; + cbuf.precision (4); + cbuf.width (6); + Matrix v (1,2,0); + v = ap.get ("view").matrix_value (); + cbuf << "[azimuth: " << v(0) << ", elevation: " << v(1) << "]"; - status->value (cbuf.str ().c_str ()); - status->redraw (); - } + status->value (cbuf.str ().c_str ()); + status->redraw (); + } } void set_currentpoint (int px, int py) @@ -1139,12 +1149,12 @@ } int menu_dy () - { - if (uimenu->is_visible ()) - return menu_h; - else - return 0; - } + { + if (uimenu->is_visible ()) + return menu_h; + else + return 0; + } int key2shift (int key) { @@ -1261,22 +1271,22 @@ case 'a': case 'A': axis_auto (); - break; + break; case 'g': case 'G': toggle_grid (); - break; + break; case 'p': case 'P': gui_mode = pan_zoom; - break; + break; case 'r': case 'R': gui_mode = rotate_zoom; - break; + break; } } break; @@ -1299,7 +1309,8 @@ break; case FL_MOVE: - pixel2status (pixel2axes_or_ca (Fl::event_x (), Fl::event_y () - menu_dy ()), + pixel2status (pixel2axes_or_ca (Fl::event_x (), + Fl::event_y () - menu_dy ()), Fl::event_x (), Fl::event_y () - menu_dy ()); break; @@ -1317,7 +1328,7 @@ set_axes_currentpoint (ax_obj, pos_x, pos_y); } - fp.execute_windowbuttondownfcn (Fl::event_button()); + fp.execute_windowbuttondownfcn (Fl::event_button()); if (Fl::event_button () == 1 || Fl::event_button () == 3) return 1; @@ -1337,16 +1348,20 @@ { if (gui_mode == pan_zoom) pixel2status (ax_obj, pos_x, pos_y, - Fl::event_x (), Fl::event_y () - menu_dy ()); + Fl::event_x (), + Fl::event_y () - menu_dy ()); else view2status (ax_obj); axes::properties& ap = - dynamic_cast<axes::properties&> (ax_obj.get_properties ()); + dynamic_cast<axes::properties&> + (ax_obj.get_properties ()); double x0, y0, x1, y1; Matrix pos = fp.get_boundingbox (true); pixel2pos (ax_obj, pos_x, pos_y, x0, y0); - pixel2pos (ax_obj, Fl::event_x (), Fl::event_y () - menu_dy (), x1, y1); + pixel2pos (ax_obj, Fl::event_x (), + Fl::event_y () - menu_dy (), + x1, y1); if (gui_mode == pan_zoom) ap.translate_view (x0, x1, y0, y1); @@ -1354,7 +1369,8 @@ { double daz, del; daz = (Fl::event_x () - pos_x) / pos(2) * 360; - del = (Fl::event_y () - menu_dy () - pos_y) / pos(3) * 360; + del = (Fl::event_y () - menu_dy () - pos_y) + / pos(3) * 360; ap.rotate_view (del, daz); } @@ -1384,7 +1400,8 @@ { graphics_object ax = gh_manager::get_object (pixel2axes_or_ca (Fl::event_x (), - Fl::event_y () - menu_dy ())); + Fl::event_y () + - menu_dy ())); if (ax && ax.isa ("axes")) { axes::properties& ap = @@ -1397,13 +1414,14 @@ // Get the point we're zooming about. double x1, y1; - pixel2pos (ax, Fl::event_x (), Fl::event_y () - menu_dy (), x1, y1); + pixel2pos (ax, Fl::event_x (), Fl::event_y () - menu_dy (), + x1, y1); ap.zoom_about_point (x1, y1, factor, false); mark_modified (); } } - return 1; + return 1; case FL_RELEASE: if (fp.get_windowbuttonupfcn ().is_defined ()) @@ -1418,8 +1436,8 @@ { if (ax_obj && ax_obj.isa ("axes")) { - axes::properties& ap = - dynamic_cast<axes::properties&> (ax_obj.get_properties ()); + axes::properties& ap = dynamic_cast<axes::properties&> + (ax_obj.get_properties ()); ap.set_xlimmode ("auto"); ap.set_ylimmode ("auto"); ap.set_zlimmode ("auto"); @@ -1436,8 +1454,8 @@ double x0,y0,x1,y1; if (ax_obj && ax_obj.isa ("axes")) { - axes::properties& ap = - dynamic_cast<axes::properties&> (ax_obj.get_properties ()); + axes::properties& ap = dynamic_cast<axes::properties&> + (ax_obj.get_properties ()); pixel2pos (ax_obj, pos_x, pos_y, x0, y0); int pos_x1 = Fl::event_x (); int pos_y1 = Fl::event_y () - menu_dy (); @@ -1848,7 +1866,7 @@ if (fobj && fobj.isa ("figure")) { figure::properties& fp = - dynamic_cast<figure::properties&> (fobj.get_properties ()); + dynamic_cast<figure::properties&> (fobj.get_properties ()); if (fp.get___graphics_toolkit__ () == FLTK_GRAPHICS_TOOLKIT_NAME) figure_manager::new_window (fp); @@ -1910,9 +1928,10 @@ std::string fltk_label = uimenup.get_label (); graphics_object go = gh_manager::get_object (uimenu_obj.get_parent ()); if (go.isa ("uimenu")) - fltk_label = dynamic_cast<const uimenu::properties&> (go.get_properties ()).get_fltk_label () - + "/" - + fltk_label; + fltk_label = dynamic_cast<const uimenu::properties&> + (go.get_properties ()).get_fltk_label () + + "/" + + fltk_label; else if (go.isa ("figure")) ; else @@ -1936,8 +1955,8 @@ switch (id) { case base_properties::ID_VISIBLE: - figure_manager::toggle_window_visibility - (ov.string_value (), fp.is_visible ()); + figure_manager::toggle_window_visibility (ov.string_value (), + fp.is_visible ()); break; case figure::properties::ID_MENUBAR: @@ -1946,8 +1965,8 @@ break; case figure::properties::ID_CURRENTAXES: - figure_manager::update_canvas - (go.get_handle (), fp.get_currentaxes ()); + figure_manager::update_canvas (go.get_handle (), + fp.get_currentaxes ()); break; case figure::properties::ID_NAME: @@ -2042,7 +2061,7 @@ #endif DEFUN_DLD (__fltk_redraw__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __fltk_redraw__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2059,7 +2078,7 @@ // Initialize the fltk graphics toolkit. DEFUN_DLD (__init_fltk__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __init_fltk__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2088,7 +2107,7 @@ } DEFUN_DLD (__fltk_maxtime__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{maxtime} =} __fltk_maxtime__ ()\n\ @deftypefnx {Loadable Function} {} __fltk_maxtime__ (@var{maxtime})\n\ Undocumented internal function.\n\ @@ -2113,7 +2132,7 @@ } DEFUN_DLD (__have_fltk__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{FLTK_available} =} __have_fltk__ ()\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2137,7 +2156,7 @@ // just changing function names and docstrings. DEFUN_DLD (mouse_wheel_zoom, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{val} =} mouse_wheel_zoom ()\n\ @deftypefnx {Loadable Function} {@var{old_val} =} mouse_wheel_zoom (@var{new_val})\n\ @deftypefnx {Loadable Function} {} mouse_wheel_zoom (@var{new_val}, \"local\")\n\ @@ -2165,7 +2184,7 @@ } DEFUN_DLD (gui_mode, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{mode} =} gui_mode ()\n\ @deftypefnx {Built-in Function} {} gui_mode (@var{mode})\n\ Query or set the GUI mode for the current graphics toolkit.\n\
--- a/libinterp/dldfcn/__init_gnuplot__.cc +++ b/libinterp/dldfcn/__init_gnuplot__.cc @@ -48,83 +48,83 @@ { public: gnuplot_graphics_toolkit (void) - : base_graphics_toolkit ("gnuplot") { } + : base_graphics_toolkit ("gnuplot") { } ~gnuplot_graphics_toolkit (void) { } bool is_valid (void) const { return true; } bool initialize (const graphics_object& go) - { - return go.isa ("figure"); - } + { + return go.isa ("figure"); + } void finalize (const graphics_object& go) - { - if (go.isa ("figure")) - { - const figure::properties& props = - dynamic_cast<const figure::properties&> (go.get_properties ()); + { + if (go.isa ("figure")) + { + const figure::properties& props = + dynamic_cast<const figure::properties&> (go.get_properties ()); - send_quit (props.get___plot_stream__ ()); - } - } + send_quit (props.get___plot_stream__ ()); + } + } void update (const graphics_object& go, int id) - { - if (go.isa ("figure")) - { - graphics_object obj (go); + { + if (go.isa ("figure")) + { + graphics_object obj (go); - figure::properties& props = - dynamic_cast<figure::properties&> (obj.get_properties ()); + figure::properties& props = + dynamic_cast<figure::properties&> (obj.get_properties ()); - switch (id) - { - case base_properties::ID_VISIBLE: - if (! props.is_visible ()) - { - send_quit (props.get___plot_stream__ ()); - props.set___plot_stream__ (Matrix ()); - props.set___enhanced__ (false); - } - break; - } - } - } + switch (id) + { + case base_properties::ID_VISIBLE: + if (! props.is_visible ()) + { + send_quit (props.get___plot_stream__ ()); + props.set___plot_stream__ (Matrix ()); + props.set___enhanced__ (false); + } + break; + } + } + } void redraw_figure (const graphics_object& go) const - { - octave_value_list args; - args(0) = go.get_handle ().as_octave_value (); - feval ("__gnuplot_drawnow__", args); - } + { + octave_value_list args; + args(0) = go.get_handle ().as_octave_value (); + feval ("__gnuplot_drawnow__", args); + } void print_figure (const graphics_object& go, const std::string& term, const std::string& file, bool mono, const std::string& debug_file) const - { - octave_value_list args; - if (! debug_file.empty ()) - args(4) = debug_file; - args(3) = mono; - args(2) = file; - args(1) = term; - args(0) = go.get_handle ().as_octave_value (); - feval ("__gnuplot_drawnow__", args); - } + { + octave_value_list args; + if (! debug_file.empty ()) + args(4) = debug_file; + args(3) = mono; + args(2) = file; + args(1) = term; + args(0) = go.get_handle ().as_octave_value (); + feval ("__gnuplot_drawnow__", args); + } Matrix get_canvas_size (const graphics_handle&) const - { - Matrix sz (1, 2, 0.0); - return sz; - } + { + Matrix sz (1, 2, 0.0); + return sz; + } double get_screen_resolution (void) const - { return 72.0; } + { return 72.0; } Matrix get_screen_size (void) const - { return Matrix (1, 2, 0.0); } + { return Matrix (1, 2, 0.0); } void close (void) { @@ -141,29 +141,29 @@ private: void send_quit (const octave_value& pstream) const - { - if (! pstream.is_empty ()) - { - octave_value_list args; - Matrix fids = pstream.matrix_value (); + { + if (! pstream.is_empty ()) + { + octave_value_list args; + Matrix fids = pstream.matrix_value (); - if (! error_state) - { - Ffputs (ovl (fids(0), "\nquit;\n")); + if (! error_state) + { + Ffputs (ovl (fids(0), "\nquit;\n")); - Ffflush (ovl (fids(0))); - Fpclose (ovl (fids(0))); + Ffflush (ovl (fids(0))); + Fpclose (ovl (fids(0))); - if (fids.numel () > 1) - { - Fpclose (ovl (fids(1))); + if (fids.numel () > 1) + { + Fpclose (ovl (fids(1))); - if (fids.numel () > 2) - Fwaitpid (ovl (fids(2))); - } - } - } - } + if (fids.numel () > 2) + Fwaitpid (ovl (fids(2))); + } + } + } + } }; // Initialize the fltk graphics toolkit.
--- a/libinterp/dldfcn/__magick_read__.cc +++ b/libinterp/dldfcn/__magick_read__.cc @@ -211,12 +211,12 @@ T img = T (dim_vector (nRows, nCols, 1, nFrames)); P* img_fvec = img.fortran_vec (); - const octave_idx_type row_start = region["row_start"]; - const octave_idx_type col_start = region["col_start"]; - const octave_idx_type row_shift = region["row_shift"]; - const octave_idx_type col_shift = region["col_shift"]; - const octave_idx_type row_cache = region["row_cache"]; - const octave_idx_type col_cache = region["col_cache"]; + const octave_idx_type row_start = region["row_start"]; + const octave_idx_type col_start = region["col_start"]; + const octave_idx_type row_shift = region["row_shift"]; + const octave_idx_type col_shift = region["col_shift"]; + const octave_idx_type row_cache = region["row_cache"]; + const octave_idx_type col_cache = region["col_cache"]; // When reading PixelPackets from the Image Pixel Cache, they come in // row major order. So we keep moving back and forth there so we can @@ -242,7 +242,7 @@ } retval(0) = octave_value (img); -// Only bother reading the colormap if it was requested as output. + // Only bother reading the colormap if it was requested as output. if (nargout > 1) { // In theory, it should be possible for each frame of an image to @@ -303,12 +303,12 @@ // reading to get information about the image. const octave_idx_type def_elem = frameidx(0); - const octave_idx_type row_start = region["row_start"]; - const octave_idx_type col_start = region["col_start"]; - const octave_idx_type row_shift = region["row_shift"]; - const octave_idx_type col_shift = region["col_shift"]; - const octave_idx_type row_cache = region["row_cache"]; - const octave_idx_type col_cache = region["col_cache"]; + const octave_idx_type row_start = region["row_start"]; + const octave_idx_type col_start = region["col_start"]; + const octave_idx_type row_shift = region["row_shift"]; + const octave_idx_type col_shift = region["col_shift"]; + const octave_idx_type row_cache = region["row_cache"]; + const octave_idx_type col_cache = region["col_cache"]; // GraphicsMagick (GM) keeps the image values in memory using whatever // QuantumDepth it was built with independently of the original image @@ -362,7 +362,9 @@ // Grayscale + Alpha = 4 // We won't bother with case 3 (palette) since those should be // read by the function to read indexed images - const std::string type_str = imvec[0].attribute ("PNG:IHDR.color-type-orig"); + const std::string type_str + = imvec[0].attribute ("PNG:IHDR.color-type-orig"); + if (type_str == "0") type = Magick::GrayscaleType; else if (type_str == "2") @@ -506,8 +508,8 @@ break; } - case Magick::PaletteMatteType: // Indexed color (palette) image with opacity - case Magick::TrueColorMatteType: // Truecolor image with opacity + case Magick::PaletteMatteType: // Indexed color image with opacity + case Magick::TrueColorMatteType: // Truecolor image with opacity { img = T (dim_vector (nRows, nCols, 3, nFrames)); T alpha (dim_vector (nRows, nCols, 1, nFrames)); @@ -547,7 +549,7 @@ break; } - case Magick::ColorSeparationType: // Cyan/Yellow/Magenta/Black (CYMK) image + case Magick::ColorSeparationType: // Cyan/Magenta/Yellow/Black (CMYK) image { img = T (dim_vector (nRows, nCols, 4, nFrames)); P *img_fvec = img.fortran_vec (); @@ -676,7 +678,8 @@ const char *static_locale = setlocale (LC_ALL, NULL); const std::string locale (static_locale); - const std::string program_name = octave_env::get_program_invocation_name (); + const std::string program_name + = octave_env::get_program_invocation_name (); Magick::InitializeMagick (program_name.c_str ()); // Restore locale from before GraphicsMagick initialisation @@ -692,7 +695,7 @@ #endif DEFUN_DLD (__magick_read__, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{img}, @var{map}, @var{alpha}] =} __magick_read__ (@var{fname}, @var{options})\n\ Read image with GraphicsMagick or ImageMagick.\n\ \n\ @@ -854,15 +857,15 @@ img.depth (bitdepth); switch (type) { - case Magick::GrayscaleMatteType: - case Magick::TrueColorMatteType: - case Magick::ColorSeparationMatteType: - case Magick::PaletteMatteType: - img.matte (true); - break; + case Magick::GrayscaleMatteType: + case Magick::TrueColorMatteType: + case Magick::ColorSeparationMatteType: + case Magick::PaletteMatteType: + img.matte (true); + break; - default: - img.matte (false); + default: + img.matte (false); } return img; @@ -914,9 +917,9 @@ // values (no indexes), then set the image as PseudoClass and GM // would create a colormap for us. However, we wouldn't have control // over the order of that colormap. And that's why we set both. - Magick::PixelPacket* pix = m_img.getPixels (0, 0, nCols, nRows); - Magick::IndexPacket* ind = m_img.getIndexes (); - const P* img_fvec = img.fortran_vec (); + Magick::PixelPacket* pix = m_img.getPixels (0, 0, nCols, nRows); + Magick::IndexPacket* ind = m_img.getIndexes (); + const P* img_fvec = img.fortran_vec (); octave_idx_type GM_idx = 0; for (octave_idx_type column = 0; column < nCols; column++) @@ -988,11 +991,11 @@ const T& img, const T& alpha) { typedef typename T::element_type P; - const octave_idx_type channels = img.ndims () < 3 ? 1 : img.dims ()(2); - const octave_idx_type nFrames = img.ndims () < 4 ? 1 : img.dims ()(3); - const octave_idx_type nRows = img.rows (); - const octave_idx_type nCols = img.columns (); - const octave_idx_type bitdepth = bitdepth_from_class<T> (); + const octave_idx_type channels = img.ndims () < 3 ? 1 : img.dims ()(2); + const octave_idx_type nFrames = img.ndims () < 4 ? 1 : img.dims ()(3); + const octave_idx_type nRows = img.rows (); + const octave_idx_type nCols = img.columns (); + const octave_idx_type bitdepth = bitdepth_from_class<T> (); Magick::ImageType type; const bool has_alpha = ! alpha.is_empty (); @@ -1034,7 +1037,8 @@ // From GM documentation: // Color arguments are must be scaled to fit the Quantum size according to // the range of MaxRGB - const double divisor = static_cast<double>((uint64_t (1) << bitdepth) - 1) / MaxRGB; + const double divisor = static_cast<double>((uint64_t (1) << bitdepth) - 1) + / MaxRGB; const P *img_fvec = img.fortran_vec (); const P *a_fvec = alpha.fortran_vec (); @@ -1277,7 +1281,7 @@ #endif DEFUN_DLD (__magick_write__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __magick_write__ (@var{fname}, @var{fmt}, @var{img}, @var{map}, @var{options})\n\ Write image with GraphicsMagick or ImageMagick.\n\ \n\ @@ -1345,8 +1349,10 @@ uint32NDArray clip_alpha; if (img.is_single_type ()) { - clip_img = img_float2uint<FloatNDArray> (img.float_array_value ()); - clip_alpha = img_float2uint<FloatNDArray> (alpha.float_array_value ()); + clip_img = img_float2uint<FloatNDArray> + (img.float_array_value ()); + clip_alpha = img_float2uint<FloatNDArray> + (alpha.float_array_value ()); } else { @@ -1394,7 +1400,7 @@ std::vector<Magick::Image> ini_imvec; read_file (filename, ini_imvec); if (error_state) - return retval; + return retval; if (ini_imvec.size () > 0) { ini_imvec.insert (ini_imvec.end (), imvec.begin (), imvec.end ()); @@ -1420,7 +1426,7 @@ // this, we need to read the image once for imfinfo to set defaults (which is // done in Octave language), and then again for the actual reading. DEFUN_DLD (__magick_ping__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __magick_ping__ (@var{fname}, @var{idx})\n\ Ping image information with GraphicsMagick or ImageMagick.\n\ \n\ @@ -1480,24 +1486,24 @@ { switch (magick) { - case Magick::NoCompression: - return octave_value ("none"); - case Magick::BZipCompression: - return octave_value ("bzip"); - case Magick::FaxCompression: - return octave_value ("fax3"); - case Magick::Group4Compression: - return octave_value ("fax4"); - case Magick::JPEGCompression: - return octave_value ("jpeg"); - case Magick::LZWCompression: - return octave_value ("lzw"); - case Magick::RLECompression: - // This is named "rle" for the HDF, but the same thing is named - // "ccitt" and "PackBits" for binary and non-binary images in TIFF. - return octave_value ("rle"); - case Magick::ZipCompression: - return octave_value ("deflate"); + case Magick::NoCompression: + return octave_value ("none"); + case Magick::BZipCompression: + return octave_value ("bzip"); + case Magick::FaxCompression: + return octave_value ("fax3"); + case Magick::Group4Compression: + return octave_value ("fax4"); + case Magick::JPEGCompression: + return octave_value ("jpeg"); + case Magick::LZWCompression: + return octave_value ("lzw"); + case Magick::RLECompression: + // This is named "rle" for the HDF, but the same thing is named + // "ccitt" and "PackBits" for binary and non-binary images in TIFF. + return octave_value ("rle"); + case Magick::ZipCompression: + return octave_value ("deflate"); // The following are present only in recent versions of GraphicsMagick. // At the moment the only use of this would be to have imfinfo report @@ -1505,16 +1511,16 @@ // the Compression option for imwrite in which case a macro in // configure.ac will have to check for their presence of this. // See bug #39913 -// case Magick::LZMACompression: -// return octave_value ("lzma"); -// case Magick::JPEG2000Compression: -// return octave_value ("jpeg2000"); -// case Magick::JBIG1Compression: -// return octave_value ("jbig1"); -// case Magick::JBIG2Compression: -// return octave_value ("jbig2"); - default: - return octave_value ("undefined"); + // case Magick::LZMACompression: + // return octave_value ("lzma"); + // case Magick::JPEG2000Compression: + // return octave_value ("jpeg2000"); + // case Magick::JBIG1Compression: + // return octave_value ("jbig1"); + // case Magick::JBIG2Compression: + // return octave_value ("jbig2"); + default: + return octave_value ("undefined"); } } @@ -1523,12 +1529,12 @@ { switch (magick) { - case Magick::LSBEndian: - return octave_value ("little-endian"); - case Magick::MSBEndian: - return octave_value ("big-endian"); - default: - return octave_value ("undefined"); + case Magick::LSBEndian: + return octave_value ("little-endian"); + case Magick::MSBEndian: + return octave_value ("big-endian"); + default: + return octave_value ("undefined"); } } @@ -1538,24 +1544,24 @@ switch (magick) { // Values come from the TIFF6 spec - case Magick::TopLeftOrientation: - return octave_value (1); - case Magick::TopRightOrientation: - return octave_value (2); - case Magick::BottomRightOrientation: - return octave_value (3); - case Magick::BottomLeftOrientation: - return octave_value (4); - case Magick::LeftTopOrientation: - return octave_value (5); - case Magick::RightTopOrientation: - return octave_value (6); - case Magick::RightBottomOrientation: - return octave_value (7); - case Magick::LeftBottomOrientation: - return octave_value (8); - default: - return octave_value (1); + case Magick::TopLeftOrientation: + return octave_value (1); + case Magick::TopRightOrientation: + return octave_value (2); + case Magick::BottomRightOrientation: + return octave_value (3); + case Magick::BottomLeftOrientation: + return octave_value (4); + case Magick::LeftTopOrientation: + return octave_value (5); + case Magick::RightTopOrientation: + return octave_value (6); + case Magick::RightBottomOrientation: + return octave_value (7); + case Magick::LeftBottomOrientation: + return octave_value (8); + default: + return octave_value (1); } } @@ -1564,12 +1570,12 @@ { switch (magick) { - case Magick::PixelsPerInchResolution: - return octave_value ("Inch"); - case Magick::PixelsPerCentimeterResolution: - return octave_value ("Centimeter"); - default: - return octave_value ("undefined"); + case Magick::PixelsPerInchResolution: + return octave_value ("Inch"); + case Magick::PixelsPerCentimeterResolution: + return octave_value ("Centimeter"); + default: + return octave_value ("undefined"); } } @@ -1671,7 +1677,7 @@ #endif DEFUN_DLD (__magick_finfo__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __magick_finfo__ (@var{fname})\n\ Read image information with GraphicsMagick or ImageMagick.\n\ \n\ @@ -1721,55 +1727,55 @@ // where only the third image has a colormap. static const char *fields[] = - { - // These are fields that must always appear for Matlab. - "Filename", - "FileModDate", - "FileSize", - "Format", - "FormatVersion", - "Width", - "Height", - "BitDepth", - "ColorType", + { + // These are fields that must always appear for Matlab. + "Filename", + "FileModDate", + "FileSize", + "Format", + "FormatVersion", + "Width", + "Height", + "BitDepth", + "ColorType", - // These are format specific or not existent in Matlab. The most - // annoying thing is that Matlab may have different names for the - // same thing in different formats. - "DelayTime", - "DisposalMethod", - "LoopCount", - "ByteOrder", - "Gamma", - "Chromaticities", - "Comment", - "Quality", - "Compression", // same as CompressionType - "Colormap", // same as ColorTable (in PNG) - "Orientation", - "ResolutionUnit", - "XResolution", - "YResolution", - "Software", // sometimes is an Exif tag - "Make", // actually an Exif tag - "Model", // actually an Exif tag - "DateTime", // actually an Exif tag - "ImageDescription", // actually an Exif tag - "Artist", // actually an Exif tag - "Copyright", // actually an Exif tag - "DigitalCamera", - "GPSInfo", - // Notes for the future: GM allows to get many attributes, and even has - // attribute() to obtain arbitrary ones, that may exist in only some - // cases. The following is a list of some methods and into what possible - // Matlab compatible values they may be converted. - // - // colorSpace() -> PhotometricInterpretation - // backgroundColor() -> BackgroundColor - // interlaceType() -> Interlaced, InterlaceType, and PlanarConfiguration - // label() -> Title - 0 - }; + // These are format specific or not existent in Matlab. The most + // annoying thing is that Matlab may have different names for the + // same thing in different formats. + "DelayTime", + "DisposalMethod", + "LoopCount", + "ByteOrder", + "Gamma", + "Chromaticities", + "Comment", + "Quality", + "Compression", // same as CompressionType + "Colormap", // same as ColorTable (in PNG) + "Orientation", + "ResolutionUnit", + "XResolution", + "YResolution", + "Software", // sometimes is an Exif tag + "Make", // actually an Exif tag + "Model", // actually an Exif tag + "DateTime", // actually an Exif tag + "ImageDescription", // actually an Exif tag + "Artist", // actually an Exif tag + "Copyright", // actually an Exif tag + "DigitalCamera", + "GPSInfo", + // Notes for the future: GM allows to get many attributes, and even has + // attribute() to obtain arbitrary ones, that may exist in only some + // cases. The following is a list of some methods and into what possible + // Matlab compatible values they may be converted. + // + // colorSpace() -> PhotometricInterpretation + // backgroundColor() -> BackgroundColor + // interlaceType() -> Interlaced, InterlaceType, and PlanarConfiguration + // label() -> Title + 0 + }; // The one we will return at the end octave_map info (dim_vector (nFrames, 1), string_vector (fields)); @@ -1807,7 +1813,7 @@ info_frame.setfield ("Width", octave_value (img.columns ())); info_frame.setfield ("Height", octave_value (img.rows ())); info_frame.setfield ("BitDepth", - octave_value (get_depth (const_cast<Magick::Image&> (img)))); + octave_value (get_depth (const_cast<Magick::Image&> (img)))); // Stuff related to colormap, image class and type // Because GM is too smart for us... Read the comments in is_indexed() @@ -1817,36 +1823,37 @@ if (is_indexed (img)) { color_type = "indexed"; - cmap = read_maps (const_cast<Magick::Image&> (img))(0).matrix_value (); + cmap = + read_maps (const_cast<Magick::Image&> (img))(0).matrix_value (); } else { switch (img.type ()) { - case Magick::BilevelType: - case Magick::GrayscaleType: - case Magick::GrayscaleMatteType: - color_type = "grayscale"; - break; + case Magick::BilevelType: + case Magick::GrayscaleType: + case Magick::GrayscaleMatteType: + color_type = "grayscale"; + break; - case Magick::TrueColorType: - case Magick::TrueColorMatteType: - color_type = "truecolor"; - break; + case Magick::TrueColorType: + case Magick::TrueColorMatteType: + color_type = "truecolor"; + break; - case Magick::PaletteType: - case Magick::PaletteMatteType: - // we should never get here or is_indexed needs to be fixed - color_type = "indexed"; - break; + case Magick::PaletteType: + case Magick::PaletteMatteType: + // we should never get here or is_indexed needs to be fixed + color_type = "indexed"; + break; - case Magick::ColorSeparationType: - case Magick::ColorSeparationMatteType: - color_type = "CMYK"; - break; + case Magick::ColorSeparationType: + case Magick::ColorSeparationMatteType: + color_type = "CMYK"; + break; - default: - color_type = "undefined"; + default: + color_type = "undefined"; } } info_frame.setfield ("ColorType", octave_value (color_type)); @@ -1868,22 +1875,23 @@ info_frame.setfield ("Chromaticities", octave_value (chromaticities)); } - info_frame.setfield ("Gamma", octave_value (img.gamma ())); - info_frame.setfield ("XResolution", octave_value (img.xResolution ())); - info_frame.setfield ("YResolution", octave_value (img.yResolution ())); - info_frame.setfield ("DelayTime", octave_value (img.animationDelay ())); - info_frame.setfield ("LoopCount", octave_value (img.animationIterations ())); - info_frame.setfield ("Quality", octave_value (img.quality ())); - info_frame.setfield ("Comment", octave_value (img.comment ())); + info_frame.setfield ("Gamma", octave_value (img.gamma ())); + info_frame.setfield ("XResolution", octave_value (img.xResolution ())); + info_frame.setfield ("YResolution", octave_value (img.yResolution ())); + info_frame.setfield ("DelayTime", octave_value (img.animationDelay ())); + info_frame.setfield ("LoopCount", + octave_value (img.animationIterations ())); + info_frame.setfield ("Quality", octave_value (img.quality ())); + info_frame.setfield ("Comment", octave_value (img.comment ())); info_frame.setfield ("Compression", - magick_to_octave_value (img.compressType ())); + magick_to_octave_value (img.compressType ())); info_frame.setfield ("Orientation", - magick_to_octave_value (img.orientation ())); + magick_to_octave_value (img.orientation ())); info_frame.setfield ("ResolutionUnit", - magick_to_octave_value (img.resolutionUnits ())); + magick_to_octave_value (img.resolutionUnits ())); info_frame.setfield ("ByteOrder", - magick_to_octave_value (img.endian ())); + magick_to_octave_value (img.endian ())); // It is not possible to know if there's an Exif field so we just // check for the Exif Version value. If it does exists, then we @@ -1898,7 +1906,8 @@ // exists outside the Exif tag. // See Section 4.6.4, table 4, page 28 of Exif specs version 2.3 // (CIPA DC- 008-Translation- 2010) - static const char *base_exif_str_fields[] = { + static const char *base_exif_str_fields[] = + { "DateTime", "ImageDescription", "Make", @@ -1913,7 +1922,7 @@ for (octave_idx_type field = 0; field < n_base_exif_str; field++) { info_frame.setfield (base_exif_str[field], - octave_value (cimg.attribute (base_exif_str[field]))); + octave_value (cimg.attribute (base_exif_str[field]))); fill_exif (info_frame, cimg, base_exif_str[field]); } @@ -1925,7 +1934,8 @@ // of Exif specs version 2.3 (CIPA DC- 008-Translation- 2010) // Listed on the Exif specs as being of type ASCII. - static const char *exif_str_fields[] = { + static const char *exif_str_fields[] = + { "RelatedSoundFile", "DateTimeOriginal", "DateTimeDigitized", @@ -1952,7 +1962,8 @@ fill_exif (camera, cimg, exif_str[field]); // Listed on the Exif specs as being of type SHORT or LONG. - static const char *exif_int_fields[] = { + static const char *exif_int_fields[] = + { "ColorSpace", "ExifImageWidth", // PixelXDimension (CPixelXDimension in Matlab) "ExifImageHeight", // PixelYDimension (CPixelYDimension in Matlab) @@ -1995,7 +2006,8 @@ fill_exif_ints (camera, cimg, exif_int[field]); // Listed as RATIONAL or SRATIONAL - static const char *exif_float_fields[] = { + static const char *exif_float_fields[] = + { "Gamma", "CompressedBitsPerPixel", "ExposureTime", @@ -2030,7 +2042,8 @@ // See Section 4.6.6, table 15 on page 68 of Exif specs // version 2.3 (CIPA DC- 008-Translation- 2010) - static const char *gps_str_fields[] = { + static const char *gps_str_fields[] = + { "GPSLatitudeRef", "GPSLongitudeRef", "GPSAltitudeRef", @@ -2053,7 +2066,8 @@ for (octave_idx_type field = 0; field < n_gps_str; field++) fill_exif (gps, cimg, gps_str[field]); - static const char *gps_int_fields[] = { + static const char *gps_int_fields[] = + { "GPSDifferential", 0 }; @@ -2062,7 +2076,8 @@ for (octave_idx_type field = 0; field < n_gps_int; field++) fill_exif_ints (gps, cimg, gps_int[field]); - static const char *gps_float_fields[] = { + static const char *gps_float_fields[] = + { "GPSAltitude", "GPSDOP", "GPSSpeed", @@ -2117,7 +2132,7 @@ */ DEFUN_DLD (__magick_formats__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} __magick_imformats__ (@var{formats})\n\ Fill formats info with GraphicsMagick CoderInfo.\n\ \n\
--- a/libinterp/dldfcn/__voronoi__.cc +++ b/libinterp/dldfcn/__voronoi__.cc @@ -60,7 +60,7 @@ } DEFUN_DLD (__voronoi__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{C}, @var{F} =} __voronoi__ (@var{caller}, @var{pts})\n\ @deftypefnx {Loadable Function} {@var{C}, @var{F} =} __voronoi__ (@var{caller}, @var{pts}, @var{options})\n\ @deftypefnx {Loadable Function} {@var{C}, @var{F}, @var{Inf_Pts} =} __voronoi__ (@dots{})\n\ @@ -150,7 +150,7 @@ int exitcode = qh_new_qhull (dim, num_points, points.fortran_vec (), ismalloc, cmd_str, outfile, errfile); - if (! exitcode) + if (! exitcode) { // Calling findgood_all provides the number of Voronoi vertices // (sets qh num_good). @@ -218,7 +218,7 @@ // of the at_inf and C arrays so that they always contain at least // as many elements as the given points array. - // FIXME -- is it possible (or does it make sense) for + // FIXME: is it possible (or does it make sense) for // num_voronoi_regions to ever be larger than num_points? octave_idx_type nr = (num_points > num_voronoi_regions
--- a/libinterp/dldfcn/amd.cc +++ b/libinterp/dldfcn/amd.cc @@ -51,7 +51,7 @@ #endif DEFUN_DLD (amd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} amd (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} amd (@var{S}, @var{opts})\n\ \n\ @@ -162,8 +162,8 @@ Matrix xinfo (AMD_INFO, 1); double *Info = xinfo.fortran_vec (); - // FIXME -- how can we manage the memory allocation of - // amd in a cleaner manner? + // FIXME: how can we manage the memory allocation of amd + // in a cleaner manner? amd_malloc = malloc; amd_free = free; amd_calloc = calloc;
--- a/libinterp/dldfcn/ccolamd.cc +++ b/libinterp/dldfcn/ccolamd.cc @@ -52,7 +52,7 @@ #endif DEFUN_DLD (ccolamd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} ccolamd (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} ccolamd (@var{S}, @var{knobs})\n\ @deftypefnx {Loadable Function} {@var{p} =} ccolamd (@var{S}, @var{knobs}, @var{cmember})\n\ @@ -188,7 +188,8 @@ if (knobs[CCOLAMD_DENSE_ROW] >= 0) octave_stdout << "knobs(2): " << User_knobs(1) << ", rows with > max (16," - << knobs[CCOLAMD_DENSE_ROW] << "*sqrt (size(A,2)))" + << knobs[CCOLAMD_DENSE_ROW] + << "*sqrt (size(A,2)))" << " entries removed\n"; else octave_stdout << "knobs(2): " << User_knobs(1) @@ -281,7 +282,8 @@ error ("ccolamd: CMEMBER must be of length equal to #cols of A"); else // Order the columns (destroys A) - if (! CCOLAMD_NAME () (n_row, n_col, Alen, A, p, knobs, stats, cmember)) + if (! CCOLAMD_NAME () (n_row, n_col, Alen, A, p, + knobs, stats, cmember)) { CCOLAMD_NAME (_report) (stats) ; error ("ccolamd: internal error!"); @@ -336,7 +338,7 @@ } DEFUN_DLD (csymamd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} csymamd (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} csymamd (@var{S}, @var{knobs})\n\ @deftypefnx {Loadable Function} {@var{p} =} csymamd (@var{S}, @var{knobs}, @var{cmember})\n\ @@ -428,13 +430,15 @@ // print knob settings if spumoni is set if (spumoni) { - octave_stdout << "\ncsymamd version " << CCOLAMD_MAIN_VERSION << "." - << CCOLAMD_SUB_VERSION << ", " << CCOLAMD_DATE << "\n"; + octave_stdout << "\ncsymamd version " << CCOLAMD_MAIN_VERSION + << "." << CCOLAMD_SUB_VERSION + << ", " << CCOLAMD_DATE << "\n"; if (knobs[CCOLAMD_DENSE_ROW] >= 0) octave_stdout << "knobs(1): " << User_knobs(0) << ", rows/cols with > max (16," - << knobs[CCOLAMD_DENSE_ROW] << "*sqrt (size(A,2)))" + << knobs[CCOLAMD_DENSE_ROW] + << "*sqrt (size(A,2)))" << " entries removed\n"; else octave_stdout << "knobs(1): " << User_knobs(0) @@ -511,14 +515,13 @@ if (cslen != n_col) error ("csymamd: CMEMBER must be of length equal to #cols of A"); - else - if (!CSYMAMD_NAME () (n_col, ridx, cidx, perm, knobs, stats, - &calloc, &free, cmember, -1)) - { - CSYMAMD_NAME (_report) (stats) ; - error ("csymamd: internal error!") ; - return retval; - } + else if (!CSYMAMD_NAME () (n_col, ridx, cidx, perm, knobs, stats, + &calloc, &free, cmember, -1)) + { + CSYMAMD_NAME (_report) (stats) ; + error ("csymamd: internal error!") ; + return retval; + } } else {
--- a/libinterp/dldfcn/chol.cc +++ b/libinterp/dldfcn/chol.cc @@ -61,7 +61,7 @@ } DEFUN_DLD (chol, args, nargout, -"-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{R} =} chol (@var{A})\n\ @deftypefnx {Loadable Function} {[@var{R}, @var{p}] =} chol (@var{A})\n\ @deftypefnx {Loadable Function} {[@var{R}, @var{p}, @var{Q}] =} chol (@var{S})\n\ @@ -161,9 +161,9 @@ vecout = true; else if (tmp.compare ("lower") == 0) // FIXME currently the option "lower" is handled by transposing the - // matrix, factorizing it with the lapack function DPOTRF ('U', ...) - // and finally transposing the factor. It would be more efficient to use - // DPOTRF ('L', ...) in this case. + // matrix, factorizing it with the lapack function + // DPOTRF ('U', ...) and finally transposing the factor. It would + // be more efficient to use DPOTRF ('L', ...) in this case. LLt = true; else if (tmp.compare ("upper") == 0) LLt = false; @@ -319,10 +319,10 @@ if (! error_state) { octave_idx_type info; - + CHOL fact; if (LLt) - fact = CHOL (m.transpose (), info); + fact = CHOL (m.transpose (), info); else fact = CHOL (m, info); @@ -345,7 +345,7 @@ if (! error_state) { octave_idx_type info; - + ComplexCHOL fact; if (LLt) fact = ComplexCHOL (m.transpose (), info); @@ -383,7 +383,7 @@ */ DEFUN_DLD (cholinv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} cholinv (@var{A})\n\ Use the Cholesky@tie{}factorization to compute the inverse of the\n\ symmetric positive definite matrix @var{A}.\n\ @@ -530,7 +530,7 @@ */ DEFUN_DLD (chol2inv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {} chol2inv (@var{U})\n\ Invert a symmetric, positive definite square matrix from its Cholesky\n\ decomposition, @var{U}. Note that @var{U} should be an upper-triangular\n\ @@ -622,7 +622,7 @@ } DEFUN_DLD (cholupdate, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{R1}, @var{info}] =} cholupdate (@var{R}, @var{u}, @var{op})\n\ Update or downdate a Cholesky@tie{}factorization. Given an upper triangular\n\ matrix @var{R} and a column vector @var{u}, attempt to determine another\n\ @@ -700,7 +700,8 @@ { // complex case FloatComplexMatrix R = argr.float_complex_matrix_value (); - FloatComplexColumnVector u = argu.float_complex_column_vector_value (); + FloatComplexColumnVector u = + argu.float_complex_column_vector_value (); FloatComplexCHOL fact; fact.set (R); @@ -830,7 +831,7 @@ */ DEFUN_DLD (cholinsert, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{R1} =} cholinsert (@var{R}, @var{j}, @var{u})\n\ @deftypefnx {Loadable Function} {[@var{R1}, @var{info}] =} cholinsert (@var{R}, @var{j}, @var{u})\n\ Given a Cholesky@tie{}factorization of a real symmetric or complex Hermitian\n\ @@ -895,7 +896,8 @@ { // complex case FloatComplexMatrix R = argr.float_complex_matrix_value (); - FloatComplexColumnVector u = argu.float_complex_column_vector_value (); + FloatComplexColumnVector u = + argu.float_complex_column_vector_value (); FloatComplexCHOL fact; fact.set (R); @@ -922,7 +924,8 @@ { // complex case ComplexMatrix R = argr.complex_matrix_value (); - ComplexColumnVector u = argu.complex_column_vector_value (); + ComplexColumnVector u = + argu.complex_column_vector_value (); ComplexCHOL fact; fact.set (R); @@ -1071,7 +1074,7 @@ %! -3, -2, -1, 0]; %! %! ca = a + i*b; -%! +%! %! cca = chol (ca); %! %! ccal = chol (ca, "lower"); @@ -1091,7 +1094,7 @@ */ DEFUN_DLD (choldelete, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{R1} =} choldelete (@var{R}, @var{j})\n\ Given a Cholesky@tie{}factorization of a real symmetric or complex Hermitian\n\ positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper\n\ @@ -1224,7 +1227,7 @@ */ DEFUN_DLD (cholshift, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{R1} =} cholshift (@var{R}, @var{i}, @var{j})\n\ Given a Cholesky@tie{}factorization of a real symmetric or complex Hermitian\n\ positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper\n\ @@ -1251,7 +1254,8 @@ octave_value argi = args(1); octave_value argj = args(2); - if (argr.is_numeric_type () && argi.is_real_scalar () && argj.is_real_scalar ()) + if (argr.is_numeric_type () + && argi.is_real_scalar () && argj.is_real_scalar ()) { octave_idx_type n = argr.rows (); octave_idx_type i = argi.scalar_value (); @@ -1359,7 +1363,7 @@ %!test %! R = chol (single (A)); -%! +%! %! i = 1; j = 3; p = [1:i-1, shift(i:j,-1), j+1:4]; %! R1 = cholshift (R, i, j); %!
--- a/libinterp/dldfcn/colamd.cc +++ b/libinterp/dldfcn/colamd.cc @@ -70,7 +70,8 @@ // L(k,:) pattern: all nodes reachable in etree from nz in A(0:k-1,k) Parent[k] = n ; // parent of k is not yet known Flag[k] = k ; // mark node k as visited - octave_idx_type kk = (P) ? (P[k]) : (k) ; // kth original, or permuted, column + octave_idx_type kk = (P) ? P[k] // kth original, or permuted, column + : (k) ; octave_idx_type p2 = cidx[kk+1] ; for (octave_idx_type p = cidx[kk] ; p < p2 ; p++) { @@ -209,7 +210,7 @@ } DEFUN_DLD (colamd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} colamd (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} colamd (@var{S}, @var{knobs})\n\ @deftypefnx {Loadable Function} {[@var{p}, @var{stats}] =} colamd (@var{S})\n\ @@ -309,8 +310,9 @@ if (spumoni) { - octave_stdout << "\ncolamd version " << COLAMD_MAIN_VERSION << "." - << COLAMD_SUB_VERSION << ", " << COLAMD_DATE << ":\n"; + octave_stdout << "\ncolamd version " << COLAMD_MAIN_VERSION + << "." << COLAMD_SUB_VERSION + << ", " << COLAMD_DATE << ":\n"; if (knobs[COLAMD_DENSE_ROW] >= 0) octave_stdout << "knobs(1): " << User_knobs (0) @@ -449,7 +451,7 @@ } DEFUN_DLD (symamd, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} symamd (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} symamd (@var{S}, @var{knobs})\n\ @deftypefnx {Loadable Function} {[@var{p}, @var{stats}] =} symamd (@var{S})\n\ @@ -590,7 +592,8 @@ // Allocate workspace for symamd OCTAVE_LOCAL_BUFFER (octave_idx_type, perm, n_col+1); OCTAVE_LOCAL_BUFFER (octave_idx_type, stats, COLAMD_STATS); - if (!SYMAMD_NAME () (n_col, ridx, cidx, perm, knobs, stats, &calloc, &free)) + if (!SYMAMD_NAME () (n_col, ridx, cidx, perm, + knobs, stats, &calloc, &free)) { SYMAMD_NAME (_report) (stats) ; error ("symamd: internal error!") ; @@ -642,7 +645,7 @@ } DEFUN_DLD (etree, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} etree (@var{S})\n\ @deftypefnx {Loadable Function} {@var{p} =} etree (@var{S}, @var{typ})\n\ @deftypefnx {Loadable Function} {[@var{p}, @var{q}] =} etree (@var{S}, @var{typ})\n\
--- a/libinterp/dldfcn/convhulln.cc +++ b/libinterp/dldfcn/convhulln.cc @@ -56,7 +56,7 @@ } DEFUN_DLD (convhulln, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{h} =} convhulln (@var{pts})\n\ @deftypefnx {Loadable Function} {@var{h} =} convhulln (@var{pts}, @var{options})\n\ @deftypefnx {Loadable Function} {[@var{h}, @var{v}] =} convhulln (@dots{})\n\ @@ -131,7 +131,7 @@ error ("convhulln: OPTIONS must be a string, cell array of strings, or empty"); return retval; } - } + } boolT ismalloc = false; @@ -290,7 +290,7 @@ %!testif HAVE_QHULL %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; %! [h, v] = convhulln (cube, "Qt"); -%! assert (size (h), [12 3]); +%! assert (size (h), [12 3]); %! h = sortrows (sort (h, 2), [1:3]); %! assert (h, [1 2 4; 1 2 6; 1 4 8; 1 5 6; 1 5 8; 2 3 4; 2 3 7; 2 6 7; 3 4 7; 4 7 8; 5 6 7; 5 7 8]); %! assert (v, 1, 10*eps); @@ -303,7 +303,7 @@ %!testif HAVE_QHULL %! cube = [0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1]; %! [h, v] = convhulln (cube, "QJ"); -%! assert (size (h), [12 3]); +%! assert (size (h), [12 3]); %! assert (sortrows (sort (h, 2), [1:3]), [1 2 4; 1 2 5; 1 4 5; 2 3 4; 2 3 6; 2 5 6; 3 4 8; 3 6 7; 3 7 8; 4 5 8; 5 6 8; 6 7 8]); %! assert (v, 1.0, 1e6*eps);
--- a/libinterp/dldfcn/dmperm.cc +++ b/libinterp/dldfcn/dmperm.cc @@ -132,7 +132,7 @@ #endif DEFUN_DLD (dmperm, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} dmperm (@var{S})\n\ @deftypefnx {Loadable Function} {[@var{p}, @var{q}, @var{r}, @var{S}] =} dmperm (@var{S})\n\ \n\ @@ -188,7 +188,7 @@ */ DEFUN_DLD (sprank, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} sprank (@var{S})\n\ @cindex structural rank\n\ \n\
--- a/libinterp/dldfcn/fftw.cc +++ b/libinterp/dldfcn/fftw.cc @@ -33,7 +33,7 @@ #include "ov.h" DEFUN_DLD (fftw, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{method} =} fftw (\"planner\")\n\ @deftypefnx {Loadable Function} {} fftw (\"planner\", @var{method})\n\ @deftypefnx {Loadable Function} {@var{wisdom} =} fftw (\"dwisdom\")\n\ @@ -151,7 +151,8 @@ if (args(1).is_string ()) { // Use STL function to convert to lower case - std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower); + std::transform (arg0.begin (), arg0.end (), arg0.begin (), + tolower); std::string arg1 = args(1).string_value (); if (!error_state) { @@ -235,7 +236,8 @@ if (args(1).is_string ()) { // Use STL function to convert to lower case - std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower); + std::transform (arg0.begin (), arg0.end (), arg0.begin (), + tolower); std::string arg1 = args(1).string_value (); if (!error_state) { @@ -268,7 +270,8 @@ if (args(1).is_string ()) { // Use STL function to convert to lower case - std::transform (arg0.begin (), arg0.end (), arg0.begin (), tolower); + std::transform (arg0.begin (), arg0.end (), arg0.begin (), + tolower); std::string arg1 = args(1).string_value (); if (!error_state) { @@ -320,7 +323,7 @@ error ("setting threads needs one integer argument."); } else //threads getter -#if defined (HAVE_FFTW3_THREADS) +#if defined (HAVE_FFTW3_THREADS) retval = octave_value (octave_fftw_planner::threads()); #else retval = 1;
--- a/libinterp/dldfcn/qr.cc +++ b/libinterp/dldfcn/qr.cc @@ -73,7 +73,7 @@ // that R = triu (qr (X)) DEFUN_DLD (qr, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{Q}, @var{R}, @var{P}] =} qr (@var{A})\n\ @deftypefnx {Loadable Function} {[@var{Q}, @var{R}, @var{P}] =} qr (@var{A}, '0')\n\ @deftypefnx {Loadable Function} {[@var{C}, @var{R}] =} qr (@var{A}, @var{B})\n\ @@ -289,7 +289,8 @@ else { QR::type type = (nargout == 0 || nargout == 1) ? QR::raw - : (nargin == 2 ? QR::economy : QR::std); + : nargin == 2 + ? QR::economy : QR::std; if (arg.is_single_type ()) { @@ -469,7 +470,7 @@ %!test %! a = [0, 2, 1; 2, 1, 2]; %! -%! [q, r, p] = qr (a); # FIXME: not giving right dimensions. +%! [q, r, p] = qr (a); # FIXME: not giving right dimensions. %! [qe, re, pe] = qr (a, 0); %! %! assert (q * r, a * p, sqrt (eps)); @@ -745,7 +746,7 @@ { octave_idx_type m = q.rows (), k = r.rows (), n = r.columns (); return ((q.ndims () == 2 && r.ndims () == 2 && k == q.columns ()) - && (m == k || (allow_ecf && k == n && k < m))); + && (m == k || (allow_ecf && k == n && k < m))); } static @@ -756,7 +757,7 @@ } DEFUN_DLD (qrupdate, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrupdate (@var{Q}, @var{R}, @var{u}, @var{v})\n\ Given a QR@tie{}factorization of a real or complex matrix\n\ @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ @@ -936,7 +937,7 @@ */ DEFUN_DLD (qrinsert, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrinsert (@var{Q}, @var{R}, @var{j}, @var{x}, @var{orient})\n\ Given a QR@tie{}factorization of a real or complex matrix\n\ @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ @@ -1046,9 +1047,12 @@ || argr.is_single_type () || argx.is_single_type ()) { - FloatComplexMatrix Q = argq.float_complex_matrix_value (); - FloatComplexMatrix R = argr.float_complex_matrix_value (); - FloatComplexMatrix x = argx.float_complex_matrix_value (); + FloatComplexMatrix Q = + argq.float_complex_matrix_value (); + FloatComplexMatrix R = + argr.float_complex_matrix_value (); + FloatComplexMatrix x = + argx.float_complex_matrix_value (); FloatComplexQR fact (Q, R); @@ -1155,7 +1159,7 @@ */ DEFUN_DLD (qrdelete, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrdelete (@var{Q}, @var{R}, @var{j}, @var{orient})\n\ Given a QR@tie{}factorization of a real or complex matrix\n\ @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\ @@ -1255,8 +1259,10 @@ if (argq.is_single_type () || argr.is_single_type ()) { - FloatComplexMatrix Q = argq.float_complex_matrix_value (); - FloatComplexMatrix R = argr.float_complex_matrix_value (); + FloatComplexMatrix Q = + argq.float_complex_matrix_value (); + FloatComplexMatrix R = + argr.float_complex_matrix_value (); FloatComplexQR fact (Q, R); @@ -1420,7 +1426,7 @@ */ DEFUN_DLD (qrshift, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{Q1}, @var{R1}] =} qrshift (@var{Q}, @var{R}, @var{i}, @var{j})\n\ Given a QR@tie{}factorization of a real or complex matrix\n\ @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
--- a/libinterp/dldfcn/symbfact.cc +++ b/libinterp/dldfcn/symbfact.cc @@ -40,7 +40,7 @@ #include "utils.h" DEFUN_DLD (symbfact, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{count}, @var{h}, @var{parent}, @var{post}, @var{r}] =} symbfact (@var{S})\n\ @deftypefnx {Loadable Function} {[@dots{}] =} symbfact (@var{S}, @var{typ})\n\ @deftypefnx {Loadable Function} {[@dots{}] =} symbfact (@var{S}, @var{typ}, @var{mode})\n\ @@ -355,7 +355,7 @@ retval(0) = tmp; } - symbfact_error: +symbfact_error: #else error ("symbfact: not available in this version of Octave"); #endif
--- a/libinterp/dldfcn/symrcm.cc +++ b/libinterp/dldfcn/symrcm.cc @@ -412,7 +412,7 @@ // An implementation of the Cuthill-McKee algorithm. DEFUN_DLD (symrcm, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{p} =} symrcm (@var{S})\n\ Return the symmetric reverse Cuthill-McKee permutation of @var{S}.\n\ @var{p} is a permutation vector such that\n\
--- a/libinterp/dldfcn/tsearch.cc +++ b/libinterp/dldfcn/tsearch.cc @@ -65,7 +65,7 @@ // method to traverse it DEFUN_DLD (tsearch, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{idx} =} tsearch (@var{x}, @var{y}, @var{t}, @var{xi}, @var{yi})\n\ Search for the enclosing Delaunay convex hull. For @code{@var{t} =\n\ delaunay (@var{x}, @var{y})}, finds the index in @var{t} containing the\n\
--- a/libinterp/octave-value/ov-base-diag.cc +++ b/libinterp/octave-value/ov-base-diag.cc @@ -147,12 +147,15 @@ if (type.length () == 1) { octave_value_list jdx = idx.front (); - // Check for a simple element assignment. That means, if D is a diagonal matrix, - // 'D(i,i) = x' will not destroy its diagonality (provided i is a valid index). - if (jdx.length () == 2 && jdx(0).is_scalar_type () && jdx(1).is_scalar_type ()) + // Check for a simple element assignment. That means, if D is a + // diagonal matrix, 'D(i,i) = x' will not destroy its diagonality + // (provided i is a valid index). + if (jdx.length () == 2 + && jdx(0).is_scalar_type () && jdx(1).is_scalar_type ()) { typename DMT::element_type val; - idx_vector i0 = jdx(0).index_vector (), i1 = jdx(1).index_vector (); + idx_vector i0 = jdx(0).index_vector (); + idx_vector i1 = jdx(1).index_vector (); if (! error_state && i0(0) == i1(0) && i0(0) < matrix.rows () && i1(0) < matrix.cols () && chk_valid_scalar (rhs, val)) @@ -224,10 +227,12 @@ return to_dense ().is_true (); } -// FIXME: this should be achieveable using ::real +// FIXME: This should be achieveable using ::real template <class T> inline T helper_getreal (T x) { return x; } -template <class T> inline T helper_getreal (std::complex<T> x) { return x.real (); } -// FIXME: we really need some traits so that ad hoc hooks like this are not necessary +template <class T> inline T helper_getreal (std::complex<T> x) +{ return x.real (); } +// FIXME: We really need some traits so that ad hoc hooks like this +// are not necessary. template <class T> inline T helper_iscomplex (T) { return false; } template <class T> inline T helper_iscomplex (std::complex<T>) { return true; } @@ -414,7 +419,8 @@ template <class DMT, class MT> octave_value -octave_base_diag<DMT, MT>::convert_to_str_internal (bool pad, bool force, char type) const +octave_base_diag<DMT, MT>::convert_to_str_internal (bool pad, bool force, + char type) const { return to_dense ().convert_to_str_internal (pad, force, type); } @@ -424,7 +430,7 @@ octave_base_diag<DMT, MT>::save_ascii (std::ostream& os) { os << "# rows: " << matrix.rows () << "\n" - << "# columns: " << matrix.columns () << "\n"; + << "# columns: " << matrix.columns () << "\n"; os << matrix.extract_diag (); @@ -499,7 +505,8 @@ template <class DMT, class MT> void -octave_base_diag<DMT, MT>::print (std::ostream& os, bool pr_as_read_syntax) const +octave_base_diag<DMT, MT>::print (std::ostream& os, + bool pr_as_read_syntax) const { print_raw (os, pr_as_read_syntax); newline (os); @@ -507,7 +514,8 @@ template <class DMT, class MT> int octave_base_diag<DMT, MT>::write (octave_stream& os, int block_size, - oct_data_conv::data_type output_type, int skip, + oct_data_conv::data_type output_type, + int skip, oct_mach_info::float_format flt_fmt) const { return to_dense ().write (os, block_size, output_type, skip, flt_fmt);
--- a/libinterp/octave-value/ov-base-diag.h +++ b/libinterp/octave-value/ov-base-diag.h @@ -69,7 +69,7 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -83,10 +83,10 @@ octave_idx_type nnz (void) const { return to_dense ().nnz (); } octave_value reshape (const dim_vector& new_dims) const - { return to_dense ().reshape (new_dims); } + { return to_dense ().reshape (new_dims); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return to_dense ().permute (vec, inv); } + { return to_dense ().permute (vec, inv); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -95,24 +95,24 @@ MatrixType matrix_type (void) const { return MatrixType::Diagonal; } MatrixType matrix_type (const MatrixType&) const - { return matrix_type (); } + { return matrix_type (); } octave_value diag (octave_idx_type k = 0) const; octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return to_dense ().sort (dim, mode); } + { return to_dense ().sort (dim, mode); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return to_dense ().sort (sidx, dim, mode); } + { return to_dense ().sort (sidx, dim, mode); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return to_dense ().is_sorted (mode); } + { return to_dense ().is_sorted (mode); } Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const - { return to_dense ().sort_rows_idx (mode); } + { return to_dense ().sort_rows_idx (mode); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return to_dense ().is_sorted_rows (mode); } + { return to_dense ().is_sorted_rows (mode); } bool is_matrix_type (void) const { return true; } @@ -131,7 +131,7 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } idx_vector index_vector (void) const;
--- a/libinterp/octave-value/ov-base-int.cc +++ b/libinterp/octave-value/ov-base-int.cc @@ -129,7 +129,8 @@ octave_base_value *retval = 0; if (this->matrix.nelem () == 1) - retval = new typename octave_value_int_traits<T>::scalar_type (this->matrix (0)); + retval = new typename octave_value_int_traits<T>::scalar_type + (this->matrix (0)); return retval; } @@ -163,7 +164,7 @@ if (octave_base_int_helper<val_type, is_signed, can_be_larger_than_uchar_max>::char_value_out_of_range (ival)) { - // FIXME -- is there something better we could do? + // FIXME: is there something better we could do? ival = 0; @@ -256,7 +257,8 @@ os.write (reinterpret_cast<char *> (&tmp), 4); } - os.write (reinterpret_cast<const char *> (this->matrix.data ()), this->byte_size ()); + os.write (reinterpret_cast<const char *> (this->matrix.data ()), + this->byte_size ()); return true; } @@ -388,7 +390,7 @@ if (empty > 0) this->matrix.resize (dv); if (empty) - return (empty > 0); + return (empty > 0); #if HAVE_HDF5_18 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT); @@ -469,7 +471,7 @@ if (octave_base_int_helper<val_type, is_signed, can_be_larger_than_uchar_max>::char_value_out_of_range (ival)) { - // FIXME -- is there something better we could do? + // FIXME: is there something better we could do? ival = 0;
--- a/libinterp/octave-value/ov-base-int.h +++ b/libinterp/octave-value/ov-base-int.h @@ -52,8 +52,11 @@ ~octave_base_int_matrix (void) { } - octave_base_value *clone (void) const { return new octave_base_int_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_base_int_matrix (); } + octave_base_value *clone (void) const + { return new octave_base_int_matrix (*this); } + + octave_base_value *empty_clone (void) const + { return new octave_base_int_matrix (); } octave_base_value *try_narrowing_conversion (void); @@ -97,8 +100,10 @@ ~octave_base_int_scalar (void) { } - octave_base_value *clone (void) const { return new octave_base_int_scalar (*this); } - octave_base_value *empty_clone (void) const { return new octave_base_int_scalar (); } + octave_base_value *clone (void) const + { return new octave_base_int_scalar (*this); } + octave_base_value *empty_clone (void) const + { return new octave_base_int_scalar (); } octave_base_value *try_narrowing_conversion (void) { return 0; }
--- a/libinterp/octave-value/ov-base-mat.h +++ b/libinterp/octave-value/ov-base-mat.h @@ -63,7 +63,7 @@ : octave_base_value (), matrix (m.matrix), typ (m.typ ? new MatrixType (*m.typ) : 0), idx_cache (m.idx_cache ? new idx_vector (*m.idx_cache) : 0) - { } + { } ~octave_base_matrix (void) { clear_cached_info (); } @@ -80,7 +80,7 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx, @@ -90,7 +90,7 @@ bool resize_ok = false); octave_value_list do_multi_index_op (int, const octave_value_list& idx) - { return do_index_op (idx); } + { return do_index_op (idx); } void assign (const octave_value_list& idx, const MT& rhs); @@ -107,10 +107,10 @@ octave_idx_type nnz (void) const { return matrix.nnz (); } octave_value reshape (const dim_vector& new_dims) const - { return MT (matrix.reshape (new_dims)); } + { return MT (matrix.reshape (new_dims)); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return MT (matrix.permute (vec, inv)); } + { return MT (matrix.permute (vec, inv)); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -121,25 +121,25 @@ MatrixType matrix_type (const MatrixType& _typ) const; octave_value diag (octave_idx_type k = 0) const - { return octave_value (matrix.diag (k)); } + { return octave_value (matrix.diag (k)); } octave_value diag (octave_idx_type m, octave_idx_type n) const - { return octave_value (matrix.diag (m, n)); } + { return octave_value (matrix.diag (m, n)); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (dim, mode)); } + { return octave_value (matrix.sort (dim, mode)); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (sidx, dim, mode)); } + { return octave_value (matrix.sort (sidx, dim, mode)); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return matrix.is_sorted (mode); } + { return matrix.is_sorted (mode); } Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const - { return matrix.sort_rows_idx (mode); } + { return matrix.sort_rows_idx (mode); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return matrix.is_sorted_rows (mode); } + { return matrix.is_sorted_rows (mode); } bool is_matrix_type (void) const { return true; } @@ -158,15 +158,15 @@ void print_info (std::ostream& os, const std::string& prefix) const; MT& matrix_ref (void) - { - clear_cached_info (); - return matrix; - } + { + clear_cached_info (); + return matrix; + } const MT& matrix_ref (void) const - { - return matrix; - } + { + return matrix; + } octave_value fast_elem_extract (octave_idx_type n) const; @@ -179,17 +179,17 @@ MT matrix; idx_vector set_idx_cache (const idx_vector& idx) const - { - delete idx_cache; - idx_cache = idx ? new idx_vector (idx) : 0; - return idx; - } + { + delete idx_cache; + idx_cache = idx ? new idx_vector (idx) : 0; + return idx; + } void clear_cached_info (void) const - { - delete typ; typ = 0; - delete idx_cache; idx_cache = 0; - } + { + delete typ; typ = 0; + delete idx_cache; idx_cache = 0; + } mutable MatrixType *typ; mutable idx_vector *idx_cache;
--- a/libinterp/octave-value/ov-base-scalar.cc +++ b/libinterp/octave-value/ov-base-scalar.cc @@ -179,7 +179,8 @@ template <class ST> bool -octave_base_scalar<ST>::fast_elem_insert_self (void *where, builtin_type_t btyp) const +octave_base_scalar<ST>::fast_elem_insert_self (void *where, + builtin_type_t btyp) const { // Don't use builtin_type () here to avoid an extra VM call.
--- a/libinterp/octave-value/ov-base-scalar.h +++ b/libinterp/octave-value/ov-base-scalar.h @@ -65,14 +65,14 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx, const octave_value& rhs); octave_value_list do_multi_index_op (int, const octave_value_list& idx) - { return do_index_op (idx); } + { return do_index_op (idx); } bool is_constant (void) const { return true; } @@ -101,30 +101,30 @@ octave_value diag (octave_idx_type m, octave_idx_type n) const; octave_value sort (octave_idx_type, sortmode) const - { return octave_value (scalar); } + { return octave_value (scalar); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type, sortmode) const - { - sidx.resize (dim_vector (1, 1)); - sidx(0) = 0; - return octave_value (scalar); - } + { + sidx.resize (dim_vector (1, 1)); + sidx(0) = 0; + return octave_value (scalar); + } sortmode is_sorted (sortmode mode = UNSORTED) const - { return mode ? mode : ASCENDING; } + { return mode ? mode : ASCENDING; } Array<octave_idx_type> sort_rows_idx (sortmode) const - { - return Array<octave_idx_type> (dim_vector (1, 1), - static_cast<octave_idx_type> (0)); - } + { + return Array<octave_idx_type> (dim_vector (1, 1), + static_cast<octave_idx_type> (0)); + } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return mode ? mode : ASCENDING; } + { return mode ? mode : ASCENDING; } MatrixType matrix_type (void) const { return MatrixType::Diagonal; } MatrixType matrix_type (const MatrixType&) const - { return matrix_type (); } + { return matrix_type (); } bool is_scalar_type (void) const { return true; }
--- a/libinterp/octave-value/ov-base-sparse.cc +++ b/libinterp/octave-value/ov-base-sparse.cc @@ -310,7 +310,7 @@ octave_idx_type nc = matrix.cols (); octave_idx_type nz = nnz (); - // FIXME -- this should probably all be handled by a + // FIXME: this should probably all be handled by a // separate octave_print_internal function that can handle format // compact, loose, etc. @@ -364,7 +364,7 @@ { octave_quit (); - // FIXME -- is there an easy way to get the max row + // FIXME: is there an easy way to get the max row // and column indices so we can set the width appropriately // and line up the columns here? Similarly, we should look // at all the nonzero values and display them with the same @@ -373,8 +373,7 @@ for (octave_idx_type i = matrix.cidx (j); i < matrix.cidx (j+1); i++) { os << "\n"; - os << " (" << matrix.ridx (i)+1 << - ", " << j+1 << ") -> "; + os << " (" << matrix.ridx (i)+1 << ", " << j+1 << ") -> "; octave_print_internal (os, matrix.data (i), pr_as_read_syntax); }
--- a/libinterp/octave-value/ov-base-sparse.h +++ b/libinterp/octave-value/ov-base-sparse.h @@ -47,28 +47,28 @@ class octave_base_sparse : public octave_base_value { - public: +public: octave_base_sparse (void) : octave_base_value (), matrix (), typ (MatrixType ()) { } - octave_base_sparse (const T& a) : octave_base_value (), matrix (a), - typ (MatrixType ()) + octave_base_sparse (const T& a) + : octave_base_value (), matrix (a), typ (MatrixType ()) { if (matrix.ndims () == 0) matrix.resize (dim_vector (0, 0)); } - octave_base_sparse (const T& a, const MatrixType& t) : octave_base_value (), - matrix (a), typ (t) + octave_base_sparse (const T& a, const MatrixType& t) + : octave_base_value (), matrix (a), typ (t) { if (matrix.ndims () == 0) matrix.resize (dim_vector (0, 0)); } - octave_base_sparse (const octave_base_sparse& a) : - octave_base_value (), matrix (a.matrix), typ (a.typ) { } + octave_base_sparse (const octave_base_sparse& a) + : octave_base_value (), matrix (a.matrix), typ (a.typ) { } ~octave_base_sparse (void) { } @@ -89,7 +89,7 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value subsasgn (const std::string& type, const std::list<octave_value_list>& idx, @@ -105,10 +105,10 @@ bool resize_ok = false); octave_value reshape (const dim_vector& new_dims) const - { return T (matrix.reshape (new_dims)); } + { return T (matrix.reshape (new_dims)); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return T (matrix.permute (vec, inv)); } + { return T (matrix.permute (vec, inv)); } octave_value resize (const dim_vector& dv, bool = false) const; @@ -116,20 +116,20 @@ octave_value any (int dim = 0) const { return matrix.any (dim); } octave_value diag (octave_idx_type k = 0) const - { return octave_value (matrix.diag (k)); } + { return octave_value (matrix.diag (k)); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (dim, mode)); } + { return octave_value (matrix.sort (dim, mode)); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (sidx, dim, mode)); } + { return octave_value (matrix.sort (sidx, dim, mode)); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return full_value ().is_sorted (mode); } + { return full_value ().is_sorted (mode); } MatrixType matrix_type (void) const { return typ; } MatrixType matrix_type (const MatrixType& _typ) const - { MatrixType ret = typ; typ = _typ; return ret; } + { MatrixType ret = typ; typ = _typ; return ret; } bool is_matrix_type (void) const { return true; }
--- a/libinterp/octave-value/ov-base.cc +++ b/libinterp/octave-value/ov-base.cc @@ -408,7 +408,8 @@ } bool -octave_base_value::print_name_tag (std::ostream& os, const std::string& name) const +octave_base_value::print_name_tag (std::ostream& os, + const std::string& name) const { bool retval = false; @@ -546,7 +547,8 @@ octave_base_value::float_matrix_value (bool) const { FloatMatrix retval; - gripe_wrong_type_arg ("octave_base_value::float_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::float_matrix_value()", + type_name ()); return retval; } @@ -580,7 +582,8 @@ { float tmp = lo_ieee_float_nan_value (); FloatComplex retval (tmp, tmp); - gripe_wrong_type_arg ("octave_base_value::float_complex_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::float_complex_value()", + type_name ()); return retval; } @@ -672,7 +675,8 @@ octave_base_value::sparse_matrix_value (bool) const { SparseMatrix retval; - gripe_wrong_type_arg ("octave_base_value::sparse_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::sparse_matrix_value()", + type_name ()); return retval; } @@ -680,7 +684,8 @@ octave_base_value::sparse_complex_matrix_value (bool) const { SparseComplexMatrix retval; - gripe_wrong_type_arg ("octave_base_value::sparse_complex_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::sparse_complex_matrix_value()", + type_name ()); return retval; } @@ -688,7 +693,8 @@ octave_base_value::sparse_bool_matrix_value (bool) const { SparseBoolMatrix retval; - gripe_wrong_type_arg ("octave_base_value::sparse_bool_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::sparse_bool_matrix_value()", + type_name ()); return retval; } @@ -704,7 +710,8 @@ octave_base_value::float_diag_matrix_value (bool) const { FloatDiagMatrix retval; - gripe_wrong_type_arg ("octave_base_value::float_diag_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::float_diag_matrix_value()", + type_name ()); return retval; } @@ -712,7 +719,8 @@ octave_base_value::complex_diag_matrix_value (bool) const { ComplexDiagMatrix retval; - gripe_wrong_type_arg ("octave_base_value::complex_diag_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::complex_diag_matrix_value()", + type_name ()); return retval; } @@ -720,7 +728,8 @@ octave_base_value::float_complex_diag_matrix_value (bool) const { FloatComplexDiagMatrix retval; - gripe_wrong_type_arg ("octave_base_value::float_complex_diag_matrix_value()", type_name ()); + gripe_wrong_type_arg ("octave_base_value::float_complex_diag_matrix_value()", + type_name ()); return retval; } @@ -1177,69 +1186,69 @@ octave_base_value::get_umap_name (unary_mapper_t umap) { static const char *names[num_unary_mappers] = - { - "abs", - "acos", - "acosh", - "angle", - "arg", - "asin", - "asinh", - "atan", - "atanh", - "cbrt", - "ceil", - "conj", - "cos", - "cosh", - "erf", - "erfinv", - "erfcinv", - "erfc", - "erfcx", - "erfi", - "dawson", - "exp", - "expm1", - "finite", - "fix", - "floor", - "gamma", - "imag", - "isinf", - "isna", - "isnan", - "lgamma", - "log", - "log2", - "log10", - "log1p", - "real", - "round", - "roundb", - "signum", - "sin", - "sinh", - "sqrt", - "tan", - "tanh", - "isalnum", - "isalpha", - "isascii", - "iscntrl", - "isdigit", - "isgraph", - "islower", - "isprint", - "ispunct", - "isspace", - "isupper", - "isxdigit", - "signbit", - "toascii", - "tolower", - "toupper" - }; + { + "abs", + "acos", + "acosh", + "angle", + "arg", + "asin", + "asinh", + "atan", + "atanh", + "cbrt", + "ceil", + "conj", + "cos", + "cosh", + "erf", + "erfinv", + "erfcinv", + "erfc", + "erfcx", + "erfi", + "dawson", + "exp", + "expm1", + "finite", + "fix", + "floor", + "gamma", + "imag", + "isinf", + "isna", + "isnan", + "lgamma", + "log", + "log2", + "log10", + "log1p", + "real", + "round", + "roundb", + "signum", + "sin", + "sinh", + "sqrt", + "tan", + "tanh", + "isalnum", + "isalpha", + "isascii", + "iscntrl", + "isdigit", + "isgraph", + "islower", + "isprint", + "ispunct", + "isspace", + "isupper", + "isxdigit", + "signbit", + "toascii", + "tolower", + "toupper" + }; if (umap < 0 || umap >= num_unary_mappers) return "unknown"; @@ -1376,7 +1385,8 @@ // Try biased (one-sided) conversions first. if (cf_rhs.type_id () >= 0 && (octave_value_typeinfo::lookup_assign_op (octave_value::op_asn_eq, - t_lhs, cf_rhs.type_id ()) + t_lhs, + cf_rhs.type_id ()) || octave_value_typeinfo::lookup_pref_assign_conv (t_lhs, cf_rhs.type_id ()) >= 0)) cf_this = 0; @@ -1427,7 +1437,8 @@ done = (! error_state); } else - gripe_no_conversion (octave_value::assign_op_as_string (octave_value::op_asn_eq), + gripe_no_conversion (octave_value::assign_op_as_string + (octave_value::op_asn_eq), type_name (), rhs.type_name ()); } } @@ -1457,7 +1468,7 @@ if (beginning_of_line) { - // FIXME -- do we need this? + // FIXME: do we need this? // os << prefix; for (int i = 0; i < curr_print_indent_level; i++) @@ -1531,19 +1542,22 @@ INSTALL_ASSIGNCONV (octave_base_value, octave_scalar, octave_matrix); INSTALL_ASSIGNCONV (octave_base_value, octave_matrix, octave_matrix); INSTALL_ASSIGNCONV (octave_base_value, octave_complex, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_base_value, octave_complex_matrix, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_base_value, octave_complex_matrix, + octave_complex_matrix); INSTALL_ASSIGNCONV (octave_base_value, octave_range, octave_matrix); - INSTALL_ASSIGNCONV (octave_base_value, octave_char_matrix_str, octave_char_matrix_str); + INSTALL_ASSIGNCONV (octave_base_value, octave_char_matrix_str, + octave_char_matrix_str); INSTALL_ASSIGNCONV (octave_base_value, octave_cell, octave_cell); INSTALL_WIDENOP (octave_base_value, octave_matrix, matrix_conv); - INSTALL_WIDENOP (octave_base_value, octave_complex_matrix, complex_matrix_conv); + INSTALL_WIDENOP (octave_base_value, octave_complex_matrix, + complex_matrix_conv); INSTALL_WIDENOP (octave_base_value, octave_char_matrix_str, string_conv); INSTALL_WIDENOP (octave_base_value, octave_cell, cell_conv); } DEFUN (sparse_auto_mutate, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sparse_auto_mutate ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sparse_auto_mutate (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sparse_auto_mutate (@var{new_val}, \"local\")\n\
--- a/libinterp/octave-value/ov-base.h +++ b/libinterp/octave-value/ov-base.h @@ -97,7 +97,7 @@ inline bool btyp_isarray (builtin_type_t btyp) { return btyp <= btyp_char; } -// Compute a numeric type for a possibly mixed-type operation, using these rules: +// Compute numeric type for a possible mixed-type operation, using these rules: // bool -> double // single + double -> single // real + complex -> complex @@ -188,12 +188,13 @@ class type_conv_info { public: - type_conv_info (type_conv_fcn f = 0, int t = -1) : _fcn (f), _type_id (t) { } + type_conv_info (type_conv_fcn f = 0, int t = -1) + : _fcn (f), _type_id (t) { } operator type_conv_fcn (void) const { return _fcn; } octave_base_value * operator () (const octave_base_value &v) const - { return (*_fcn) (v); } + { return (*_fcn) (v); } int type_id (void) const { return _type_id; } @@ -226,11 +227,11 @@ virtual type_conv_info numeric_conversion_function (void) const - { return type_conv_info (); } + { return type_conv_info (); } virtual type_conv_info numeric_demotion_function (void) const - { return type_conv_info (); } + { return type_conv_info (); } virtual octave_value squeeze (void) const; @@ -291,21 +292,21 @@ virtual dim_vector dims (void) const { return dim_vector (); } octave_idx_type rows (void) const - { - const dim_vector dv = dims (); + { + const dim_vector dv = dims (); - return dv(0); - } + return dv(0); + } octave_idx_type columns (void) const - { - const dim_vector dv = dims (); + { + const dim_vector dv = dims (); - return dv(1); - } + return dv(1); + } virtual int ndims (void) const - { return dims ().length (); } + { return dims ().length (); } virtual octave_idx_type numel (void) const { return dims ().numel (); } @@ -470,10 +471,10 @@ virtual float float_value (bool = false) const; virtual double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } virtual float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } virtual Cell cell_value (void) const; @@ -519,7 +520,8 @@ virtual ComplexDiagMatrix complex_diag_matrix_value (bool = false) const; - virtual FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const; + virtual FloatComplexDiagMatrix + float_complex_diag_matrix_value (bool = false) const; virtual PermMatrix perm_matrix_value (void) const; @@ -576,10 +578,10 @@ virtual string_vector parent_class_names (void) const; virtual octave_base_value *find_parent_class (const std::string&) - { return 0; } + { return 0; } virtual octave_base_value *unique_parent_class (const std::string&) - { return 0; } + { return 0; } virtual octave_function *function_value (bool silent = false); @@ -677,71 +679,71 @@ // Standard mappers. Register new ones here. enum unary_mapper_t - { - umap_abs, - umap_acos, - umap_acosh, - umap_angle, - umap_arg, - umap_asin, - umap_asinh, - umap_atan, - umap_atanh, - umap_cbrt, - umap_ceil, - umap_conj, - umap_cos, - umap_cosh, - umap_erf, - umap_erfinv, - umap_erfcinv, - umap_erfc, - umap_erfcx, - umap_erfi, - umap_dawson, - umap_exp, - umap_expm1, - umap_finite, - umap_fix, - umap_floor, - umap_gamma, - umap_imag, - umap_isinf, - umap_isna, - umap_isnan, - umap_lgamma, - umap_log, - umap_log2, - umap_log10, - umap_log1p, - umap_real, - umap_round, - umap_roundb, - umap_signum, - umap_sin, - umap_sinh, - umap_sqrt, - umap_tan, - umap_tanh, - umap_xisalnum, - umap_xisalpha, - umap_xisascii, - umap_xiscntrl, - umap_xisdigit, - umap_xisgraph, - umap_xislower, - umap_xisprint, - umap_xispunct, - umap_xisspace, - umap_xisupper, - umap_xisxdigit, - umap_xsignbit, - umap_xtoascii, - umap_xtolower, - umap_xtoupper, - umap_unknown, - num_unary_mappers = umap_unknown - }; + { + umap_abs, + umap_acos, + umap_acosh, + umap_angle, + umap_arg, + umap_asin, + umap_asinh, + umap_atan, + umap_atanh, + umap_cbrt, + umap_ceil, + umap_conj, + umap_cos, + umap_cosh, + umap_erf, + umap_erfinv, + umap_erfcinv, + umap_erfc, + umap_erfcx, + umap_erfi, + umap_dawson, + umap_exp, + umap_expm1, + umap_finite, + umap_fix, + umap_floor, + umap_gamma, + umap_imag, + umap_isinf, + umap_isna, + umap_isnan, + umap_lgamma, + umap_log, + umap_log2, + umap_log10, + umap_log1p, + umap_real, + umap_round, + umap_roundb, + umap_signum, + umap_sin, + umap_sinh, + umap_sqrt, + umap_tan, + umap_tanh, + umap_xisalnum, + umap_xisalpha, + umap_xisascii, + umap_xiscntrl, + umap_xisdigit, + umap_xisgraph, + umap_xislower, + umap_xisprint, + umap_xispunct, + umap_xisspace, + umap_xisupper, + umap_xisxdigit, + umap_xsignbit, + umap_xtoascii, + umap_xtolower, + umap_xtoupper, + umap_unknown, + num_unary_mappers = umap_unknown + }; virtual octave_value map (unary_mapper_t) const; @@ -789,16 +791,16 @@ const octave_value& rhs); void reset_indent_level (void) const - { curr_print_indent_level = 0; } + { curr_print_indent_level = 0; } void increment_indent_level (void) const - { curr_print_indent_level += 2; } + { curr_print_indent_level += 2; } void decrement_indent_level (void) const - { curr_print_indent_level -= 2; } + { curr_print_indent_level -= 2; } int current_print_indent_level (void) const - { return curr_print_indent_level; } + { return curr_print_indent_level; } void indent (std::ostream& os) const;
--- a/libinterp/octave-value/ov-bool-mat.cc +++ b/libinterp/octave-value/ov-bool-mat.cc @@ -510,13 +510,14 @@ octave_idx_type nel = dv.numel (); OCTAVE_LOCAL_BUFFER (hbool_t, htmp, nel); - if (H5Dread (data_hid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, htmp) >= 0) + if (H5Dread (data_hid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, htmp) + >= 0) { retval = true; boolNDArray btmp (dv); for (octave_idx_type i = 0; i < nel; i++) - btmp.elem (i) = htmp[i]; + btmp.elem (i) = htmp[i]; matrix = btmp; } @@ -546,7 +547,7 @@ } DEFUN (logical, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} logical (@var{x})\n\ Convert @var{x} to logical type.\n\ @seealso{double, single, char}\n\
--- a/libinterp/octave-value/ov-bool-mat.h +++ b/libinterp/octave-value/ov-bool-mat.h @@ -69,24 +69,27 @@ octave_bool_matrix (const boolNDArray& bm, const idx_vector& cache) : octave_base_matrix<boolNDArray> (bm) - { - set_idx_cache (cache); - } + { + set_idx_cache (cache); + } octave_bool_matrix (const octave_bool_matrix& bm) : octave_base_matrix<boolNDArray> (bm) { } ~octave_bool_matrix (void) { } - octave_base_value *clone (void) const { return new octave_bool_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_bool_matrix (); } + octave_base_value *clone (void) const + { return new octave_bool_matrix (*this); } + + octave_base_value *empty_clone (void) const + { return new octave_bool_matrix (); } type_conv_info numeric_conversion_function (void) const; octave_base_value *try_narrowing_conversion (void); idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } builtin_type_t builtin_type (void) const { return btyp_bool; } @@ -127,35 +130,35 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } Matrix matrix_value (bool = false) const - { return Matrix (matrix.matrix_value ()); } + { return Matrix (matrix.matrix_value ()); } FloatMatrix float_matrix_value (bool = false) const - { return FloatMatrix (matrix.matrix_value ()); } + { return FloatMatrix (matrix.matrix_value ()); } NDArray array_value (bool = false) const - { return NDArray (matrix); } + { return NDArray (matrix); } FloatNDArray float_array_value (bool = false) const - { return FloatNDArray (matrix); } + { return FloatNDArray (matrix); } Complex complex_value (bool = false) const; FloatComplex float_complex_value (bool = false) const; ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (matrix.matrix_value ( )); } + { return ComplexMatrix (matrix.matrix_value ( )); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (matrix.matrix_value ( )); } + { return FloatComplexMatrix (matrix.matrix_value ( )); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (matrix); } + { return ComplexNDArray (matrix); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexNDArray (matrix); } + { return FloatComplexNDArray (matrix); } charNDArray char_array_value (bool = false) const @@ -171,10 +174,10 @@ } boolMatrix bool_matrix_value (bool = false) const - { return matrix.matrix_value (); } + { return matrix.matrix_value (); } boolNDArray bool_array_value (bool = false) const - { return matrix; } + { return matrix; } SparseMatrix sparse_matrix_value (bool = false) const { return SparseMatrix (Matrix (matrix.matrix_value ())); } @@ -210,7 +213,7 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else. @@ -220,10 +223,10 @@ // Mapper functions are converted to double for treatment octave_value map (unary_mapper_t umap) const - { - octave_matrix m (array_value ()); - return m.map (umap); - } + { + octave_matrix m (array_value ()); + return m.map (umap); + } protected:
--- a/libinterp/octave-value/ov-bool-sparse.cc +++ b/libinterp/octave-value/ov-bool-sparse.cc @@ -51,14 +51,16 @@ DEFINE_OCTAVE_ALLOCATOR (octave_sparse_bool_matrix); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_bool_matrix, "sparse bool matrix", "logical"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_bool_matrix, + "sparse bool matrix", "logical"); static octave_base_value * default_numeric_conversion_function (const octave_base_value& a) { CAST_CONV_ARG (const octave_sparse_bool_matrix&); - return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ())); + return + new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ())); } octave_base_value::type_conv_info @@ -272,10 +274,11 @@ if (swap) swap_bytes<4> (&tmp); - if (tmp != -2) { - error ("load: only 2-D sparse matrices are supported"); - return false; - } + if (tmp != -2) + { + error ("load: only 2-D sparse matrices are supported"); + return false; + } if (! is.read (reinterpret_cast<char *> (&nr), 4)) return false; @@ -347,7 +350,8 @@ // Ensure that additional memory is deallocated matrix.maybe_compress (); #if HAVE_HDF5_18 - hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); #else hid_t group_hid = H5Gcreate (loc_id, name, 0); #endif @@ -381,7 +385,8 @@ } tmp = m.rows (); - retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &tmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -579,7 +584,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nr) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nr) + < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -603,7 +609,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nc) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nc) + < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -627,7 +634,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nz) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nz) + < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -671,7 +679,8 @@ } octave_idx_type *itmp = m.xcidx (); - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) + < 0) { H5Sclose (space_hid); H5Dclose (data_hid);
--- a/libinterp/octave-value/ov-bool-sparse.h +++ b/libinterp/octave-value/ov-bool-sparse.h @@ -76,8 +76,10 @@ ~octave_sparse_bool_matrix (void) { } - octave_base_value *clone (void) const { return new octave_sparse_bool_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_sparse_bool_matrix (); } + octave_base_value *clone (void) const + { return new octave_sparse_bool_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_sparse_bool_matrix (); } type_conv_info numeric_conversion_function (void) const; @@ -85,7 +87,7 @@ // FIXME Adapt idx_vector to allow sparse logical indexing without overflow!! idx_vector index_vector (void) const - { return idx_vector (matrix); } + { return idx_vector (matrix); } builtin_type_t builtin_type (void) const { return btyp_bool; } @@ -100,7 +102,7 @@ double double_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -123,7 +125,7 @@ SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; SparseBoolMatrix sparse_bool_matrix_value (bool = false) const - { return matrix; } + { return matrix; } octave_value convert_to_str_internal (bool pad, bool force, char type) const; @@ -142,10 +144,10 @@ // Mapper functions are converted to double for treatment octave_value map (unary_mapper_t umap) const - { - octave_sparse_matrix m (sparse_matrix_value ()); - return m.map (umap); - } + { + octave_sparse_matrix m (sparse_matrix_value ()); + return m.map (umap); + } protected:
--- a/libinterp/octave-value/ov-bool.cc +++ b/libinterp/octave-value/ov-bool.cc @@ -69,13 +69,13 @@ octave_value octave_bool::do_index_op (const octave_value_list& idx, bool resize_ok) { - // FIXME -- this doesn't solve the problem of + // FIXME: this doesn't solve the problem of // // a = 1; a([1,1], [1,1], [1,1]) // // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the + // FIXME: using this constructor avoids narrowing the // 1x1 matrix back to a scalar value. Need a better solution // to this problem.
--- a/libinterp/octave-value/ov-bool.h +++ b/libinterp/octave-value/ov-bool.h @@ -64,7 +64,8 @@ ~octave_bool (void) { } octave_base_value *clone (void) const { return new octave_bool (*this); } - octave_base_value *empty_clone (void) const { return new octave_bool_matrix (); } + octave_base_value *empty_clone (void) const + { return new octave_bool_matrix (); } type_conv_info numeric_conversion_function (void) const; @@ -89,35 +90,35 @@ int8NDArray int8_array_value (void) const - { return int8NDArray (dim_vector (1, 1), scalar); } + { return int8NDArray (dim_vector (1, 1), scalar); } int16NDArray int16_array_value (void) const - { return int16NDArray (dim_vector (1, 1), scalar); } + { return int16NDArray (dim_vector (1, 1), scalar); } int32NDArray int32_array_value (void) const - { return int32NDArray (dim_vector (1, 1), scalar); } + { return int32NDArray (dim_vector (1, 1), scalar); } int64NDArray int64_array_value (void) const - { return int64NDArray (dim_vector (1, 1), scalar); } + { return int64NDArray (dim_vector (1, 1), scalar); } uint8NDArray uint8_array_value (void) const - { return uint8NDArray (dim_vector (1, 1), scalar); } + { return uint8NDArray (dim_vector (1, 1), scalar); } uint16NDArray uint16_array_value (void) const - { return uint16NDArray (dim_vector (1, 1), scalar); } + { return uint16NDArray (dim_vector (1, 1), scalar); } uint32NDArray uint32_array_value (void) const - { return uint32NDArray (dim_vector (1, 1), scalar); } + { return uint32NDArray (dim_vector (1, 1), scalar); } uint64NDArray uint64_array_value (void) const - { return uint64NDArray (dim_vector (1, 1), scalar); } + { return uint64NDArray (dim_vector (1, 1), scalar); } octave_int8 int8_scalar_value (void) const { return octave_int8 (scalar); } @@ -152,42 +153,42 @@ float float_scalar_value (bool = false) const { return scalar; } Matrix matrix_value (bool = false) const - { return Matrix (1, 1, scalar); } + { return Matrix (1, 1, scalar); } FloatMatrix float_matrix_value (bool = false) const - { return FloatMatrix (1, 1, scalar); } + { return FloatMatrix (1, 1, scalar); } NDArray array_value (bool = false) const - { return NDArray (dim_vector (1, 1), static_cast<double> (scalar)); } + { return NDArray (dim_vector (1, 1), static_cast<double> (scalar)); } FloatNDArray float_array_value (bool = false) const - { return FloatNDArray (dim_vector (1, 1), static_cast<double> (scalar)); } + { return FloatNDArray (dim_vector (1, 1), static_cast<double> (scalar)); } Complex complex_value (bool = false) const { return scalar; } FloatComplex float_complex_value (bool = false) const { return scalar; } ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (1, 1, Complex (scalar)); } + { return ComplexMatrix (1, 1, Complex (scalar)); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } + { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } + { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } + { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (Matrix (1, 1, scalar)); } + { return SparseMatrix (Matrix (1, 1, scalar)); } // FIXME Need SparseComplexMatrix (Matrix) constructor!!! SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (sparse_matrix_value ()); } + { return SparseComplexMatrix (sparse_matrix_value ()); } SparseBoolMatrix sparse_bool_matrix_value (bool = false) const - { return SparseBoolMatrix (boolMatrix (1, 1, scalar)); } + { return SparseBoolMatrix (boolMatrix (1, 1, scalar)); } charNDArray char_array_value (bool = false) const @@ -200,10 +201,10 @@ bool bool_value (bool = false) const { return scalar; } boolMatrix bool_matrix_value (bool = false) const - { return boolMatrix (1, 1, scalar); } + { return boolMatrix (1, 1, scalar); } boolNDArray bool_array_value (bool = false) const - { return boolNDArray (dim_vector (1, 1), scalar); } + { return boolNDArray (dim_vector (1, 1), scalar); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -227,19 +228,19 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - return os.write (bool_array_value (), block_size, output_type, - skip, flt_fmt); - } + { + return os.write (bool_array_value (), block_size, output_type, + skip, flt_fmt); + } mxArray *as_mxArray (void) const; // Mapper functions are converted to double for treatment octave_value map (unary_mapper_t umap) const - { - octave_scalar m (scalar_value ()); - return m.map (umap); - } + { + octave_scalar m (scalar_value ()); + return m.map (umap); + } private:
--- a/libinterp/octave-value/ov-builtin.cc +++ b/libinterp/octave-value/ov-builtin.cc @@ -50,7 +50,8 @@ octave_value_list octave_builtin::subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list) + int nargout, + const std::list<octave_lvalue>* lvalue_list) { octave_value_list retval; @@ -77,11 +78,11 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. // - // FIXME -- Note that if a function call returns multiple + // FIXME: Note that if a function call returns multiple // values, and there is further indexing to perform, then we are // ignoring all but the first value. Is this really what we want to // do? If it is not, then what should happen for stat("file").size, @@ -130,7 +131,7 @@ retval = (*f) (args, nargout); // Do not allow null values to be returned from functions. - // FIXME -- perhaps true builtins should be allowed? + // FIXME: perhaps true builtins should be allowed? retval.make_storable_values (); // Fix the case of a single undefined value. // This happens when a compiled function uses
--- a/libinterp/octave-value/ov-builtin.h +++ b/libinterp/octave-value/ov-builtin.h @@ -58,10 +58,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -69,7 +69,8 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list); + int nargout, + const std::list<octave_lvalue>* lvalue_list); octave_function *function_value (bool = false) { return this; }
--- a/libinterp/octave-value/ov-cell.cc +++ b/libinterp/octave-value/ov-cell.cc @@ -77,7 +77,8 @@ template <> void -octave_base_matrix<Cell>::assign (const octave_value_list& idx, octave_value rhs) +octave_base_matrix<Cell>::assign (const octave_value_list& idx, + octave_value rhs) { // FIXME: Really? if (rhs.is_cell ()) @@ -93,8 +94,8 @@ matrix.delete_elements (idx); } -// FIXME: this list of specializations is becoming so long that we should really ask -// whether octave_cell should inherit from octave_base_matrix at all. +// FIXME: this list of specializations is becoming so long that we should +// really ask whether octave_cell should inherit from octave_base_matrix at all. template <> octave_value @@ -174,7 +175,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. @@ -226,7 +227,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. @@ -317,7 +318,7 @@ tmp.make_unique (); // probably a no-op. } else - // optimization: ignore the copy still stored inside our array. + // optimization: ignore copy still stored inside array. tmp.make_unique (1); if (! error_state) @@ -358,11 +359,10 @@ if (t_rhs.is_cell ()) octave_base_matrix<Cell>::assign (i, t_rhs.cell_value ()); + else if (t_rhs.is_null_value ()) + octave_base_matrix<Cell>::delete_elements (i); else - if (t_rhs.is_null_value ()) - octave_base_matrix<Cell>::delete_elements (i); - else - octave_base_matrix<Cell>::assign (i, Cell (t_rhs)); + octave_base_matrix<Cell>::assign (i, Cell (t_rhs)); if (! error_state) { @@ -394,9 +394,11 @@ octave_base_matrix<Cell>::assign (idxf, tmp_cell); } - else if (idxf.all_scalars () || do_index_op (idxf, true).numel () == 1) + else if (idxf.all_scalars () + || do_index_op (idxf, true).numel () == 1) // Regularize a null matrix if stored into a cell. - octave_base_matrix<Cell>::assign (idxf, Cell (t_rhs.storable_value ())); + octave_base_matrix<Cell>::assign (idxf, + Cell (t_rhs.storable_value ())); else if (! error_state) gripe_nonbraced_cs_list_assignment (); @@ -1132,7 +1134,8 @@ for (octave_idx_type i = 0; i < nel; i++) { std::ostringstream buf; - int digits = static_cast<int> (gnulib::floor (::log10 (static_cast<double> (nel)) + 1.0)); + int digits = static_cast<int> (gnulib::floor (::log10 (static_cast<double> + (nel)) + 1.0)); buf << "_" << std::setw (digits) << std::setfill ('0') << i; std::string s = buf.str (); @@ -1257,7 +1260,7 @@ #endif DEFUN (iscell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} iscell (@var{x})\n\ Return true if @var{x} is a cell array object.\n\ @seealso{ismatrix, isstruct, iscellstr, isa}\n\ @@ -1274,7 +1277,7 @@ } DEFUN (cell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cell (@var{n})\n\ @deftypefnx {Built-in Function} {} cell (@var{m}, @var{n})\n\ @deftypefnx {Built-in Function} {} cell (@var{m}, @var{n}, @var{k}, @dots{})\n\ @@ -1334,7 +1337,7 @@ } DEFUN (iscellstr, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} iscellstr (@var{cell})\n\ Return true if every element of the cell array @var{cell} is a\n\ character string.\n\ @@ -1357,7 +1360,7 @@ // declaration) and so we don't have to use feval to call it. DEFUN (cellstr, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} cellstr (@var{string})\n\ Create a new cell array object from the elements of the string\n\ array @var{string}.\n\ @@ -1390,7 +1393,7 @@ } DEFUN (struct2cell, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} struct2cell (@var{S})\n\ Create a new cell array from the objects stored in the struct object.\n\ If @var{f} is the number of fields in the structure, the resulting\n\ @@ -1443,9 +1446,9 @@ dim_vector result_dv; if (m_dv (m_dv.length () - 1) == 1) - result_dv.resize (m_dv.length ()); + result_dv.resize (m_dv.length ()); else - result_dv.resize (m_dv.length () + 1); // Add 1 for the fields. + result_dv.resize (m_dv.length () + 1); // Add 1 for the fields. result_dv(0) = num_fields;
--- a/libinterp/octave-value/ov-cell.h +++ b/libinterp/octave-value/ov-cell.h @@ -57,7 +57,8 @@ : octave_base_matrix<Cell> (c), cellstr_cache () { } octave_cell (const Array<std::string>& str) - : octave_base_matrix<Cell> (Cell (str)), cellstr_cache (new Array<std::string> (str)) { } + : octave_base_matrix<Cell> (Cell (str)), + cellstr_cache (new Array<std::string> (str)) { } octave_cell (const octave_cell& c) : octave_base_matrix<Cell> (c), cellstr_cache () { } @@ -73,10 +74,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -138,7 +139,7 @@ octave_value_list list_value (void) const; octave_value convert_to_str_internal (bool pad, bool, char type) const - { return octave_value (all_strings (pad), type); } + { return octave_value (all_strings (pad), type); } string_vector all_strings (bool pad = false) const; @@ -177,7 +178,7 @@ private: void clear_cellstr_cache (void) const - { cellstr_cache.reset (); } + { cellstr_cache.reset (); } mutable std::auto_ptr<Array<std::string> > cellstr_cache;
--- a/libinterp/octave-value/ov-ch-mat.cc +++ b/libinterp/octave-value/ov-ch-mat.cc @@ -202,8 +202,8 @@ STRING_MAPPER (xtolower, std::tolower, char); STRING_MAPPER (xtoupper, std::toupper, char); - // For Matlab compatibility, these should work on ASCII values - // without error or warning. + // For Matlab compatibility, these should work on ASCII values + // without error or warning. case umap_abs: case umap_ceil: case umap_fix:
--- a/libinterp/octave-value/ov-ch-mat.h +++ b/libinterp/octave-value/ov-ch-mat.h @@ -82,8 +82,10 @@ ~octave_char_matrix (void) { } - octave_base_value *clone (void) const { return new octave_char_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_char_matrix (); } + octave_base_value *clone (void) const + { return new octave_char_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_char_matrix (); } idx_vector index_vector (void) const; @@ -99,47 +101,47 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const - { return Matrix (matrix.matrix_value ()); } + { return Matrix (matrix.matrix_value ()); } FloatMatrix float_matrix_value (bool = false) const - { return FloatMatrix (matrix.matrix_value ()); } + { return FloatMatrix (matrix.matrix_value ()); } NDArray array_value (bool = false) const - { return NDArray (matrix); } + { return NDArray (matrix); } FloatNDArray float_array_value (bool = false) const - { return FloatNDArray (matrix); } + { return FloatNDArray (matrix); } Complex complex_value (bool = false) const; FloatComplex float_complex_value (bool = false) const; ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (matrix.matrix_value ()); } + { return ComplexMatrix (matrix.matrix_value ()); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (matrix.matrix_value ()); } + { return FloatComplexMatrix (matrix.matrix_value ()); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (matrix); } + { return ComplexNDArray (matrix); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexNDArray (matrix); } + { return FloatComplexNDArray (matrix); } charMatrix char_matrix_value (bool = false) const - { return matrix.matrix_value (); } + { return matrix.matrix_value (); } charNDArray char_array_value (bool = false) const - { return matrix; } + { return matrix; } octave_value convert_to_str_internal (bool, bool, char type) const - { return octave_value (matrix, type); } + { return octave_value (matrix, type); } void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/libinterp/octave-value/ov-class.cc +++ b/libinterp/octave-value/ov-class.cc @@ -67,7 +67,8 @@ octave_class::register_type (void) { t_id = octave_value_typeinfo::register_type - (octave_class::t_name, "<unknown>", octave_value (new octave_class ())); + (octave_class::t_name, "<unknown>", + octave_value (new octave_class ())); } octave_class::octave_class (const octave_map& m, const std::string& id, @@ -173,7 +174,7 @@ else if (nel == p_nel) { - // FIXME -- is there a better way to do this? + // FIXME: is there a better way to do this? // The parent class object has the same number of // elements as the map we are using to create the @@ -402,7 +403,7 @@ { octave_function *fcn = octave_call_stack::caller (); - // FIXME -- we probably need a better check here, or some other + // FIXME: we probably need a better check here, or some other // mechanism to avoid overloaded functions when builtin is used. // For example, what if someone overloads the builtin function? // Also, are there other places where using builtin is not properly @@ -426,7 +427,8 @@ octave_value_list args (1, octave_value (this)); octave_value_list lv = feval (meth.function_value (), args, 1); - if (lv.length () > 0 && lv(0).is_matrix_type () && lv(0).dims ().is_vector ()) + if (lv.length () > 0 + && lv(0).is_matrix_type () && lv(0).dims ().is_vector ()) retval = lv(0).matrix_value (); else error ("@%s/size: invalid return value", class_name ().c_str ()); @@ -488,7 +490,7 @@ if (in_class_method () || called_from_builtin ()) { - // FIXME -- this block of code is the same as the body of + // FIXME: this block of code is the same as the body of // octave_struct::subsref. Maybe it could be shared instead of // duplicated. @@ -509,7 +511,8 @@ { Cell t = tmp.index (idx.front ()); - retval(0) = (t.length () == 1) ? t(0) : octave_value (t, true); + retval(0) = (t.length () == 1) ? t(0) + : octave_value (t, true); // We handled two index elements, so tell // next_subsref to skip both of them. @@ -542,7 +545,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. @@ -704,7 +707,7 @@ else tmp = feval (meth.function_value (), args); - // FIXME -- should the subsasgn method be able to return + // FIXME: should the subsasgn method be able to return // more than one value? if (tmp.length () > 1) @@ -744,7 +747,7 @@ return retval; } - // FIXME -- this block of code is the same as the body of + // FIXME: this block of code is the same as the body of // octave_struct::subsasgn. Maybe it could be shared instead of // duplicated. @@ -842,7 +845,7 @@ tmp.make_unique (); // probably a no-op. } else - // optimization: ignore the copy still stored inside our map. + // optimization: ignore copy still stored inside our map. tmp.make_unique (1); if (! error_state) @@ -1491,7 +1494,7 @@ bool octave_class::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { bool success = true; @@ -1617,11 +1620,12 @@ H5P_DEFAULT); #endif if (class_hid < 0 || H5Dwrite (class_hid, type_hid, H5S_ALL, H5S_ALL, - H5P_DEFAULT, c_name.c_str ()) < 0) + H5P_DEFAULT, c_name.c_str ()) < 0) goto error_cleanup; #if HAVE_HDF5_18 - data_hid = H5Gcreate (group_hid, "value", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + data_hid = H5Gcreate (group_hid, "value", H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); #else data_hid = H5Gcreate (group_hid, "value", 0); #endif @@ -1655,7 +1659,7 @@ i++; } - error_cleanup: +error_cleanup: if (data_hid > 0) H5Gclose (data_hid); @@ -1806,7 +1810,7 @@ } } - error_cleanup: +error_cleanup: if (data_hid > 0) H5Dclose (data_hid); @@ -1921,7 +1925,7 @@ } DEFUN (class, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Function File} {@var{classname} =} class (@var{obj})\n\ @deftypefnx {Function File} {} class (@var{s}, @var{id})\n\ @deftypefnx {Function File} {} class (@var{s}, @var{id}, @var{p}, @dots{})\n\ @@ -2013,7 +2017,7 @@ */ DEFUN (__isa_parent__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __isa_parent__ (@var{class}, @var{name})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2040,7 +2044,7 @@ } DEFUN (__parent_classes__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __parent_classes__ (@var{x})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2061,7 +2065,7 @@ } DEFUN (isobject, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isobject (@var{x})\n\ Return true if @var{x} is a class object.\n\ @seealso{class, typeinfo, isa, ismethod}\n\ @@ -2078,7 +2082,7 @@ } DEFUN (ismethod, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} ismethod (@var{x}, @var{method})\n\ Return true if @var{x} is a class object and the string @var{method}\n\ is a method of this class.\n\ @@ -2120,7 +2124,7 @@ } DEFUN (__methods__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __methods__ (@var{x})\n\ @deftypefnx {Built-in Function} {} __methods__ (\"classname\")\n\ Internal function.\n\ @@ -2178,7 +2182,7 @@ } DEFUN (superiorto, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} superiorto (@var{class_name}, @dots{})\n\ When called from a class constructor, mark the object currently\n\ constructed as having a higher precedence than @var{class_name}.\n\ @@ -2200,8 +2204,8 @@ std::string inf_class = args(i).string_value (); if (error_state) { - error ("superiorto: expecting argument to be class name"); - break; + error ("superiorto: expecting argument to be class name"); + break; } // User defined classes always have higher precedence @@ -2222,7 +2226,7 @@ } DEFUN (inferiorto, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} inferiorto (@var{class_name}, @dots{})\n\ When called from a class constructor, mark the object currently\n\ constructed as having a lower precedence than @var{class_name}.\n\
--- a/libinterp/octave-value/ov-class.h +++ b/libinterp/octave-value/ov-class.h @@ -52,13 +52,13 @@ octave_class (void) : octave_base_value (), map (), c_name (), parent_list (), obsolete_copies (0) - { } + { } octave_class (const octave_map& m, const std::string& id, const std::list<std::string>& plist) : octave_base_value (), map (m), c_name (id), parent_list (plist), obsolete_copies (0) - { } + { } octave_class (const octave_map& m, const std::string& id, const octave_value_list& parents); @@ -86,10 +86,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -134,18 +134,18 @@ size_t nparents (void) const { return parent_list.size (); } octave_value reshape (const dim_vector& new_dims) const - { - octave_class retval = octave_class (*this); - retval.map = retval.map_value ().reshape (new_dims); - return octave_value (new octave_class (retval)); - } + { + octave_class retval = octave_class (*this); + retval.map = retval.map_value ().reshape (new_dims); + return octave_value (new octave_class (retval)); + } octave_value resize (const dim_vector& dv, bool = false) const - { - octave_class retval = octave_class (*this); - retval.map.resize (dv); - return octave_value (new octave_class (retval)); - } + { + octave_class retval = octave_class (*this); + retval.map.resize (dv); + return octave_value (new octave_class (retval)); + } bool is_defined (void) const { return true; } @@ -158,10 +158,10 @@ string_vector map_keys (void) const; std::list<std::string> parent_class_name_list (void) const - { return parent_list; } + { return parent_list; } string_vector parent_class_names (void) const - { return string_vector (parent_list); } + { return string_vector (parent_list); } octave_base_value *find_parent_class (const std::string&); @@ -278,8 +278,10 @@ // A map from class names to lists of fields. static std::map<std::string, exemplar_info> exemplar_map; - typedef std::map<std::string, exemplar_info>::iterator exemplar_iterator; - typedef std::map<std::string, exemplar_info>::const_iterator exemplar_const_iterator; + typedef std::map<std::string, exemplar_info>::iterator + exemplar_iterator; + typedef std::map<std::string, exemplar_info>::const_iterator + exemplar_const_iterator; }; #endif
--- a/libinterp/octave-value/ov-colon.h +++ b/libinterp/octave-value/ov-colon.h @@ -54,8 +54,10 @@ ~octave_magic_colon (void) { } - octave_base_value *clone (void) const { return new octave_magic_colon (*this); } - octave_base_value *empty_clone (void) const { return new octave_magic_colon (); } + octave_base_value *clone (void) const + { return new octave_magic_colon (*this); } + octave_base_value *empty_clone (void) const + { return new octave_magic_colon (); } idx_vector index_vector (void) const { return idx_vector (':'); }
--- a/libinterp/octave-value/ov-complex.cc +++ b/libinterp/octave-value/ov-complex.cc @@ -66,8 +66,9 @@ octave_base_value::type_conv_info octave_complex::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_complex::static_type_id ()); + return + octave_base_value::type_conv_info (default_numeric_demotion_function, + octave_float_complex::static_type_id ()); } octave_base_value * @@ -86,13 +87,13 @@ octave_value octave_complex::do_index_op (const octave_value_list& idx, bool resize_ok) { - // FIXME -- this doesn't solve the problem of + // FIXME: this doesn't solve the problem of // // a = i; a([1,1], [1,1], [1,1]) // // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the + // FIXME: using this constructor avoids narrowing the // 1x1 matrix back to a scalar value. Need a better solution // to this problem. @@ -218,7 +219,8 @@ FloatComplexNDArray octave_complex::float_complex_array_value (bool /* force_conversion */) const { - return FloatComplexNDArray (dim_vector (1, 1), static_cast<FloatComplex> (scalar)); + return FloatComplexNDArray (dim_vector (1, 1), + static_cast<FloatComplex> (scalar)); } octave_value
--- a/libinterp/octave-value/ov-complex.h +++ b/libinterp/octave-value/ov-complex.h @@ -70,7 +70,7 @@ // (for A previously undefined), A will be empty instead of a 1x1 // object. octave_base_value *empty_clone (void) const - { return new octave_complex_matrix (); } + { return new octave_complex_matrix (); } type_conv_info numeric_demotion_function (void) const; @@ -82,18 +82,17 @@ // Use this to give a more specific error message idx_vector index_vector (void) const { - error ( - "attempted to use a complex scalar as an index\n" + error ("attempted to use a complex scalar as an index\n" " (forgot to initialize i or j?)"); return idx_vector (); } octave_value any (int = 0) const - { - return (scalar != Complex (0, 0) - && ! (lo_ieee_isnan (std::real (scalar)) - || lo_ieee_isnan (std::imag (scalar)))); - } + { + return (scalar != Complex (0, 0) + && ! (lo_ieee_isnan (std::real (scalar)) + || lo_ieee_isnan (std::imag (scalar)))); + } builtin_type_t builtin_type (void) const { return btyp_complex; } @@ -110,10 +109,10 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -124,10 +123,10 @@ FloatNDArray float_array_value (bool = false) const; SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (matrix_value ()); } + { return SparseMatrix (matrix_value ()); } SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (complex_matrix_value ()); } + { return SparseComplexMatrix (complex_matrix_value ()); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -187,11 +186,11 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // Yes, for compatibility, we drop the imaginary part here. - return os.write (array_value (true), block_size, output_type, - skip, flt_fmt); - } + { + // Yes, for compatibility, we drop the imaginary part here. + return os.write (array_value (true), block_size, output_type, + skip, flt_fmt); + } mxArray *as_mxArray (void) const;
--- a/libinterp/octave-value/ov-cx-diag.cc +++ b/libinterp/octave-value/ov-cx-diag.cc @@ -52,8 +52,9 @@ octave_base_value::type_conv_info octave_complex_diag_matrix::numeric_conversion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_conversion_function, - octave_complex_matrix::static_type_id ()); + return octave_base_value::type_conv_info + (default_numeric_conversion_function, + octave_complex_matrix::static_type_id ()); } static octave_base_value * @@ -61,14 +62,16 @@ { CAST_CONV_ARG (const octave_complex_diag_matrix&); - return new octave_float_complex_diag_matrix (v.float_complex_diag_matrix_value ()); + return new octave_float_complex_diag_matrix + (v.float_complex_diag_matrix_value ()); } octave_base_value::type_conv_info octave_complex_diag_matrix::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_complex_diag_matrix::static_type_id ()); + return + octave_base_value::type_conv_info (default_numeric_demotion_function, + octave_float_complex_diag_matrix::static_type_id ()); } octave_base_value * @@ -149,7 +152,8 @@ return ::imag (matrix); case umap_sqrt: { - ComplexColumnVector tmp = matrix.extract_diag ().map<Complex> (std::sqrt); + ComplexColumnVector tmp = + matrix.extract_diag ().map<Complex> (std::sqrt); ComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -179,7 +183,7 @@ else st = LS_FLOAT; } - else if (matrix.length () > 4096) // FIXME -- make this configurable. + else if (matrix.length () > 4096) // FIXME: make this configurable. { double max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -187,14 +191,15 @@ } const Complex *mtmp = m.data (); - write_doubles (os, reinterpret_cast<const double *> (mtmp), st, 2 * m.numel ()); + write_doubles (os, reinterpret_cast<const double *> (mtmp), st, + 2 * m.numel ()); return true; } bool octave_complex_diag_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { int32_t r, c; char tmp;
--- a/libinterp/octave-value/ov-cx-diag.h +++ b/libinterp/octave-value/ov-cx-diag.h @@ -48,8 +48,10 @@ ~octave_complex_diag_matrix (void) { } - octave_base_value *clone (void) const { return new octave_complex_diag_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_complex_diag_matrix (); } + octave_base_value *clone (void) const + { return new octave_complex_diag_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_complex_diag_matrix (); } type_conv_info numeric_conversion_function (void) const;
--- a/libinterp/octave-value/ov-cx-mat.cc +++ b/libinterp/octave-value/ov-cx-mat.cc @@ -74,8 +74,9 @@ octave_base_value::type_conv_info octave_complex_matrix::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_complex_matrix::static_type_id ()); + return octave_base_value::type_conv_info + (default_numeric_demotion_function, + octave_float_complex_matrix::static_type_id ()); } octave_base_value * @@ -462,7 +463,7 @@ else st = LS_FLOAT; } - else if (d.numel () > 4096) // FIXME -- make this configurable. + else if (d.numel () > 4096) // FIXME: make this configurable. { double max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -471,14 +472,15 @@ const Complex *mtmp = m.data (); - write_doubles (os, reinterpret_cast<const double *> (mtmp), st, 2 * d.numel ()); + write_doubles (os, reinterpret_cast<const double *> (mtmp), st, + 2 * d.numel ()); return true; } bool octave_complex_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; int32_t mdims; @@ -647,7 +649,7 @@ if (empty > 0) matrix.resize (dv); if (empty) - return (empty > 0); + return (empty > 0); #if HAVE_HDF5_18 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT);
--- a/libinterp/octave-value/ov-cx-mat.h +++ b/libinterp/octave-value/ov-cx-mat.h @@ -82,8 +82,10 @@ ~octave_complex_matrix (void) { } - octave_base_value *clone (void) const { return new octave_complex_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_complex_matrix (); } + octave_base_value *clone (void) const + { return new octave_complex_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_complex_matrix (); } type_conv_info numeric_demotion_function (void) const; @@ -104,10 +106,10 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -161,11 +163,11 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // Yes, for compatibility, we drop the imaginary part here. - return os.write (matrix_value (true), block_size, output_type, - skip, flt_fmt); - } + { + // Yes, for compatibility, we drop the imaginary part here. + return os.write (matrix_value (true), block_size, output_type, + skip, flt_fmt); + } void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/libinterp/octave-value/ov-cx-sparse.cc +++ b/libinterp/octave-value/ov-cx-sparse.cc @@ -51,7 +51,8 @@ DEFINE_OCTAVE_ALLOCATOR (octave_sparse_complex_matrix); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_complex_matrix, "sparse complex matrix", "double"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_complex_matrix, + "sparse complex matrix", "double"); octave_base_value * octave_sparse_complex_matrix::try_narrowing_conversion (void) @@ -110,7 +111,7 @@ gripe_implicit_conversion ("Octave:imag-to-real", "complex sparse matrix", "real scalar"); - // FIXME -- maybe this should be a function, valid_as_scalar() + // FIXME: maybe this should be a function, valid_as_scalar() if (numel () > 0) { if (numel () > 1) @@ -146,7 +147,7 @@ Complex retval (tmp, tmp); - // FIXME -- maybe this should be a function, valid_as_scalar() + // FIXME: maybe this should be a function, valid_as_scalar() if (numel () > 0) { if (numel () > 1) @@ -263,7 +264,7 @@ else st = LS_FLOAT; } - else if (matrix.nnz () > 8192) // FIXME -- make this configurable. + else if (matrix.nnz () > 8192) // FIXME: make this configurable. { double max_val, min_val; if (matrix.all_integers (max_val, min_val)) @@ -272,28 +273,29 @@ // add one to the printed indices to go from // zero-based to one-based arrays - for (int i = 0; i < nc+1; i++) - { - octave_quit (); - itmp = matrix.cidx (i); - os.write (reinterpret_cast<char *> (&itmp), 4); - } + for (int i = 0; i < nc+1; i++) + { + octave_quit (); + itmp = matrix.cidx (i); + os.write (reinterpret_cast<char *> (&itmp), 4); + } - for (int i = 0; i < nz; i++) - { - octave_quit (); - itmp = matrix.ridx (i); - os.write (reinterpret_cast<char *> (&itmp), 4); - } + for (int i = 0; i < nz; i++) + { + octave_quit (); + itmp = matrix.ridx (i); + os.write (reinterpret_cast<char *> (&itmp), 4); + } - write_doubles (os, reinterpret_cast<const double *> (matrix.data ()), st, 2 * nz); + write_doubles (os, reinterpret_cast<const double *> (matrix.data ()), st, + 2 * nz); return true; } bool octave_sparse_complex_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { int32_t nz, nc, nr, tmp; char ctmp; @@ -304,10 +306,11 @@ if (swap) swap_bytes<4> (&tmp); - if (tmp != -2) { - error ("load: only 2-D sparse matrices are supported"); - return false; - } + if (tmp != -2) + { + error ("load: only 2-D sparse matrices are supported"); + return false; + } if (! is.read (reinterpret_cast<char *> (&nr), 4)) return false; @@ -379,7 +382,8 @@ matrix.maybe_compress (); #if HAVE_HDF5_18 - hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); #else hid_t group_hid = H5Gcreate (loc_id, name, 0); #endif @@ -540,7 +544,8 @@ } itmp = m.xridx (); - retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, + itmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -648,7 +653,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nr) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, &nr) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -672,7 +678,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nc) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, &nc) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -696,7 +703,8 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nz) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, &nz) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -740,7 +748,8 @@ } octave_idx_type *itmp = m.xcidx (); - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, itmp) < 0) { H5Sclose (space_hid); H5Dclose (data_hid); @@ -779,7 +788,8 @@ } itmp = m.xridx (); - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, + H5S_ALL, H5P_DEFAULT, itmp) < 0) { H5Sclose (space_hid); H5Dclose (data_hid);
--- a/libinterp/octave-value/ov-cx-sparse.h +++ b/libinterp/octave-value/ov-cx-sparse.h @@ -87,8 +87,10 @@ ~octave_sparse_complex_matrix (void) { } - octave_base_value *clone (void) const { return new octave_sparse_complex_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_sparse_complex_matrix (); } + octave_base_value *clone (void) const + { return new octave_sparse_complex_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_sparse_complex_matrix (); } octave_base_value *try_narrowing_conversion (void); @@ -105,7 +107,7 @@ double double_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -120,7 +122,7 @@ SparseMatrix sparse_matrix_value (bool = false) const; SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return matrix; } + { return matrix; } SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const; @@ -128,11 +130,11 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // Yes, for compatibility, we drop the imaginary part here. - return os.write (matrix_value (true), block_size, output_type, - skip, flt_fmt); - } + { + // Yes, for compatibility, we drop the imaginary part here. + return os.write (matrix_value (true), block_size, output_type, + skip, flt_fmt); + } #endif bool save_binary (std::ostream& os, bool& save_as_floats);
--- a/libinterp/octave-value/ov-dld-fcn.h +++ b/libinterp/octave-value/ov-dld-fcn.h @@ -69,12 +69,12 @@ bool is_dld_function (void) const { return true; } static octave_dld_function* create (octave_builtin::fcn ff, - const octave_shlib& shl, - const std::string& nm = std::string (), - const std::string& ds = std::string ()); + const octave_shlib& shl, + const std::string& nm = std::string (), + const std::string& ds = std::string ()); octave_shlib get_shlib (void) const - { return sh_lib; } + { return sh_lib; } private:
--- a/libinterp/octave-value/ov-fcn-handle.cc +++ b/libinterp/octave-value/ov-fcn-handle.cc @@ -96,7 +96,8 @@ octave_value_list octave_fcn_handle::subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list) + int nargout, + const std::list<octave_lvalue>* lvalue_list) { octave_value_list retval; @@ -123,7 +124,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_builtin::subsref. @@ -210,7 +211,8 @@ else if (fcn.is_defined ()) retval = fcn.do_multi_index_op (nargout, args, lvalue_list); else - error ("%s: no method for class %s", nm.c_str (), dispatch_type.c_str ()); + error ("%s: no method for class %s", + nm.c_str (), dispatch_type.c_str ()); } else { @@ -235,9 +237,11 @@ for (int i = 0; i < btyp_num_types && retval; i++) retval = builtin_overloads[i].is_copy_of (h.builtin_overloads[i]); - str_ov_map::const_iterator iter = overloads.begin (), hiter = h.overloads.begin (); + str_ov_map::const_iterator iter = overloads.begin (); + str_ov_map::const_iterator hiter = h.overloads.begin (); for (; iter != overloads.end () && retval; iter++, hiter++) - retval = (iter->first == hiter->first) && (iter->second.is_copy_of (hiter->second)); + retval = (iter->first == hiter->first) + && (iter->second.is_copy_of (hiter->second)); } return retval; @@ -256,7 +260,7 @@ { // First check if just replacing matlabroot is enough std::string str = OCTAVE_EXEC_PREFIX + - fpath.substr (octaveroot.length ()); + fpath.substr (octaveroot.length ()); file_stat fs (str); if (fs.exists ()) @@ -372,8 +376,8 @@ { os << "# length: " << varlen << "\n"; - for (std::list<symbol_table::symbol_record>::const_iterator p = vars.begin (); - p != vars.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = vars.begin (); p != vars.end (); p++) { if (! save_ascii_data (os, p->varval (0), p->name (), false, 0)) return os; @@ -547,8 +551,8 @@ if (varlen > 0) { - for (std::list<symbol_table::symbol_record>::const_iterator p = vars.begin (); - p != vars.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = vars.begin (); p != vars.end (); p++) { if (! save_binary_data (os, p->varval (0), p->name (), "", 0, save_as_floats)) @@ -696,7 +700,7 @@ } success = set_fcn (octaveroot, fpath); - } + } return success; } @@ -824,7 +828,8 @@ else retval = false; #if HAVE_HDF5_18 - data_hid = H5Gcreate (group_hid, "symbol table", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + data_hid = H5Gcreate (group_hid, "symbol table", + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); #else data_hid = H5Gcreate (group_hid, "symbol table", 0); #endif @@ -836,8 +841,8 @@ return false; } - for (std::list<symbol_table::symbol_record>::const_iterator p = vars.begin (); - p != vars.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = vars.begin (); p != vars.end (); p++) { if (! add_hdf5_data (data_hid, p->varval (0), p->name (), "", false, save_as_floats)) @@ -1432,7 +1437,7 @@ // Bow to the god of compatibility. - // FIXME -- it seems ugly to put this here, but there is no single + // FIXME: it seems ugly to put this here, but there is no single // function in the parser that converts from the operator name to // the corresponding function name. At least try to do it without N // string compares. @@ -1653,7 +1658,7 @@ */ DEFUN (functions, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} functions (@var{fcn_handle})\n\ Return a struct containing information about the function handle\n\ @var{fcn_handle}.\n\ @@ -1719,8 +1724,8 @@ if (varlen > 0) { octave_scalar_map ws; - for (std::list<symbol_table::symbol_record>::const_iterator p = vars.begin (); - p != vars.end (); p++) + for (std::list<symbol_table::symbol_record>::const_iterator + p = vars.begin (); p != vars.end (); p++) { ws.assign (p->name (), p->varval (0)); } @@ -1751,7 +1756,7 @@ } DEFUN (func2str, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} func2str (@var{fcn_handle})\n\ Return a string containing the name of the function referenced by\n\ the function handle @var{fcn_handle}.\n\ @@ -1788,7 +1793,7 @@ } DEFUN (str2func, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} str2func (@var{fcn_name})\n\ @deftypefnx {Built-in Function} {} str2func (@var{fcn_name}, \"global\")\n\ Return a function handle constructed from the string @var{fcn_name}.\n\ @@ -1831,7 +1836,7 @@ */ DEFUN (is_function_handle, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} is_function_handle (@var{x})\n\ Return true if @var{x} is a function handle.\n\ @seealso{isa, typeinfo, class}\n\ @@ -1866,8 +1871,8 @@ const octave_value_list& templ, const std::vector<int>& mask, int exp_nargin) -: octave_fcn_handle (f), root_handle (root), arg_template (templ), - arg_mask (mask), expected_nargin (exp_nargin) + : octave_fcn_handle (f), root_handle (root), arg_template (templ), + arg_mask (mask), expected_nargin (exp_nargin) { } @@ -1890,7 +1895,8 @@ && ! (param_list && param_list->takes_varargs ())) { // It's an index expression. - tree_index_expression *idx_expr = dynamic_cast<tree_index_expression *> (body_expr); + tree_index_expression *idx_expr = dynamic_cast<tree_index_expression *> + (body_expr); tree_expression *head_expr = idx_expr->expression (); std::list<tree_argument_list *> arg_lists = idx_expr->arg_lists (); std::string type_tags = idx_expr->type_tags (); @@ -1901,7 +1907,8 @@ assert (arg_lists.size () == 1); // It's a single index expression: a(x,y,....) - tree_identifier *head_id = dynamic_cast<tree_identifier *> (head_expr); + tree_identifier *head_id = + dynamic_cast<tree_identifier *> (head_expr); tree_argument_list *arg_list = arg_lists.front (); // Build a map of input params to their position. @@ -1916,7 +1923,7 @@ tree_decl_elt *elt = *it; tree_identifier *id = elt ? elt->ident () : 0; if (id && ! id->is_black_hole ()) - arginmap[id->name ()] = npar; + arginmap[id->name ()] = npar; } } @@ -1927,7 +1934,8 @@ octave_value_list arg_template (nargs); std::vector<int> arg_mask (nargs); - // Verify that each argument is either a named param, a constant, or a defined identifier. + // Verify that each argument is either a named param, a constant, + // or a defined identifier. int iarg = 0; for (tree_argument_list::iterator it = arg_list->begin (); it != arg_list->end (); ++it, ++iarg) @@ -1940,7 +1948,8 @@ } else if (elt && elt->is_identifier ()) { - tree_identifier *elt_id = dynamic_cast<tree_identifier *> (elt); + tree_identifier *elt_id = + dynamic_cast<tree_identifier *> (elt); if (arginmap.find (elt_id->name ()) != arginmap.end ()) { arg_mask[iarg] = arginmap[elt_id->name ()]; @@ -1969,7 +1978,7 @@ { // If the head is a value, use it as root. if (head_id->is_defined ()) - root_val = head_id->rvalue1 (); + root_val = head_id->rvalue1 (); else { // It's a name. @@ -1977,7 +1986,7 @@ // Function handles can't handle legacy dispatch, so // we make sure it's not defined. if (symbol_table::get_dispatch (head_name).size () > 0) - bad = true; + bad = true; else { // Simulate try/catch. @@ -1986,7 +1995,7 @@ root_val = make_fcn_handle (head_name); if (error_state) - bad = true; + bad = true; } } } @@ -2006,7 +2015,7 @@ } if (! retval) - retval = new octave_fcn_handle (f, octave_fcn_handle::anonymous); + retval = new octave_fcn_handle (f, octave_fcn_handle::anonymous); return retval; } @@ -2031,16 +2040,16 @@ { int j = arg_mask[i]; if (j >= 0) - arg_template(i) = args(j); // May force a copy... + arg_template(i) = args(j); // May force a copy... } - // Make a shallow copy of arg_template, to ensure consistency throughout the following - // call even if we happen to get back here. + // Make a shallow copy of arg_template, to ensure consistency throughout + // the following call even if we happen to get back here. octave_value_list tmp (arg_template); retval = root_handle.do_multi_index_op (nargout, tmp, lvalue_list); } else - retval = octave_fcn_handle::do_multi_index_op (nargout, args, lvalue_list); + retval = octave_fcn_handle::do_multi_index_op (nargout, args, lvalue_list); return retval; }
--- a/libinterp/octave-value/ov-fcn-handle.h +++ b/libinterp/octave-value/ov-fcn-handle.h @@ -59,25 +59,27 @@ octave_fcn_handle (const octave_fcn_handle& fh) : octave_base_value (fh), fcn (fh.fcn), nm (fh.nm), - has_overloads (fh.has_overloads), overloads () - { - for (int i = 0; i < btyp_num_types; i++) - builtin_overloads[i] = fh.builtin_overloads[i]; + has_overloads (fh.has_overloads), overloads () + { + for (int i = 0; i < btyp_num_types; i++) + builtin_overloads[i] = fh.builtin_overloads[i]; - overloads = fh.overloads; - } + overloads = fh.overloads; + } ~octave_fcn_handle (void) { } - octave_base_value *clone (void) const { return new octave_fcn_handle (*this); } - octave_base_value *empty_clone (void) const { return new octave_fcn_handle (); } + octave_base_value *clone (void) const + { return new octave_fcn_handle (*this); } + octave_base_value *empty_clone (void) const + { return new octave_fcn_handle (); } octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -85,7 +87,8 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list); + int nargout, + const std::list<octave_lvalue>* lvalue_list); octave_value_list do_multi_index_op (int nargout, const octave_value_list& args); @@ -105,10 +108,10 @@ dim_vector dims (void) const { static dim_vector dv (1, 1); return dv; } octave_function *function_value (bool = false) - { return fcn.function_value (); } + { return fcn.function_value (); } octave_user_function *user_function_value (bool = false) - { return fcn.user_function_value (); } + { return fcn.user_function_value (); } octave_fcn_handle *fcn_handle_value (bool = false) { return this; } @@ -117,20 +120,21 @@ std::string fcn_name (void) const { return nm; } void set_overload (builtin_type_t btyp, const octave_value& ov_fcn) - { - if (btyp != btyp_unknown) - { - has_overloads = true; - builtin_overloads[btyp] = ov_fcn; - } + { + if (btyp != btyp_unknown) + { + has_overloads = true; + builtin_overloads[btyp] = ov_fcn; + } - } + } - void set_overload (const std::string& dispatch_type, const octave_value& ov_fcn) - { - has_overloads = true; - overloads[dispatch_type] = ov_fcn; - } + void set_overload (const std::string& dispatch_type, + const octave_value& ov_fcn) + { + has_overloads = true; + overloads[dispatch_type] = ov_fcn; + } bool is_equal_to (const octave_fcn_handle&) const;
--- a/libinterp/octave-value/ov-fcn-inline.cc +++ b/libinterp/octave-value/ov-fcn-inline.cc @@ -634,7 +634,7 @@ } DEFUNX ("inline", Finline, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} inline (@var{str})\n\ @deftypefnx {Built-in Function} {} inline (@var{str}, @var{arg1}, @dots{})\n\ @deftypefnx {Built-in Function} {} inline (@var{str}, @var{n})\n\ @@ -806,7 +806,7 @@ std::string s = args(i).string_value (); fargs(i-1) = s; } - else + else { error ("inline: expecting string arguments"); return retval; @@ -843,7 +843,7 @@ */ DEFUN (formula, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} formula (@var{fun})\n\ Return a character string representing the inline function @var{fun}.\n\ Note that @code{char (@var{fun})} is equivalent to\n\ @@ -881,7 +881,7 @@ */ DEFUN (argnames, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} argnames (@var{fun})\n\ Return a cell array of character strings containing the names of\n\ the arguments of the inline function @var{fun}.\n\ @@ -928,7 +928,7 @@ */ DEFUN (vectorize, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} vectorize (@var{fun})\n\ Create a vectorized version of the inline function @var{fun}\n\ by replacing all occurrences of @code{*}, @code{/}, etc., with\n\
--- a/libinterp/octave-value/ov-fcn-inline.h +++ b/libinterp/octave-value/ov-fcn-inline.h @@ -54,8 +54,10 @@ ~octave_fcn_inline (void) { } - octave_base_value *clone (void) const { return new octave_fcn_inline (*this); } - octave_base_value *empty_clone (void) const { return new octave_fcn_inline (); } + octave_base_value *clone (void) const + { return new octave_fcn_inline (*this); } + octave_base_value *empty_clone (void) const + { return new octave_fcn_inline (); } bool is_inline_function (void) const { return true; }
--- a/libinterp/octave-value/ov-fcn.h +++ b/libinterp/octave-value/ov-fcn.h @@ -75,18 +75,18 @@ virtual symbol_table::scope_id scope (void) { return -1; } virtual octave_time time_parsed (void) const - { return octave_time (static_cast<time_t> (0)); } + { return octave_time (static_cast<time_t> (0)); } virtual octave_time time_checked (void) const - { return octave_time (static_cast<time_t> (0)); } + { return octave_time (static_cast<time_t> (0)); } virtual bool is_subfunction (void) const { return false; } virtual bool is_class_constructor (const std::string& = std::string ()) const - { return false; } + { return false; } virtual bool is_class_method (const std::string& = std::string ()) const - { return false; } + { return false; } virtual bool takes_varargs (void) const { return false; } @@ -106,11 +106,11 @@ bool is_private_function (void) const { return private_function; } bool is_private_function_of_class (const std::string& nm) const - { return private_function && xdispatch_class == nm; } + { return private_function && xdispatch_class == nm; } virtual bool is_anonymous_function_of_class (const std::string& = std::string ()) const - { return false; } + { return false; } std::string dir_name (void) const { return my_dir_name; }
--- a/libinterp/octave-value/ov-float.cc +++ b/libinterp/octave-value/ov-float.cc @@ -55,18 +55,19 @@ DEFINE_OCTAVE_ALLOCATOR (octave_float_scalar); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_scalar, "float scalar", "single"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_scalar, "float scalar", + "single"); octave_value octave_float_scalar::do_index_op (const octave_value_list& idx, bool resize_ok) { - // FIXME -- this doesn't solve the problem of + // FIXME: this doesn't solve the problem of // // a = 1; a([1,1], [1,1], [1,1]) // // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the + // FIXME: using this constructor avoids narrowing the // 1x1 matrix back to a scalar value. Need a better solution // to this problem. @@ -117,7 +118,7 @@ if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) { - // FIXME -- is there something better we could do? + // FIXME: is there something better we could do? ival = 0; @@ -168,7 +169,7 @@ bool octave_float_scalar::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; if (! is.read (reinterpret_cast<char *> (&tmp), 1)) @@ -187,7 +188,7 @@ bool octave_float_scalar::save_hdf5 (hid_t loc_id, const char *name, - bool /* save_as_floats */) + bool /* save_as_floats */) { hsize_t dimens[3]; hid_t space_hid = -1, data_hid = -1; @@ -331,7 +332,8 @@ } bool -octave_float_scalar::fast_elem_insert_self (void *where, builtin_type_t btyp) const +octave_float_scalar::fast_elem_insert_self (void *where, + builtin_type_t btyp) const { // Support inline real->complex conversion.
--- a/libinterp/octave-value/ov-float.h +++ b/libinterp/octave-value/ov-float.h @@ -65,12 +65,14 @@ ~octave_float_scalar (void) { } - octave_base_value *clone (void) const { return new octave_float_scalar (*this); } + octave_base_value *clone (void) const + { return new octave_float_scalar (*this); } // We return an octave_matrix here instead of an octave_float_scalar so // that in expressions like A(2,2,2) = 2 (for A previously // undefined), A will be empty instead of a 1x1 object. - octave_base_value *empty_clone (void) const { return new octave_float_matrix (); } + octave_base_value *empty_clone (void) const + { return new octave_float_matrix (); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -78,7 +80,7 @@ idx_vector index_vector (void) const { return idx_vector (scalar); } octave_value any (int = 0) const - { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } + { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } builtin_type_t builtin_type (void) const { return btyp_float; } @@ -92,35 +94,35 @@ int8NDArray int8_array_value (void) const - { return int8NDArray (dim_vector (1, 1), scalar); } + { return int8NDArray (dim_vector (1, 1), scalar); } int16NDArray int16_array_value (void) const - { return int16NDArray (dim_vector (1, 1), scalar); } + { return int16NDArray (dim_vector (1, 1), scalar); } int32NDArray int32_array_value (void) const - { return int32NDArray (dim_vector (1, 1), scalar); } + { return int32NDArray (dim_vector (1, 1), scalar); } int64NDArray int64_array_value (void) const - { return int64NDArray (dim_vector (1, 1), scalar); } + { return int64NDArray (dim_vector (1, 1), scalar); } uint8NDArray uint8_array_value (void) const - { return uint8NDArray (dim_vector (1, 1), scalar); } + { return uint8NDArray (dim_vector (1, 1), scalar); } uint16NDArray uint16_array_value (void) const - { return uint16NDArray (dim_vector (1, 1), scalar); } + { return uint16NDArray (dim_vector (1, 1), scalar); } uint32NDArray uint32_array_value (void) const - { return uint32NDArray (dim_vector (1, 1), scalar); } + { return uint32NDArray (dim_vector (1, 1), scalar); } uint64NDArray uint64_array_value (void) const - { return uint64NDArray (dim_vector (1, 1), scalar); } + { return uint64NDArray (dim_vector (1, 1), scalar); } #define DEFINE_INT_SCALAR_VALUE(TYPE) \ octave_ ## TYPE \ @@ -138,32 +140,34 @@ #undef DEFINE_INT_SCALAR_VALUE - double double_value (bool = false) const { return static_cast<double> (scalar); } + double double_value (bool = false) const + { return static_cast<double> (scalar); } float float_value (bool = false) const { return scalar; } - double scalar_value (bool = false) const { return static_cast<double> (scalar); } + double scalar_value (bool = false) const + { return static_cast<double> (scalar); } float float_scalar_value (bool = false) const { return scalar; } Matrix matrix_value (bool = false) const - { return Matrix (1, 1, scalar); } + { return Matrix (1, 1, scalar); } FloatMatrix float_matrix_value (bool = false) const - { return FloatMatrix (1, 1, scalar); } + { return FloatMatrix (1, 1, scalar); } NDArray array_value (bool = false) const - { return NDArray (dim_vector (1, 1), scalar); } + { return NDArray (dim_vector (1, 1), scalar); } FloatNDArray float_array_value (bool = false) const - { return FloatNDArray (dim_vector (1, 1), scalar); } + { return FloatNDArray (dim_vector (1, 1), scalar); } SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (Matrix (1, 1, scalar)); } + { return SparseMatrix (Matrix (1, 1, scalar)); } // FIXME Need SparseComplexMatrix (Matrix) constructor!!! SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (sparse_matrix_value ()); } + { return SparseComplexMatrix (sparse_matrix_value ()); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -172,16 +176,16 @@ FloatComplex float_complex_value (bool = false) const { return scalar; } ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (1, 1, Complex (scalar)); } + { return ComplexMatrix (1, 1, Complex (scalar)); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } + { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } + { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } + { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } charNDArray char_array_value (bool = false) const @@ -237,10 +241,10 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - return os.write (array_value (), block_size, output_type, - skip, flt_fmt); - } + { + return os.write (array_value (), block_size, output_type, + skip, flt_fmt); + } mxArray *as_mxArray (void) const;
--- a/libinterp/octave-value/ov-flt-complex.cc +++ b/libinterp/octave-value/ov-flt-complex.cc @@ -71,13 +71,13 @@ octave_value octave_float_complex::do_index_op (const octave_value_list& idx, bool resize_ok) { - // FIXME -- this doesn't solve the problem of + // FIXME: this doesn't solve the problem of // // a = i; a([1,1], [1,1], [1,1]) // // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the + // FIXME: using this constructor avoids narrowing the // 1x1 matrix back to a scalar value. Need a better solution // to this problem. @@ -232,7 +232,9 @@ octave_value octave_float_complex::diag (octave_idx_type m, octave_idx_type n) const { - return FloatComplexDiagMatrix (Array<FloatComplex> (dim_vector (1, 1), scalar), m, n); + return + FloatComplexDiagMatrix (Array<FloatComplex> (dim_vector (1, 1), scalar), + m, n); } bool @@ -275,7 +277,7 @@ bool octave_float_complex::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; if (! is.read (reinterpret_cast<char *> (&tmp), 1)) @@ -283,7 +285,7 @@ FloatComplex ctmp; read_floats (is, reinterpret_cast<float *> (&ctmp), - static_cast<save_type> (tmp), 2, swap, fmt); + static_cast<save_type> (tmp), 2, swap, fmt); if (error_state || ! is) return false; @@ -295,7 +297,7 @@ bool octave_float_complex::save_hdf5 (hid_t loc_id, const char *name, - bool /* save_as_floats */) + bool /* save_as_floats */) { hsize_t dimens[3]; hid_t space_hid = -1, type_hid = -1, data_hid = -1;
--- a/libinterp/octave-value/ov-flt-complex.h +++ b/libinterp/octave-value/ov-flt-complex.h @@ -63,14 +63,15 @@ ~octave_float_complex (void) { } - octave_base_value *clone (void) const { return new octave_float_complex (*this); } + octave_base_value *clone (void) const + { return new octave_float_complex (*this); } // We return an octave_float_complex_matrix object here instead of an // octave_float_complex object so that in expressions like A(2,2,2) = 2 // (for A previously undefined), A will be empty instead of a 1x1 // object. octave_base_value *empty_clone (void) const - { return new octave_float_complex_matrix (); } + { return new octave_float_complex_matrix (); } octave_base_value *try_narrowing_conversion (void); @@ -78,11 +79,11 @@ bool resize_ok = false); octave_value any (int = 0) const - { - return (scalar != FloatComplex (0, 0) - && ! (lo_ieee_isnan (std::real (scalar)) - || lo_ieee_isnan (std::imag (scalar)))); - } + { + return (scalar != FloatComplex (0, 0) + && ! (lo_ieee_isnan (std::real (scalar)) + || lo_ieee_isnan (std::imag (scalar)))); + } builtin_type_t builtin_type (void) const { return btyp_float_complex; } @@ -99,10 +100,10 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -113,10 +114,10 @@ FloatNDArray float_array_value (bool = false) const; SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (matrix_value ()); } + { return SparseMatrix (matrix_value ()); } SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (complex_matrix_value ()); } + { return SparseComplexMatrix (complex_matrix_value ()); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -176,11 +177,11 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // Yes, for compatibility, we drop the imaginary part here. - return os.write (array_value (true), block_size, output_type, - skip, flt_fmt); - } + { + // Yes, for compatibility, we drop the imaginary part here. + return os.write (array_value (true), block_size, output_type, + skip, flt_fmt); + } mxArray *as_mxArray (void) const;
--- a/libinterp/octave-value/ov-flt-cx-diag.cc +++ b/libinterp/octave-value/ov-flt-cx-diag.cc @@ -133,7 +133,8 @@ return ::imag (matrix); case umap_sqrt: { - FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> (std::sqrt); + FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> + (std::sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -155,7 +156,7 @@ FloatComplexMatrix m = FloatComplexMatrix (matrix.extract_diag ()); save_type st = LS_FLOAT; - if (matrix.length () > 4096) // FIXME -- make this configurable. + if (matrix.length () > 4096) // FIXME: make this configurable. { float max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -170,7 +171,7 @@ bool octave_float_complex_diag_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { int32_t r, c; char tmp;
--- a/libinterp/octave-value/ov-flt-cx-diag.h +++ b/libinterp/octave-value/ov-flt-cx-diag.h @@ -48,8 +48,10 @@ ~octave_float_complex_diag_matrix (void) { } - octave_base_value *clone (void) const { return new octave_float_complex_diag_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_float_complex_diag_matrix (); } + octave_base_value *clone (void) const + { return new octave_float_complex_diag_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_float_complex_diag_matrix (); } type_conv_info numeric_conversion_function (void) const;
--- a/libinterp/octave-value/ov-flt-cx-mat.cc +++ b/libinterp/octave-value/ov-flt-cx-mat.cc @@ -441,7 +441,7 @@ FloatComplexNDArray m = complex_array_value (); save_type st = LS_FLOAT; - if (d.numel () > 4096) // FIXME -- make this configurable. + if (d.numel () > 4096) // FIXME: make this configurable. { float max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -456,7 +456,7 @@ bool octave_float_complex_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; int32_t mdims; @@ -498,7 +498,7 @@ FloatComplexNDArray m(dv); FloatComplex *im = m.fortran_vec (); read_floats (is, reinterpret_cast<float *> (im), - static_cast<save_type> (tmp), 2 * dv.numel (), swap, fmt); + static_cast<save_type> (tmp), 2 * dv.numel (), swap, fmt); if (error_state || ! is) return false; matrix = m; @@ -517,7 +517,7 @@ FloatComplex *im = m.fortran_vec (); octave_idx_type len = nr * nc; read_floats (is, reinterpret_cast<float *> (im), - static_cast<save_type> (tmp), 2*len, swap, fmt); + static_cast<save_type> (tmp), 2*len, swap, fmt); if (error_state || ! is) return false; matrix = m; @@ -614,7 +614,7 @@ if (empty > 0) matrix.resize (dv); if (empty) - return (empty > 0); + return (empty > 0); #if HAVE_HDF5_18 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT); @@ -683,7 +683,7 @@ void octave_float_complex_matrix::print_raw (std::ostream& os, - bool pr_as_read_syntax) const + bool pr_as_read_syntax) const { octave_print_internal (os, matrix, pr_as_read_syntax, current_print_indent_level ());
--- a/libinterp/octave-value/ov-flt-cx-mat.h +++ b/libinterp/octave-value/ov-flt-cx-mat.h @@ -82,8 +82,10 @@ ~octave_float_complex_matrix (void) { } - octave_base_value *clone (void) const { return new octave_float_complex_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_float_complex_matrix (); } + octave_base_value *clone (void) const + { return new octave_float_complex_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_float_complex_matrix (); } octave_base_value *try_narrowing_conversion (void); @@ -102,10 +104,10 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -159,11 +161,11 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // Yes, for compatibility, we drop the imaginary part here. - return os.write (matrix_value (true), block_size, output_type, - skip, flt_fmt); - } + { + // Yes, for compatibility, we drop the imaginary part here. + return os.write (matrix_value (true), block_size, output_type, + skip, flt_fmt); + } void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
--- a/libinterp/octave-value/ov-flt-re-diag.cc +++ b/libinterp/octave-value/ov-flt-re-diag.cc @@ -103,7 +103,8 @@ return DiagMatrix (matrix.rows (), matrix.cols (), 0.0); case umap_sqrt: { - FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> (rc_sqrt); + FloatComplexColumnVector tmp = matrix.extract_diag ().map<FloatComplex> + (rc_sqrt); FloatComplexDiagMatrix retval (tmp); retval.resize (matrix.rows (), matrix.columns ()); return retval; @@ -124,7 +125,7 @@ FloatMatrix m = FloatMatrix (matrix.extract_diag ()); save_type st = LS_FLOAT; - if (matrix.length () > 8192) // FIXME -- make this configurable. + if (matrix.length () > 8192) // FIXME: make this configurable. { float max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -139,7 +140,7 @@ bool octave_float_diag_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { int32_t r, c; char tmp;
--- a/libinterp/octave-value/ov-flt-re-diag.h +++ b/libinterp/octave-value/ov-flt-re-diag.h @@ -48,8 +48,10 @@ ~octave_float_diag_matrix (void) { } - octave_base_value *clone (void) const { return new octave_float_diag_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_float_diag_matrix (); } + octave_base_value *clone (void) const + { return new octave_float_diag_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_float_diag_matrix (); } type_conv_info numeric_conversion_function (void) const;
--- a/libinterp/octave-value/ov-flt-re-mat.cc +++ b/libinterp/octave-value/ov-flt-re-mat.cc @@ -72,7 +72,8 @@ DEFINE_OCTAVE_ALLOCATOR (octave_float_matrix); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_matrix, "float matrix", "single"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_float_matrix, "float matrix", + "single"); octave_base_value * octave_float_matrix::try_narrowing_conversion (void) @@ -305,8 +306,7 @@ if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) { - // FIXME -- is there something - // better we could do? + // FIXME: is there something better we could do? ival = 0; @@ -469,7 +469,7 @@ FloatNDArray m = float_array_value (); save_type st = LS_FLOAT; - if (d.numel () > 8192) // FIXME -- make this configurable. + if (d.numel () > 8192) // FIXME: make this configurable. { float max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -484,7 +484,7 @@ bool octave_float_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; int32_t mdims; @@ -525,7 +525,8 @@ FloatNDArray m(dv); float *re = m.fortran_vec (); - read_floats (is, re, static_cast<save_type> (tmp), dv.numel (), swap, fmt); + read_floats (is, re, static_cast<save_type> (tmp), dv.numel (), + swap, fmt); if (error_state || ! is) return false; matrix = m; @@ -622,7 +623,7 @@ if (empty > 0) matrix.resize (dv); if (empty) - return (empty > 0); + return (empty > 0); #if HAVE_HDF5_18 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT); @@ -678,7 +679,7 @@ void octave_float_matrix::print_raw (std::ostream& os, - bool pr_as_read_syntax) const + bool pr_as_read_syntax) const { octave_print_internal (os, matrix, pr_as_read_syntax, current_print_indent_level ()); @@ -816,7 +817,7 @@ } DEFUN (single, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} single (@var{x})\n\ Convert @var{x} to single precision type.\n\ @seealso{double}\n\ @@ -832,11 +833,13 @@ { if (args(0).is_complex_type ()) { - OCTAVE_TYPE_CONV_BODY3 (single, octave_float_complex_diag_matrix, octave_float_complex); + OCTAVE_TYPE_CONV_BODY3 (single, octave_float_complex_diag_matrix, + octave_float_complex); } else { - OCTAVE_TYPE_CONV_BODY3 (single, octave_float_diag_matrix, octave_float_scalar); + OCTAVE_TYPE_CONV_BODY3 (single, octave_float_diag_matrix, + octave_float_scalar); } } else if (args(0).is_sparse_type ()) @@ -845,11 +848,13 @@ } else if (args(0).is_complex_type ()) { - OCTAVE_TYPE_CONV_BODY3 (single, octave_float_complex_matrix, octave_float_complex); + OCTAVE_TYPE_CONV_BODY3 (single, octave_float_complex_matrix, + octave_float_complex); } else { - OCTAVE_TYPE_CONV_BODY3 (single, octave_float_matrix, octave_float_scalar); + OCTAVE_TYPE_CONV_BODY3 (single, octave_float_matrix, + octave_float_scalar); } } else
--- a/libinterp/octave-value/ov-flt-re-mat.h +++ b/libinterp/octave-value/ov-flt-re-mat.h @@ -82,13 +82,15 @@ ~octave_float_matrix (void) { } - octave_base_value *clone (void) const { return new octave_float_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_float_matrix (); } + octave_base_value *clone (void) const + { return new octave_float_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_float_matrix (); } octave_base_value *try_narrowing_conversion (void); idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } builtin_type_t builtin_type (void) const { return btyp_float; } @@ -129,10 +131,10 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -195,7 +197,7 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else.
--- a/libinterp/octave-value/ov-int16.cc +++ b/libinterp/octave-value/ov-int16.cc @@ -74,7 +74,7 @@ "int16 scalar", "int16"); DEFUN (int16, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} int16 (@var{x})\n\ Convert @var{x} to 16-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-int32.cc +++ b/libinterp/octave-value/ov-int32.cc @@ -74,7 +74,7 @@ "int32 scalar", "int32"); DEFUN (int32, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} int32 (@var{x})\n\ Convert @var{x} to 32-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-int64.cc +++ b/libinterp/octave-value/ov-int64.cc @@ -74,7 +74,7 @@ "int64 scalar", "int64"); DEFUN (int64, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} int64 (@var{x})\n\ Convert @var{x} to 64-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-int8.cc +++ b/libinterp/octave-value/ov-int8.cc @@ -74,7 +74,7 @@ "int8 scalar", "int8"); DEFUN (int8, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} int8 (@var{x})\n\ Convert @var{x} to 8-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-intx.h +++ b/libinterp/octave-value/ov-intx.h @@ -61,10 +61,10 @@ ~OCTAVE_VALUE_INT_MATRIX_T (void) { } octave_base_value *clone (void) const - { return new OCTAVE_VALUE_INT_MATRIX_T (*this); } + { return new OCTAVE_VALUE_INT_MATRIX_T (*this); } octave_base_value *empty_clone (void) const - { return new OCTAVE_VALUE_INT_MATRIX_T (); } + { return new OCTAVE_VALUE_INT_MATRIX_T (); } bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } @@ -100,41 +100,41 @@ double double_value (bool = false) const - { - double retval = lo_ieee_nan_value (); + { + double retval = lo_ieee_nan_value (); - if (numel () > 0) - { - gripe_implicit_conversion ("Octave:array-to-scalar", - type_name (), "real scalar"); + if (numel () > 0) + { + gripe_implicit_conversion ("Octave:array-to-scalar", + type_name (), "real scalar"); - retval = matrix(0).double_value (); - } - else - gripe_invalid_conversion (type_name (), "real scalar"); + retval = matrix(0).double_value (); + } + else + gripe_invalid_conversion (type_name (), "real scalar"); - return retval; + return retval; - } + } float float_value (bool = false) const - { - float retval = lo_ieee_float_nan_value (); + { + float retval = lo_ieee_float_nan_value (); - if (numel () > 0) - { - gripe_implicit_conversion ("Octave:array-to-scalar", - type_name (), "real scalar"); + if (numel () > 0) + { + gripe_implicit_conversion ("Octave:array-to-scalar", + type_name (), "real scalar"); - retval = matrix(0).float_value (); - } - else - gripe_invalid_conversion (type_name (), "real scalar"); + retval = matrix(0).float_value (); + } + else + gripe_invalid_conversion (type_name (), "real scalar"); - return retval; + return retval; - } + } double scalar_value (bool = false) const { return double_value (); } @@ -142,119 +142,119 @@ Matrix matrix_value (bool = false) const - { - Matrix retval; - dim_vector dv = dims (); - if (dv.length () > 2) - error ("invalid conversion of %s to Matrix", type_name ().c_str ()); - else - { - retval = Matrix (dv(0), dv(1)); - double *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = matrix(i).double_value (); - } - return retval; - } + { + Matrix retval; + dim_vector dv = dims (); + if (dv.length () > 2) + error ("invalid conversion of %s to Matrix", type_name ().c_str ()); + else + { + retval = Matrix (dv(0), dv(1)); + double *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = matrix(i).double_value (); + } + return retval; + } FloatMatrix float_matrix_value (bool = false) const - { - FloatMatrix retval; - dim_vector dv = dims (); - if (dv.length () > 2) - error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); - else - { - retval = FloatMatrix (dv(0), dv(1)); - float *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = matrix(i).float_value (); - } - return retval; - } + { + FloatMatrix retval; + dim_vector dv = dims (); + if (dv.length () > 2) + error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); + else + { + retval = FloatMatrix (dv(0), dv(1)); + float *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = matrix(i).float_value (); + } + return retval; + } ComplexMatrix complex_matrix_value (bool = false) const - { - ComplexMatrix retval; - dim_vector dv = dims (); - if (dv.length () > 2) - error ("invalid conversion of %s to Matrix", type_name ().c_str ()); - else - { - retval = ComplexMatrix (dv(0), dv(1)); - Complex *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = Complex (matrix(i).double_value ()); - } - return retval; - } + { + ComplexMatrix retval; + dim_vector dv = dims (); + if (dv.length () > 2) + error ("invalid conversion of %s to Matrix", type_name ().c_str ()); + else + { + retval = ComplexMatrix (dv(0), dv(1)); + Complex *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = Complex (matrix(i).double_value ()); + } + return retval; + } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { - FloatComplexMatrix retval; - dim_vector dv = dims (); - if (dv.length () > 2) - error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); - else - { - retval = FloatComplexMatrix (dv(0), dv(1)); - FloatComplex *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = FloatComplex (matrix(i).float_value ()); - } - return retval; - } + { + FloatComplexMatrix retval; + dim_vector dv = dims (); + if (dv.length () > 2) + error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); + else + { + retval = FloatComplexMatrix (dv(0), dv(1)); + FloatComplex *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = FloatComplex (matrix(i).float_value ()); + } + return retval; + } NDArray array_value (bool = false) const - { - NDArray retval (matrix.dims ()); - double *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = matrix(i).double_value (); - return retval; - } + { + NDArray retval (matrix.dims ()); + double *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = matrix(i).double_value (); + return retval; + } FloatNDArray float_array_value (bool = false) const - { - FloatNDArray retval (matrix.dims ()); - float *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = matrix(i).float_value (); - return retval; - } + { + FloatNDArray retval (matrix.dims ()); + float *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = matrix(i).float_value (); + return retval; + } ComplexNDArray complex_array_value (bool = false) const - { - ComplexNDArray retval (matrix.dims ()); - Complex *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = Complex (matrix(i).double_value ()); - return retval; - } + { + ComplexNDArray retval (matrix.dims ()); + Complex *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = Complex (matrix(i).double_value ()); + return retval; + } FloatComplexNDArray float_complex_array_value (bool = false) const - { - FloatComplexNDArray retval (matrix.dims ()); - FloatComplex *vec = retval.fortran_vec (); - octave_idx_type nel = matrix.numel (); - for (octave_idx_type i = 0; i < nel; i++) - vec[i] = FloatComplex (matrix(i).float_value ()); - return retval; - } + { + FloatComplexNDArray retval (matrix.dims ()); + FloatComplex *vec = retval.fortran_vec (); + octave_idx_type nel = matrix.numel (); + for (octave_idx_type i = 0; i < nel; i++) + vec[i] = FloatComplex (matrix(i).float_value ()); + return retval; + } boolNDArray bool_array_value (bool warn = false) const @@ -289,27 +289,27 @@ // Use matrix_ref here to clear index cache. void increment (void) - { - matrix_ref () += OCTAVE_INT_T (1); - } + { + matrix_ref () += OCTAVE_INT_T (1); + } void decrement (void) - { - matrix_ref () -= OCTAVE_INT_T (1); - } + { + matrix_ref () -= OCTAVE_INT_T (1); + } void changesign (void) - { - matrix_ref ().changesign (); - } + { + matrix_ref ().changesign (); + } idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else. @@ -319,7 +319,8 @@ { mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, dims (), mxREAL); - OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ()); + OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> + (retval->get_data ()); mwSize nel = numel (); @@ -332,36 +333,36 @@ } octave_value map (unary_mapper_t umap) const - { - switch (umap) + { + switch (umap) + { + case umap_abs: + return matrix.abs (); + case umap_signum: + return matrix.signum (); + case umap_ceil: + case umap_conj: + case umap_fix: + case umap_floor: + case umap_real: + case umap_round: + return matrix; + case umap_imag: + return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ()); + case umap_isnan: + case umap_isna: + case umap_isinf: + return boolNDArray (matrix.dims (), false); + case umap_finite: + return boolNDArray (matrix.dims (), true); + + default: { - case umap_abs: - return matrix.abs (); - case umap_signum: - return matrix.signum (); - case umap_ceil: - case umap_conj: - case umap_fix: - case umap_floor: - case umap_real: - case umap_round: - return matrix; - case umap_imag: - return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ()); - case umap_isnan: - case umap_isna: - case umap_isinf: - return boolNDArray (matrix.dims (), false); - case umap_finite: - return boolNDArray (matrix.dims (), true); - - default: - { - octave_matrix m (array_value ()); - return m.map (umap); - } + octave_matrix m (array_value ()); + return m.map (umap); } - } + } + } private: @@ -386,30 +387,30 @@ ~OCTAVE_VALUE_INT_SCALAR_T (void) { } octave_base_value *clone (void) const - { return new OCTAVE_VALUE_INT_SCALAR_T (*this); } + { return new OCTAVE_VALUE_INT_SCALAR_T (*this); } octave_base_value *empty_clone (void) const - { return new OCTAVE_VALUE_INT_MATRIX_T (); } + { return new OCTAVE_VALUE_INT_MATRIX_T (); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) - { - // FIXME -- this doesn't solve the problem of - // - // a = 1; a([1,1], [1,1], [1,1]) - // - // and similar constructions. Hmm... + { + // FIXME: this doesn't solve the problem of + // + // a = 1; a([1,1], [1,1], [1,1]) + // + // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the - // 1x1 matrix back to a scalar value. Need a better solution - // to this problem. + // FIXME: using this constructor avoids narrowing the + // 1x1 matrix back to a scalar value. Need a better solution + // to this problem. - octave_value tmp - (new OCTAVE_VALUE_INT_MATRIX_T - (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION ())); + octave_value tmp + (new OCTAVE_VALUE_INT_MATRIX_T + (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION ())); - return tmp.do_index_op (idx, resize_ok); - } + return tmp.do_index_op (idx, resize_ok); + } bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } @@ -445,53 +446,53 @@ int8NDArray int8_array_value (void) const - { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); } + { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); } int16NDArray int16_array_value (void) const - { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); } + { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); } int32NDArray int32_array_value (void) const - { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); } + { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); } int64NDArray int64_array_value (void) const - { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); } + { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); } uint8NDArray uint8_array_value (void) const - { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); } + { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); } uint16NDArray uint16_array_value (void) const - { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); } + { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); } uint32NDArray uint32_array_value (void) const - { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); } + { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); } uint64NDArray uint64_array_value (void) const - { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); } + { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); } octave_value resize (const dim_vector& dv, bool fill = false) const - { - if (fill) - { - intNDArray<OCTAVE_INT_T> retval (dv, 0); - if (dv.numel ()) - retval(0) = scalar; - return retval; - } - else - { - intNDArray<OCTAVE_INT_T> retval (dv); - if (dv.numel ()) - retval(0) = scalar; - return retval; - } - } + { + if (fill) + { + intNDArray<OCTAVE_INT_T> retval (dv, 0); + if (dv.numel ()) + retval(0) = scalar; + return retval; + } + else + { + intNDArray<OCTAVE_INT_T> retval (dv); + if (dv.numel ()) + retval(0) = scalar; + return retval; + } + } double double_value (bool = false) const { return scalar.double_value (); } @@ -499,71 +500,72 @@ double scalar_value (bool = false) const { return scalar.double_value (); } - float float_scalar_value (bool = false) const { return scalar.float_value (); } + float float_scalar_value (bool = false) const + { return scalar.float_value (); } Matrix matrix_value (bool = false) const - { - Matrix retval (1, 1); - retval(0,0) = scalar.double_value (); - return retval; - } + { + Matrix retval (1, 1); + retval(0,0) = scalar.double_value (); + return retval; + } FloatMatrix float_matrix_value (bool = false) const - { - FloatMatrix retval (1, 1); - retval(0,0) = scalar.float_value (); - return retval; - } + { + FloatMatrix retval (1, 1); + retval(0,0) = scalar.float_value (); + return retval; + } ComplexMatrix complex_matrix_value (bool = false) const - { - ComplexMatrix retval (1, 1); - retval(0,0) = Complex (scalar.double_value ()); - return retval; - } + { + ComplexMatrix retval (1, 1); + retval(0,0) = Complex (scalar.double_value ()); + return retval; + } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { - FloatComplexMatrix retval (1, 1); - retval(0,0) = FloatComplex (scalar.float_value ()); - return retval; - } + { + FloatComplexMatrix retval (1, 1); + retval(0,0) = FloatComplex (scalar.float_value ()); + return retval; + } NDArray array_value (bool = false) const - { - NDArray retval (dim_vector (1, 1)); - retval(0) = scalar.double_value (); - return retval; - } + { + NDArray retval (dim_vector (1, 1)); + retval(0) = scalar.double_value (); + return retval; + } FloatNDArray float_array_value (bool = false) const - { - FloatNDArray retval (dim_vector (1, 1)); - retval(0) = scalar.float_value (); - return retval; - } + { + FloatNDArray retval (dim_vector (1, 1)); + retval(0) = scalar.float_value (); + return retval; + } ComplexNDArray complex_array_value (bool = false) const - { - ComplexNDArray retval (dim_vector (1, 1)); - retval(0) = FloatComplex (scalar.double_value ()); - return retval; - } + { + ComplexNDArray retval (dim_vector (1, 1)); + retval(0) = FloatComplex (scalar.double_value ()); + return retval; + } FloatComplexNDArray float_complex_array_value (bool = false) const - { - FloatComplexNDArray retval (dim_vector (1, 1)); - retval(0) = FloatComplex (scalar.float_value ()); - return retval; - } + { + FloatComplexNDArray retval (dim_vector (1, 1)); + retval(0) = FloatComplex (scalar.float_value ()); + return retval; + } bool bool_value (bool warn = false) const { @@ -595,24 +597,24 @@ } void increment (void) - { - scalar += OCTAVE_INT_T (1); - } + { + scalar += OCTAVE_INT_T (1); + } void decrement (void) - { - scalar -= OCTAVE_INT_T (1); - } + { + scalar -= OCTAVE_INT_T (1); + } idx_vector index_vector (void) const { return idx_vector (scalar); } int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, octave_idx_type skip, oct_mach_info::float_format flt_fmt) const - { - return os.write (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION (), - block_size, output_type, skip, flt_fmt); - } + { + return os.write (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION (), + block_size, output_type, skip, flt_fmt); + } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else. @@ -622,7 +624,8 @@ { mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, 1, 1, mxREAL); - OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ()); + OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> + (retval->get_data ()); pr[0] = scalar.value (); @@ -630,36 +633,36 @@ } octave_value map (unary_mapper_t umap) const - { - switch (umap) + { + switch (umap) + { + case umap_abs: + return scalar.abs (); + case umap_signum: + return scalar.signum (); + case umap_ceil: + case umap_conj: + case umap_fix: + case umap_floor: + case umap_real: + case umap_round: + return scalar; + case umap_imag: + return OCTAVE_INT_T (); + case umap_isnan: + case umap_isna: + case umap_isinf: + return false; + case umap_finite: + return true; + + default: { - case umap_abs: - return scalar.abs (); - case umap_signum: - return scalar.signum (); - case umap_ceil: - case umap_conj: - case umap_fix: - case umap_floor: - case umap_real: - case umap_round: - return scalar; - case umap_imag: - return OCTAVE_INT_T (); - case umap_isnan: - case umap_isna: - case umap_isinf: - return false; - case umap_finite: - return true; - - default: - { - octave_scalar m (scalar_value ()); - return m.map (umap); - } + octave_scalar m (scalar_value ()); + return m.map (umap); } - } + } + } private:
--- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -166,7 +166,8 @@ vm_args.nOptions = java_opts.size (); vm_args.options = new JavaVMOption [vm_args.nOptions]; - for (std::list<std::string>::const_iterator it = java_opts.begin (); it != java_opts.end (); ++it) + for (std::list<std::string>::const_iterator it = java_opts.begin (); + it != java_opts.end (); ++it) { if (Vdebug_java) std::cout << *it << std::endl; @@ -197,7 +198,8 @@ if (! RegQueryValueEx (hkey, value.c_str (), 0, 0, 0, &len)) { retval.resize (len); - if (RegQueryValueEx (hkey, value.c_str (), 0, 0, (LPBYTE)&retval[0], &len)) + if (RegQueryValueEx (hkey, value.c_str (), 0, 0, + (LPBYTE)&retval[0], &len)) retval = ""; else if (retval[len-1] == '\0') retval.resize (--len); @@ -245,7 +247,8 @@ if (! dllfcn && first) { HINSTANCE hKernel32 = GetModuleHandle ("kernel32"); - dllfcn = reinterpret_cast<dllfcn_t> (GetProcAddress (hKernel32, "SetDllDirectoryA")); + dllfcn = reinterpret_cast<dllfcn_t> (GetProcAddress (hKernel32, + "SetDllDirectoryA")); first = false; } @@ -508,8 +511,10 @@ #endif - JNI_CreateJavaVM_t create_vm = reinterpret_cast<JNI_CreateJavaVM_t> (lib.search ("JNI_CreateJavaVM")); - JNI_GetCreatedJavaVMs_t get_vm = reinterpret_cast<JNI_GetCreatedJavaVMs_t> (lib.search ("JNI_GetCreatedJavaVMs")); + JNI_CreateJavaVM_t create_vm = + reinterpret_cast<JNI_CreateJavaVM_t> (lib.search ("JNI_CreateJavaVM")); + JNI_GetCreatedJavaVMs_t get_vm = + reinterpret_cast<JNI_GetCreatedJavaVMs_t> (lib.search ("JNI_GetCreatedJavaVMs")); if (!create_vm) throw std::string ("unable to find JNI_CreateJavaVM in ") + jvm_lib_path; @@ -540,7 +545,8 @@ vm_args.version = JNI_VERSION_1_2; vm_args.name = const_cast<char *> ("octave"); vm_args.group = NULL; - if (jvm->AttachCurrentThread (reinterpret_cast<void **> (¤t_env), &vm_args) < 0) + if (jvm->AttachCurrentThread (reinterpret_cast<void **> (¤t_env), + &vm_args) < 0) throw std::string ("JVM internal error, unable to attach octave to existing JVM"); break; @@ -635,7 +641,8 @@ if (cls) { if (jni_env->IsInstanceOf (obj, cls)) - retval = jstring_to_string (jni_env, reinterpret_cast<jstring> (obj)); + retval = jstring_to_string (jni_env, + reinterpret_cast<jstring> (obj)); } } @@ -671,8 +678,10 @@ jni_env->ExceptionClear (); jclass_ref jcls (jni_env, jni_env->GetObjectClass (ex)); - jmethodID mID = jni_env->GetMethodID (jcls, "toString", "()Ljava/lang/String;"); - jstring_ref js (jni_env, reinterpret_cast<jstring> (jni_env->CallObjectMethod (ex, mID))); + jmethodID mID = jni_env->GetMethodID (jcls, "toString", + "()Ljava/lang/String;"); + jstring_ref js (jni_env, + reinterpret_cast<jstring> (jni_env->CallObjectMethod (ex, mID))); std::string msg = jstring_to_string (jni_env, js); error ("[java] %s", msg.c_str ()); @@ -699,7 +708,8 @@ { if (class_loader.empty ()) { - jclass_ref syscls (jni_env, jni_env->FindClass ("java/lang/System")); + jclass_ref syscls (jni_env, + jni_env->FindClass ("java/lang/System")); jmethodID mID = jni_env->GetStaticMethodID (syscls, "getProperty", "(Ljava/lang/String;)Ljava/lang/String;"); jstring_ref js (jni_env, jni_env->NewStringUTF ("octave.class.loader")); js = reinterpret_cast<jstring> (jni_env->CallStaticObjectMethod (syscls, mID, jstring (js))); @@ -1148,7 +1158,8 @@ for (int r = 0; r < rows; r++) { - jdoubleArray_ref row (jni_env, reinterpret_cast<jdoubleArray> (jni_env->GetObjectArrayElement (jarr, r))); + jdoubleArray_ref row (jni_env, + reinterpret_cast<jdoubleArray> (jni_env->GetObjectArrayElement (jarr, r))); if (m.length () == 0) { @@ -1176,7 +1187,8 @@ for (int i = 0; i < len; i++) { - jstring_ref js (jni_env, reinterpret_cast<jstring> (jni_env->GetObjectArrayElement (jarr, i))); + jstring_ref js (jni_env, + reinterpret_cast<jstring> (jni_env->GetObjectArrayElement (jarr, i))); m(i) = jstring_to_string (jni_env, js); } @@ -1286,16 +1298,19 @@ { NDArray m = val.array_value (); jdoubleArray_ref dv (jni_env, jni_env->NewDoubleArray (m.length ())); - jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.length (), m.fortran_vec ()); + jni_env->SetDoubleArrayRegion (jdoubleArray (dv), 0, m.length (), + m.fortran_vec ()); jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([D[I)V"); - jobj = jni_env->NewObject (jclass (mcls), mID, jdoubleArray (dv), jintArray (iv)); + jobj = jni_env->NewObject (jclass (mcls), mID, jdoubleArray (dv), + jintArray (iv)); jcls = jni_env->GetObjectClass (jobj); } else if (val.is_int8_type ()) { int8NDArray m = val.int8_array_value (); jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); - jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), reinterpret_cast <jbyte *> (m.fortran_vec ())); + jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), + reinterpret_cast <jbyte *> (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); jcls = jni_env->GetObjectClass (jobj); @@ -1304,7 +1319,8 @@ { uint8NDArray m = val.uint8_array_value (); jbyteArray_ref bv (jni_env, jni_env->NewByteArray (m.length ())); - jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), reinterpret_cast<jbyte *> (m.fortran_vec ())); + jni_env->SetByteArrayRegion (jbyteArray (bv), 0, m.length (), + reinterpret_cast<jbyte *> (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([B[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jbyteArray (bv), jintArray (iv)); jcls = jni_env->GetObjectClass (jobj); @@ -1313,7 +1329,8 @@ { int32NDArray m = val.int32_array_value (); jintArray_ref v (jni_env, jni_env->NewIntArray (m.length ())); - jni_env->SetIntArrayRegion (jintArray (v), 0, m.length (), reinterpret_cast<jint *> (m.fortran_vec ())); + jni_env->SetIntArrayRegion (jintArray (v), 0, m.length (), + reinterpret_cast<jint *> (m.fortran_vec ())); jmethodID mID = jni_env->GetMethodID (mcls, "<init>", "([I[I)V"); jobj = jni_env->NewObject (jclass (mcls), mID, jintArray (v), jintArray (iv)); jcls = jni_env->GetObjectClass (jobj); @@ -1331,7 +1348,8 @@ jobjectArray array = jni_env->NewObjectArray (cellStr.length (), scls, 0); for (int i = 0; i < cellStr.length (); i++) { - jstring_ref jstr (jni_env, jni_env->NewStringUTF (cellStr(i).string_value().c_str ())); + jstring_ref jstr (jni_env, + jni_env->NewStringUTF (cellStr(i).string_value().c_str ())); jni_env->SetObjectArrayElement (array, i, jstr); } jobj = array; @@ -1560,7 +1578,7 @@ octave_java::register_type (void) { t_id = octave_value_typeinfo::register_type - (octave_java::t_name, "<unknown>", octave_value (new octave_java ())); + (octave_java::t_name, "<unknown>", octave_value (new octave_java ())); } dim_vector @@ -1645,76 +1663,76 @@ switch (type[0]) { - case '.': - if (type.length () == 1) - { - // field assignment - octave_value_list ovl; - count++; - ovl(0) = octave_value (this); - ovl(1) = (idx.front ())(0); - ovl(2) = rhs; - feval ("__java_set__", ovl, 0); - if (! error_state) - { - count++; - retval = octave_value (this); - } - } - else if (type.length () > 2 && type[1] == '(') - { - std::list<octave_value_list> new_idx; - std::list<octave_value_list>::const_iterator it = idx.begin (); - new_idx.push_back (*it++); - new_idx.push_back (*it++); - octave_value_list u = subsref (type.substr (0, 2), new_idx, 1); - if (! error_state) - { - std::list<octave_value_list> next_idx (idx); - next_idx.erase (next_idx.begin ()); - next_idx.erase (next_idx.begin ()); - u(0).subsasgn (type.substr (2), next_idx, rhs); - if (! error_state) - { - count++; - retval = octave_value (this); - } - } - } - else if (type[1] == '.') - { - octave_value_list u = subsref (type.substr (0, 1), idx, 1); - if (! error_state) - { - std::list<octave_value_list> next_idx (idx); - next_idx.erase (next_idx.begin ()); - u(0).subsasgn (type.substr (1), next_idx, rhs); - if (! error_state) - { - count++; - retval = octave_value (this); - } - } - } - else - error ("invalid indexing/assignment on Java object"); - break; + case '.': + if (type.length () == 1) + { + // field assignment + octave_value_list ovl; + count++; + ovl(0) = octave_value (this); + ovl(1) = (idx.front ())(0); + ovl(2) = rhs; + feval ("__java_set__", ovl, 0); + if (! error_state) + { + count++; + retval = octave_value (this); + } + } + else if (type.length () > 2 && type[1] == '(') + { + std::list<octave_value_list> new_idx; + std::list<octave_value_list>::const_iterator it = idx.begin (); + new_idx.push_back (*it++); + new_idx.push_back (*it++); + octave_value_list u = subsref (type.substr (0, 2), new_idx, 1); + if (! error_state) + { + std::list<octave_value_list> next_idx (idx); + next_idx.erase (next_idx.begin ()); + next_idx.erase (next_idx.begin ()); + u(0).subsasgn (type.substr (2), next_idx, rhs); + if (! error_state) + { + count++; + retval = octave_value (this); + } + } + } + else if (type[1] == '.') + { + octave_value_list u = subsref (type.substr (0, 1), idx, 1); + if (! error_state) + { + std::list<octave_value_list> next_idx (idx); + next_idx.erase (next_idx.begin ()); + u(0).subsasgn (type.substr (1), next_idx, rhs); + if (! error_state) + { + count++; + retval = octave_value (this); + } + } + } + else + error ("invalid indexing/assignment on Java object"); + break; - case '(': - if (current_env) - { - set_array_elements (current_env, to_java (), idx.front (), rhs); - if (! error_state) - { - count++; - retval = octave_value (this); - } - } - break; + case '(': + if (current_env) + { + set_array_elements (current_env, to_java (), idx.front (), rhs); + if (! error_state) + { + count++; + retval = octave_value (this); + } + } + break; - default: - error ("Java object cannot be indexed with %c", type[0]); - break; + default: + error ("Java object cannot be indexed with %c", type[0]); + break; } return retval; @@ -1757,7 +1775,7 @@ octave_value octave_java::do_javaMethod (JNIEnv* jni_env, const std::string& name, - const octave_value_list& args) + const octave_value_list& args) { octave_value retval; @@ -1786,9 +1804,9 @@ octave_value octave_java:: do_javaMethod (JNIEnv* jni_env, - const std::string& class_name, - const std::string& name, - const octave_value_list& args) + const std::string& class_name, + const std::string& name, + const octave_value_list& args) { octave_value retval; @@ -1818,7 +1836,7 @@ octave_value octave_java::do_javaObject (JNIEnv* jni_env, const std::string& name, - const octave_value_list& args) + const octave_value_list& args) { octave_value retval; @@ -1959,7 +1977,7 @@ // documentation strings are always available, even when functions are not. DEFUN (__java_init__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} java_init ()\n\ Internal function used @strong{only} when debugging Java interface.\n\ Function will directly call initialize_java() to create an instance of a JVM.\n\ @@ -1984,7 +2002,7 @@ } DEFUN (__java_exit__, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} java_exit ()\n\ Internal function used @strong{only} when debugging Java interface.\n\ Function will directly call terminate_jvm() to destroy the current JVM\n\ @@ -2001,7 +2019,7 @@ } DEFUN (javaObject, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\ @deftypefnx {Built-in Function} {@var{jobj} =} javaObject (@var{classname}, @var{arg1}, @dots{})\n\ Create a Java object of class @var{classsname}, by calling the class\n\ @@ -2062,7 +2080,7 @@ */ DEFUN (javaMethod, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj})\n\ @deftypefnx {Built-in Function} {@var{ret} =} javaMethod (@var{methodname}, @var{obj}, @var{arg1}, @dots{})\n\ Invoke the method @var{methodname} on the Java object @var{obj} with the\n\ @@ -2137,7 +2155,7 @@ */ DEFUN (__java_get__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} __java_get__ (@var{obj}, @var{name})\n\ Get the value of the field @var{name} of the Java object @var{obj}. For\n\ static fields, @var{obj} can be a string representing the fully qualified\n\ @@ -2199,7 +2217,7 @@ } DEFUN (__java_set__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{obj} =} __java_set__ (@var{obj}, @var{name}, @var{val})\n\ Set the value of the field @var{name} of the Java object @var{obj} to\n\ @var{val}. For static fields, @var{obj} can be a string representing the\n\ @@ -2261,7 +2279,7 @@ } DEFUN (java2mat, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} java2mat (@var{javaobj})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -2297,7 +2315,7 @@ } DEFUN (java_matrix_autoconversion, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} java_matrix_autoconversion ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} java_matrix_autoconversion (@var{new_val})\n\ @deftypefnx {Built-in Function} {} java_matrix_autoconversion (@var{new_val}, \"local\")\n\ @@ -2319,7 +2337,7 @@ } DEFUN (java_unsigned_autoconversion, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} java_unsigned_autoconversion ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} java_unsigned_autoconversion (@var{new_val})\n\ @deftypefnx {Built-in Function} {} java_unsigned_autoconversion (@var{new_val}, \"local\")\n\ @@ -2343,7 +2361,7 @@ } DEFUN (debug_java, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_java ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_java (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_java (@var{new_val}, \"local\")\n\ @@ -2366,9 +2384,9 @@ } // Outside of #ifdef HAVE_JAVA because it is desirable to be able to -// test for the presence of a Java object without having Java installed. +// test for the presence of a Java object without having Java installed. DEFUN (isjava, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isjava (@var{x})\n\ Return true if @var{x} is a Java object.\n\ @seealso{class, typeinfo, isa, javaObject}\n\
--- a/libinterp/octave-value/ov-lazy-idx.h +++ b/libinterp/octave-value/ov-lazy-idx.h @@ -45,7 +45,8 @@ ~octave_lazy_index (void) { } - octave_base_value *clone (void) const { return new octave_lazy_index (*this); } + octave_base_value *clone (void) const + { return new octave_lazy_index (*this); } octave_base_value *empty_clone (void) const { return new octave_matrix (); } type_conv_info numeric_conversion_function (void) const; @@ -59,7 +60,7 @@ octave_value full_value (void) const { return make_value (); } idx_vector index_vector (void) const - { return index; } + { return index; } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -73,15 +74,15 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { return make_value ().subsref (type, idx); } + { return make_value ().subsref (type, idx); } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) - { return make_value ().do_index_op (idx, resize_ok); } + { return make_value ().do_index_op (idx, resize_ok); } dim_vector dims (void) const { return index.orig_dimensions (); } @@ -94,14 +95,14 @@ octave_value permute (const Array<int>& vec, bool inv = false) const; octave_value resize (const dim_vector& dv, bool fill = false) const - { return make_value ().resize (dv, fill); } + { return make_value ().resize (dv, fill); } octave_value all (int dim = 0) const { return make_value ().all (dim); } octave_value any (int dim = 0) const { return make_value ().any (dim); } MatrixType matrix_type (void) const { return make_value ().matrix_type (); } MatrixType matrix_type (const MatrixType& _typ) const - { return make_value ().matrix_type (_typ); } + { return make_value ().matrix_type (_typ); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const; @@ -123,16 +124,16 @@ bool is_constant (void) const { return true; } bool is_true (void) const - { return make_value ().is_true (); } + { return make_value ().is_true (); } bool print_as_scalar (void) const - { return make_value ().print_as_scalar (); } + { return make_value ().print_as_scalar (); } void print (std::ostream& os, bool pr_as_read_syntax = false) const - { make_value ().print (os, pr_as_read_syntax); } + { make_value ().print (os, pr_as_read_syntax); } void print_info (std::ostream& os, const std::string& prefix) const - { make_value ().print_info (os, prefix); } + { make_value ().print_info (os, prefix); } #define FORWARD_VALUE_QUERY(TYPE,NAME) \ TYPE \ @@ -186,13 +187,13 @@ FORWARD_VALUE_QUERY1 (SparseComplexMatrix, sparse_complex_matrix_value) octave_value diag (octave_idx_type k = 0) const - { return make_value ().diag (k); } + { return make_value ().diag (k); } octave_value convert_to_str_internal (bool pad, bool force, char type) const - { return make_value ().convert_to_str_internal (pad, force, type); } + { return make_value ().convert_to_str_internal (pad, force, type); } void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const - { return make_value ().print_raw (os, pr_as_read_syntax); } + { return make_value ().print_raw (os, pr_as_read_syntax); } bool save_ascii (std::ostream& os); @@ -208,40 +209,41 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return make_value ().write (os, block_size, output_type, skip, flt_fmt); } + { return make_value ().write (os, block_size, output_type, skip, flt_fmt); } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else. void *mex_get_data (void) const - { return make_value ().mex_get_data (); } + { return make_value ().mex_get_data (); } mxArray *as_mxArray (void) const - { return make_value ().as_mxArray (); } + { return make_value ().as_mxArray (); } octave_value map (unary_mapper_t umap) const - { return make_value ().map (umap); } + { return make_value ().map (umap); } private: const octave_value& make_value (void) const - { - if (value.is_undefined ()) - value = octave_value (index, false); + { + if (value.is_undefined ()) + value = octave_value (index, false); - return value; - } + return value; + } octave_value& make_value (void) - { - if (value.is_undefined ()) - value = octave_value (index, false); + { + if (value.is_undefined ()) + value = octave_value (index, false); - return value; - } + return value; + } idx_vector index; mutable octave_value value; - static octave_base_value *numeric_conversion_function (const octave_base_value&); + static octave_base_value * + numeric_conversion_function (const octave_base_value&); DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA };
--- a/libinterp/octave-value/ov-mex-fcn.cc +++ b/libinterp/octave-value/ov-mex-fcn.cc @@ -106,11 +106,11 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. // - // FIXME -- Note that if a function call returns multiple + // FIXME: Note that if a function call returns multiple // values, and there is further indexing to perform, then we are // ignoring all but the first value. Is this really what we want to // do? If it is not, then what should happen for stat("file").size, @@ -122,7 +122,7 @@ return retval; } -// FIXME -- shouldn't this declaration be a header file somewhere? +// FIXME: shouldn't this declaration be a header file somewhere? extern octave_value_list call_mex (bool have_fmex, void *f, const octave_value_list& args, int nargout, octave_mex_function *curr_mex_fcn);
--- a/libinterp/octave-value/ov-mex-fcn.h +++ b/libinterp/octave-value/ov-mex-fcn.h @@ -54,10 +54,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -87,7 +87,7 @@ void atexit (void (*fcn) (void)) { exit_fcn_ptr = fcn; } octave_shlib get_shlib (void) const - { return sh_lib; } + { return sh_lib; } private:
--- a/libinterp/octave-value/ov-null-mat.cc +++ b/libinterp/octave-value/ov-null-mat.cc @@ -28,7 +28,8 @@ #include "ops.h" #include "defun.h" -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_null_matrix, "null_matrix", "double"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_null_matrix, "null_matrix", + "double"); const octave_value octave_null_matrix::instance (new octave_null_matrix ()); @@ -44,8 +45,9 @@ octave_base_value::type_conv_info octave_null_matrix::numeric_conversion_function (void) const { - return octave_base_value::type_conv_info (default_null_matrix_numeric_conversion_function, - octave_matrix::static_type_id ()); + return octave_base_value::type_conv_info + (default_null_matrix_numeric_conversion_function, + octave_matrix::static_type_id ()); } DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_null_str, "null_string", "char"); @@ -64,11 +66,13 @@ octave_base_value::type_conv_info octave_null_str::numeric_conversion_function (void) const { - return octave_base_value::type_conv_info (default_null_str_numeric_conversion_function, - octave_char_matrix_str::static_type_id ()); + return octave_base_value::type_conv_info + (default_null_str_numeric_conversion_function, + octave_char_matrix_str::static_type_id ()); } -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_null_sq_str, "null_sq_string", "char"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_null_sq_str, "null_sq_string", + "char"); const octave_value octave_null_sq_str::instance (new octave_null_sq_str ()); @@ -84,12 +88,13 @@ octave_base_value::type_conv_info octave_null_sq_str::numeric_conversion_function (void) const { - return octave_base_value::type_conv_info (default_null_sq_str_numeric_conversion_function, - octave_char_matrix_sq_str::static_type_id ()); + return octave_base_value::type_conv_info + (default_null_sq_str_numeric_conversion_function, + octave_char_matrix_sq_str::static_type_id ()); } DEFUN (isnull, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isnull (@var{x})\n\ Return true if @var{x} is a special null matrix, string, or single quoted\n\ string. Indexed assignment with such a value on the right-hand side should\n\
--- a/libinterp/octave-value/ov-null-mat.h +++ b/libinterp/octave-value/ov-null-mat.h @@ -28,10 +28,11 @@ #include "ov-str-mat.h" // Design rationale: -// The constructors are hidden. There is only one null matrix (or null string) object, -// that can have shallow copies. Cloning the object returns just a normal empty matrix, -// so all the shallow copies are, in fact, read-only. This conveniently ensures that any -// attempt to fiddle with the null matrix destroys its special status. +// The constructors are hidden. There is only one null matrix (or null string) +// object, that can have shallow copies. Cloning the object returns just a +// normal empty matrix, so all the shallow copies are, in fact, read-only. This +// conveniently ensures that any attempt to fiddle with the null matrix +// destroys its special status. // The special [] value.
--- a/libinterp/octave-value/ov-oncleanup.cc +++ b/libinterp/octave-value/ov-oncleanup.cc @@ -137,7 +137,8 @@ } bool -octave_oncleanup::save_binary (std::ostream& /* os */, bool& /* save_as_floats */) +octave_oncleanup::save_binary (std::ostream& /* os */, + bool& /* save_as_floats */) { warn_save_load (); return true; @@ -185,7 +186,7 @@ } DEFUN (onCleanup, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{c} =} onCleanup (@var{action})\n\ Create a special object that executes a given function upon destruction.\n\ If the object is copied to multiple variables (or cell or struct array\n\
--- a/libinterp/octave-value/ov-perm.cc +++ b/libinterp/octave-value/ov-perm.cc @@ -251,7 +251,8 @@ } octave_value -octave_perm_matrix::convert_to_str_internal (bool pad, bool force, char type) const +octave_perm_matrix::convert_to_str_internal (bool pad, bool force, + char type) const { return to_dense ().convert_to_str_internal (pad, force, type); } @@ -319,7 +320,8 @@ bool colp = matrix.is_col_perm (); os.write (reinterpret_cast<char *> (&sz), 4); os.write (reinterpret_cast<char *> (&colp), 1); - os.write (reinterpret_cast<const char *> (matrix.data ()), matrix.byte_size ()); + os.write (reinterpret_cast<const char *> (matrix.data ()), + matrix.byte_size ()); return true; } @@ -395,15 +397,15 @@ int octave_perm_matrix::write (octave_stream& os, int block_size, - oct_data_conv::data_type output_type, int skip, - oct_mach_info::float_format flt_fmt) const + oct_data_conv::data_type output_type, int skip, + oct_mach_info::float_format flt_fmt) const { return to_dense ().write (os, block_size, output_type, skip, flt_fmt); } void octave_perm_matrix::print_info (std::ostream& os, - const std::string& prefix) const + const std::string& prefix) const { matrix.print_info (os, prefix); } @@ -413,7 +415,7 @@ octave_perm_matrix::to_dense (void) const { if (! dense_cache.is_defined ()) - dense_cache = Matrix (matrix); + dense_cache = Matrix (matrix); return dense_cache; }
--- a/libinterp/octave-value/ov-perm.h +++ b/libinterp/octave-value/ov-perm.h @@ -39,8 +39,10 @@ octave_perm_matrix (const PermMatrix& p) : matrix (p), dense_cache () { } - octave_base_value *clone (void) const { return new octave_perm_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_perm_matrix (); } + octave_base_value *clone (void) const + { return new octave_perm_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_perm_matrix (); } type_conv_info numeric_conversion_function (void) const; @@ -57,7 +59,7 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -67,38 +69,38 @@ octave_idx_type nnz (void) const { return matrix.rows (); } octave_value reshape (const dim_vector& new_dims) const - { return to_dense ().reshape (new_dims); } + { return to_dense ().reshape (new_dims); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return to_dense ().permute (vec, inv); } + { return to_dense ().permute (vec, inv); } octave_value resize (const dim_vector& dv, bool fill = false) const - { return to_dense ().resize (dv, fill); } + { return to_dense ().resize (dv, fill); } octave_value all (int dim = 0) const { return to_dense ().all (dim); } octave_value any (int dim = 0) const { return to_dense ().any (dim); } MatrixType matrix_type (void) const { return MatrixType::Permuted_Diagonal; } MatrixType matrix_type (const MatrixType&) const - { return matrix_type (); } + { return matrix_type (); } octave_value diag (octave_idx_type k = 0) const - { return to_dense () .diag (k); } + { return to_dense () .diag (k); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return to_dense ().sort (dim, mode); } + { return to_dense ().sort (dim, mode); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return to_dense ().sort (sidx, dim, mode); } + { return to_dense ().sort (sidx, dim, mode); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return to_dense ().is_sorted (mode); } + { return to_dense ().is_sorted (mode); } Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const - { return to_dense ().sort_rows_idx (mode); } + { return to_dense ().sort_rows_idx (mode); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return to_dense ().is_sorted_rows (mode); } + { return to_dense ().is_sorted_rows (mode); } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -127,12 +129,12 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } idx_vector index_vector (void) const; PermMatrix perm_matrix_value (void) const - { return matrix; } + { return matrix; } Matrix matrix_value (bool = false) const; @@ -214,7 +216,7 @@ void print_info (std::ostream& os, const std::string& prefix) const; octave_value map (unary_mapper_t umap) const - { return to_dense ().map (umap); } + { return to_dense ().map (umap); } protected:
--- a/libinterp/octave-value/ov-range.cc +++ b/libinterp/octave-value/ov-range.cc @@ -224,7 +224,7 @@ octave_value octave_range::all (int dim) const { - // FIXME -- this is a potential waste of memory. + // FIXME: this is a potential waste of memory. Matrix m = range.matrix_value (); @@ -234,7 +234,7 @@ octave_value octave_range::any (int dim) const { - // FIXME -- this is a potential waste of memory. + // FIXME: this is a potential waste of memory. Matrix m = range.matrix_value (); @@ -244,9 +244,10 @@ octave_value octave_range::diag (octave_idx_type k) const { - return (k == 0 - ? octave_value (DiagMatrix (DiagArray2<double> (range.matrix_value ()))) - : octave_value (range.diag (k))); + return + (k == 0 + ? octave_value (DiagMatrix (DiagArray2<double> (range.matrix_value ()))) + : octave_value (range.diag (k))); } octave_value @@ -264,7 +265,7 @@ if (range.nelem () != 0) { - // FIXME -- this is a potential waste of memory. + // FIXME: this is a potential waste of memory. Matrix m ((range.matrix_value () . all ()) . all ()); @@ -391,7 +392,7 @@ octave_range::short_disp (void) const { std::ostringstream buf; - + octave_idx_type len = range.nelem (); if (len == 0) @@ -679,7 +680,7 @@ } DEFUN (allow_noninteger_range_as_index, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} allow_noninteger_range_as_index ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} allow_noninteger_range_as_index (@var{new_val})\n\ @deftypefnx {Built-in Function} {} allow_noninteger_range_as_index (@var{new_val}, \"local\")\n\
--- a/libinterp/octave-value/ov-range.h +++ b/libinterp/octave-value/ov-range.h @@ -58,28 +58,28 @@ octave_range (double base, double limit, double inc) : octave_base_value (), range (base, limit, inc), idx_cache () - { - if (range.nelem () < 0) - ::error ("invalid range"); - } + { + if (range.nelem () < 0) + ::error ("invalid range"); + } octave_range (const Range& r) : octave_base_value (), range (r), idx_cache () - { - if (range.nelem () < 0 && range.nelem () != -2) - ::error ("invalid range"); - } + { + if (range.nelem () < 0 && range.nelem () != -2) + ::error ("invalid range"); + } octave_range (const octave_range& r) : octave_base_value (), range (r.range), idx_cache (r.idx_cache ? new idx_vector (*r.idx_cache) : 0) - { } + { } octave_range (const Range& r, const idx_vector& cache) : octave_base_value (), range (r), idx_cache () - { - set_idx_cache (cache); - } + { + set_idx_cache (cache); + } ~octave_range (void) { clear_cached_info (); } @@ -99,7 +99,7 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, int) - { return subsref (type, idx); } + { return subsref (type, idx); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -107,10 +107,10 @@ idx_vector index_vector (void) const; dim_vector dims (void) const - { - octave_idx_type n = range.nelem (); - return dim_vector (n > 0, n); - } + { + octave_idx_type n = range.nelem (); + return dim_vector (n > 0, n); + } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -118,10 +118,10 @@ size_t byte_size (void) const { return 3 * sizeof (double); } octave_value reshape (const dim_vector& new_dims) const - { return NDArray (array_value ().reshape (new_dims)); } + { return NDArray (array_value ().reshape (new_dims)); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return NDArray (array_value ().permute (vec, inv)); } + { return NDArray (array_value ().permute (vec, inv)); } octave_value squeeze (void) const { return range; } @@ -142,20 +142,20 @@ octave_value diag (octave_idx_type m, octave_idx_type n) const; octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return range.sort (dim, mode); } + { return range.sort (dim, mode); } octave_value sort (Array<octave_idx_type>& sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return range.sort (sidx, dim, mode); } + { return range.sort (sidx, dim, mode); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return range.is_sorted (mode); } + { return range.is_sorted (mode); } Array<octave_idx_type> sort_rows_idx (sortmode) const - { return Array<octave_idx_type> (dim_vector (1, 0)); } + { return Array<octave_idx_type> (dim_vector (1, 0)); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return mode ? mode : ASCENDING; } + { return mode ? mode : ASCENDING; } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -174,26 +174,26 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return float_value (frc_str_conv); } + { return float_value (frc_str_conv); } Matrix matrix_value (bool = false) const - { return range.matrix_value (); } + { return range.matrix_value (); } FloatMatrix float_matrix_value (bool = false) const - { return range.matrix_value (); } + { return range.matrix_value (); } NDArray array_value (bool = false) const - { return range.matrix_value (); } + { return range.matrix_value (); } FloatNDArray float_array_value (bool = false) const - { return FloatMatrix (range.matrix_value ()); } + { return FloatMatrix (range.matrix_value ()); } charNDArray char_array_value (bool = false) const; - // FIXME -- it would be better to have Range::intXNDArray_value + // FIXME: it would be better to have Range::intXNDArray_value // functions to avoid the intermediate conversion to a matrix // object. @@ -222,10 +222,10 @@ uint64_array_value (void) const { return uint64NDArray (array_value ()); } SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (range.matrix_value ()); } + { return SparseMatrix (range.matrix_value ()); } SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (sparse_matrix_value ()); } + { return SparseComplexMatrix (sparse_matrix_value ()); } Complex complex_value (bool = false) const; @@ -234,16 +234,16 @@ boolNDArray bool_array_value (bool warn = false) const; ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (range.matrix_value ()); } + { return ComplexMatrix (range.matrix_value ()); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (range.matrix_value ()); } + { return FloatComplexMatrix (range.matrix_value ()); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexMatrix (range.matrix_value ()); } + { return ComplexMatrix (range.matrix_value ()); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexMatrix (range.matrix_value ()); } + { return FloatComplexMatrix (range.matrix_value ()); } Range range_value (void) const { return range; } @@ -275,37 +275,36 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - // FIXME -- could be more memory efficient by having a - // special case of the octave_stream::write method for ranges. + { + // FIXME: could be more memory efficient by having a + // special case of the octave_stream::write method for ranges. - return os.write (matrix_value (), block_size, output_type, skip, - flt_fmt); - } + return os.write (matrix_value (), block_size, output_type, skip, flt_fmt); + } mxArray *as_mxArray (void) const; octave_value map (unary_mapper_t umap) const - { - octave_matrix m (matrix_value ()); - return m.map (umap); - } + { + octave_matrix m (matrix_value ()); + return m.map (umap); + } private: Range range; idx_vector set_idx_cache (const idx_vector& idx) const - { - delete idx_cache; - idx_cache = idx ? new idx_vector (idx) : 0; - return idx; - } + { + delete idx_cache; + idx_cache = idx ? new idx_vector (idx) : 0; + return idx; + } void clear_cached_info (void) const - { - delete idx_cache; idx_cache = 0; - } + { + delete idx_cache; idx_cache = 0; + } mutable idx_vector *idx_cache;
--- a/libinterp/octave-value/ov-re-diag.cc +++ b/libinterp/octave-value/ov-re-diag.cc @@ -37,7 +37,8 @@ DEFINE_OCTAVE_ALLOCATOR (octave_diag_matrix); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_diag_matrix, "diagonal matrix", "double"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_diag_matrix, "diagonal matrix", + "double"); static octave_base_value * default_numeric_conversion_function (const octave_base_value& a) @@ -65,8 +66,9 @@ octave_base_value::type_conv_info octave_diag_matrix::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_diag_matrix::static_type_id ()); + return octave_base_value::type_conv_info + (default_numeric_demotion_function, + octave_float_diag_matrix::static_type_id ()); } octave_base_value * @@ -193,7 +195,7 @@ else st = LS_FLOAT; } - else if (matrix.length () > 8192) // FIXME -- make this configurable. + else if (matrix.length () > 8192) // FIXME: make this configurable. { double max_val, min_val; if (m.all_integers (max_val, min_val))
--- a/libinterp/octave-value/ov-re-diag.h +++ b/libinterp/octave-value/ov-re-diag.h @@ -48,8 +48,10 @@ ~octave_diag_matrix (void) { } - octave_base_value *clone (void) const { return new octave_diag_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_diag_matrix (); } + octave_base_value *clone (void) const + { return new octave_diag_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_diag_matrix (); } type_conv_info numeric_conversion_function (void) const;
--- a/libinterp/octave-value/ov-re-mat.cc +++ b/libinterp/octave-value/ov-re-mat.cc @@ -85,8 +85,9 @@ octave_base_value::type_conv_info octave_matrix::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_matrix::static_type_id ()); + return octave_base_value::type_conv_info + (default_numeric_demotion_function, + octave_float_matrix::static_type_id ()); } octave_base_value * @@ -407,8 +408,7 @@ if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) { - // FIXME -- is there something - // better we could do? + // FIXME: is there something better we could do? ival = 0; @@ -581,7 +581,7 @@ else st = LS_FLOAT; } - else if (d.numel () > 8192) // FIXME -- make this configurable. + else if (d.numel () > 8192) // FIXME: make this configurable. { double max_val, min_val; if (m.all_integers (max_val, min_val)) @@ -596,7 +596,7 @@ bool octave_matrix::load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) + oct_mach_info::float_format fmt) { char tmp; int32_t mdims; @@ -637,7 +637,8 @@ NDArray m(dv); double *re = m.fortran_vec (); - read_doubles (is, re, static_cast<save_type> (tmp), dv.numel (), swap, fmt); + read_doubles (is, re, static_cast<save_type> (tmp), dv.numel (), + swap, fmt); if (error_state || ! is) return false; matrix = m; @@ -745,7 +746,7 @@ if (empty > 0) matrix.resize (dv); if (empty) - return (empty > 0); + return (empty > 0); #if HAVE_HDF5_18 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT); @@ -945,7 +946,7 @@ } DEFUN (double, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} double (@var{x})\n\ Convert @var{x} to double precision type.\n\ @seealso{single}\n\ @@ -965,27 +966,32 @@ { if (args(0).is_complex_type ()) { - OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_diag_matrix, octave_complex); + OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_diag_matrix, + octave_complex); } else { - OCTAVE_TYPE_CONV_BODY3 (double, octave_diag_matrix, octave_scalar); + OCTAVE_TYPE_CONV_BODY3 (double, octave_diag_matrix, + octave_scalar); } } else if (args(0).is_sparse_type ()) { if (args(0).is_complex_type ()) { - OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_complex_matrix, octave_complex); + OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_complex_matrix, + octave_complex); } else { - OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_matrix, octave_scalar); + OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_matrix, + octave_scalar); } } else if (args(0).is_complex_type ()) { - OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_matrix, octave_complex); + OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_matrix, + octave_complex); } else {
--- a/libinterp/octave-value/ov-re-mat.h +++ b/libinterp/octave-value/ov-re-mat.h @@ -83,17 +83,17 @@ octave_matrix (const Array<octave_idx_type>& idx, bool zero_based = false, bool cache_index = false) : octave_base_matrix<NDArray> (NDArray (idx, zero_based)) - { - // Auto-create cache to speed up subsequent indexing. - if (zero_based && cache_index) - set_idx_cache (idx_vector (idx)); - } + { + // Auto-create cache to speed up subsequent indexing. + if (zero_based && cache_index) + set_idx_cache (idx_vector (idx)); + } octave_matrix (const NDArray& nda, const idx_vector& cache) : octave_base_matrix<NDArray> (nda) - { - set_idx_cache (cache); - } + { + set_idx_cache (cache); + } ~octave_matrix (void) { } @@ -105,7 +105,7 @@ octave_base_value *try_narrowing_conversion (void); idx_vector index_vector (void) const - { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } + { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -146,7 +146,7 @@ float float_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -223,7 +223,7 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } // Unsafe. This function exists to support the MEX interface. // You should not use it anywhere else.
--- a/libinterp/octave-value/ov-re-sparse.cc +++ b/libinterp/octave-value/ov-re-sparse.cc @@ -51,7 +51,8 @@ DEFINE_OCTAVE_ALLOCATOR (octave_sparse_matrix); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_matrix, "sparse matrix", "double"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_sparse_matrix, "sparse matrix", + "double"); idx_vector octave_sparse_matrix::index_vector (void) const @@ -118,7 +119,7 @@ Complex retval (tmp, tmp); - // FIXME -- maybe this should be a function, valid_as_scalar() + // FIXME: maybe this should be a function, valid_as_scalar() if (rows () > 0 && columns () > 0) { if (numel () > 1) @@ -223,32 +224,32 @@ double d = matrix.data (i); - if (xisnan (d)) - { - gripe_nan_to_character_conversion (); - return retval; - } - else - { - int ival = NINT (d); + if (xisnan (d)) + { + gripe_nan_to_character_conversion (); + return retval; + } + else + { + int ival = NINT (d); - if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) - { - // FIXME -- is there something - // better we could do? + if (ival < 0 + || ival > std::numeric_limits<unsigned char>::max ()) + { + // FIXME: is there something better we could do? - ival = 0; + ival = 0; - if (! warned) - { - ::warning ("range error for conversion to character value"); - warned = true; - } - } + if (! warned) + { + ::warning ("range error for conversion to character value"); + warned = true; + } + } - chm (matrix.ridx (i) + j * nr) = - static_cast<char> (ival); - } + chm (matrix.ridx (i) + j * nr) = + static_cast<char> (ival); + } } retval = octave_value (chm, type); @@ -296,7 +297,7 @@ else st = LS_FLOAT; } - else if (matrix.nnz () > 8192) // FIXME -- make this configurable. + else if (matrix.nnz () > 8192) // FIXME: make this configurable. { double max_val, min_val; if (matrix.all_integers (max_val, min_val)) @@ -305,21 +306,21 @@ // add one to the printed indices to go from // zero-based to one-based arrays - for (int i = 0; i < nc+1; i++) - { - octave_quit (); - itmp = matrix.cidx (i); - os.write (reinterpret_cast<char *> (&itmp), 4); - } + for (int i = 0; i < nc+1; i++) + { + octave_quit (); + itmp = matrix.cidx (i); + os.write (reinterpret_cast<char *> (&itmp), 4); + } - for (int i = 0; i < nz; i++) - { - octave_quit (); - itmp = matrix.ridx (i); - os.write (reinterpret_cast<char *> (&itmp), 4); - } + for (int i = 0; i < nz; i++) + { + octave_quit (); + itmp = matrix.ridx (i); + os.write (reinterpret_cast<char *> (&itmp), 4); + } - write_doubles (os, matrix.data (), st, nz); + write_doubles (os, matrix.data (), st, nz); return true; } @@ -337,10 +338,11 @@ if (swap) swap_bytes<4> (&tmp); - if (tmp != -2) { - error ("load: only 2-D sparse matrices are supported"); - return false; - } + if (tmp != -2) + { + error ("load: only 2-D sparse matrices are supported"); + return false; + } if (! is.read (reinterpret_cast<char *> (&nr), 4)) return false; @@ -411,7 +413,8 @@ matrix.maybe_compress (); #if HAVE_HDF5_18 - hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + hid_t group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT); #else hid_t group_hid = H5Gcreate (loc_id, name, 0); #endif
--- a/libinterp/octave-value/ov-re-sparse.h +++ b/libinterp/octave-value/ov-re-sparse.h @@ -85,8 +85,10 @@ ~octave_sparse_matrix (void) { } - octave_base_value *clone (void) const { return new octave_sparse_matrix (*this); } - octave_base_value *empty_clone (void) const { return new octave_sparse_matrix (); } + octave_base_value *clone (void) const + { return new octave_sparse_matrix (*this); } + octave_base_value *empty_clone (void) const + { return new octave_sparse_matrix (); } octave_base_value *try_narrowing_conversion (void); @@ -105,7 +107,7 @@ double double_value (bool = false) const; double scalar_value (bool frc_str_conv = false) const - { return double_value (frc_str_conv); } + { return double_value (frc_str_conv); } Matrix matrix_value (bool = false) const; @@ -122,10 +124,10 @@ NDArray array_value (bool = false) const; SparseMatrix sparse_matrix_value (bool = false) const - { return matrix; } + { return matrix; } SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (matrix); } + { return SparseComplexMatrix (matrix); } SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const; @@ -135,7 +137,7 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } #endif bool save_binary (std::ostream& os, bool& save_as_floats);
--- a/libinterp/octave-value/ov-scalar.cc +++ b/libinterp/octave-value/ov-scalar.cc @@ -68,20 +68,21 @@ octave_base_value::type_conv_info octave_scalar::numeric_demotion_function (void) const { - return octave_base_value::type_conv_info (default_numeric_demotion_function, - octave_float_scalar::static_type_id ()); + return octave_base_value::type_conv_info + (default_numeric_demotion_function, + octave_float_scalar::static_type_id ()); } octave_value octave_scalar::do_index_op (const octave_value_list& idx, bool resize_ok) { - // FIXME -- this doesn't solve the problem of + // FIXME: this doesn't solve the problem of // // a = 1; a([1,1], [1,1], [1,1]) // // and similar constructions. Hmm... - // FIXME -- using this constructor avoids narrowing the + // FIXME: using this constructor avoids narrowing the // 1x1 matrix back to a scalar value. Need a better solution // to this problem. @@ -132,7 +133,7 @@ if (ival < 0 || ival > std::numeric_limits<unsigned char>::max ()) { - // FIXME -- is there something better we could do? + // FIXME: is there something better we could do? ival = 0;
--- a/libinterp/octave-value/ov-scalar.h +++ b/libinterp/octave-value/ov-scalar.h @@ -79,7 +79,7 @@ idx_vector index_vector (void) const { return idx_vector (scalar); } octave_value any (int = 0) const - { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } + { return (scalar != 0 && ! lo_ieee_isnan (scalar)); } builtin_type_t builtin_type (void) const { return btyp_double; } @@ -93,35 +93,35 @@ int8NDArray int8_array_value (void) const - { return int8NDArray (dim_vector (1, 1), scalar); } + { return int8NDArray (dim_vector (1, 1), scalar); } int16NDArray int16_array_value (void) const - { return int16NDArray (dim_vector (1, 1), scalar); } + { return int16NDArray (dim_vector (1, 1), scalar); } int32NDArray int32_array_value (void) const - { return int32NDArray (dim_vector (1, 1), scalar); } + { return int32NDArray (dim_vector (1, 1), scalar); } int64NDArray int64_array_value (void) const - { return int64NDArray (dim_vector (1, 1), scalar); } + { return int64NDArray (dim_vector (1, 1), scalar); } uint8NDArray uint8_array_value (void) const - { return uint8NDArray (dim_vector (1, 1), scalar); } + { return uint8NDArray (dim_vector (1, 1), scalar); } uint16NDArray uint16_array_value (void) const - { return uint16NDArray (dim_vector (1, 1), scalar); } + { return uint16NDArray (dim_vector (1, 1), scalar); } uint32NDArray uint32_array_value (void) const - { return uint32NDArray (dim_vector (1, 1), scalar); } + { return uint32NDArray (dim_vector (1, 1), scalar); } uint64NDArray uint64_array_value (void) const - { return uint64NDArray (dim_vector (1, 1), scalar); } + { return uint64NDArray (dim_vector (1, 1), scalar); } #define DEFINE_INT_SCALAR_VALUE(TYPE) \ octave_ ## TYPE \ @@ -141,30 +141,32 @@ double double_value (bool = false) const { return scalar; } - float float_value (bool = false) const { return static_cast<float> (scalar); } + float float_value (bool = false) const + { return static_cast<float> (scalar); } double scalar_value (bool = false) const { return scalar; } - float float_scalar_value (bool = false) const { return static_cast<float> (scalar); } + float float_scalar_value (bool = false) const + { return static_cast<float> (scalar); } Matrix matrix_value (bool = false) const - { return Matrix (1, 1, scalar); } + { return Matrix (1, 1, scalar); } FloatMatrix float_matrix_value (bool = false) const - { return FloatMatrix (1, 1, scalar); } + { return FloatMatrix (1, 1, scalar); } NDArray array_value (bool = false) const - { return NDArray (dim_vector (1, 1), scalar); } + { return NDArray (dim_vector (1, 1), scalar); } FloatNDArray float_array_value (bool = false) const - { return FloatNDArray (dim_vector (1, 1), scalar); } + { return FloatNDArray (dim_vector (1, 1), scalar); } SparseMatrix sparse_matrix_value (bool = false) const - { return SparseMatrix (Matrix (1, 1, scalar)); } + { return SparseMatrix (Matrix (1, 1, scalar)); } // FIXME Need SparseComplexMatrix (Matrix) constructor!!! SparseComplexMatrix sparse_complex_matrix_value (bool = false) const - { return SparseComplexMatrix (sparse_matrix_value ()); } + { return SparseComplexMatrix (sparse_matrix_value ()); } octave_value resize (const dim_vector& dv, bool fill = false) const; @@ -173,16 +175,16 @@ FloatComplex float_complex_value (bool = false) const { return scalar; } ComplexMatrix complex_matrix_value (bool = false) const - { return ComplexMatrix (1, 1, Complex (scalar)); } + { return ComplexMatrix (1, 1, Complex (scalar)); } FloatComplexMatrix float_complex_matrix_value (bool = false) const - { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } + { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } ComplexNDArray complex_array_value (bool = false) const - { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } + { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } FloatComplexNDArray float_complex_array_value (bool = false) const - { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } + { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } charNDArray char_array_value (bool = false) const @@ -238,10 +240,10 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { - return os.write (array_value (), block_size, output_type, - skip, flt_fmt); - } + { + return os.write (array_value (), block_size, output_type, + skip, flt_fmt); + } mxArray *as_mxArray (void) const;
--- a/libinterp/octave-value/ov-str-mat.cc +++ b/libinterp/octave-value/ov-str-mat.cc @@ -57,7 +57,8 @@ DEFINE_OCTAVE_ALLOCATOR (octave_char_matrix_sq_str); DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_char_matrix_str, "string", "char"); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_char_matrix_sq_str, "sq_string", "char"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_char_matrix_sq_str, "sq_string", + "char"); static octave_base_value * default_numeric_conversion_function (const octave_base_value& a) @@ -129,8 +130,9 @@ idx_vec(i) = idx(i).index_vector (); if (! error_state) - retval = octave_value (charNDArray (matrix.index (idx_vec, resize_ok)), - type); + retval = + octave_value (charNDArray (matrix.index (idx_vec, resize_ok)), + type); } break; } @@ -261,7 +263,8 @@ } void -octave_char_matrix_str::print_raw (std::ostream& os, bool pr_as_read_syntax) const +octave_char_matrix_str::print_raw (std::ostream& os, + bool pr_as_read_syntax) const { octave_print_internal (os, matrix, pr_as_read_syntax, current_print_indent_level (), true); @@ -371,8 +374,7 @@ if (elements >= 0) { - // FIXME -- need to be able to get max length - // before doing anything. + // FIXME: need to be able to get max length before doing anything. charMatrix chm (elements, 0); int max_len = 0; @@ -694,7 +696,8 @@ // to read into: hid_t st_id = H5Tcopy (H5T_C_S1); H5Tset_size (st_id, slen+1); - if (H5Dread (data_hid, st_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, s) < 0) + if (H5Dread (data_hid, st_id, H5S_ALL, + H5S_ALL, H5P_DEFAULT, s) < 0) { H5Tclose (st_id); H5Tclose (type_hid); @@ -738,7 +741,8 @@ hid_t st_id = H5Tcopy (H5T_C_S1); H5Tset_size (st_id, slen+1); - if (H5Dread (data_hid, st_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, s) < 0) + if (H5Dread (data_hid, st_id, H5S_ALL, + H5S_ALL, H5P_DEFAULT, s) < 0) { H5Tclose (st_id); H5Tclose (type_hid);
--- a/libinterp/octave-value/ov-str-mat.h +++ b/libinterp/octave-value/ov-str-mat.h @@ -84,28 +84,30 @@ ~octave_char_matrix_str (void) { } - octave_base_value *clone (void) const { return new octave_char_matrix_str (*this); } - octave_base_value *empty_clone (void) const { return new octave_char_matrix_str (); } + octave_base_value *clone (void) const + { return new octave_char_matrix_str (*this); } + octave_base_value *empty_clone (void) const + { return new octave_char_matrix_str (); } type_conv_info numeric_conversion_function (void) const; octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) - { return do_index_op_internal (idx, resize_ok); } + { return do_index_op_internal (idx, resize_ok); } octave_value squeeze (void) const - { return octave_value (charNDArray (matrix.squeeze ())); } + { return octave_value (charNDArray (matrix.squeeze ())); } octave_value reshape (const dim_vector& new_dims) const - { return octave_value (charNDArray (matrix.reshape (new_dims))); } + { return octave_value (charNDArray (matrix.reshape (new_dims))); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return octave_value (charNDArray (matrix.permute (vec, inv))); } + { return octave_value (charNDArray (matrix.permute (vec, inv))); } octave_value resize (const dim_vector& dv, bool fill = false) const; octave_value diag (octave_idx_type k = 0) const - { return octave_value (matrix.diag (k)); } + { return octave_value (matrix.diag (k)); } bool is_string (void) const { return true; } @@ -130,11 +132,11 @@ Array<std::string> cellstr_value (void) const; octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (dim, mode)); } + { return octave_value (matrix.sort (dim, mode)); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (sidx, dim, mode)); } + { return octave_value (matrix.sort (sidx, dim, mode)); } bool print_as_scalar (void) const { return (rows () <= 1); } @@ -158,7 +160,7 @@ int write (octave_stream& os, int block_size, oct_data_conv::data_type output_type, int skip, oct_mach_info::float_format flt_fmt) const - { return os.write (matrix, block_size, output_type, skip, flt_fmt); } + { return os.write (matrix, block_size, output_type, skip, flt_fmt); } protected: @@ -211,41 +213,43 @@ ~octave_char_matrix_sq_str (void) { } - octave_base_value *clone (void) const { return new octave_char_matrix_sq_str (*this); } - octave_base_value *empty_clone (void) const { return new octave_char_matrix_sq_str (); } + octave_base_value *clone (void) const + { return new octave_char_matrix_sq_str (*this); } + octave_base_value *empty_clone (void) const + { return new octave_char_matrix_sq_str (); } octave_value squeeze (void) const - { return octave_value (charNDArray (matrix.squeeze ()), '\''); } + { return octave_value (charNDArray (matrix.squeeze ()), '\''); } octave_value reshape (const dim_vector& new_dims) const - { return octave_value (charNDArray (matrix.reshape (new_dims)), '\''); } + { return octave_value (charNDArray (matrix.reshape (new_dims)), '\''); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return octave_value (charNDArray (matrix.permute (vec, inv)), '\''); } + { return octave_value (charNDArray (matrix.permute (vec, inv)), '\''); } octave_value resize (const dim_vector& dv, bool = false) const - { - charNDArray retval (matrix); - retval.resize (dv); - return octave_value (retval, '\''); - } + { + charNDArray retval (matrix); + retval.resize (dv); + return octave_value (retval, '\''); + } octave_value diag (octave_idx_type k = 0) const - { return octave_value (matrix.diag (k), '\''); } + { return octave_value (matrix.diag (k), '\''); } bool is_sq_string (void) const { return true; } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) - { return do_index_op_internal (idx, resize_ok, '\''); } + { return do_index_op_internal (idx, resize_ok, '\''); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (dim, mode), '\''); } + { return octave_value (matrix.sort (dim, mode), '\''); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return octave_value (matrix.sort (sidx, dim, mode), '\''); } + { return octave_value (matrix.sort (sidx, dim, mode), '\''); } private:
--- a/libinterp/octave-value/ov-struct.cc +++ b/libinterp/octave-value/ov-struct.cc @@ -85,7 +85,7 @@ else if (auto_add) retval = (numel () == 0) ? Cell (dim_vector (1, 1)) : Cell (dims ()); else - error_with_id ("Octave:invalid-indexing", + error_with_id ("Octave:invalid-indexing", "structure has no member '%s'", nm.c_str ()); return retval; @@ -189,7 +189,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. @@ -255,7 +255,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_user_function::subsref. @@ -345,7 +345,8 @@ tmpc = map.contents (pkey).index (idx.front (), true); } - // FIXME: better code reuse? cf. octave_cell::subsasgn and the case below. + // FIXME: better code reuse? + // cf. octave_cell::subsasgn and the case below. if (! error_state) { if (tmpc.numel () == 1) @@ -360,13 +361,15 @@ tmp.make_unique (); // probably a no-op. } else - // optimization: ignore the copy still stored inside our map. + // optimization: ignore the copy + // still stored inside our map. tmp.make_unique (1); if (! error_state) - t_rhs = (orig_undefined - ? tmp.undef_subsasgn (next_type, next_idx, rhs) - : tmp.subsasgn (next_type, next_idx, rhs)); + t_rhs = + (orig_undefined + ? tmp.undef_subsasgn (next_type, next_idx, rhs) + : tmp.subsasgn (next_type, next_idx, rhs)); } else gripe_indexed_cs_list (); @@ -419,7 +422,8 @@ tmp.make_unique (); // probably a no-op. } else - // optimization: ignore the copy still stored inside our map. + // optimization: ignore the copy + // still stored inside our map. tmp.make_unique (1); if (! error_state) @@ -473,7 +477,8 @@ dim_vector didx = dims ().redim (idxf.length ()); for (octave_idx_type k = 0; k < idxf.length (); k++) - if (! idxf(k).is_magic_colon ()) didx(k) = idxf(k).numel (); + if (! idxf(k).is_magic_colon ()) + didx(k) = idxf(k).numel (); if (didx.numel () == tmp_cell.numel ()) tmp_cell = tmp_cell.reshape (didx); @@ -491,12 +496,15 @@ } else { - const octave_map& cmap = const_cast<const octave_map &> (map); - // cast map to const reference to avoid forced key insertion. + const octave_map& cmap = + const_cast<const octave_map &> (map); + // cast to const reference, avoid forced key insertion. if (idxf.all_scalars () - || cmap.contents (key).index (idxf, true).numel () == 1) + || cmap.contents (key).index (idxf, true).numel () + == 1) { - map.assign (idxf, key, Cell (t_rhs.storable_value ())); + map.assign (idxf, + key, Cell (t_rhs.storable_value ())); if (! error_state) { count++; @@ -841,10 +849,11 @@ else panic_impossible (); } - else { - error ("load: failed to extract number of elements in structure"); - success = false; - } + else + { + error ("load: failed to extract number of elements in structure"); + success = false; + } return success; } @@ -1031,7 +1040,7 @@ H5Gget_num_objs (group_id, &num_obj); H5Gclose (group_id); - // FIXME -- fields appear to be sorted alphabetically on loading. + // FIXME: fields appear to be sorted alphabetically on loading. // Why is that happening? while (current_item < static_cast<int> (num_obj) @@ -1125,7 +1134,8 @@ } DEFINE_OCTAVE_ALLOCATOR(octave_scalar_struct); -DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_scalar_struct, "scalar struct", "struct"); +DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(octave_scalar_struct, "scalar struct", + "struct"); octave_value octave_scalar_struct::dotref (const octave_value_list& idx, bool auto_add) @@ -1412,7 +1422,8 @@ } bool -octave_scalar_struct::print_name_tag (std::ostream& os, const std::string& name) const +octave_scalar_struct::print_name_tag (std::ostream& os, + const std::string& name) const { bool retval = false; @@ -1512,10 +1523,11 @@ else panic_impossible (); } - else { - error ("load: failed to extract number of elements in structure"); - success = false; - } + else + { + error ("load: failed to extract number of elements in structure"); + success = false; + } return success; } @@ -1607,7 +1619,8 @@ #if defined (HAVE_HDF5) bool -octave_scalar_struct::save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) +octave_scalar_struct::save_hdf5 (hid_t loc_id, const char *name, + bool save_as_floats) { hid_t data_hid = -1; @@ -1664,7 +1677,7 @@ H5Gget_num_objs (group_id, &num_obj); H5Gclose (group_id); - // FIXME -- fields appear to be sorted alphabetically on loading. + // FIXME: fields appear to be sorted alphabetically on loading. // Why is that happening? while (current_item < static_cast<int> (num_obj) @@ -1735,7 +1748,8 @@ } bool -octave_scalar_struct::fast_elem_insert_self (void *where, builtin_type_t btyp) const +octave_scalar_struct::fast_elem_insert_self (void *where, + builtin_type_t btyp) const { if (btyp == btyp_struct) @@ -1748,7 +1762,7 @@ } DEFUN (struct, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} struct (@var{field1}, @var{value1}, @var{field2}, @var{value2}, @dots{})\n\ \n\ Create a scalar or array structure and initialize its values. The\n\ @@ -1947,7 +1961,7 @@ */ DEFUN (isstruct, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isstruct (@var{x})\n\ Return true if @var{x} is a structure or a structure array.\n\ @seealso{ismatrix, iscell, isa}\n\ @@ -1964,7 +1978,7 @@ } DEFUN (__fieldnames__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __fieldnames__ (@var{struct})\n\ @deftypefnx {Built-in Function} {} __fieldnames__ (@var{obj})\n\ Internal function.\n\ @@ -1991,7 +2005,7 @@ } DEFUN (isfield, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isfield (@var{x}, @var{name})\n\ Return true if the @var{x} is a structure and it\n\ includes an element named @var{name}. If @var{name} is a cell\n\ @@ -2010,7 +2024,7 @@ { octave_map m = args(0).map_value (); - // FIXME -- should this work for all types that can do + // FIXME: should this work for all types that can do // structure reference operations? if (args(1).is_string ()) @@ -2048,7 +2062,7 @@ } DEFUN (nfields, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nfields (@var{s})\n\ Return the number of fields of the structure @var{s}.\n\ @end deftypefn") @@ -2278,7 +2292,7 @@ */ DEFUN (struct_levels_to_print, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} struct_levels_to_print ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} struct_levels_to_print (@var{new_val})\n\ @deftypefnx {Built-in Function} {} struct_levels_to_print (@var{new_val}, \"local\")\n\ @@ -2295,7 +2309,7 @@ } DEFUN (print_struct_array_contents, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} print_struct_array_contents ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} print_struct_array_contents (@var{new_val})\n\ @deftypefnx {Built-in Function} {} print_struct_array_contents (@var{new_val}, \"local\")\n\
--- a/libinterp/octave-value/ov-struct.h +++ b/libinterp/octave-value/ov-struct.h @@ -68,10 +68,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string&, const std::list<octave_value_list>&, int); @@ -90,7 +90,7 @@ octave_value squeeze (void) const { return map.squeeze (); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return map.permute (vec, inv); } + { return map.permute (vec, inv); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -109,10 +109,10 @@ octave_idx_type nfields (void) const { return map.nfields (); } octave_value reshape (const dim_vector& new_dims) const - { return map.reshape (new_dims); } + { return map.reshape (new_dims); } octave_value resize (const dim_vector& dv, bool fill = false) const - { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } + { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; } @@ -183,8 +183,10 @@ ~octave_scalar_struct (void) { } - octave_base_value *clone (void) const { return new octave_scalar_struct (*this); } - octave_base_value *empty_clone (void) const { return new octave_scalar_struct (); } + octave_base_value *clone (void) const + { return new octave_scalar_struct (*this); } + octave_base_value *empty_clone (void) const + { return new octave_scalar_struct (); } octave_value dotref (const octave_value_list& idx, bool auto_add = false); @@ -209,7 +211,7 @@ octave_value squeeze (void) const { return map; } octave_value permute (const Array<int>& vec, bool inv = false) const - { return octave_map (map).permute (vec, inv); } + { return octave_map (map).permute (vec, inv); } octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false); @@ -228,10 +230,10 @@ octave_idx_type nfields (void) const { return map.nfields (); } octave_value reshape (const dim_vector& new_dims) const - { return octave_map (map).reshape (new_dims); } + { return octave_map (map).reshape (new_dims); } octave_value resize (const dim_vector& dv, bool fill = false) const - { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } + { octave_map tmap = map; tmap.resize (dv, fill); return tmap; } bool is_defined (void) const { return true; }
--- a/libinterp/octave-value/ov-type-conv.h +++ b/libinterp/octave-value/ov-type-conv.h @@ -25,7 +25,8 @@ static octave_value -octave_type_conv_body (const octave_value &arg, const std::string& name, int t_result) +octave_type_conv_body (const octave_value &arg, const std::string& name, + int t_result) { int t_arg = arg.type_id (); octave_value retval;
--- a/libinterp/octave-value/ov-typeinfo.cc +++ b/libinterp/octave-value/ov-typeinfo.cc @@ -66,7 +66,7 @@ const octave_value& val) { return (instance_ok ()) - ? instance->do_register_type (t_name, c_name, val) : -1; + ? instance->do_register_type (t_name, c_name, val) : -1; } bool @@ -74,15 +74,16 @@ octave_value_typeinfo::unary_class_op_fcn f) { return (instance_ok ()) - ? instance->do_register_unary_class_op (op, f) : false; + ? instance->do_register_unary_class_op (op, f) : false; } bool octave_value_typeinfo::register_unary_op (octave_value::unary_op op, - int t, octave_value_typeinfo::unary_op_fcn f) + int t, + octave_value_typeinfo::unary_op_fcn f) { return (instance_ok ()) - ? instance->do_register_unary_op (op, t, f) : false; + ? instance->do_register_unary_op (op, t, f) : false; } bool @@ -91,7 +92,7 @@ octave_value_typeinfo::non_const_unary_op_fcn f) { return (instance_ok ()) - ? instance->do_register_non_const_unary_op (op, t, f) : false; + ? instance->do_register_non_const_unary_op (op, t, f) : false; } bool @@ -99,7 +100,7 @@ octave_value_typeinfo::binary_class_op_fcn f) { return (instance_ok ()) - ? instance->do_register_binary_class_op (op, f) : false; + ? instance->do_register_binary_class_op (op, f) : false; } bool @@ -108,7 +109,7 @@ octave_value_typeinfo::binary_op_fcn f) { return (instance_ok ()) - ? instance->do_register_binary_op (op, t1, t2, f) : false; + ? instance->do_register_binary_op (op, t1, t2, f) : false; } bool @@ -116,7 +117,7 @@ octave_value_typeinfo::binary_class_op_fcn f) { return (instance_ok ()) - ? instance->do_register_binary_class_op (op, f) : false; + ? instance->do_register_binary_class_op (op, f) : false; } bool @@ -125,14 +126,15 @@ octave_value_typeinfo::binary_op_fcn f) { return (instance_ok ()) - ? instance->do_register_binary_op (op, t1, t2, f) : false; + ? instance->do_register_binary_op (op, t1, t2, f) : false; } bool -octave_value_typeinfo::register_cat_op (int t1, int t2, octave_value_typeinfo::cat_op_fcn f) +octave_value_typeinfo::register_cat_op (int t1, int t2, + octave_value_typeinfo::cat_op_fcn f) { return (instance_ok ()) - ? instance->do_register_cat_op (t1, t2, f) : false; + ? instance->do_register_cat_op (t1, t2, f) : false; } bool @@ -141,7 +143,7 @@ octave_value_typeinfo::assign_op_fcn f) { return (instance_ok ()) - ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1; + ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1; } bool @@ -149,7 +151,7 @@ int t_lhs, octave_value_typeinfo::assignany_op_fcn f) { return (instance_ok ()) - ? instance->do_register_assignany_op (op, t_lhs, f) : -1; + ? instance->do_register_assignany_op (op, t_lhs, f) : -1; } bool @@ -157,7 +159,8 @@ int t_result) { return (instance_ok ()) - ? instance->do_register_pref_assign_conv (t_lhs, t_rhs, t_result) : false; + ? instance->do_register_pref_assign_conv (t_lhs, t_rhs, t_result) + : false; } bool @@ -165,7 +168,7 @@ octave_base_value::type_conv_fcn f) { return (instance_ok ()) - ? instance->do_register_type_conv_op (t, t_result, f) : false; + ? instance->do_register_type_conv_op (t, t_result, f) : false; } bool @@ -173,10 +176,10 @@ octave_base_value::type_conv_fcn f) { return (instance_ok ()) - ? instance->do_register_widening_op (t, t_result, f) : false; + ? instance->do_register_widening_op (t, t_result, f) : false; } -// FIXME -- we should also store all class names and provide a +// FIXME: we should also store all class names and provide a // way to list them (calling class with nargin == 0?). int @@ -247,14 +250,16 @@ op_name.c_str ()); } - unary_class_ops.checkelem (static_cast<int> (op)) = reinterpret_cast<void *> (f); + unary_class_ops.checkelem (static_cast<int> (op)) + = reinterpret_cast<void *> (f); return false; } bool octave_value_typeinfo::do_register_unary_op (octave_value::unary_op op, - int t, octave_value_typeinfo::unary_op_fcn f) + int t, + octave_value_typeinfo::unary_op_fcn f) { if (lookup_unary_op (op, t)) { @@ -272,7 +277,8 @@ bool octave_value_typeinfo::do_register_non_const_unary_op - (octave_value::unary_op op, int t, octave_value_typeinfo::non_const_unary_op_fcn f) + (octave_value::unary_op op, int t, + octave_value_typeinfo::non_const_unary_op_fcn f) { if (lookup_non_const_unary_op (op, t)) { @@ -283,7 +289,8 @@ op_name.c_str (), type_name.c_str ()); } - non_const_unary_ops.checkelem (static_cast<int> (op), t) = reinterpret_cast<void *> (f); + non_const_unary_ops.checkelem (static_cast<int> (op), t) + = reinterpret_cast<void *> (f); return false; } @@ -300,7 +307,8 @@ op_name.c_str ()); } - binary_class_ops.checkelem (static_cast<int> (op)) = reinterpret_cast<void *> (f); + binary_class_ops.checkelem (static_cast<int> (op)) + = reinterpret_cast<void *> (f); return false; } @@ -320,7 +328,8 @@ op_name.c_str (), t1_name.c_str (), t1_name.c_str ()); } - binary_ops.checkelem (static_cast<int> (op), t1, t2) = reinterpret_cast<void *> (f); + binary_ops.checkelem (static_cast<int> (op), t1, t2) + = reinterpret_cast<void *> (f); return false; } @@ -337,7 +346,8 @@ op_name.c_str ()); } - compound_binary_class_ops.checkelem (static_cast<int> (op)) = reinterpret_cast<void *> (f); + compound_binary_class_ops.checkelem (static_cast<int> (op)) + = reinterpret_cast<void *> (f); return false; } @@ -357,13 +367,15 @@ op_name.c_str (), t1_name.c_str (), t1_name.c_str ()); } - compound_binary_ops.checkelem (static_cast<int> (op), t1, t2) = reinterpret_cast<void *> (f); + compound_binary_ops.checkelem (static_cast<int> (op), t1, t2) + = reinterpret_cast<void *> (f); return false; } bool -octave_value_typeinfo::do_register_cat_op (int t1, int t2, octave_value_typeinfo::cat_op_fcn f) +octave_value_typeinfo::do_register_cat_op (int t1, int t2, + octave_value_typeinfo::cat_op_fcn f) { if (lookup_cat_op (t1, t2)) { @@ -394,7 +406,8 @@ op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ()); } - assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs) = reinterpret_cast<void *> (f); + assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs) + = reinterpret_cast<void *> (f); return false; } @@ -412,7 +425,8 @@ op_name.c_str (), t_lhs_name.c_str ()); } - assignany_ops.checkelem (static_cast<int> (op), t_lhs) = reinterpret_cast<void *> (f); + assignany_ops.checkelem (static_cast<int> (op), t_lhs) + = reinterpret_cast<void *> (f); return false; } @@ -596,7 +610,7 @@ } DEFUN (typeinfo, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} typeinfo ()\n\ @deftypefnx {Built-in Function} {} typeinfo (@var{expr})\n\ \n\
--- a/libinterp/octave-value/ov-typeinfo.h +++ b/libinterp/octave-value/ov-typeinfo.h @@ -301,7 +301,8 @@ binary_class_op_fcn do_lookup_binary_class_op (octave_value::compound_binary_op); - binary_op_fcn do_lookup_binary_op (octave_value::compound_binary_op, int, int); + binary_op_fcn do_lookup_binary_op (octave_value::compound_binary_op, + int, int); cat_op_fcn do_lookup_cat_op (int, int);
--- a/libinterp/octave-value/ov-uint16.cc +++ b/libinterp/octave-value/ov-uint16.cc @@ -74,7 +74,7 @@ "uint16 scalar", "uint16"); DEFUN (uint16, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uint16 (@var{x})\n\ Convert @var{x} to unsigned 16-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-uint32.cc +++ b/libinterp/octave-value/ov-uint32.cc @@ -74,7 +74,7 @@ "uint32 scalar", "uint32"); DEFUN (uint32, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uint32 (@var{x})\n\ Convert @var{x} to unsigned 32-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-uint64.cc +++ b/libinterp/octave-value/ov-uint64.cc @@ -74,7 +74,7 @@ "uint64 scalar", "uint64"); DEFUN (uint64, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uint64 (@var{x})\n\ Convert @var{x} to unsigned 64-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-uint8.cc +++ b/libinterp/octave-value/ov-uint8.cc @@ -74,7 +74,7 @@ "uint8 scalar", "uint8"); DEFUN (uint8, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} uint8 (@var{x})\n\ Convert @var{x} to unsigned 8-bit integer type.\n\ @end deftypefn")
--- a/libinterp/octave-value/ov-usr-fcn.cc +++ b/libinterp/octave-value/ov-usr-fcn.cc @@ -232,7 +232,7 @@ delete jit_info; #endif - // FIXME -- this is really playing with fire. + // FIXME: this is really playing with fire. symbol_table::erase_scope (local_scope); } @@ -423,7 +423,8 @@ octave_value_list octave_user_function::subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list) + int nargout, + const std::list<octave_lvalue>* lvalue_list) { octave_value_list retval; @@ -450,7 +451,7 @@ panic_impossible (); } - // FIXME -- perhaps there should be an + // FIXME: perhaps there should be an // octave_value_list::next_subsref member function? See also // octave_builtin::subsref. @@ -691,7 +692,8 @@ void octave_user_function::bind_automatic_vars (const string_vector& arg_names, int nargin, int nargout, - const octave_value_list& va_args, const std::list<octave_lvalue> *lvalue_list) + const octave_value_list& va_args, + const std::list<octave_lvalue> *lvalue_list) { if (! arg_names.empty ()) { @@ -700,7 +702,8 @@ // which might be redefined in a function. Keep the old argn name // for backward compatibility of functions that use it directly. - symbol_table::force_assign ("argn", charMatrix (arg_names, Vstring_fill_char)); + symbol_table::force_assign ("argn", + charMatrix (arg_names, Vstring_fill_char)); symbol_table::force_assign (".argn.", Cell (arg_names)); symbol_table::mark_hidden (".argn."); @@ -741,8 +744,8 @@ // Only assign the hidden variable if black holes actually present. Matrix bh (1, nbh); octave_idx_type k = 0, l = 0; - for (std::list<octave_lvalue>::const_iterator p = lvalue_list->begin (); - p != lvalue_list->end (); p++) + for (std::list<octave_lvalue>::const_iterator + p = lvalue_list->begin (); p != lvalue_list->end (); p++) { if (p->is_black_hole ()) bh(l++) = k+1; @@ -784,7 +787,7 @@ } DEFUN (nargin, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nargin ()\n\ @deftypefnx {Built-in Function} {} nargin (@var{fcn})\n\ Within a function, return the number of arguments passed to the function.\n\ @@ -829,7 +832,8 @@ } else { - // Matlab gives up for histc, so maybe it's ok we give up somtimes too. + // Matlab gives up for histc, + // so maybe it's ok that that we give up somtimes too? error ("nargin: nargin information not available for builtin functions"); } } @@ -850,7 +854,7 @@ } DEFUN (nargout, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} nargout ()\n\ @deftypefnx {Built-in Function} {} nargout (@var{fcn})\n\ Within a function, return the number of values the caller expects to\n\ @@ -940,7 +944,7 @@ if (fcn) { tree_parameter_list *ret_list = fcn->return_list (); - + retval = ret_list ? ret_list->length () : 0; if (fcn->takes_var_return ()) @@ -948,9 +952,10 @@ } else { - // JWE said this information is not available (currently, 2011-03-10) + // JWE said this information is not available (2011-03-10) // without making intrusive changes to Octave. - // Matlab gives up for histc, so maybe it's ok we give up somtimes too. + // Matlab gives up for histc, + // so maybe it's ok that we give up somtimes too? error ("nargout: nargout information not available for builtin functions."); } } @@ -976,7 +981,7 @@ } DEFUN (optimize_subsasgn_calls, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} optimize_subsasgn_calls ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} optimize_subsasgn_calls (@var{new_val})\n\ @deftypefnx {Built-in Function} {} optimize_subsasgn_calls (@var{new_val}, \"local\")\n\ @@ -1013,7 +1018,7 @@ } DEFUN (isargout, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isargout (@var{k})\n\ Within a function, return a logical value indicating whether the argument\n\ @var{k} will be assigned on output to a variable. If the result is false,\n\ @@ -1060,7 +1065,9 @@ if (! error_state) { boolNDArray r (ka.dims ()); - for (octave_idx_type i = 0; i < ka.numel () && ! error_state; i++) + for (octave_idx_type i = 0; + i < ka.numel () && ! error_state; + i++) r(i) = isargout1 (nargout1, ignored, ka(i)); retval = r;
--- a/libinterp/octave-value/ov-usr-fcn.h +++ b/libinterp/octave-value/ov-usr-fcn.h @@ -112,10 +112,10 @@ void mark_fcn_file_up_to_date (const octave_time& t) { t_checked = t; } void stash_fcn_file_time (const octave_time& t) - { - t_parsed = t; - mark_fcn_file_up_to_date (t); - } + { + t_parsed = t; + mark_fcn_file_up_to_date (t); + } std::string fcn_file_name (void) const { return file_name; } @@ -125,10 +125,10 @@ octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -187,7 +187,7 @@ symbol_table::context_id active_context () const { return is_anonymous_function () - ? 0 : static_cast<symbol_table::context_id>(call_depth); + ? 0 : static_cast<symbol_table::context_id>(call_depth); } octave_function *function_value (bool = false) { return this; } @@ -203,19 +203,19 @@ void stash_fcn_file_name (const std::string& nm); void stash_fcn_location (int line, int col) - { - location_line = line; - location_column = col; - } + { + location_line = line; + location_column = col; + } int beginning_line (void) const { return location_line; } int beginning_column (void) const { return location_column; } void stash_fcn_end_location (int line, int col) - { - end_location_line = line; - end_location_column = col; - } + { + end_location_line = line; + end_location_column = col; + } int ending_line (void) const { return end_location_line; } int ending_column (void) const { return end_location_column; } @@ -233,10 +233,10 @@ void mark_fcn_file_up_to_date (const octave_time& t) { t_checked = t; } void stash_fcn_file_time (const octave_time& t) - { - t_parsed = t; - mark_fcn_file_up_to_date (t); - } + { + t_parsed = t; + mark_fcn_file_up_to_date (t); + } std::string fcn_file_name (void) const { return file_name; } @@ -259,20 +259,20 @@ bool is_user_function (void) const { return true; } void erase_subfunctions (void) - { - symbol_table::erase_subfunctions_in_scope (local_scope); - } + { + symbol_table::erase_subfunctions_in_scope (local_scope); + } bool takes_varargs (void) const; bool takes_var_return (void) const; void mark_as_private_function (const std::string& cname = std::string ()) - { - symbol_table::mark_subfunctions_in_scope_as_private (local_scope, cname); + { + symbol_table::mark_subfunctions_in_scope_as_private (local_scope, cname); - octave_function::mark_as_private_function (cname); - } + octave_function::mark_as_private_function (cname); + } void lock_subfunctions (void); @@ -306,13 +306,13 @@ bool is_anonymous_function (void) const { return anonymous_function; } bool is_anonymous_function_of_class - (const std::string& cname = std::string ()) const + (const std::string& cname = std::string ()) const { return anonymous_function - ? (cname.empty () - ? (! dispatch_class ().empty ()) - : cname == dispatch_class ()) - : false; + ? (cname.empty () + ? (! dispatch_class ().empty ()) + : cname == dispatch_class ()) + : false; } // If we are a special expression, then the function body consists of exactly @@ -330,25 +330,25 @@ void mark_as_class_constructor (void) { class_constructor = true; } bool is_class_constructor (const std::string& cname = std::string ()) const - { - return class_constructor - ? (cname.empty () ? true : cname == dispatch_class ()) : false; - } + { + return class_constructor + ? (cname.empty () ? true : cname == dispatch_class ()) : false; + } void mark_as_class_method (void) { class_method = true; } bool is_class_method (const std::string& cname = std::string ()) const - { - return class_method - ? (cname.empty () ? true : cname == dispatch_class ()) : false; - } + { + return class_method + ? (cname.empty () ? true : cname == dispatch_class ()) : false; + } octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { - octave_value_list tmp = subsref (type, idx, 1); - return tmp.length () > 0 ? tmp(0) : octave_value (); - } + { + octave_value_list tmp = subsref (type, idx, 1); + return tmp.length () > 0 ? tmp(0) : octave_value (); + } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -356,7 +356,8 @@ octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, - int nargout, const std::list<octave_lvalue>* lvalue_list); + int nargout, + const std::list<octave_lvalue>* lvalue_list); octave_value_list do_multi_index_op (int nargout, const octave_value_list& args); @@ -385,15 +386,15 @@ template <class T> bool local_protect (T& variable) - { - if (curr_unwind_protect_frame) - { - curr_unwind_protect_frame->protect_var (variable); - return true; - } - else - return false; - } + { + if (curr_unwind_protect_frame) + { + curr_unwind_protect_frame->protect_var (variable); + return true; + } + else + return false; + } #ifdef HAVE_LLVM jit_function_info *get_info (void) { return jit_info; }
--- a/libinterp/octave-value/ov.cc +++ b/libinterp/octave-value/ov.cc @@ -1460,7 +1460,8 @@ try { f (*rep, octave_value_list (), *rhs.rep); - maybe_mutate (); // Usually unnecessary, but may be needed (complex arrays). + // Usually unnecessary, but may be needed (complex arrays). + maybe_mutate (); } catch (octave_execution_exception) { @@ -1843,8 +1844,9 @@ octave_value::float_complex_column_vector_value (bool force_string_conv, bool frc_vec_conv) const { - return FloatComplexColumnVector (float_complex_vector_value (force_string_conv, - frc_vec_conv)); + return + FloatComplexColumnVector (float_complex_vector_value (force_string_conv, + frc_vec_conv)); } FloatRowVector @@ -1971,7 +1973,7 @@ } else { - // FIXME -- we need to handle overloading operators for built-in + // FIXME: we need to handle overloading operators for built-in // classes (double, char, int8, etc.) octave_value_typeinfo::binary_op_fcn f @@ -1991,17 +1993,21 @@ else { octave_value tv1; - octave_base_value::type_conv_info cf1 = v1.numeric_conversion_function (); + octave_base_value::type_conv_info cf1 = + v1.numeric_conversion_function (); octave_value tv2; - octave_base_value::type_conv_info cf2 = v2.numeric_conversion_function (); + octave_base_value::type_conv_info cf2 = + v2.numeric_conversion_function (); // Try biased (one-sided) conversions first. if (cf2.type_id () >= 0 && octave_value_typeinfo::lookup_binary_op (op, t1, cf2.type_id ())) cf1 = 0; - else if (cf1.type_id () >= 0 && - octave_value_typeinfo::lookup_binary_op (op, cf1.type_id (), t2)) + else if (cf1.type_id () >= 0 + && octave_value_typeinfo::lookup_binary_op (op, + cf1.type_id (), + t2)) cf2 = 0; if (cf1) @@ -2053,10 +2059,13 @@ // Try biased (one-sided) conversions first. if (cf2.type_id () >= 0 - && octave_value_typeinfo::lookup_binary_op (op, t1, cf2.type_id ())) + && octave_value_typeinfo::lookup_binary_op (op, t1, + cf2.type_id ())) cf1 = 0; - else if (cf1.type_id () >= 0 - && octave_value_typeinfo::lookup_binary_op (op, cf1.type_id (), t2)) + else if (cf1.type_id () >= 0 && + octave_value_typeinfo::lookup_binary_op (op, + cf1.type_id (), + t2)) cf2 = 0; if (cf1) @@ -2070,7 +2079,8 @@ } else { - gripe_binary_op_conv (octave_value::binary_op_as_string (op)); + gripe_binary_op_conv + (octave_value::binary_op_as_string (op)); return retval; } } @@ -2086,7 +2096,8 @@ } else { - gripe_binary_op_conv (octave_value::binary_op_as_string (op)); + gripe_binary_op_conv + (octave_value::binary_op_as_string (op)); return retval; } } @@ -2392,7 +2403,7 @@ } else { - // FIXME -- we need to handle overloading operators for built-in + // FIXME: we need to handle overloading operators for built-in // classes (double, char, int8, etc.) octave_value_typeinfo::unary_op_fcn f @@ -2529,7 +2540,8 @@ (octave_value::unary_op_as_string (op), type_name ()); } else - gripe_unary_op (octave_value::unary_op_as_string (op), type_name ()); + gripe_unary_op (octave_value::unary_op_as_string (op), + type_name ()); } } else @@ -2569,7 +2581,7 @@ do_non_const_unary_op (op); else { - // FIXME -- only do the following stuff if we can't find a + // FIXME: only do the following stuff if we can't find a // specific function to call to handle the op= operation for the // types we have. @@ -2778,7 +2790,7 @@ } DEFUN (sizeof, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} sizeof (@var{val})\n\ Return the size of @var{val} in bytes.\n\ @seealso{whos}\n\ @@ -2874,11 +2886,12 @@ } } else - error ("%s: second argument must be a structure with fields 'type' and 'subs'", name); + error ("%s: second argument must be a structure with fields 'type' and 'subs'", + name); } DEFUN (subsref, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} subsref (@var{val}, @var{idx})\n\ Perform the subscripted element selection operation according to\n\ the subscript specified by @var{idx}.\n\ @@ -2941,7 +2954,7 @@ } DEFUN (subsasgn, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} subsasgn (@var{val}, @var{idx}, @var{rhs})\n\ Perform the subscripted assignment operation according to\n\ the subscript specified by @var{idx}.\n\ @@ -3076,7 +3089,7 @@ */ DEFUN (is_sq_string, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} is_sq_string (@var{x})\n\ Return true if @var{x} is a single-quoted character string.\n\ @seealso{is_dq_string, ischar}\n\ @@ -3103,7 +3116,7 @@ */ DEFUN (is_dq_string, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} is_dq_string (@var{x})\n\ Return true if @var{x} is a double-quoted character string.\n\ @seealso{is_sq_string, ischar}\n\
--- a/libinterp/octave-value/ov.h +++ b/libinterp/octave-value/ov.h @@ -165,11 +165,11 @@ enum magic_colon { magic_colon_t }; octave_value (void) - { - static octave_base_value nil_rep; - rep = &nil_rep; - rep->count++; - } + { + static octave_base_value nil_rep; + rep = &nil_rep; + rep->count++; + } octave_value (short int i); octave_value (unsigned short int i); @@ -178,7 +178,7 @@ octave_value (long int i); octave_value (unsigned long int i); - // FIXME -- these are kluges. They turn into doubles + // FIXME: these are kluges. They turn into doubles // internally, which will break for very large values. We just use // them to store things like 64-bit ino_t, etc, and hope that those // values are never actually larger than can be represented exactly @@ -215,7 +215,8 @@ octave_value (const Complex& C); octave_value (const FloatComplex& C); octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ()); - octave_value (const FloatComplexMatrix& m, const MatrixType& t = MatrixType ()); + octave_value (const FloatComplexMatrix& m, + const MatrixType& t = MatrixType ()); octave_value (const ComplexNDArray& cnda); octave_value (const FloatComplexNDArray& cnda); octave_value (const Array<Complex>& m); @@ -296,17 +297,17 @@ // Copy constructor. octave_value (const octave_value& a) - { - rep = a.rep; - rep->count++; - } + { + rep = a.rep; + rep->count++; + } // This should only be called for derived types. octave_base_value *clone (void) const; octave_base_value *empty_clone (void) const - { return rep->empty_clone (); } + { return rep->empty_clone (); } // Delete the representation of this constant if the count drops to // zero. @@ -318,88 +319,88 @@ } void make_unique (void) - { - if (rep->count > 1) - { - octave_base_value *r = rep->unique_clone (); + { + if (rep->count > 1) + { + octave_base_value *r = rep->unique_clone (); - if (--rep->count == 0) - delete rep; + if (--rep->count == 0) + delete rep; - rep = r; - } - } + rep = r; + } + } // This uniquifies the value if it is referenced by more than a certain // number of shallow copies. This is useful for optimizations where we // know a certain copy, typically within a cell array, to be obsolete. void make_unique (int obsolete_copies) - { - if (rep->count > obsolete_copies + 1) - { - octave_base_value *r = rep->unique_clone (); + { + if (rep->count > obsolete_copies + 1) + { + octave_base_value *r = rep->unique_clone (); - if (--rep->count == 0) - delete rep; + if (--rep->count == 0) + delete rep; - rep = r; - } - } + rep = r; + } + } // Simple assignment. octave_value& operator = (const octave_value& a) - { - if (rep != a.rep) - { - if (--rep->count == 0) - delete rep; + { + if (rep != a.rep) + { + if (--rep->count == 0) + delete rep; - rep = a.rep; - rep->count++; - } + rep = a.rep; + rep->count++; + } - return *this; - } + return *this; + } octave_idx_type get_count (void) const { return rep->count; } octave_base_value::type_conv_info numeric_conversion_function (void) const - { return rep->numeric_conversion_function (); } + { return rep->numeric_conversion_function (); } octave_base_value::type_conv_info numeric_demotion_function (void) const - { return rep->numeric_demotion_function (); } + { return rep->numeric_demotion_function (); } void maybe_mutate (void); octave_value squeeze (void) const - { return rep->squeeze (); } + { return rep->squeeze (); } // The result of full(). octave_value full_value (void) const - { return rep->full_value (); } + { return rep->full_value (); } octave_base_value *try_narrowing_conversion (void) - { return rep->try_narrowing_conversion (); } + { return rep->try_narrowing_conversion (); } // Close to dims (), but can be overloaded for classes. Matrix size (void) - { return rep->size (); } + { return rep->size (); } octave_idx_type numel (const octave_value_list& idx) - { return rep->numel (idx); } + { return rep->numel (idx); } octave_value single_subsref (const std::string& type, const octave_value_list& idx); octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx) - { return rep->subsref (type, idx); } + { return rep->subsref (type, idx); } octave_value subsref (const std::string& type, const std::list<octave_value_list>& idx, bool auto_add) - { return rep->subsref (type, idx, auto_add); } + { return rep->subsref (type, idx, auto_add); } octave_value_list subsref (const std::string& type, const std::list<octave_value_list>& idx, @@ -431,7 +432,7 @@ octave_value do_index_op (const octave_value_list& idx, bool resize_ok = false) - { return rep->do_index_op (idx, resize_ok); } + { return rep->do_index_op (idx, resize_ok); } octave_value_list do_multi_index_op (int nargout, const octave_value_list& idx); @@ -441,26 +442,26 @@ const std::list<octave_lvalue> *lvalue_list); octave_value subsasgn (const std::string& type, - const std::list<octave_value_list>& idx, - const octave_value& rhs); + const std::list<octave_value_list>& idx, + const octave_value& rhs); octave_value undef_subsasgn (const std::string& type, const std::list<octave_value_list>& idx, const octave_value& rhs); octave_value& assign (assign_op op, const std::string& type, - const std::list<octave_value_list>& idx, - const octave_value& rhs); + const std::list<octave_value_list>& idx, + const octave_value& rhs); octave_value& assign (assign_op, const octave_value& rhs); idx_vector index_vector (void) const - { return rep->index_vector (); } + { return rep->index_vector (); } // Size. dim_vector dims (void) const - { return rep->dims (); } + { return rep->dims (); } octave_idx_type rows (void) const { return rep->rows (); } @@ -473,13 +474,13 @@ bool all_zero_dims (void) const { return dims ().all_zero (); } octave_idx_type numel (void) const - { return rep->numel (); } + { return rep->numel (); } octave_idx_type capacity (void) const - { return rep->capacity (); } + { return rep->capacity (); } size_t byte_size (void) const - { return rep->byte_size (); } + { return rep->byte_size (); } octave_idx_type nnz (void) const { return rep->nnz (); } @@ -488,16 +489,16 @@ octave_idx_type nfields (void) const { return rep->nfields (); } octave_value reshape (const dim_vector& dv) const - { return rep->reshape (dv); } + { return rep->reshape (dv); } octave_value permute (const Array<int>& vec, bool inv = false) const - { return rep->permute (vec, inv); } + { return rep->permute (vec, inv); } octave_value ipermute (const Array<int>& vec) const - { return rep->permute (vec, true); } + { return rep->permute (vec, true); } octave_value resize (const dim_vector& dv, bool fill = false) const - { return rep->resize (dv, fill);} + { return rep->resize (dv, fill);} MatrixType matrix_type (void) const { return rep->matrix_type (); } @@ -510,155 +511,155 @@ // ! is_defined(). bool is_defined (void) const - { return rep->is_defined (); } + { return rep->is_defined (); } bool is_undefined (void) const - { return ! is_defined (); } + { return ! is_defined (); } bool is_empty (void) const - { return rep->is_empty (); } + { return rep->is_empty (); } bool is_cell (void) const - { return rep->is_cell (); } + { return rep->is_cell (); } bool is_cellstr (void) const - { return rep->is_cellstr (); } + { return rep->is_cellstr (); } bool is_real_scalar (void) const - { return rep->is_real_scalar (); } + { return rep->is_real_scalar (); } bool is_real_matrix (void) const - { return rep->is_real_matrix (); } + { return rep->is_real_matrix (); } bool is_complex_scalar (void) const - { return rep->is_complex_scalar (); } + { return rep->is_complex_scalar (); } bool is_complex_matrix (void) const - { return rep->is_complex_matrix (); } + { return rep->is_complex_matrix (); } bool is_bool_scalar (void) const - { return rep->is_bool_scalar (); } + { return rep->is_bool_scalar (); } bool is_bool_matrix (void) const - { return rep->is_bool_matrix (); } + { return rep->is_bool_matrix (); } bool is_char_matrix (void) const - { return rep->is_char_matrix (); } + { return rep->is_char_matrix (); } bool is_diag_matrix (void) const - { return rep->is_diag_matrix (); } + { return rep->is_diag_matrix (); } bool is_perm_matrix (void) const - { return rep->is_perm_matrix (); } + { return rep->is_perm_matrix (); } bool is_string (void) const - { return rep->is_string (); } + { return rep->is_string (); } bool is_sq_string (void) const - { return rep->is_sq_string (); } + { return rep->is_sq_string (); } bool is_dq_string (void) const - { return rep->is_string () && ! rep->is_sq_string (); } + { return rep->is_string () && ! rep->is_sq_string (); } bool is_range (void) const - { return rep->is_range (); } + { return rep->is_range (); } bool is_map (void) const - { return rep->is_map (); } + { return rep->is_map (); } bool is_object (void) const - { return rep->is_object (); } + { return rep->is_object (); } bool is_java (void) const - { return rep->is_java (); } + { return rep->is_java (); } bool is_cs_list (void) const - { return rep->is_cs_list (); } + { return rep->is_cs_list (); } bool is_magic_colon (void) const - { return rep->is_magic_colon (); } + { return rep->is_magic_colon (); } bool is_null_value (void) const - { return rep->is_null_value (); } + { return rep->is_null_value (); } // Are any or all of the elements in this constant nonzero? octave_value all (int dim = 0) const - { return rep->all (dim); } + { return rep->all (dim); } octave_value any (int dim = 0) const - { return rep->any (dim); } + { return rep->any (dim); } builtin_type_t builtin_type (void) const - { return rep->builtin_type (); } + { return rep->builtin_type (); } // Floating point types. bool is_double_type (void) const - { return rep->is_double_type (); } + { return rep->is_double_type (); } bool is_single_type (void) const - { return rep->is_single_type (); } + { return rep->is_single_type (); } bool is_float_type (void) const - { return rep->is_float_type (); } + { return rep->is_float_type (); } // Integer types. bool is_int8_type (void) const - { return rep->is_int8_type (); } + { return rep->is_int8_type (); } bool is_int16_type (void) const - { return rep->is_int16_type (); } + { return rep->is_int16_type (); } bool is_int32_type (void) const - { return rep->is_int32_type (); } + { return rep->is_int32_type (); } bool is_int64_type (void) const - { return rep->is_int64_type (); } + { return rep->is_int64_type (); } bool is_uint8_type (void) const - { return rep->is_uint8_type (); } + { return rep->is_uint8_type (); } bool is_uint16_type (void) const - { return rep->is_uint16_type (); } + { return rep->is_uint16_type (); } bool is_uint32_type (void) const - { return rep->is_uint32_type (); } + { return rep->is_uint32_type (); } bool is_uint64_type (void) const - { return rep->is_uint64_type (); } + { return rep->is_uint64_type (); } // Other type stuff. bool is_bool_type (void) const - { return rep->is_bool_type (); } + { return rep->is_bool_type (); } bool is_integer_type (void) const - { return rep->is_integer_type (); } + { return rep->is_integer_type (); } bool is_real_type (void) const - { return rep->is_real_type (); } + { return rep->is_real_type (); } bool is_complex_type (void) const - { return rep->is_complex_type (); } + { return rep->is_complex_type (); } bool is_scalar_type (void) const - { return rep->is_scalar_type (); } + { return rep->is_scalar_type (); } bool is_matrix_type (void) const - { return rep->is_matrix_type (); } + { return rep->is_matrix_type (); } bool is_numeric_type (void) const - { return rep->is_numeric_type (); } + { return rep->is_numeric_type (); } bool is_sparse_type (void) const - { return rep->is_sparse_type (); } + { return rep->is_sparse_type (); } // Does this constant correspond to a truth value? bool is_true (void) const - { return rep->is_true (); } + { return rep->is_true (); } // Do two constants match (in a switch statement)? @@ -667,40 +668,40 @@ // Are the dimensions of this constant zero by zero? bool is_zero_by_zero (void) const - { return (rows () == 0 && columns () == 0); } + { return (rows () == 0 && columns () == 0); } bool is_constant (void) const - { return rep->is_constant (); } + { return rep->is_constant (); } bool is_function_handle (void) const - { return rep->is_function_handle (); } + { return rep->is_function_handle (); } bool is_anonymous_function (void) const - { return rep->is_anonymous_function (); } + { return rep->is_anonymous_function (); } bool is_inline_function (void) const - { return rep->is_inline_function (); } + { return rep->is_inline_function (); } bool is_function (void) const - { return rep->is_function (); } + { return rep->is_function (); } bool is_user_script (void) const - { return rep->is_user_script (); } + { return rep->is_user_script (); } bool is_user_function (void) const - { return rep->is_user_function (); } + { return rep->is_user_function (); } bool is_user_code (void) const - { return rep->is_user_code (); } + { return rep->is_user_code (); } bool is_builtin_function (void) const - { return rep->is_builtin_function (); } + { return rep->is_builtin_function (); } bool is_dld_function (void) const - { return rep->is_dld_function (); } + { return rep->is_dld_function (); } bool is_mex_function (void) const - { return rep->is_mex_function (); } + { return rep->is_mex_function (); } void erase_subfunctions (void) { rep->erase_subfunctions (); } @@ -710,203 +711,207 @@ short int short_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->short_value (req_int, frc_str_conv); } + { return rep->short_value (req_int, frc_str_conv); } unsigned short int ushort_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->ushort_value (req_int, frc_str_conv); } + { return rep->ushort_value (req_int, frc_str_conv); } int int_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->int_value (req_int, frc_str_conv); } + { return rep->int_value (req_int, frc_str_conv); } unsigned int uint_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->uint_value (req_int, frc_str_conv); } + { return rep->uint_value (req_int, frc_str_conv); } int nint_value (bool frc_str_conv = false) const - { return rep->nint_value (frc_str_conv); } + { return rep->nint_value (frc_str_conv); } long int long_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->long_value (req_int, frc_str_conv); } + { return rep->long_value (req_int, frc_str_conv); } unsigned long int ulong_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->ulong_value (req_int, frc_str_conv); } + { return rep->ulong_value (req_int, frc_str_conv); } int64_t int64_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->int64_value (req_int, frc_str_conv); } + { return rep->int64_value (req_int, frc_str_conv); } uint64_t uint64_value (bool req_int = false, bool frc_str_conv = false) const - { return rep->uint64_value (req_int, frc_str_conv); } + { return rep->uint64_value (req_int, frc_str_conv); } octave_idx_type idx_type_value (bool req_int = false, bool frc_str_conv = false) const; double double_value (bool frc_str_conv = false) const - { return rep->double_value (frc_str_conv); } + { return rep->double_value (frc_str_conv); } float float_value (bool frc_str_conv = false) const - { return rep->float_value (frc_str_conv); } + { return rep->float_value (frc_str_conv); } double scalar_value (bool frc_str_conv = false) const - { return rep->scalar_value (frc_str_conv); } + { return rep->scalar_value (frc_str_conv); } float float_scalar_value (bool frc_str_conv = false) const - { return rep->float_scalar_value (frc_str_conv); } + { return rep->float_scalar_value (frc_str_conv); } Cell cell_value (void) const; Matrix matrix_value (bool frc_str_conv = false) const - { return rep->matrix_value (frc_str_conv); } + { return rep->matrix_value (frc_str_conv); } FloatMatrix float_matrix_value (bool frc_str_conv = false) const - { return rep->float_matrix_value (frc_str_conv); } + { return rep->float_matrix_value (frc_str_conv); } NDArray array_value (bool frc_str_conv = false) const - { return rep->array_value (frc_str_conv); } + { return rep->array_value (frc_str_conv); } FloatNDArray float_array_value (bool frc_str_conv = false) const - { return rep->float_array_value (frc_str_conv); } + { return rep->float_array_value (frc_str_conv); } Complex complex_value (bool frc_str_conv = false) const - { return rep->complex_value (frc_str_conv); } + { return rep->complex_value (frc_str_conv); } FloatComplex float_complex_value (bool frc_str_conv = false) const - { return rep->float_complex_value (frc_str_conv); } + { return rep->float_complex_value (frc_str_conv); } ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const - { return rep->complex_matrix_value (frc_str_conv); } + { return rep->complex_matrix_value (frc_str_conv); } - FloatComplexMatrix float_complex_matrix_value (bool frc_str_conv = false) const - { return rep->float_complex_matrix_value (frc_str_conv); } + FloatComplexMatrix + float_complex_matrix_value (bool frc_str_conv = false) const + { return rep->float_complex_matrix_value (frc_str_conv); } ComplexNDArray complex_array_value (bool frc_str_conv = false) const - { return rep->complex_array_value (frc_str_conv); } + { return rep->complex_array_value (frc_str_conv); } - FloatComplexNDArray float_complex_array_value (bool frc_str_conv = false) const - { return rep->float_complex_array_value (frc_str_conv); } + FloatComplexNDArray + float_complex_array_value (bool frc_str_conv = false) const + { return rep->float_complex_array_value (frc_str_conv); } bool bool_value (bool warn = false) const - { return rep->bool_value (warn); } + { return rep->bool_value (warn); } boolMatrix bool_matrix_value (bool warn = false) const - { return rep->bool_matrix_value (warn); } + { return rep->bool_matrix_value (warn); } boolNDArray bool_array_value (bool warn = false) const - { return rep->bool_array_value (warn); } + { return rep->bool_array_value (warn); } charMatrix char_matrix_value (bool frc_str_conv = false) const - { return rep->char_matrix_value (frc_str_conv); } + { return rep->char_matrix_value (frc_str_conv); } charNDArray char_array_value (bool frc_str_conv = false) const - { return rep->char_array_value (frc_str_conv); } + { return rep->char_array_value (frc_str_conv); } SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const - { return rep->sparse_matrix_value (frc_str_conv); } + { return rep->sparse_matrix_value (frc_str_conv); } - SparseComplexMatrix sparse_complex_matrix_value (bool frc_str_conv = false) const - { return rep->sparse_complex_matrix_value (frc_str_conv); } + SparseComplexMatrix + sparse_complex_matrix_value (bool frc_str_conv = false) const + { return rep->sparse_complex_matrix_value (frc_str_conv); } SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const - { return rep->sparse_bool_matrix_value (warn); } + { return rep->sparse_bool_matrix_value (warn); } DiagMatrix diag_matrix_value (bool force = false) const - { return rep->diag_matrix_value (force); } + { return rep->diag_matrix_value (force); } FloatDiagMatrix float_diag_matrix_value (bool force = false) const - { return rep->float_diag_matrix_value (force); } + { return rep->float_diag_matrix_value (force); } ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const - { return rep->complex_diag_matrix_value (force); } + { return rep->complex_diag_matrix_value (force); } - FloatComplexDiagMatrix float_complex_diag_matrix_value (bool force = false) const - { return rep->float_complex_diag_matrix_value (force); } + FloatComplexDiagMatrix + float_complex_diag_matrix_value (bool force = false) const + { return rep->float_complex_diag_matrix_value (force); } PermMatrix perm_matrix_value (void) const - { return rep->perm_matrix_value (); } + { return rep->perm_matrix_value (); } octave_int8 int8_scalar_value (void) const - { return rep->int8_scalar_value (); } + { return rep->int8_scalar_value (); } octave_int16 int16_scalar_value (void) const - { return rep->int16_scalar_value (); } + { return rep->int16_scalar_value (); } octave_int32 int32_scalar_value (void) const - { return rep->int32_scalar_value (); } + { return rep->int32_scalar_value (); } octave_int64 int64_scalar_value (void) const - { return rep->int64_scalar_value (); } + { return rep->int64_scalar_value (); } octave_uint8 uint8_scalar_value (void) const - { return rep->uint8_scalar_value (); } + { return rep->uint8_scalar_value (); } octave_uint16 uint16_scalar_value (void) const - { return rep->uint16_scalar_value (); } + { return rep->uint16_scalar_value (); } octave_uint32 uint32_scalar_value (void) const - { return rep->uint32_scalar_value (); } + { return rep->uint32_scalar_value (); } octave_uint64 uint64_scalar_value (void) const - { return rep->uint64_scalar_value (); } + { return rep->uint64_scalar_value (); } int8NDArray int8_array_value (void) const - { return rep->int8_array_value (); } + { return rep->int8_array_value (); } int16NDArray int16_array_value (void) const - { return rep->int16_array_value (); } + { return rep->int16_array_value (); } int32NDArray int32_array_value (void) const - { return rep->int32_array_value (); } + { return rep->int32_array_value (); } int64NDArray int64_array_value (void) const - { return rep->int64_array_value (); } + { return rep->int64_array_value (); } uint8NDArray uint8_array_value (void) const - { return rep->uint8_array_value (); } + { return rep->uint8_array_value (); } uint16NDArray uint16_array_value (void) const - { return rep->uint16_array_value (); } + { return rep->uint16_array_value (); } uint32NDArray uint32_array_value (void) const - { return rep->uint32_array_value (); } + { return rep->uint32_array_value (); } uint64NDArray uint64_array_value (void) const - { return rep->uint64_array_value (); } + { return rep->uint64_array_value (); } string_vector all_strings (bool pad = false) const - { return rep->all_strings (pad); } + { return rep->all_strings (pad); } std::string string_value (bool force = false) const - { return rep->string_value (force); } + { return rep->string_value (force); } Array<std::string> cellstr_value (void) const - { return rep->cellstr_value (); } + { return rep->cellstr_value (); } Range range_value (void) const - { return rep->range_value (); } + { return rep->range_value (); } octave_map map_value (void) const; octave_scalar_map scalar_map_value (void) const; string_vector map_keys (void) const - { return rep->map_keys (); } + { return rep->map_keys (); } size_t nparents (void) const - { return rep->nparents (); } + { return rep->nparents (); } std::list<std::string> parent_class_name_list (void) const - { return rep->parent_class_name_list (); } + { return rep->parent_class_name_list (); } string_vector parent_class_names (void) const - { return rep->parent_class_names (); } + { return rep->parent_class_names (); } octave_base_value * find_parent_class (const std::string& parent_class_name) - { return rep->find_parent_class (parent_class_name); } + { return rep->find_parent_class (parent_class_name); } octave_function *function_value (bool silent = false) const; @@ -923,11 +928,11 @@ octave_value_list list_value (void) const; ColumnVector column_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; ComplexColumnVector complex_column_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; RowVector row_vector_value (bool frc_str_conv = false, bool frc_vec_conv = false) const; @@ -938,18 +943,18 @@ FloatColumnVector float_column_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; FloatComplexColumnVector float_complex_column_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; FloatRowVector float_row_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; FloatComplexRowVector float_complex_row_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; @@ -970,15 +975,16 @@ bool frc_vec_conv = false) const; Array<float> float_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + bool frc_vec_conv = false) const; - Array<FloatComplex> float_complex_vector_value (bool frc_str_conv = false, - bool frc_vec_conv = false) const; + Array<FloatComplex> + float_complex_vector_value (bool frc_str_conv = false, + bool frc_vec_conv = false) const; // Possibly economize a lazy-indexed value. void maybe_economize (void) - { rep->maybe_economize (); } + { rep->maybe_economize (); } // The following two hook conversions are called on any octave_value prior to // storing it to a "permanent" location, like a named variable, a cell or a @@ -997,27 +1003,26 @@ octave_value convert_to_str (bool pad = false, bool force = false, char type = '\'') const - { return rep->convert_to_str (pad, force, type); } + { return rep->convert_to_str (pad, force, type); } octave_value convert_to_str_internal (bool pad, bool force, char type) const - { return rep->convert_to_str_internal (pad, force, type); } + { return rep->convert_to_str_internal (pad, force, type); } void convert_to_row_or_column_vector (void) - { rep->convert_to_row_or_column_vector (); } + { rep->convert_to_row_or_column_vector (); } bool print_as_scalar (void) const - { return rep->print_as_scalar (); } + { return rep->print_as_scalar (); } void print (std::ostream& os, bool pr_as_read_syntax = false) const - { rep->print (os, pr_as_read_syntax); } + { rep->print (os, pr_as_read_syntax); } - void print_raw (std::ostream& os, - bool pr_as_read_syntax = false) const - { rep->print_raw (os, pr_as_read_syntax); } + void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const + { rep->print_raw (os, pr_as_read_syntax); } bool print_name_tag (std::ostream& os, const std::string& name) const - { return rep->print_name_tag (os, name); } + { return rep->print_name_tag (os, name); } void print_with_name (std::ostream& os, const std::string& name) const { rep->print_with_name (os, name, true); } @@ -1033,54 +1038,54 @@ // Unary and binary operations. friend OCTINTERP_API octave_value do_unary_op (unary_op op, - const octave_value& a); + const octave_value& a); octave_value& do_non_const_unary_op (unary_op op); octave_value& do_non_const_unary_op (unary_op op, const std::string& type, - const std::list<octave_value_list>& idx); + const std::list<octave_value_list>& idx); friend OCTINTERP_API octave_value do_binary_op (binary_op op, - const octave_value& a, - const octave_value& b); + const octave_value& a, + const octave_value& b); friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op, const octave_value& a, const octave_value& b); friend OCTINTERP_API octave_value do_cat_op (const octave_value& a, - const octave_value& b, - const Array<octave_idx_type>& ra_idx); + const octave_value& b, + const Array<octave_idx_type>& ra_idx); const octave_base_value& get_rep (void) const { return *rep; } bool is_copy_of (const octave_value &val) const { return rep == val.rep; } void print_info (std::ostream& os, - const std::string& prefix = std::string ()) const; + const std::string& prefix = std::string ()) const; bool save_ascii (std::ostream& os) { return rep->save_ascii (os); } bool load_ascii (std::istream& is) { return rep->load_ascii (is); } bool save_binary (std::ostream& os, bool& save_as_floats) - { return rep->save_binary (os, save_as_floats); } + { return rep->save_binary (os, save_as_floats); } bool load_binary (std::istream& is, bool swap, - oct_mach_info::float_format fmt) - { return rep->load_binary (is, swap, fmt); } + oct_mach_info::float_format fmt) + { return rep->load_binary (is, swap, fmt); } #if defined (HAVE_HDF5) bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) - { return rep->save_hdf5 (loc_id, name, save_as_floats); } + { return rep->save_hdf5 (loc_id, name, save_as_floats); } bool load_hdf5 (hid_t loc_id, const char *name) - { return rep->load_hdf5 (loc_id, name); } + { return rep->load_hdf5 (loc_id, name); } #endif int write (octave_stream& os, int block_size, - oct_data_conv::data_type output_type, int skip, - oct_mach_info::float_format flt_fmt) const; + oct_data_conv::data_type output_type, int skip, + oct_mach_info::float_format flt_fmt) const; octave_base_value *internal_rep (void) const { return rep; } @@ -1095,25 +1100,25 @@ mxArray *as_mxArray (void) const { return rep->as_mxArray (); } octave_value diag (octave_idx_type k = 0) const - { return rep->diag (k); } + { return rep->diag (k); } octave_value diag (octave_idx_type m, octave_idx_type n) const - { return rep->diag (m, n); } + { return rep->diag (m, n); } octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const - { return rep->sort (dim, mode); } + { return rep->sort (dim, mode); } octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, - sortmode mode = ASCENDING) const - { return rep->sort (sidx, dim, mode); } + sortmode mode = ASCENDING) const + { return rep->sort (sidx, dim, mode); } sortmode is_sorted (sortmode mode = UNSORTED) const - { return rep->is_sorted (mode); } + { return rep->is_sorted (mode); } Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const - { return rep->sort_rows_idx (mode); } + { return rep->sort_rows_idx (mode); } sortmode is_sorted_rows (sortmode mode = UNSORTED) const - { return rep->is_sorted_rows (mode); } + { return rep->is_sorted_rows (mode); } void lock (void) { rep->lock (); } @@ -1195,23 +1200,23 @@ #undef MAPPER_FORWARD octave_value map (octave_base_value::unary_mapper_t umap) const - { return rep->map (umap); } + { return rep->map (umap); } // Extract the n-th element, aka val(n). Result is undefined if val is not an // array type or n is out of range. Never error. octave_value fast_elem_extract (octave_idx_type n) const - { return rep->fast_elem_extract (n); } + { return rep->fast_elem_extract (n); } // Assign the n-th element, aka val(n) = x. Returns false if val is not an // array type, x is not a matching scalar type, or n is out of range. // Never error. virtual bool fast_elem_insert (octave_idx_type n, const octave_value& x) - { - make_unique (); - return rep->fast_elem_insert (n, x); - } + { + make_unique (); + return rep->fast_elem_insert (n, x); + } protected: @@ -1341,7 +1346,7 @@ // Templated value extractors. template<class Value> inline Value octave_value_extract (const octave_value&) - { assert (false); } +{ assert (false); } #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ template<> \
--- a/libinterp/octave.cc +++ b/libinterp/octave.cc @@ -191,7 +191,7 @@ } DEFUN (__version_info__, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {retval =} __version_info__ (@var{name}, @var{version}, @var{release}, @var{date})\n\ Undocumented internal function.\n\ @end deftypefn") @@ -861,14 +861,14 @@ { command_editor::blink_matching_paren (false); - // FIXME -- is this the right thing to do? + // FIXME: is this the right thing to do? Fecho_executing_commands (octave_value (ECHO_CMD_LINE)); } if (octave_embedded) { - // FIXME -- do we need to do any cleanup here before + // FIXME: do we need to do any cleanup here before // returning? If we don't, what will happen to Octave functions // that have been registered to execute with atexit, for example? @@ -931,7 +931,7 @@ } DEFUN (isguirunning, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isguirunning ()\n\ Return true if Octave is running in GUI mode and false otherwise.\n\ @end deftypefn") @@ -952,7 +952,7 @@ */ DEFUN (argv, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} argv ()\n\ Return the command line arguments passed to Octave. For example,\n\ if you invoked Octave using the command\n\ @@ -986,7 +986,7 @@ */ DEFUN (program_invocation_name, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} program_invocation_name ()\n\ Return the name that was typed at the shell prompt to run Octave.\n\ \n\ @@ -1013,7 +1013,7 @@ */ DEFUN (program_name, args, , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} program_name ()\n\ Return the last component of the value returned by\n\ @code{program_invocation_name}.\n\
--- a/libinterp/operators/op-b-bm.cc +++ b/libinterp/operators/op-b-bm.cc @@ -51,7 +51,8 @@ DEFNDCATOP_FN (s_bm, scalar, bool_matrix, array, array, concat) DEFNDCATOP_FN (b_fm, bool, float_matrix, float_array, float_array, concat) -DEFNDCATOP_FN (f_bm, float_scalar, bool_matrix, float_array, float_array, concat) +DEFNDCATOP_FN (f_bm, float_scalar, bool_matrix, float_array, float_array, + concat) DEFCONV (bool_matrix_conv, bool, bool_matrix) {
--- a/libinterp/operators/op-b-sbm.cc +++ b/libinterp/operators/op-b-sbm.cc @@ -91,5 +91,6 @@ INSTALL_ASSIGNCONV (octave_bool, octave_sparse_bool_matrix, octave_bool_matrix); - INSTALL_WIDENOP (octave_bool, octave_sparse_bool_matrix, sparse_bool_matrix_conv); + INSTALL_WIDENOP (octave_bool, octave_sparse_bool_matrix, + sparse_bool_matrix_conv); }
--- a/libinterp/operators/op-bm-b.cc +++ b/libinterp/operators/op-bm-b.cc @@ -58,7 +58,8 @@ DEFNDCATOP_FN (bm_b, bool_matrix, bool, bool_array, bool_array, concat) DEFNDCATOP_FN (bm_s, bool_matrix, scalar, array, array, concat) DEFNDCATOP_FN (m_b, matrix, bool, array, array, concat) -DEFNDCATOP_FN (bm_f, bool_matrix, float_scalar, float_array, float_array, concat) +DEFNDCATOP_FN (bm_f, bool_matrix, float_scalar, float_array, float_array, + concat) DEFNDCATOP_FN (fm_b, float_matrix, bool, float_array, float_array, concat) DEFNDASSIGNOP_FN (assign, bool_matrix, bool, bool_array, assign) @@ -70,8 +71,8 @@ { octave_bool_matrix& v1 = dynamic_cast<octave_bool_matrix&> (a1); - // FIXME -- perhaps add a warning for this conversion if the values - // are not all 0 or 1? + // FIXME: perhaps add a warning for this conversion + // if the values are not all 0 or 1? boolNDArray v2 = a2.bool_array_value (true); @@ -97,15 +98,24 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_bool, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_scalar, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_scalar, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int8_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int16_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int32_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int64_scalar, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int8_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int16_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int32_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int64_scalar, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint8_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint16_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint32_scalar, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint64_scalar, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint8_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint16_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint32_scalar, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint64_scalar, + conv_and_assign); }
--- a/libinterp/operators/op-bm-bm.cc +++ b/libinterp/operators/op-bm-bm.cc @@ -95,12 +95,16 @@ DEFNDCATOP_FN (bm_bm, bool_matrix, bool_matrix, bool_array, bool_array, concat) DEFNDCATOP_FN (bm_m, bool_matrix, matrix, array, array, concat) DEFNDCATOP_FN (m_bm, matrix, bool_matrix, array, array, concat) -DEFNDCATOP_FN (bm_fm, bool_matrix, float_matrix, float_array, float_array, concat) -DEFNDCATOP_FN (fm_bm, float_matrix, bool_matrix, float_array, float_array, concat) +DEFNDCATOP_FN (bm_fm, bool_matrix, float_matrix, float_array, float_array, + concat) +DEFNDCATOP_FN (fm_bm, float_matrix, bool_matrix, float_array, float_array, + concat) DEFNDASSIGNOP_FN (assign, bool_matrix, bool_matrix, bool_array, assign) -DEFNDASSIGNOP_FNOP (assign_and, bool_matrix, bool_matrix, bool_array, mx_el_and_assign) -DEFNDASSIGNOP_FNOP (assign_or, bool_matrix, bool_matrix, bool_array, mx_el_or_assign) +DEFNDASSIGNOP_FNOP (assign_and, bool_matrix, bool_matrix, bool_array, + mx_el_and_assign) +DEFNDASSIGNOP_FNOP (assign_or, bool_matrix, bool_matrix, bool_array, + mx_el_or_assign) DEFNULLASSIGNOP_FN (null_assign, bool_matrix, delete_elements) @@ -111,8 +115,8 @@ { octave_bool_matrix& v1 = dynamic_cast<octave_bool_matrix&> (a1); - // FIXME -- perhaps add a warning for this conversion if the values - // are not all 0 or 1? + // FIXME: perhaps add a warning for this conversion + // if the values are not all 0 or 1? boolNDArray v2 = a2.bool_array_value (true); @@ -141,10 +145,14 @@ INSTALL_BINOP (op_el_and, octave_bool_matrix, octave_bool_matrix, el_and); INSTALL_BINOP (op_el_or, octave_bool_matrix, octave_bool_matrix, el_or); - INSTALL_BINOP (op_el_not_and, octave_bool_matrix, octave_bool_matrix, el_not_and); - INSTALL_BINOP (op_el_not_or, octave_bool_matrix, octave_bool_matrix, el_not_or); - INSTALL_BINOP (op_el_and_not, octave_bool_matrix, octave_bool_matrix, el_and_not); - INSTALL_BINOP (op_el_or_not, octave_bool_matrix, octave_bool_matrix, el_or_not); + INSTALL_BINOP (op_el_not_and, octave_bool_matrix, octave_bool_matrix, + el_not_and); + INSTALL_BINOP (op_el_not_or, octave_bool_matrix, octave_bool_matrix, + el_not_or); + INSTALL_BINOP (op_el_and_not, octave_bool_matrix, octave_bool_matrix, + el_and_not); + INSTALL_BINOP (op_el_or_not, octave_bool_matrix, octave_bool_matrix, + el_or_not); INSTALL_CATOP (octave_bool_matrix, octave_bool_matrix, bm_bm); INSTALL_CATOP (octave_bool_matrix, octave_matrix, bm_m); @@ -157,28 +165,46 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_bool_matrix, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_char_matrix_str, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_char_matrix_sq_str, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_char_matrix_str, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_char_matrix_sq_str, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_range, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_range, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_sparse_matrix, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_sparse_matrix, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int8_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int16_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int32_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int64_matrix, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int8_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int16_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int32_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_int64_matrix, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint8_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint16_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint32_matrix, conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint64_matrix, conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint8_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint16_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint32_matrix, + conv_and_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_uint64_matrix, + conv_and_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_sq_str, null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_bool_matrix, octave_null_sq_str, + null_assign); - INSTALL_ASSIGNOP (op_el_and_eq, octave_bool_matrix, octave_bool_matrix, assign_and); - INSTALL_ASSIGNOP (op_el_or_eq, octave_bool_matrix, octave_bool_matrix, assign_or); + INSTALL_ASSIGNOP (op_el_and_eq, octave_bool_matrix, octave_bool_matrix, + assign_and); + INSTALL_ASSIGNOP (op_el_or_eq, octave_bool_matrix, octave_bool_matrix, + assign_or); }
--- a/libinterp/operators/op-cdm-cdm.cc +++ b/libinterp/operators/op-cdm-cdm.cc @@ -60,7 +60,8 @@ DEFBINOP (div, complex_diag_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_complex_diag_matrix&); return xdiv (v1.complex_diag_matrix_value (), v2.complex_diag_matrix_value ()); @@ -68,7 +69,8 @@ DEFBINOP (ldiv, complex_diag_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_complex_diag_matrix&); return xleftdiv (v1.complex_diag_matrix_value (), v2.complex_diag_matrix_value ()); @@ -85,7 +87,8 @@ { CAST_CONV_ARG (const octave_complex_diag_matrix&); - return new octave_float_complex_diag_matrix (v.float_complex_diag_matrix_value ()); + return + new octave_float_complex_diag_matrix (v.float_complex_diag_matrix_value ()); } void @@ -96,15 +99,23 @@ INSTALL_UNOP (op_transpose, octave_complex_diag_matrix, transpose); INSTALL_UNOP (op_hermitian, octave_complex_diag_matrix, hermitian); - INSTALL_BINOP (op_add, octave_complex_diag_matrix, octave_complex_diag_matrix, add); - INSTALL_BINOP (op_sub, octave_complex_diag_matrix, octave_complex_diag_matrix, sub); - INSTALL_BINOP (op_mul, octave_complex_diag_matrix, octave_complex_diag_matrix, mul); - INSTALL_BINOP (op_div, octave_complex_diag_matrix, octave_complex_diag_matrix, div); - INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, octave_complex_diag_matrix, ldiv); + INSTALL_BINOP (op_add, octave_complex_diag_matrix, octave_complex_diag_matrix, + add); + INSTALL_BINOP (op_sub, octave_complex_diag_matrix, octave_complex_diag_matrix, + sub); + INSTALL_BINOP (op_mul, octave_complex_diag_matrix, octave_complex_diag_matrix, + mul); + INSTALL_BINOP (op_div, octave_complex_diag_matrix, octave_complex_diag_matrix, + div); + INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, + octave_complex_diag_matrix, ldiv); - INSTALL_CONVOP (octave_complex_diag_matrix, octave_complex_matrix, complex_diag_matrix_to_complex_matrix); + INSTALL_CONVOP (octave_complex_diag_matrix, octave_complex_matrix, + complex_diag_matrix_to_complex_matrix); INSTALL_CONVOP (octave_complex_diag_matrix, octave_float_complex_diag_matrix, complex_diag_matrix_to_float_complex_diag_matrix); - INSTALL_ASSIGNCONV (octave_complex_diag_matrix, octave_complex_matrix, octave_complex_matrix); - INSTALL_WIDENOP (octave_complex_diag_matrix, octave_complex_matrix, complex_diag_matrix_to_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex_diag_matrix, octave_complex_matrix, + octave_complex_matrix); + INSTALL_WIDENOP (octave_complex_diag_matrix, octave_complex_matrix, + complex_diag_matrix_to_complex_matrix); }
--- a/libinterp/operators/op-chm.cc +++ b/libinterp/operators/op-chm.cc @@ -54,8 +54,8 @@ gripe_implicit_conversion ("Octave:num-to-str", v2.type_name (), v1.type_name ()); - return octave_value (v1.char_array_value (). concat(v2.array_value (), - ra_idx)); + return octave_value (v1.char_array_value (). concat (v2.array_value (), + ra_idx)); } DEFCATOP (chm_m, char_matrix, matrix) @@ -66,7 +66,7 @@ v2.type_name (), v1.type_name ()); return octave_value (v1.char_array_value (). concat (v2.array_value (), - ra_idx)); + ra_idx)); } DEFCATOP (s_chm, scalar, char_matrix) @@ -77,7 +77,7 @@ v1.type_name (), v2.type_name ()); return octave_value (v1.array_value (). concat (v2.char_array_value (), - ra_idx)); + ra_idx)); } DEFCATOP (m_chm, matrix, char_matrix) @@ -88,7 +88,7 @@ v1.type_name (), v2.type_name ()); return octave_value (v1.array_value (). concat (v2.char_array_value (), - ra_idx)); + ra_idx)); } void
--- a/libinterp/operators/op-class.cc +++ b/libinterp/operators/op-class.cc @@ -72,7 +72,7 @@ DEF_CLASS_UNOP (transpose) DEF_CLASS_UNOP (ctranspose) -// FIXME -- we need to handle precedence in the binop function. +// FIXME: we need to handle precedence in the binop function. #define DEF_CLASS_BINOP(name) \ static octave_value \
--- a/libinterp/operators/op-cm-cm.cc +++ b/libinterp/operators/op-cm-cm.cc @@ -73,8 +73,10 @@ // complex matrix by complex matrix ops. -DEFNDBINOP_OP (add, complex_matrix, complex_matrix, complex_array, complex_array, +) -DEFNDBINOP_OP (sub, complex_matrix, complex_matrix, complex_array, complex_array, -) +DEFNDBINOP_OP (add, complex_matrix, complex_matrix, complex_array, + complex_array, +) +DEFNDBINOP_OP (sub, complex_matrix, complex_matrix, complex_array, + complex_array, -) DEFBINOP_OP (mul, complex_matrix, complex_matrix, *) @@ -158,34 +160,48 @@ MatrixType typ = v1.matrix_type (); ComplexMatrix ret = xleftdiv (v1.complex_matrix_value (), - v2.complex_matrix_value (), typ, blas_conj_trans); + v2.complex_matrix_value (), typ, + blas_conj_trans); v1.matrix_type (typ); return ret; } -DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_lt) -DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_le) -DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_eq) -DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ge) -DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_gt) -DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_ne) -DEFNDBINOP_FN (el_mul, complex_matrix, complex_matrix, complex_array, complex_array, product) -DEFNDBINOP_FN (el_div, complex_matrix, complex_matrix, complex_array, complex_array, quotient) -DEFNDBINOP_FN (el_pow, complex_matrix, complex_matrix, complex_array, complex_array, elem_xpow) +DEFNDBINOP_FN (el_mul, complex_matrix, complex_matrix, complex_array, + complex_array, product) +DEFNDBINOP_FN (el_div, complex_matrix, complex_matrix, complex_array, + complex_array, quotient) +DEFNDBINOP_FN (el_pow, complex_matrix, complex_matrix, complex_array, + complex_array, elem_xpow) DEFBINOP (el_ldiv, complex_matrix, complex_matrix) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - return octave_value (quotient (v2.complex_array_value (), v1.complex_array_value ())); + return octave_value (quotient (v2.complex_array_value (), + v1.complex_array_value ())); } -DEFNDBINOP_FN (el_and, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, complex_matrix, complex_array, + complex_array, mx_el_or) -DEFNDCATOP_FN (cm_cm, complex_matrix, complex_matrix, complex_array, complex_array, concat) +DEFNDCATOP_FN (cm_cm, complex_matrix, complex_matrix, complex_array, + complex_array, concat) DEFNDASSIGNOP_FN (assign, complex_matrix, complex_matrix, complex_array, assign) @@ -193,14 +209,18 @@ DEFNDASSIGNOP_OP (assign_add, complex_matrix, complex_matrix, complex_array, +=) DEFNDASSIGNOP_OP (assign_sub, complex_matrix, complex_matrix, complex_array, -=) -DEFNDASSIGNOP_FNOP (assign_el_mul, complex_matrix, complex_matrix, complex_array, product_eq) -DEFNDASSIGNOP_FNOP (assign_el_div, complex_matrix, complex_matrix, complex_array, quotient_eq) +DEFNDASSIGNOP_FNOP (assign_el_mul, complex_matrix, complex_matrix, + complex_array, product_eq) +DEFNDASSIGNOP_FNOP (assign_el_div, complex_matrix, complex_matrix, + complex_array, quotient_eq) CONVDECL (complex_matrix_to_float_complex_matrix) { CAST_CONV_ARG (const octave_complex_matrix&); - return new octave_float_complex_matrix (FloatComplexNDArray (v.complex_array_value ())); + return + new octave_float_complex_matrix + (FloatComplexNDArray (v.complex_array_value ())); } void @@ -222,12 +242,18 @@ INSTALL_BINOP (op_div, octave_complex_matrix, octave_complex_matrix, div); INSTALL_BINOP (op_pow, octave_complex_matrix, octave_complex_matrix, pow); INSTALL_BINOP (op_ldiv, octave_complex_matrix, octave_complex_matrix, ldiv); - INSTALL_BINOP (op_trans_mul, octave_complex_matrix, octave_complex_matrix, trans_mul); - INSTALL_BINOP (op_mul_trans, octave_complex_matrix, octave_complex_matrix, mul_trans); - INSTALL_BINOP (op_herm_mul, octave_complex_matrix, octave_complex_matrix, herm_mul); - INSTALL_BINOP (op_mul_herm, octave_complex_matrix, octave_complex_matrix, mul_herm); - INSTALL_BINOP (op_trans_ldiv, octave_complex_matrix, octave_complex_matrix, trans_ldiv); - INSTALL_BINOP (op_herm_ldiv, octave_complex_matrix, octave_complex_matrix, herm_ldiv); + INSTALL_BINOP (op_trans_mul, octave_complex_matrix, octave_complex_matrix, + trans_mul); + INSTALL_BINOP (op_mul_trans, octave_complex_matrix, octave_complex_matrix, + mul_trans); + INSTALL_BINOP (op_herm_mul, octave_complex_matrix, octave_complex_matrix, + herm_mul); + INSTALL_BINOP (op_mul_herm, octave_complex_matrix, octave_complex_matrix, + mul_herm); + INSTALL_BINOP (op_trans_ldiv, octave_complex_matrix, octave_complex_matrix, + trans_ldiv); + INSTALL_BINOP (op_herm_ldiv, octave_complex_matrix, octave_complex_matrix, + herm_ldiv); INSTALL_BINOP (op_lt, octave_complex_matrix, octave_complex_matrix, lt); INSTALL_BINOP (op_le, octave_complex_matrix, octave_complex_matrix, le); @@ -235,25 +261,38 @@ INSTALL_BINOP (op_ge, octave_complex_matrix, octave_complex_matrix, ge); INSTALL_BINOP (op_gt, octave_complex_matrix, octave_complex_matrix, gt); INSTALL_BINOP (op_ne, octave_complex_matrix, octave_complex_matrix, ne); - INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_complex_matrix, el_mul); - INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_complex_matrix, el_div); - INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_complex_matrix, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_complex_matrix, el_ldiv); - INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_complex_matrix, el_and); + INSTALL_BINOP (op_el_mul, octave_complex_matrix, octave_complex_matrix, + el_mul); + INSTALL_BINOP (op_el_div, octave_complex_matrix, octave_complex_matrix, + el_div); + INSTALL_BINOP (op_el_pow, octave_complex_matrix, octave_complex_matrix, + el_pow); + INSTALL_BINOP (op_el_ldiv, octave_complex_matrix, octave_complex_matrix, + el_ldiv); + INSTALL_BINOP (op_el_and, octave_complex_matrix, octave_complex_matrix, + el_and); INSTALL_BINOP (op_el_or, octave_complex_matrix, octave_complex_matrix, el_or); INSTALL_CATOP (octave_complex_matrix, octave_complex_matrix, cm_cm); - INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_complex_matrix, assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_complex_matrix, + assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_sq_str, null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_null_sq_str, + null_assign); - INSTALL_ASSIGNOP (op_add_eq, octave_complex_matrix, octave_complex_matrix, assign_add); - INSTALL_ASSIGNOP (op_sub_eq, octave_complex_matrix, octave_complex_matrix, assign_sub); - INSTALL_ASSIGNOP (op_el_mul_eq, octave_complex_matrix, octave_complex_matrix, assign_el_mul); - INSTALL_ASSIGNOP (op_el_div_eq, octave_complex_matrix, octave_complex_matrix, assign_el_div); + INSTALL_ASSIGNOP (op_add_eq, octave_complex_matrix, octave_complex_matrix, + assign_add); + INSTALL_ASSIGNOP (op_sub_eq, octave_complex_matrix, octave_complex_matrix, + assign_sub); + INSTALL_ASSIGNOP (op_el_mul_eq, octave_complex_matrix, octave_complex_matrix, + assign_el_mul); + INSTALL_ASSIGNOP (op_el_div_eq, octave_complex_matrix, octave_complex_matrix, + assign_el_div); INSTALL_CONVOP (octave_complex_matrix, octave_float_complex_matrix, complex_matrix_to_float_complex_matrix);
--- a/libinterp/operators/op-cm-cs.cc +++ b/libinterp/operators/op-cm-cs.cc @@ -68,12 +68,18 @@ return ret; } -DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex, complex_array, complex, mx_el_lt) -DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex, complex_array, complex, mx_el_le) -DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex, complex_array, complex, mx_el_eq) -DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex, complex_array, complex, mx_el_ge) -DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex, complex_array, complex, mx_el_gt) -DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex, complex_array, complex, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex, complex_array, complex, + mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex, complex_array, complex, + mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex, complex_array, complex, + mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex, complex_array, complex, + mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex, complex_array, complex, + mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex, complex_array, complex, + mx_el_ne) DEFNDBINOP_OP (el_mul, complex_matrix, complex, complex_array, complex, *) @@ -89,7 +95,8 @@ return octave_value (v1.complex_array_value () / d); } -DEFNDBINOP_FN (el_pow, complex_matrix, complex, complex_array, complex, elem_xpow) +DEFNDBINOP_FN (el_pow, complex_matrix, complex, complex_array, complex, + elem_xpow) DEFBINOP (el_ldiv, complex_matrix, complex) { @@ -98,13 +105,17 @@ return x_el_div (v2.complex_value (), v1.complex_array_value ()); } -DEFNDBINOP_FN (el_and, complex_matrix, complex, complex_array, complex, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, complex, complex_array, complex, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, complex, complex_array, complex, + mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, complex, complex_array, complex, + mx_el_or) -DEFNDCATOP_FN (cm_cs, complex_matrix, complex, complex_array, complex_array, concat) +DEFNDCATOP_FN (cm_cs, complex_matrix, complex, complex_array, complex_array, + concat) DEFNDASSIGNOP_FN (assign, complex_matrix, complex, complex, assign) -DEFNDASSIGNOP_FN (sgl_assign, float_complex_matrix, complex, float_complex, assign) +DEFNDASSIGNOP_FN (sgl_assign, float_complex_matrix, complex, float_complex, + assign) DEFNDASSIGNOP_OP (assign_add, complex_matrix, complex_scalar, complex, +=) DEFNDASSIGNOP_OP (assign_sub, complex_matrix, complex_scalar, complex, -=) @@ -136,10 +147,15 @@ INSTALL_CATOP (octave_complex_matrix, octave_complex, cm_cs); INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_complex, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_complex, sgl_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_complex, + sgl_assign); - INSTALL_ASSIGNOP (op_add_eq, octave_complex_matrix, octave_complex_scalar, assign_add); - INSTALL_ASSIGNOP (op_sub_eq, octave_complex_matrix, octave_complex_scalar, assign_sub); - INSTALL_ASSIGNOP (op_mul_eq, octave_complex_matrix, octave_complex_scalar, assign_mul); - INSTALL_ASSIGNOP (op_div_eq, octave_complex_matrix, octave_complex_scalar, assign_div); + INSTALL_ASSIGNOP (op_add_eq, octave_complex_matrix, octave_complex_scalar, + assign_add); + INSTALL_ASSIGNOP (op_sub_eq, octave_complex_matrix, octave_complex_scalar, + assign_sub); + INSTALL_ASSIGNOP (op_mul_eq, octave_complex_matrix, octave_complex_scalar, + assign_mul); + INSTALL_ASSIGNOP (op_div_eq, octave_complex_matrix, octave_complex_scalar, + assign_div); }
--- a/libinterp/operators/op-cm-s.cc +++ b/libinterp/operators/op-cm-s.cc @@ -138,6 +138,8 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_scalar, assign); - INSTALL_ASSIGNOP (op_mul_eq, octave_complex_matrix, octave_scalar, assign_mul); - INSTALL_ASSIGNOP (op_div_eq, octave_complex_matrix, octave_scalar, assign_div); + INSTALL_ASSIGNOP (op_mul_eq, octave_complex_matrix, octave_scalar, + assign_mul); + INSTALL_ASSIGNOP (op_div_eq, octave_complex_matrix, octave_scalar, + assign_div); }
--- a/libinterp/operators/op-cm-scm.cc +++ b/libinterp/operators/op-cm-scm.cc @@ -110,8 +110,8 @@ const octave_sparse_complex_matrix&); return octave_value - (elem_xpow (SparseComplexMatrix (v1.complex_matrix_value ()), - v2.sparse_complex_matrix_value ())); + (elem_xpow (SparseComplexMatrix (v1.complex_matrix_value ()), + v2.sparse_complex_matrix_value ())); } DEFBINOP (el_ldiv, sparse_complex_matrix, matrix) @@ -140,7 +140,7 @@ { CAST_CONV_ARG (const octave_complex_matrix&); return new octave_sparse_complex_matrix - (SparseComplexMatrix (v.complex_matrix_value ())); + (SparseComplexMatrix (v.complex_matrix_value ())); } DEFNDASSIGNOP_FN (assign, complex_matrix, sparse_complex_matrix,
--- a/libinterp/operators/op-cm-sm.cc +++ b/libinterp/operators/op-cm-sm.cc @@ -106,8 +106,8 @@ const octave_sparse_matrix&); return octave_value - (elem_xpow ( SparseComplexMatrix (v1.complex_matrix_value ()), - v2.sparse_matrix_value ())); + (elem_xpow ( SparseComplexMatrix (v1.complex_matrix_value ()), + v2.sparse_matrix_value ())); } DEFBINOP (el_ldiv, complex_matrix, sparse_matrix) @@ -115,7 +115,7 @@ CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_sparse_matrix&); return octave_value - (quotient (v2.sparse_matrix_value (), v1.complex_matrix_value ())); + (quotient (v2.sparse_matrix_value (), v1.complex_matrix_value ())); } DEFBINOP_FN (el_and, complex_matrix, sparse_matrix, mx_el_and)
--- a/libinterp/operators/op-cs-cm.cc +++ b/libinterp/operators/op-cs-cm.cc @@ -68,16 +68,24 @@ return octave_value (v2.complex_array_value () / d); } -DEFNDCMPLXCMPOP_FN (lt, complex, complex_matrix, complex, complex_array, mx_el_lt) -DEFNDCMPLXCMPOP_FN (le, complex, complex_matrix, complex, complex_array, mx_el_le) -DEFNDCMPLXCMPOP_FN (eq, complex, complex_matrix, complex, complex_array, mx_el_eq) -DEFNDCMPLXCMPOP_FN (ge, complex, complex_matrix, complex, complex_array, mx_el_ge) -DEFNDCMPLXCMPOP_FN (gt, complex, complex_matrix, complex, complex_array, mx_el_gt) -DEFNDCMPLXCMPOP_FN (ne, complex, complex_matrix, complex, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex, complex_matrix, complex, complex_array, + mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex, complex_matrix, complex, complex_array, + mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex, complex_matrix, complex, complex_array, + mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex, complex_matrix, complex, complex_array, + mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex, complex_matrix, complex, complex_array, + mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex, complex_matrix, complex, complex_array, + mx_el_ne) DEFNDBINOP_OP (el_mul, complex, complex_matrix, complex, complex_array, *) -DEFNDBINOP_FN (el_div, complex, complex_matrix, complex, complex_array, x_el_div) -DEFNDBINOP_FN (el_pow, complex, complex_matrix, complex, complex_array, elem_xpow) +DEFNDBINOP_FN (el_div, complex, complex_matrix, complex, complex_array, + x_el_div) +DEFNDBINOP_FN (el_pow, complex, complex_matrix, complex, complex_array, + elem_xpow) DEFBINOP (el_ldiv, complex, complex_matrix) { @@ -91,10 +99,13 @@ return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (el_and, complex, complex_matrix, complex, complex_array, mx_el_and) -DEFNDBINOP_FN (el_or, complex, complex_matrix, complex, complex_array, mx_el_or) +DEFNDBINOP_FN (el_and, complex, complex_matrix, complex, complex_array, + mx_el_and) +DEFNDBINOP_FN (el_or, complex, complex_matrix, complex, complex_array, + mx_el_or) -DEFNDCATOP_FN (cs_cm, complex, complex_matrix, complex_array, complex_array, concat) +DEFNDCATOP_FN (cs_cm, complex, complex_matrix, complex_array, complex_array, + concat) DEFCONV (complex_matrix_conv, complex, complex_matrix) { @@ -127,7 +138,8 @@ INSTALL_CATOP (octave_complex, octave_complex_matrix, cs_cm); - INSTALL_ASSIGNCONV (octave_complex, octave_complex_matrix, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex, octave_complex_matrix, + octave_complex_matrix); INSTALL_WIDENOP (octave_complex, octave_complex_matrix, complex_matrix_conv); }
--- a/libinterp/operators/op-cs-cs.cc +++ b/libinterp/operators/op-cs-cs.cc @@ -150,7 +150,9 @@ { CAST_CONV_ARG (const octave_complex&); - return new octave_float_complex_matrix (FloatComplexMatrix (1, 1, static_cast<FloatComplex>(v.complex_value ()))); + return new octave_float_complex_matrix (FloatComplexMatrix (1, 1, + static_cast<FloatComplex> + (v.complex_value ()))); } void @@ -188,9 +190,11 @@ INSTALL_ASSIGNCONV (octave_complex, octave_complex, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_complex, octave_null_matrix, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex, octave_null_matrix, + octave_complex_matrix); INSTALL_ASSIGNCONV (octave_complex, octave_null_str, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_complex, octave_null_sq_str, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex, octave_null_sq_str, + octave_complex_matrix); INSTALL_CONVOP (octave_complex, octave_float_complex_matrix, complex_to_float_complex);
--- a/libinterp/operators/op-cs-scm.cc +++ b/libinterp/operators/op-cs-scm.cc @@ -130,7 +130,7 @@ CAST_CONV_ARG (const octave_complex&); return new octave_sparse_complex_matrix - (SparseComplexMatrix (v.complex_matrix_value ())); + (SparseComplexMatrix (v.complex_matrix_value ())); } void
--- a/libinterp/operators/op-cs-sm.cc +++ b/libinterp/operators/op-cs-sm.cc @@ -132,7 +132,7 @@ CAST_CONV_ARG (const octave_complex&); return new octave_sparse_matrix - (SparseMatrix (v.matrix_value ())); + (SparseMatrix (v.matrix_value ())); } void
--- a/libinterp/operators/op-dm-dm.cc +++ b/libinterp/operators/op-dm-dm.cc @@ -97,7 +97,8 @@ INSTALL_BINOP (op_ldiv, octave_diag_matrix, octave_diag_matrix, ldiv); INSTALL_CONVOP (octave_diag_matrix, octave_matrix, diag_matrix_to_matrix); - INSTALL_CONVOP (octave_diag_matrix, octave_float_diag_matrix, diag_matrix_to_float_diag_matrix); + INSTALL_CONVOP (octave_diag_matrix, octave_float_diag_matrix, + diag_matrix_to_float_diag_matrix); INSTALL_ASSIGNCONV (octave_diag_matrix, octave_matrix, octave_matrix); INSTALL_WIDENOP (octave_diag_matrix, octave_matrix, diag_matrix_to_matrix); }
--- a/libinterp/operators/op-dm-scm.cc +++ b/libinterp/operators/op-dm-scm.cc @@ -41,7 +41,8 @@ DEFBINOP (mul_dm_scm, diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -54,7 +55,8 @@ else { MatrixType typ = v2.matrix_type (); - SparseComplexMatrix ret = v1.diag_matrix_value () * v2.sparse_complex_matrix_value (); + SparseComplexMatrix ret = v1.diag_matrix_value () * + v2.sparse_complex_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -64,7 +66,8 @@ DEFBINOP (mul_cdm_sm, complex_diag_matrix, sparse_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -77,7 +80,8 @@ else { MatrixType typ = v2.matrix_type (); - SparseComplexMatrix ret = v1.complex_diag_matrix_value () * v2.sparse_matrix_value (); + SparseComplexMatrix ret = v1.complex_diag_matrix_value () * + v2.sparse_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -87,7 +91,8 @@ DEFBINOP (mul_cdm_scm, complex_diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -100,7 +105,8 @@ else { MatrixType typ = v2.matrix_type (); - SparseComplexMatrix ret = v1.complex_diag_matrix_value () * v2.sparse_complex_matrix_value (); + SparseComplexMatrix ret = v1.complex_diag_matrix_value () * + v2.sparse_complex_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -134,13 +140,15 @@ const octave_sparse_complex_matrix&); MatrixType typ = v2.matrix_type (); - return xleftdiv (v1.complex_diag_matrix_value (), v2.sparse_complex_matrix_value (), + return xleftdiv (v1.complex_diag_matrix_value (), + v2.sparse_complex_matrix_value (), typ); } DEFBINOP (add_dm_scm, diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -156,7 +164,8 @@ DEFBINOP (add_cdm_sm, complex_diag_matrix, sparse_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -172,7 +181,8 @@ DEFBINOP (add_cdm_scm, complex_diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -188,7 +198,8 @@ DEFBINOP (sub_dm_scm, diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -204,7 +215,8 @@ DEFBINOP (sub_cdm_sm, complex_diag_matrix, sparse_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -220,7 +232,8 @@ DEFBINOP (sub_cdm_scm, complex_diag_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_complex_diag_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_complex_diag_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -238,7 +251,8 @@ DEFBINOP (mul_scm_dm, sparse_complex_matrix, diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_diag_matrix&); if (v1.rows () == 1 && v1.columns () == 1) // If v1 is a scalar in disguise, return a diagonal matrix rather than @@ -251,7 +265,8 @@ else { MatrixType typ = v1.matrix_type (); - SparseComplexMatrix ret = v1.sparse_complex_matrix_value () * v2.diag_matrix_value (); + SparseComplexMatrix ret = v1.sparse_complex_matrix_value () * + v2.diag_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -261,7 +276,8 @@ DEFBINOP (mul_sm_cdm, sparse_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_complex_diag_matrix&); if (v1.rows () == 1 && v1.columns () == 1) // If v1 is a scalar in disguise, return a diagonal matrix rather than @@ -274,7 +290,8 @@ else { MatrixType typ = v1.matrix_type (); - SparseComplexMatrix ret = v1.sparse_matrix_value () * v2.complex_diag_matrix_value (); + SparseComplexMatrix ret = v1.sparse_matrix_value () * + v2.complex_diag_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -284,7 +301,8 @@ DEFBINOP (mul_scm_cdm, sparse_complex_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_complex_diag_matrix&); if (v1.rows () == 1 && v1.columns () == 1) // If v1 is a scalar in disguise, return a diagonal matrix rather than @@ -304,7 +322,8 @@ else { MatrixType typ = v1.matrix_type (); - SparseComplexMatrix ret = v1.sparse_complex_matrix_value () * v2.complex_diag_matrix_value (); + SparseComplexMatrix ret = v1.sparse_complex_matrix_value () * + v2.complex_diag_matrix_value (); octave_value out = octave_value (ret); typ.mark_as_unsymmetric (); out.matrix_type (typ); @@ -314,7 +333,8 @@ DEFBINOP (div_scm_dm, sparse_complex_matrix, diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -328,13 +348,15 @@ else { MatrixType typ = v2.matrix_type (); - return xdiv (v1.sparse_complex_matrix_value (), v2.diag_matrix_value (), typ); + return xdiv (v1.sparse_complex_matrix_value (), + v2.diag_matrix_value (), typ); } } DEFBINOP (div_sm_cdm, sparse_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -348,13 +370,15 @@ else { MatrixType typ = v2.matrix_type (); - return xdiv (v1.sparse_matrix_value (), v2.complex_diag_matrix_value (), typ); + return xdiv (v1.sparse_matrix_value (), + v2.complex_diag_matrix_value (), typ); } } DEFBINOP (div_scm_cdm, sparse_complex_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -368,13 +392,15 @@ else { MatrixType typ = v2.matrix_type (); - return xdiv (v1.sparse_complex_matrix_value (), v2.complex_diag_matrix_value (), typ); + return xdiv (v1.sparse_complex_matrix_value (), + v2.complex_diag_matrix_value (), typ); } } DEFBINOP (add_sm_cdm, sparse_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -390,7 +416,8 @@ DEFBINOP (add_scm_dm, sparse_complex_matrix, diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -406,7 +433,8 @@ DEFBINOP (add_scm_cdm, sparse_complex_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -422,7 +450,8 @@ DEFBINOP (sub_sm_cdm, sparse_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -438,7 +467,8 @@ DEFBINOP (sub_scm_dm, sparse_complex_matrix, diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -454,7 +484,8 @@ DEFBINOP (sub_scm_cdm, sparse_complex_matrix, complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_complex_diag_matrix&); if (v2.rows () == 1 && v2.columns () == 1) // If v2 is a scalar in disguise, return a diagonal matrix rather than @@ -475,37 +506,52 @@ mul_dm_scm); INSTALL_BINOP (op_mul, octave_complex_diag_matrix, octave_sparse_matrix, mul_cdm_sm); - INSTALL_BINOP (op_mul, octave_complex_diag_matrix, octave_sparse_complex_matrix, - mul_cdm_scm); - INSTALL_BINOP (op_ldiv, octave_diag_matrix, octave_sparse_complex_matrix, ldiv_dm_scm); - INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, octave_sparse_matrix, ldiv_cdm_sm); - INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, octave_sparse_complex_matrix, - ldiv_cdm_scm); + INSTALL_BINOP (op_mul, octave_complex_diag_matrix, + octave_sparse_complex_matrix, mul_cdm_scm); + INSTALL_BINOP (op_ldiv, octave_diag_matrix, octave_sparse_complex_matrix, + ldiv_dm_scm); + INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, octave_sparse_matrix, + ldiv_cdm_sm); + INSTALL_BINOP (op_ldiv, octave_complex_diag_matrix, + octave_sparse_complex_matrix, ldiv_cdm_scm); - INSTALL_BINOP (op_add, octave_diag_matrix, octave_sparse_complex_matrix, add_dm_scm); - INSTALL_BINOP (op_add, octave_complex_diag_matrix, octave_sparse_matrix, add_cdm_sm); - INSTALL_BINOP (op_add, octave_complex_diag_matrix, octave_sparse_complex_matrix, - add_cdm_scm); - INSTALL_BINOP (op_sub, octave_diag_matrix, octave_sparse_complex_matrix, sub_dm_scm); - INSTALL_BINOP (op_sub, octave_complex_diag_matrix, octave_sparse_matrix, sub_cdm_sm); - INSTALL_BINOP (op_sub, octave_complex_diag_matrix, octave_sparse_complex_matrix, - sub_cdm_scm); + INSTALL_BINOP (op_add, octave_diag_matrix, octave_sparse_complex_matrix, + add_dm_scm); + INSTALL_BINOP (op_add, octave_complex_diag_matrix, octave_sparse_matrix, + add_cdm_sm); + INSTALL_BINOP (op_add, octave_complex_diag_matrix, + octave_sparse_complex_matrix, add_cdm_scm); + INSTALL_BINOP (op_sub, octave_diag_matrix, octave_sparse_complex_matrix, + sub_dm_scm); + INSTALL_BINOP (op_sub, octave_complex_diag_matrix, octave_sparse_matrix, + sub_cdm_sm); + INSTALL_BINOP (op_sub, octave_complex_diag_matrix, + octave_sparse_complex_matrix, sub_cdm_scm); INSTALL_BINOP (op_mul, octave_sparse_complex_matrix, octave_diag_matrix, mul_scm_dm); INSTALL_BINOP (op_mul, octave_sparse_matrix, octave_complex_diag_matrix, mul_sm_cdm); - INSTALL_BINOP (op_mul, octave_sparse_complex_matrix, octave_complex_diag_matrix, - mul_scm_cdm); + INSTALL_BINOP (op_mul, octave_sparse_complex_matrix, + octave_complex_diag_matrix, mul_scm_cdm); - INSTALL_BINOP (op_div, octave_sparse_complex_matrix, octave_diag_matrix, div_scm_dm); - INSTALL_BINOP (op_div, octave_sparse_matrix, octave_complex_diag_matrix, div_sm_cdm); - INSTALL_BINOP (op_div, octave_sparse_complex_matrix, octave_complex_diag_matrix, div_scm_cdm); + INSTALL_BINOP (op_div, octave_sparse_complex_matrix, octave_diag_matrix, + div_scm_dm); + INSTALL_BINOP (op_div, octave_sparse_matrix, octave_complex_diag_matrix, + div_sm_cdm); + INSTALL_BINOP (op_div, octave_sparse_complex_matrix, + octave_complex_diag_matrix, div_scm_cdm); - INSTALL_BINOP (op_add, octave_sparse_complex_matrix, octave_diag_matrix, add_scm_dm); - INSTALL_BINOP (op_add, octave_sparse_matrix, octave_complex_diag_matrix, add_sm_cdm); - INSTALL_BINOP (op_add, octave_sparse_complex_matrix, octave_complex_diag_matrix, add_scm_cdm); - INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, octave_diag_matrix, sub_scm_dm); - INSTALL_BINOP (op_sub, octave_sparse_matrix, octave_complex_diag_matrix, sub_sm_cdm); - INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, octave_complex_diag_matrix, sub_scm_cdm); + INSTALL_BINOP (op_add, octave_sparse_complex_matrix, octave_diag_matrix, + add_scm_dm); + INSTALL_BINOP (op_add, octave_sparse_matrix, octave_complex_diag_matrix, + add_sm_cdm); + INSTALL_BINOP (op_add, octave_sparse_complex_matrix, + octave_complex_diag_matrix, add_scm_cdm); + INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, octave_diag_matrix, + sub_scm_dm); + INSTALL_BINOP (op_sub, octave_sparse_matrix, octave_complex_diag_matrix, + sub_sm_cdm); + INSTALL_BINOP (op_sub, octave_sparse_complex_matrix, + octave_complex_diag_matrix, sub_scm_cdm); }
--- a/libinterp/operators/op-double-conv.cc +++ b/libinterp/operators/op-double-conv.cc @@ -84,36 +84,57 @@ void install_double_conv_ops (void) { - INSTALL_CONVOP (octave_int8_matrix, octave_matrix, int8_matrix_to_double_matrix); - INSTALL_CONVOP (octave_int16_matrix, octave_matrix, int16_matrix_to_double_matrix); - INSTALL_CONVOP (octave_int32_matrix, octave_matrix, int32_matrix_to_double_matrix); - INSTALL_CONVOP (octave_int64_matrix, octave_matrix, int64_matrix_to_double_matrix); + INSTALL_CONVOP (octave_int8_matrix, octave_matrix, + int8_matrix_to_double_matrix); + INSTALL_CONVOP (octave_int16_matrix, octave_matrix, + int16_matrix_to_double_matrix); + INSTALL_CONVOP (octave_int32_matrix, octave_matrix, + int32_matrix_to_double_matrix); + INSTALL_CONVOP (octave_int64_matrix, octave_matrix, + int64_matrix_to_double_matrix); - INSTALL_CONVOP (octave_uint8_matrix, octave_matrix, uint8_matrix_to_double_matrix); - INSTALL_CONVOP (octave_uint16_matrix, octave_matrix, uint16_matrix_to_double_matrix); - INSTALL_CONVOP (octave_uint32_matrix, octave_matrix, uint32_matrix_to_double_matrix); - INSTALL_CONVOP (octave_uint64_matrix, octave_matrix, uint64_matrix_to_double_matrix); + INSTALL_CONVOP (octave_uint8_matrix, octave_matrix, + uint8_matrix_to_double_matrix); + INSTALL_CONVOP (octave_uint16_matrix, octave_matrix, + uint16_matrix_to_double_matrix); + INSTALL_CONVOP (octave_uint32_matrix, octave_matrix, + uint32_matrix_to_double_matrix); + INSTALL_CONVOP (octave_uint64_matrix, octave_matrix, + uint64_matrix_to_double_matrix); - INSTALL_CONVOP (octave_int8_scalar, octave_matrix, int8_scalar_to_double_matrix); - INSTALL_CONVOP (octave_int16_scalar, octave_matrix, int16_scalar_to_double_matrix); - INSTALL_CONVOP (octave_int32_scalar, octave_matrix, int32_scalar_to_double_matrix); - INSTALL_CONVOP (octave_int64_scalar, octave_matrix, int64_scalar_to_double_matrix); + INSTALL_CONVOP (octave_int8_scalar, octave_matrix, + int8_scalar_to_double_matrix); + INSTALL_CONVOP (octave_int16_scalar, octave_matrix, + int16_scalar_to_double_matrix); + INSTALL_CONVOP (octave_int32_scalar, octave_matrix, + int32_scalar_to_double_matrix); + INSTALL_CONVOP (octave_int64_scalar, octave_matrix, + int64_scalar_to_double_matrix); - INSTALL_CONVOP (octave_uint8_scalar, octave_matrix, uint8_scalar_to_double_matrix); - INSTALL_CONVOP (octave_uint16_scalar, octave_matrix, uint16_scalar_to_double_matrix); - INSTALL_CONVOP (octave_uint32_scalar, octave_matrix, uint32_scalar_to_double_matrix); - INSTALL_CONVOP (octave_uint64_scalar, octave_matrix, uint64_scalar_to_double_matrix); + INSTALL_CONVOP (octave_uint8_scalar, octave_matrix, + uint8_scalar_to_double_matrix); + INSTALL_CONVOP (octave_uint16_scalar, octave_matrix, + uint16_scalar_to_double_matrix); + INSTALL_CONVOP (octave_uint32_scalar, octave_matrix, + uint32_scalar_to_double_matrix); + INSTALL_CONVOP (octave_uint64_scalar, octave_matrix, + uint64_scalar_to_double_matrix); - INSTALL_CONVOP (octave_bool_matrix, octave_matrix, bool_matrix_to_double_matrix); + INSTALL_CONVOP (octave_bool_matrix, octave_matrix, + bool_matrix_to_double_matrix); INSTALL_CONVOP (octave_bool, octave_matrix, bool_scalar_to_double_matrix); - INSTALL_CONVOP (octave_sparse_matrix, octave_matrix, sparse_matrix_to_double_matrix); - INSTALL_CONVOP (octave_sparse_bool_matrix, octave_matrix, sparse_bool_matrix_to_double_matrix); + INSTALL_CONVOP (octave_sparse_matrix, octave_matrix, + sparse_matrix_to_double_matrix); + INSTALL_CONVOP (octave_sparse_bool_matrix, octave_matrix, + sparse_bool_matrix_to_double_matrix); INSTALL_CONVOP (octave_range, octave_matrix, range_to_double_matrix); - INSTALL_CONVOP (octave_char_matrix_str, octave_matrix, char_matrix_str_to_double_matrix); - INSTALL_CONVOP (octave_char_matrix_sq_str, octave_matrix, char_matrix_sq_str_to_double_matrix); + INSTALL_CONVOP (octave_char_matrix_str, octave_matrix, + char_matrix_str_to_double_matrix); + INSTALL_CONVOP (octave_char_matrix_sq_str, octave_matrix, + char_matrix_sq_str_to_double_matrix); INSTALL_CONVOP (octave_scalar, octave_matrix, double_scalar_to_double_matrix); }
--- a/libinterp/operators/op-fcdm-fcdm.cc +++ b/libinterp/operators/op-fcdm-fcdm.cc @@ -60,7 +60,8 @@ DEFBINOP (div, float_complex_diag_matrix, float_complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_diag_matrix&, const octave_float_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_diag_matrix&, + const octave_float_complex_diag_matrix&); return xdiv (v1.float_complex_diag_matrix_value (), v2.float_complex_diag_matrix_value ()); @@ -68,7 +69,8 @@ DEFBINOP (ldiv, float_complex_diag_matrix, float_complex_diag_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_diag_matrix&, const octave_float_complex_diag_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_diag_matrix&, + const octave_float_complex_diag_matrix&); return xleftdiv (v1.float_complex_diag_matrix_value (), v2.float_complex_diag_matrix_value ()); @@ -96,17 +98,23 @@ INSTALL_UNOP (op_transpose, octave_float_complex_diag_matrix, transpose); INSTALL_UNOP (op_hermitian, octave_float_complex_diag_matrix, hermitian); - INSTALL_BINOP (op_add, octave_float_complex_diag_matrix, octave_float_complex_diag_matrix, add); - INSTALL_BINOP (op_sub, octave_float_complex_diag_matrix, octave_float_complex_diag_matrix, sub); - INSTALL_BINOP (op_mul, octave_float_complex_diag_matrix, octave_float_complex_diag_matrix, mul); - INSTALL_BINOP (op_div, octave_float_complex_diag_matrix, octave_float_complex_diag_matrix, div); - INSTALL_BINOP (op_ldiv, octave_float_complex_diag_matrix, octave_float_complex_diag_matrix, ldiv); + INSTALL_BINOP (op_add, octave_float_complex_diag_matrix, + octave_float_complex_diag_matrix, add); + INSTALL_BINOP (op_sub, octave_float_complex_diag_matrix, + octave_float_complex_diag_matrix, sub); + INSTALL_BINOP (op_mul, octave_float_complex_diag_matrix, + octave_float_complex_diag_matrix, mul); + INSTALL_BINOP (op_div, octave_float_complex_diag_matrix, + octave_float_complex_diag_matrix, div); + INSTALL_BINOP (op_ldiv, octave_float_complex_diag_matrix, + octave_float_complex_diag_matrix, ldiv); INSTALL_CONVOP (octave_float_complex_diag_matrix, octave_complex_diag_matrix, float_complex_diag_matrix_to_complex_diag_matrix); INSTALL_CONVOP (octave_float_complex_diag_matrix, octave_float_complex_matrix, float_complex_diag_matrix_to_float_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_complex_diag_matrix, octave_float_complex_matrix, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex_diag_matrix, + octave_float_complex_matrix, octave_float_complex_matrix); INSTALL_WIDENOP (octave_float_complex_diag_matrix, octave_complex_diag_matrix, float_complex_diag_matrix_to_complex_diag_matrix); }
--- a/libinterp/operators/op-fcm-fcm.cc +++ b/libinterp/operators/op-fcm-fcm.cc @@ -87,7 +87,7 @@ MatrixType typ = v2.matrix_type (); FloatComplexMatrix ret = xdiv (v1.float_complex_matrix_value (), - v2.float_complex_matrix_value (), typ); + v2.float_complex_matrix_value (), typ); v2.matrix_type (typ); return ret; @@ -114,7 +114,8 @@ DEFBINOP (trans_mul, float_complex_matrix, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_complex_matrix&); return octave_value(xgemm (v1.float_complex_matrix_value (), v2.float_complex_matrix_value (), blas_trans, blas_no_trans)); @@ -122,7 +123,8 @@ DEFBINOP (mul_trans, float_complex_matrix, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_complex_matrix&); return octave_value(xgemm (v1.float_complex_matrix_value (), v2.float_complex_matrix_value (), blas_no_trans, blas_trans)); @@ -130,7 +132,8 @@ DEFBINOP (herm_mul, float_complex_matrix, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_complex_matrix&); return octave_value(xgemm (v1.float_complex_matrix_value (), v2.float_complex_matrix_value (), blas_conj_trans, blas_no_trans)); @@ -138,7 +141,8 @@ DEFBINOP (mul_herm, float_complex_matrix, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_complex_matrix&); return octave_value(xgemm (v1.float_complex_matrix_value (), v2.float_complex_matrix_value (), blas_no_trans, blas_conj_trans)); @@ -151,7 +155,8 @@ MatrixType typ = v1.matrix_type (); FloatComplexMatrix ret = xleftdiv (v1.float_complex_matrix_value (), - v2.float_complex_matrix_value (), typ, blas_trans); + v2.float_complex_matrix_value (), + typ, blas_trans); v1.matrix_type (typ); return ret; @@ -164,24 +169,25 @@ MatrixType typ = v1.matrix_type (); FloatComplexMatrix ret = xleftdiv (v1.float_complex_matrix_value (), - v2.float_complex_matrix_value (), typ, blas_conj_trans); + v2.float_complex_matrix_value (), + typ, blas_conj_trans); v1.matrix_type (typ); return ret; } DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_lt) + float_complex_array, float_complex_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_le) + float_complex_array, float_complex_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_eq) + float_complex_array, float_complex_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_ge) + float_complex_array, float_complex_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_gt) + float_complex_array, float_complex_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_complex_matrix, - float_complex_array, float_complex_array, mx_el_ne) + float_complex_array, float_complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, product) @@ -195,7 +201,8 @@ CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_complex_matrix&); - return octave_value (quotient (v2.float_complex_array_value (), v1.float_complex_array_value ())); + return octave_value (quotient (v2.float_complex_array_value (), + v1.float_complex_array_value ())); } DEFNDBINOP_FN (el_and, float_complex_matrix, float_complex_matrix, @@ -234,7 +241,8 @@ { CAST_CONV_ARG (const octave_float_complex_matrix&); - return new octave_complex_matrix (ComplexNDArray (v.float_complex_array_value ())); + return + new octave_complex_matrix (ComplexNDArray (v.float_complex_array_value ())); } void
--- a/libinterp/operators/op-fcm-fcs.cc +++ b/libinterp/operators/op-fcm-fcs.cc @@ -75,17 +75,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_lt) + float_complex_array, float_complex, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_le) + float_complex_array, float_complex, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_eq) + float_complex_array, float_complex, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_ge) + float_complex_array, float_complex, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_gt) + float_complex_array, float_complex, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_complex, - float_complex_array, float_complex, mx_el_ne) + float_complex_array, float_complex, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex_matrix, float_complex, float_complex_array, float_complex, *)
--- a/libinterp/operators/op-fcm-fm.cc +++ b/libinterp/operators/op-fcm-fm.cc @@ -43,14 +43,17 @@ // complex matrix by matrix ops. -DEFNDBINOP_OP (add, float_complex_matrix, float_matrix, float_complex_array, float_array, +) -DEFNDBINOP_OP (sub, float_complex_matrix, float_matrix, float_complex_array, float_array, -) +DEFNDBINOP_OP (add, float_complex_matrix, float_matrix, float_complex_array, + float_array, +) +DEFNDBINOP_OP (sub, float_complex_matrix, float_matrix, float_complex_array, + float_array, -) DEFBINOP_OP (mul, float_complex_matrix, float_matrix, *) DEFBINOP (mul_trans, float_complex_matrix, float_matrix) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_matrix&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_matrix&); FloatComplexMatrix m1 = v1.float_complex_matrix_value (); FloatMatrix m2 = v2.float_matrix_value (); @@ -93,17 +96,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_lt) + float_complex_array, float_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_le) + float_complex_array, float_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_eq) + float_complex_array, float_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_ge) + float_complex_array, float_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_gt) + float_complex_array, float_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_matrix, - float_complex_array, float_array, mx_el_ne) + float_complex_array, float_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_complex_matrix, float_matrix, float_complex_array, float_array, product)
--- a/libinterp/operators/op-fcm-fs.cc +++ b/libinterp/operators/op-fcm-fs.cc @@ -42,13 +42,17 @@ // complex matrix by scalar ops. -DEFNDBINOP_OP (add, float_complex_matrix, float_scalar, float_complex_array, float_scalar, +) -DEFNDBINOP_OP (sub, float_complex_matrix, float_scalar, float_complex_array, float_scalar, -) -DEFNDBINOP_OP (mul, float_complex_matrix, float_scalar, float_complex_array, float_scalar, *) +DEFNDBINOP_OP (add, float_complex_matrix, float_scalar, float_complex_array, + float_scalar, +) +DEFNDBINOP_OP (sub, float_complex_matrix, float_scalar, float_complex_array, + float_scalar, -) +DEFNDBINOP_OP (mul, float_complex_matrix, float_scalar, float_complex_array, + float_scalar, *) DEFBINOP (div, float_complex_matrix, float) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_scalar&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_scalar&); float d = v2.float_value (); @@ -62,7 +66,8 @@ DEFBINOP (ldiv, float_complex_matrix, float) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_scalar&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_scalar&); FloatComplexMatrix m1 = v1.float_complex_matrix_value (); FloatMatrix m2 = v2.float_matrix_value (); @@ -75,24 +80,25 @@ } DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_lt) + float_scalar, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_le) + float_scalar, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_eq) + float_scalar, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_ge) + float_scalar, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_gt) + float_scalar, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_scalar, float_complex_array, - float_scalar, mx_el_ne) + float_scalar, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex_matrix, float_scalar, float_complex_array, float_scalar, *) DEFBINOP (el_div, float_complex_matrix, float) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_scalar&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_scalar&); float d = v2.float_value (); @@ -107,7 +113,8 @@ DEFBINOP (el_ldiv, float_complex_matrix, float) { - CAST_BINOP_ARGS (const octave_float_complex_matrix&, const octave_float_scalar&); + CAST_BINOP_ARGS (const octave_float_complex_matrix&, + const octave_float_scalar&); return x_el_div (v2.float_value (), v1.float_complex_array_value ()); } @@ -126,8 +133,10 @@ DEFNDCATOP_FN (fcm_s, float_complex_matrix, scalar, float_complex_array, float_array, concat) -DEFNDASSIGNOP_FN (assign, float_complex_matrix, float_scalar, float_complex_array, assign) -DEFNDASSIGNOP_FN (dbl_assign, complex_matrix, float_scalar, complex_array, assign) +DEFNDASSIGNOP_FN (assign, float_complex_matrix, float_scalar, + float_complex_array, assign) +DEFNDASSIGNOP_FN (dbl_assign, complex_matrix, float_scalar, complex_array, + assign) DEFNDASSIGNOP_OP (assign_mul, float_complex_matrix, float_scalar, float_scalar, *=) @@ -142,19 +151,26 @@ INSTALL_BINOP (op_mul, octave_float_complex_matrix, octave_float_scalar, mul); INSTALL_BINOP (op_div, octave_float_complex_matrix, octave_float_scalar, div); INSTALL_BINOP (op_pow, octave_float_complex_matrix, octave_float_scalar, pow); - INSTALL_BINOP (op_ldiv, octave_float_complex_matrix, octave_float_scalar, ldiv); + INSTALL_BINOP (op_ldiv, octave_float_complex_matrix, octave_float_scalar, + ldiv); INSTALL_BINOP (op_lt, octave_float_complex_matrix, octave_float_scalar, lt); INSTALL_BINOP (op_le, octave_float_complex_matrix, octave_float_scalar, le); INSTALL_BINOP (op_eq, octave_float_complex_matrix, octave_float_scalar, eq); INSTALL_BINOP (op_ge, octave_float_complex_matrix, octave_float_scalar, ge); INSTALL_BINOP (op_gt, octave_float_complex_matrix, octave_float_scalar, gt); INSTALL_BINOP (op_ne, octave_float_complex_matrix, octave_float_scalar, ne); - INSTALL_BINOP (op_el_mul, octave_float_complex_matrix, octave_float_scalar, el_mul); - INSTALL_BINOP (op_el_div, octave_float_complex_matrix, octave_float_scalar, el_div); - INSTALL_BINOP (op_el_pow, octave_float_complex_matrix, octave_float_scalar, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_complex_matrix, octave_float_scalar, el_ldiv); - INSTALL_BINOP (op_el_and, octave_float_complex_matrix, octave_float_scalar, el_and); - INSTALL_BINOP (op_el_or, octave_float_complex_matrix, octave_float_scalar, el_or); + INSTALL_BINOP (op_el_mul, octave_float_complex_matrix, octave_float_scalar, + el_mul); + INSTALL_BINOP (op_el_div, octave_float_complex_matrix, octave_float_scalar, + el_div); + INSTALL_BINOP (op_el_pow, octave_float_complex_matrix, octave_float_scalar, + el_pow); + INSTALL_BINOP (op_el_ldiv, octave_float_complex_matrix, octave_float_scalar, + el_ldiv); + INSTALL_BINOP (op_el_and, octave_float_complex_matrix, octave_float_scalar, + el_and); + INSTALL_BINOP (op_el_or, octave_float_complex_matrix, octave_float_scalar, + el_or); INSTALL_CATOP (octave_float_complex_matrix, octave_float_scalar, fcm_fs); INSTALL_CATOP (octave_complex_matrix, octave_float_scalar, cm_fs);
--- a/libinterp/operators/op-fcs-fcm.cc +++ b/libinterp/operators/op-fcs-fcm.cc @@ -38,13 +38,17 @@ // complex scalar by complex matrix ops. -DEFNDBINOP_OP (add, float_complex, float_complex_matrix, float_complex, float_complex_array, +) -DEFNDBINOP_OP (sub, float_complex, float_complex_matrix, float_complex, float_complex_array, -) -DEFNDBINOP_OP (mul, float_complex, float_complex_matrix, float_complex, float_complex_array, *) +DEFNDBINOP_OP (add, float_complex, float_complex_matrix, float_complex, + float_complex_array, +) +DEFNDBINOP_OP (sub, float_complex, float_complex_matrix, float_complex, + float_complex_array, -) +DEFNDBINOP_OP (mul, float_complex, float_complex_matrix, float_complex, + float_complex_array, *) DEFBINOP (div, float_complex, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex&, + const octave_float_complex_matrix&); FloatComplexMatrix m1 = v1.float_complex_matrix_value (); FloatComplexMatrix m2 = v2.float_complex_matrix_value (); @@ -60,7 +64,8 @@ DEFBINOP (ldiv, float_complex, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex&, + const octave_float_complex_matrix&); FloatComplex d = v1.float_complex_value (); @@ -71,17 +76,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_lt) + float_complex_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_le) + float_complex_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_eq) + float_complex_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_ge) + float_complex_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_gt) + float_complex_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex, float_complex_matrix, float_complex, - float_complex_array, mx_el_ne) + float_complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex, float_complex_matrix, float_complex, float_complex_array, *) @@ -92,7 +97,8 @@ DEFBINOP (el_ldiv, float_complex, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_complex&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_complex&, + const octave_float_complex_matrix&); FloatComplex d = v1.float_complex_value (); @@ -102,14 +108,19 @@ return octave_value (v2.float_complex_array_value () / d); } -DEFNDBINOP_FN (el_and, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_and) -DEFNDBINOP_FN (el_or, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_or) +DEFNDBINOP_FN (el_and, float_complex, float_complex_matrix, float_complex, + float_complex_array, mx_el_and) +DEFNDBINOP_FN (el_or, float_complex, float_complex_matrix, float_complex, + float_complex_array, mx_el_or) -DEFNDCATOP_FN (fcs_fcm, float_complex, float_complex_matrix, float_complex_array, float_complex_array, concat) +DEFNDCATOP_FN (fcs_fcm, float_complex, float_complex_matrix, + float_complex_array, float_complex_array, concat) -DEFNDCATOP_FN (cs_fcm, complex, float_complex_matrix, float_complex_array, float_complex_array, concat) +DEFNDCATOP_FN (cs_fcm, complex, float_complex_matrix, float_complex_array, + float_complex_array, concat) -DEFNDCATOP_FN (fcs_cm, float_complex, complex_matrix, float_complex_array, float_complex_array, concat) +DEFNDCATOP_FN (fcs_cm, float_complex, complex_matrix, float_complex_array, + float_complex_array, concat) DEFCONV (float_complex_matrix_conv, float_complex, float_complex_matrix) { @@ -121,32 +132,47 @@ void install_fcs_fcm_ops (void) { - INSTALL_BINOP (op_add, octave_float_complex, octave_float_complex_matrix, add); - INSTALL_BINOP (op_sub, octave_float_complex, octave_float_complex_matrix, sub); - INSTALL_BINOP (op_mul, octave_float_complex, octave_float_complex_matrix, mul); - INSTALL_BINOP (op_div, octave_float_complex, octave_float_complex_matrix, div); - INSTALL_BINOP (op_pow, octave_float_complex, octave_float_complex_matrix, pow); - INSTALL_BINOP (op_ldiv, octave_float_complex, octave_float_complex_matrix, ldiv); + INSTALL_BINOP (op_add, octave_float_complex, octave_float_complex_matrix, + add); + INSTALL_BINOP (op_sub, octave_float_complex, octave_float_complex_matrix, + sub); + INSTALL_BINOP (op_mul, octave_float_complex, octave_float_complex_matrix, + mul); + INSTALL_BINOP (op_div, octave_float_complex, octave_float_complex_matrix, + div); + INSTALL_BINOP (op_pow, octave_float_complex, octave_float_complex_matrix, + pow); + INSTALL_BINOP (op_ldiv, octave_float_complex, octave_float_complex_matrix, + ldiv); INSTALL_BINOP (op_lt, octave_float_complex, octave_float_complex_matrix, lt); INSTALL_BINOP (op_le, octave_float_complex, octave_float_complex_matrix, le); INSTALL_BINOP (op_eq, octave_float_complex, octave_float_complex_matrix, eq); INSTALL_BINOP (op_ge, octave_float_complex, octave_float_complex_matrix, ge); INSTALL_BINOP (op_gt, octave_float_complex, octave_float_complex_matrix, gt); INSTALL_BINOP (op_ne, octave_float_complex, octave_float_complex_matrix, ne); - INSTALL_BINOP (op_el_mul, octave_float_complex, octave_float_complex_matrix, el_mul); - INSTALL_BINOP (op_el_div, octave_float_complex, octave_float_complex_matrix, el_div); - INSTALL_BINOP (op_el_pow, octave_float_complex, octave_float_complex_matrix, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_complex_matrix, el_ldiv); - INSTALL_BINOP (op_el_and, octave_float_complex, octave_float_complex_matrix, el_and); - INSTALL_BINOP (op_el_or, octave_float_complex, octave_float_complex_matrix, el_or); + INSTALL_BINOP (op_el_mul, octave_float_complex, octave_float_complex_matrix, + el_mul); + INSTALL_BINOP (op_el_div, octave_float_complex, octave_float_complex_matrix, + el_div); + INSTALL_BINOP (op_el_pow, octave_float_complex, octave_float_complex_matrix, + el_pow); + INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_complex_matrix, + el_ldiv); + INSTALL_BINOP (op_el_and, octave_float_complex, octave_float_complex_matrix, + el_and); + INSTALL_BINOP (op_el_or, octave_float_complex, octave_float_complex_matrix, + el_or); INSTALL_CATOP (octave_float_complex, octave_float_complex_matrix, fcs_fcm); INSTALL_CATOP (octave_complex, octave_float_complex_matrix, cs_fcm); INSTALL_CATOP (octave_float_complex, octave_complex_matrix, fcs_cm); - INSTALL_ASSIGNCONV (octave_float_complex, octave_float_complex_matrix, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex, octave_float_complex_matrix, + octave_float_complex_matrix); - INSTALL_ASSIGNCONV (octave_complex, octave_float_complex_matrix, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex, octave_float_complex_matrix, + octave_complex_matrix); - INSTALL_WIDENOP (octave_float_complex, octave_float_complex_matrix, float_complex_matrix_conv); + INSTALL_WIDENOP (octave_float_complex, octave_float_complex_matrix, + float_complex_matrix_conv); }
--- a/libinterp/operators/op-fcs-fcs.cc +++ b/libinterp/operators/op-fcs-fcs.cc @@ -157,7 +157,9 @@ { CAST_CONV_ARG (const octave_float_complex&); - return new octave_complex_matrix (ComplexMatrix (1, 1, static_cast<Complex>(v.float_complex_value ()))); + return new octave_complex_matrix + (ComplexMatrix (1, 1, + static_cast<Complex>(v.float_complex_value ()))); } void @@ -187,7 +189,8 @@ INSTALL_BINOP (op_el_mul, octave_float_complex, octave_float_complex, el_mul); INSTALL_BINOP (op_el_div, octave_float_complex, octave_float_complex, el_div); INSTALL_BINOP (op_el_pow, octave_float_complex, octave_float_complex, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_complex, el_ldiv); + INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_complex, + el_ldiv); INSTALL_BINOP (op_el_and, octave_float_complex, octave_float_complex, el_and); INSTALL_BINOP (op_el_or, octave_float_complex, octave_float_complex, el_or); @@ -195,13 +198,18 @@ INSTALL_CATOP (octave_complex, octave_float_complex, cs_fcs); INSTALL_CATOP (octave_float_complex, octave_complex, fcs_cs); - INSTALL_ASSIGNCONV (octave_float_complex, octave_float_complex, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex, octave_float_complex, + octave_float_complex_matrix); - INSTALL_ASSIGNCONV (octave_complex, octave_float_complex, octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_complex, octave_float_complex, + octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_complex, octave_null_matrix, octave_float_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_complex, octave_null_str, octave_float_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_complex, octave_null_sq_str, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex, octave_null_matrix, + octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex, octave_null_str, + octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_complex, octave_null_sq_str, + octave_float_complex_matrix); INSTALL_CONVOP (octave_float_complex, octave_complex_matrix, float_complex_to_complex);
--- a/libinterp/operators/op-fcs-fm.cc +++ b/libinterp/operators/op-fcs-fm.cc @@ -78,17 +78,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_complex, float_matrix, float_complex, - float_array, mx_el_lt) + float_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_complex, float_matrix, float_complex, - float_array, mx_el_le) + float_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_complex, float_matrix, float_complex, - float_array, mx_el_eq) + float_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_complex, float_matrix, float_complex, - float_array, mx_el_ge) + float_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_complex, float_matrix, float_complex, - float_array, mx_el_gt) + float_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_complex, float_matrix, float_complex, - float_array, mx_el_ne) + float_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex, float_matrix, float_complex, float_array, *) @@ -141,7 +141,8 @@ INSTALL_BINOP (op_el_mul, octave_float_complex, octave_float_matrix, el_mul); INSTALL_BINOP (op_el_div, octave_float_complex, octave_float_matrix, el_div); INSTALL_BINOP (op_el_pow, octave_float_complex, octave_float_matrix, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_matrix, el_ldiv); + INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_matrix, + el_ldiv); INSTALL_BINOP (op_el_and, octave_float_complex, octave_float_matrix, el_and); INSTALL_BINOP (op_el_or, octave_float_complex, octave_float_matrix, el_or);
--- a/libinterp/operators/op-fcs-fs.cc +++ b/libinterp/operators/op-fcs-fs.cc @@ -148,7 +148,8 @@ INSTALL_BINOP (op_el_mul, octave_float_complex, octave_float_scalar, el_mul); INSTALL_BINOP (op_el_div, octave_float_complex, octave_float_scalar, el_div); INSTALL_BINOP (op_el_pow, octave_float_complex, octave_float_scalar, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_scalar, el_ldiv); + INSTALL_BINOP (op_el_ldiv, octave_float_complex, octave_float_scalar, + el_ldiv); INSTALL_BINOP (op_el_and, octave_float_complex, octave_float_scalar, el_and); INSTALL_BINOP (op_el_or, octave_float_complex, octave_float_scalar, el_or);
--- a/libinterp/operators/op-fdm-fdm.cc +++ b/libinterp/operators/op-fdm-fdm.cc @@ -54,7 +54,8 @@ DEFBINOP (div, float_diag_matrix, float_diag_matrix) { - CAST_BINOP_ARGS (const octave_float_diag_matrix&, const octave_float_diag_matrix&); + CAST_BINOP_ARGS (const octave_float_diag_matrix&, + const octave_float_diag_matrix&); return xdiv (v1.float_diag_matrix_value (), v2.float_diag_matrix_value ()); @@ -62,7 +63,8 @@ DEFBINOP (ldiv, float_diag_matrix, float_diag_matrix) { - CAST_BINOP_ARGS (const octave_float_diag_matrix&, const octave_float_diag_matrix&); + CAST_BINOP_ARGS (const octave_float_diag_matrix&, + const octave_float_diag_matrix&); return xleftdiv (v1.float_diag_matrix_value (), v2.float_diag_matrix_value ()); @@ -90,14 +92,23 @@ INSTALL_UNOP (op_transpose, octave_float_diag_matrix, transpose); INSTALL_UNOP (op_hermitian, octave_float_diag_matrix, transpose); - INSTALL_BINOP (op_add, octave_float_diag_matrix, octave_float_diag_matrix, add); - INSTALL_BINOP (op_sub, octave_float_diag_matrix, octave_float_diag_matrix, sub); - INSTALL_BINOP (op_mul, octave_float_diag_matrix, octave_float_diag_matrix, mul); - INSTALL_BINOP (op_div, octave_float_diag_matrix, octave_float_diag_matrix, div); - INSTALL_BINOP (op_ldiv, octave_float_diag_matrix, octave_float_diag_matrix, ldiv); + INSTALL_BINOP (op_add, octave_float_diag_matrix, octave_float_diag_matrix, + add); + INSTALL_BINOP (op_sub, octave_float_diag_matrix, octave_float_diag_matrix, + sub); + INSTALL_BINOP (op_mul, octave_float_diag_matrix, octave_float_diag_matrix, + mul); + INSTALL_BINOP (op_div, octave_float_diag_matrix, octave_float_diag_matrix, + div); + INSTALL_BINOP (op_ldiv, octave_float_diag_matrix, octave_float_diag_matrix, + ldiv); - INSTALL_CONVOP (octave_float_diag_matrix, octave_float_matrix, float_diag_matrix_to_float_matrix); - INSTALL_CONVOP (octave_float_diag_matrix, octave_diag_matrix, float_diag_matrix_to_diag_matrix); - INSTALL_ASSIGNCONV (octave_float_diag_matrix, octave_float_matrix, octave_float_matrix); - INSTALL_WIDENOP (octave_float_diag_matrix, octave_float_matrix, float_diag_matrix_to_float_matrix); + INSTALL_CONVOP (octave_float_diag_matrix, octave_float_matrix, + float_diag_matrix_to_float_matrix); + INSTALL_CONVOP (octave_float_diag_matrix, octave_diag_matrix, + float_diag_matrix_to_diag_matrix); + INSTALL_ASSIGNCONV (octave_float_diag_matrix, octave_float_matrix, + octave_float_matrix); + INSTALL_WIDENOP (octave_float_diag_matrix, octave_float_matrix, + float_diag_matrix_to_float_matrix); }
--- a/libinterp/operators/op-float-conv.cc +++ b/libinterp/operators/op-float-conv.cc @@ -79,33 +79,54 @@ void install_float_conv_ops (void) { - INSTALL_CONVOP (octave_int8_matrix, octave_float_matrix, int8_matrix_to_float_matrix); - INSTALL_CONVOP (octave_int16_matrix, octave_float_matrix, int16_matrix_to_float_matrix); - INSTALL_CONVOP (octave_int32_matrix, octave_float_matrix, int32_matrix_to_float_matrix); - INSTALL_CONVOP (octave_int64_matrix, octave_float_matrix, int64_matrix_to_float_matrix); + INSTALL_CONVOP (octave_int8_matrix, octave_float_matrix, + int8_matrix_to_float_matrix); + INSTALL_CONVOP (octave_int16_matrix, octave_float_matrix, + int16_matrix_to_float_matrix); + INSTALL_CONVOP (octave_int32_matrix, octave_float_matrix, + int32_matrix_to_float_matrix); + INSTALL_CONVOP (octave_int64_matrix, octave_float_matrix, + int64_matrix_to_float_matrix); - INSTALL_CONVOP (octave_uint8_matrix, octave_float_matrix, uint8_matrix_to_float_matrix); - INSTALL_CONVOP (octave_uint16_matrix, octave_float_matrix, uint16_matrix_to_float_matrix); - INSTALL_CONVOP (octave_uint32_matrix, octave_float_matrix, uint32_matrix_to_float_matrix); - INSTALL_CONVOP (octave_uint64_matrix, octave_float_matrix, uint64_matrix_to_float_matrix); + INSTALL_CONVOP (octave_uint8_matrix, octave_float_matrix, + uint8_matrix_to_float_matrix); + INSTALL_CONVOP (octave_uint16_matrix, octave_float_matrix, + uint16_matrix_to_float_matrix); + INSTALL_CONVOP (octave_uint32_matrix, octave_float_matrix, + uint32_matrix_to_float_matrix); + INSTALL_CONVOP (octave_uint64_matrix, octave_float_matrix, + uint64_matrix_to_float_matrix); - INSTALL_CONVOP (octave_int8_scalar, octave_float_matrix, int8_scalar_to_float_matrix); - INSTALL_CONVOP (octave_int16_scalar, octave_float_matrix, int16_scalar_to_float_matrix); - INSTALL_CONVOP (octave_int32_scalar, octave_float_matrix, int32_scalar_to_float_matrix); - INSTALL_CONVOP (octave_int64_scalar, octave_float_matrix, int64_scalar_to_float_matrix); + INSTALL_CONVOP (octave_int8_scalar, octave_float_matrix, + int8_scalar_to_float_matrix); + INSTALL_CONVOP (octave_int16_scalar, octave_float_matrix, + int16_scalar_to_float_matrix); + INSTALL_CONVOP (octave_int32_scalar, octave_float_matrix, + int32_scalar_to_float_matrix); + INSTALL_CONVOP (octave_int64_scalar, octave_float_matrix, + int64_scalar_to_float_matrix); - INSTALL_CONVOP (octave_uint8_scalar, octave_float_matrix, uint8_scalar_to_float_matrix); - INSTALL_CONVOP (octave_uint16_scalar, octave_float_matrix, uint16_scalar_to_float_matrix); - INSTALL_CONVOP (octave_uint32_scalar, octave_float_matrix, uint32_scalar_to_float_matrix); - INSTALL_CONVOP (octave_uint64_scalar, octave_float_matrix, uint64_scalar_to_float_matrix); + INSTALL_CONVOP (octave_uint8_scalar, octave_float_matrix, + uint8_scalar_to_float_matrix); + INSTALL_CONVOP (octave_uint16_scalar, octave_float_matrix, + uint16_scalar_to_float_matrix); + INSTALL_CONVOP (octave_uint32_scalar, octave_float_matrix, + uint32_scalar_to_float_matrix); + INSTALL_CONVOP (octave_uint64_scalar, octave_float_matrix, + uint64_scalar_to_float_matrix); - INSTALL_CONVOP (octave_bool_matrix, octave_float_matrix, bool_matrix_to_float_matrix); - INSTALL_CONVOP (octave_bool, octave_float_matrix, bool_scalar_to_float_matrix); + INSTALL_CONVOP (octave_bool_matrix, octave_float_matrix, + bool_matrix_to_float_matrix); + INSTALL_CONVOP (octave_bool, octave_float_matrix, + bool_scalar_to_float_matrix); INSTALL_CONVOP (octave_range, octave_float_matrix, range_to_float_matrix); - INSTALL_CONVOP (octave_char_matrix_str, octave_float_matrix, char_matrix_str_to_float_matrix); - INSTALL_CONVOP (octave_char_matrix_sq_str, octave_float_matrix, char_matrix_sq_str_to_float_matrix); + INSTALL_CONVOP (octave_char_matrix_str, octave_float_matrix, + char_matrix_str_to_float_matrix); + INSTALL_CONVOP (octave_char_matrix_sq_str, octave_float_matrix, + char_matrix_sq_str_to_float_matrix); - INSTALL_CONVOP (octave_scalar, octave_float_matrix, float_scalar_to_float_matrix); + INSTALL_CONVOP (octave_scalar, octave_float_matrix, + float_scalar_to_float_matrix); }
--- a/libinterp/operators/op-fm-fcm.cc +++ b/libinterp/operators/op-fm-fcm.cc @@ -52,7 +52,8 @@ DEFBINOP (trans_mul, float_matrix, float_complex_matrix) { - CAST_BINOP_ARGS (const octave_float_matrix&, const octave_float_complex_matrix&); + CAST_BINOP_ARGS (const octave_float_matrix&, + const octave_float_complex_matrix&); FloatMatrix m1 = v1.float_matrix_value (); FloatComplexMatrix m2 = v2.float_complex_matrix_value (); @@ -87,7 +88,7 @@ MatrixType typ = v1.matrix_type (); FloatComplexMatrix ret = xleftdiv (v1.float_matrix_value (), - v2.float_complex_matrix_value (), typ); + v2.float_complex_matrix_value (), typ); v1.matrix_type (typ); return ret; @@ -100,24 +101,25 @@ MatrixType typ = v1.matrix_type (); FloatComplexMatrix ret = xleftdiv (v1.float_matrix_value (), - v2.float_complex_matrix_value (), typ, blas_trans); + v2.float_complex_matrix_value (), + typ, blas_trans); v1.matrix_type (typ); return ret; } DEFNDCMPLXCMPOP_FN (lt, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_lt) + float_complex_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_le) + float_complex_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_eq) + float_complex_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_ge) + float_complex_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_gt) + float_complex_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_matrix, float_complex_matrix, float_array, - float_complex_array, mx_el_ne) + float_complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_matrix, float_complex_matrix, float_array, float_complex_array, product) @@ -152,7 +154,8 @@ { CAST_CONV_ARG (const octave_float_matrix&); - return new octave_float_complex_matrix (FloatComplexNDArray (v.float_array_value ())); + return new octave_float_complex_matrix (FloatComplexNDArray + (v.float_array_value ())); } void
--- a/libinterp/operators/op-fm-fcs.cc +++ b/libinterp/operators/op-fm-fcs.cc @@ -78,17 +78,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_matrix, float_complex, float_array, - float_complex, mx_el_lt) + float_complex, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_matrix, float_complex, float_array, - float_complex, mx_el_le) + float_complex, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_matrix, float_complex, float_array, - float_complex, mx_el_eq) + float_complex, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_matrix, float_complex, float_array, - float_complex, mx_el_ge) + float_complex, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_matrix, float_complex, float_array, - float_complex, mx_el_gt) + float_complex, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_matrix, float_complex, float_array, - float_complex, mx_el_ne) + float_complex, mx_el_ne) DEFNDBINOP_OP (el_mul, float_matrix, float_complex, float_array, float_complex, *) @@ -147,7 +147,8 @@ INSTALL_BINOP (op_el_mul, octave_float_matrix, octave_float_complex, el_mul); INSTALL_BINOP (op_el_div, octave_float_matrix, octave_float_complex, el_div); INSTALL_BINOP (op_el_pow, octave_float_matrix, octave_float_complex, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_matrix, octave_float_complex, el_ldiv); + INSTALL_BINOP (op_el_ldiv, octave_float_matrix, octave_float_complex, + el_ldiv); INSTALL_BINOP (op_el_and, octave_float_matrix, octave_float_complex, el_and); INSTALL_BINOP (op_el_or, octave_float_matrix, octave_float_complex, el_or);
--- a/libinterp/operators/op-fm-fm.cc +++ b/libinterp/operators/op-fm-fm.cc @@ -181,8 +181,10 @@ DEFNDASSIGNOP_OP (assign_add, float_matrix, float_matrix, float_array, +=) DEFNDASSIGNOP_OP (assign_sub, float_matrix, float_matrix, float_array, -=) -DEFNDASSIGNOP_FNOP (assign_el_mul, float_matrix, float_matrix, float_array, product_eq) -DEFNDASSIGNOP_FNOP (assign_el_div, float_matrix, float_matrix, float_array, quotient_eq) +DEFNDASSIGNOP_FNOP (assign_el_mul, float_matrix, float_matrix, float_array, + product_eq) +DEFNDASSIGNOP_FNOP (assign_el_div, float_matrix, float_matrix, float_array, + quotient_eq) CONVDECL (float_matrix_to_matrix) { @@ -222,16 +224,26 @@ INSTALL_BINOP (op_el_ldiv, octave_float_matrix, octave_float_matrix, el_ldiv); INSTALL_BINOP (op_el_and, octave_float_matrix, octave_float_matrix, el_and); INSTALL_BINOP (op_el_or, octave_float_matrix, octave_float_matrix, el_or); - INSTALL_BINOP (op_el_and_not, octave_float_matrix, octave_float_matrix, el_and_not); - INSTALL_BINOP (op_el_or_not, octave_float_matrix, octave_float_matrix, el_or_not); - INSTALL_BINOP (op_el_not_and, octave_float_matrix, octave_float_matrix, el_not_and); - INSTALL_BINOP (op_el_not_or, octave_float_matrix, octave_float_matrix, el_not_or); - INSTALL_BINOP (op_trans_mul, octave_float_matrix, octave_float_matrix, trans_mul); - INSTALL_BINOP (op_mul_trans, octave_float_matrix, octave_float_matrix, mul_trans); - INSTALL_BINOP (op_herm_mul, octave_float_matrix, octave_float_matrix, trans_mul); - INSTALL_BINOP (op_mul_herm, octave_float_matrix, octave_float_matrix, mul_trans); - INSTALL_BINOP (op_trans_ldiv, octave_float_matrix, octave_float_matrix, trans_ldiv); - INSTALL_BINOP (op_herm_ldiv, octave_float_matrix, octave_float_matrix, trans_ldiv); + INSTALL_BINOP (op_el_and_not, octave_float_matrix, octave_float_matrix, + el_and_not); + INSTALL_BINOP (op_el_or_not, octave_float_matrix, octave_float_matrix, + el_or_not); + INSTALL_BINOP (op_el_not_and, octave_float_matrix, octave_float_matrix, + el_not_and); + INSTALL_BINOP (op_el_not_or, octave_float_matrix, octave_float_matrix, + el_not_or); + INSTALL_BINOP (op_trans_mul, octave_float_matrix, octave_float_matrix, + trans_mul); + INSTALL_BINOP (op_mul_trans, octave_float_matrix, octave_float_matrix, + mul_trans); + INSTALL_BINOP (op_herm_mul, octave_float_matrix, octave_float_matrix, + trans_mul); + INSTALL_BINOP (op_mul_herm, octave_float_matrix, octave_float_matrix, + mul_trans); + INSTALL_BINOP (op_trans_ldiv, octave_float_matrix, octave_float_matrix, + trans_ldiv); + INSTALL_BINOP (op_herm_ldiv, octave_float_matrix, octave_float_matrix, + trans_ldiv); INSTALL_CATOP (octave_float_matrix, octave_float_matrix, fm_fm); INSTALL_CATOP (octave_matrix, octave_float_matrix, m_fm); @@ -242,14 +254,21 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_float_matrix, dbl_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_sq_str, null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_null_sq_str, + null_assign); - INSTALL_ASSIGNOP (op_add_eq, octave_float_matrix, octave_float_matrix, assign_add); - INSTALL_ASSIGNOP (op_sub_eq, octave_float_matrix, octave_float_matrix, assign_sub); - INSTALL_ASSIGNOP (op_el_mul_eq, octave_float_matrix, octave_float_matrix, assign_el_mul); - INSTALL_ASSIGNOP (op_el_div_eq, octave_float_matrix, octave_float_matrix, assign_el_div); + INSTALL_ASSIGNOP (op_add_eq, octave_float_matrix, octave_float_matrix, + assign_add); + INSTALL_ASSIGNOP (op_sub_eq, octave_float_matrix, octave_float_matrix, + assign_sub); + INSTALL_ASSIGNOP (op_el_mul_eq, octave_float_matrix, octave_float_matrix, + assign_el_mul); + INSTALL_ASSIGNOP (op_el_div_eq, octave_float_matrix, octave_float_matrix, + assign_el_div); INSTALL_CONVOP (octave_float_matrix, octave_matrix, float_matrix_to_matrix); }
--- a/libinterp/operators/op-fm-fs.cc +++ b/libinterp/operators/op-fm-fs.cc @@ -152,11 +152,16 @@ INSTALL_CATOP (octave_matrix, octave_float_scalar, m_fs); INSTALL_CATOP (octave_float_matrix, octave_scalar, fm_s); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_float_scalar, assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_float_scalar, + assign); INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_float_scalar, dbl_assign); - INSTALL_ASSIGNOP (op_add_eq, octave_float_matrix, octave_float_scalar, assign_add); - INSTALL_ASSIGNOP (op_sub_eq, octave_float_matrix, octave_float_scalar, assign_sub); - INSTALL_ASSIGNOP (op_mul_eq, octave_float_matrix, octave_float_scalar, assign_mul); - INSTALL_ASSIGNOP (op_div_eq, octave_float_matrix, octave_float_scalar, assign_div); + INSTALL_ASSIGNOP (op_add_eq, octave_float_matrix, octave_float_scalar, + assign_add); + INSTALL_ASSIGNOP (op_sub_eq, octave_float_matrix, octave_float_scalar, + assign_sub); + INSTALL_ASSIGNOP (op_mul_eq, octave_float_matrix, octave_float_scalar, + assign_mul); + INSTALL_ASSIGNOP (op_div_eq, octave_float_matrix, octave_float_scalar, + assign_div); }
--- a/libinterp/operators/op-fs-fcm.cc +++ b/libinterp/operators/op-fs-fcm.cc @@ -82,17 +82,17 @@ } DEFNDCMPLXCMPOP_FN (lt, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_lt) + float_complex_array, mx_el_lt) DEFNDCMPLXCMPOP_FN (le, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_le) + float_complex_array, mx_el_le) DEFNDCMPLXCMPOP_FN (eq, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_eq) + float_complex_array, mx_el_eq) DEFNDCMPLXCMPOP_FN (ge, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_ge) + float_complex_array, mx_el_ge) DEFNDCMPLXCMPOP_FN (gt, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_gt) + float_complex_array, mx_el_gt) DEFNDCMPLXCMPOP_FN (ne, float_scalar, float_complex_matrix, float_scalar, - float_complex_array, mx_el_ne) + float_complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_scalar, float_complex_matrix, float_scalar, float_complex_array, *) @@ -132,7 +132,8 @@ { CAST_CONV_ARG (const octave_float_scalar&); - return new octave_float_complex_matrix (FloatComplexMatrix (v.float_matrix_value ())); + return new octave_float_complex_matrix (FloatComplexMatrix + (v.float_matrix_value ())); } void
--- a/libinterp/operators/op-fs-fcs.cc +++ b/libinterp/operators/op-fs-fcs.cc @@ -109,14 +109,18 @@ { CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&); - return octave_value (v1.float_scalar_value () && (v2.float_complex_value () != static_cast<float>(0.0))); + return octave_value (v1.float_scalar_value () + && (v2.float_complex_value () + != static_cast<float>(0.0))); } DEFBINOP (el_or, float_scalar, float_complex) { CAST_BINOP_ARGS (const octave_float_scalar&, const octave_float_complex&); - return octave_value (v1.float_scalar_value () || (v2.float_complex_value () != static_cast<float>(0.0))); + return octave_value (v1.float_scalar_value () + || (v2.float_complex_value () + != static_cast<float>(0.0))); } DEFNDCATOP_FN (fs_fcs, float_scalar, float_complex, float_array, @@ -146,7 +150,8 @@ INSTALL_BINOP (op_el_mul, octave_float_scalar, octave_float_complex, el_mul); INSTALL_BINOP (op_el_div, octave_float_scalar, octave_float_complex, el_div); INSTALL_BINOP (op_el_pow, octave_float_scalar, octave_float_complex, el_pow); - INSTALL_BINOP (op_el_ldiv, octave_float_scalar, octave_float_complex, el_ldiv); + INSTALL_BINOP (op_el_ldiv, octave_float_scalar, octave_float_complex, + el_ldiv); INSTALL_BINOP (op_el_and, octave_float_scalar, octave_float_complex, el_and); INSTALL_BINOP (op_el_or, octave_float_scalar, octave_float_complex, el_or);
--- a/libinterp/operators/op-fs-fm.cc +++ b/libinterp/operators/op-fs-fm.cc @@ -79,7 +79,7 @@ DEFNDBINOP_FN (ge, float_scalar, float_matrix, float_scalar, float_array, mx_el_ge) DEFNDBINOP_FN (gt, float_scalar, float_matrix, float_scalar, -float_array, mx_el_gt) + float_array, mx_el_gt) DEFNDBINOP_FN (ne, float_scalar, float_matrix, float_scalar, float_array, mx_el_ne) @@ -147,7 +147,8 @@ INSTALL_CATOP (octave_scalar, octave_float_matrix, s_fm); INSTALL_CATOP (octave_float_scalar, octave_matrix, fs_m); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_float_matrix, octave_float_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_float_matrix, + octave_float_matrix); INSTALL_ASSIGNCONV (octave_scalar, octave_float_matrix, octave_matrix); INSTALL_WIDENOP (octave_float_scalar, octave_float_matrix, matrix_conv);
--- a/libinterp/operators/op-fs-fs.cc +++ b/libinterp/operators/op-fs-fs.cc @@ -127,7 +127,8 @@ DEFSCALARBOOLOP_OP (el_and, float_scalar, float_scalar, &&) DEFSCALARBOOLOP_OP (el_or, float_scalar, float_scalar, ||) -DEFNDCATOP_FN (fs_fs, float_scalar, float_scalar, float_array, float_array, concat) +DEFNDCATOP_FN (fs_fs, float_scalar, float_scalar, float_array, float_array, + concat) DEFNDCATOP_FN (s_fs, scalar, float_scalar, float_array, float_array, concat) DEFNDCATOP_FN (fs_s, float_scalar, scalar, float_array, float_array, concat) @@ -135,7 +136,8 @@ { CAST_CONV_ARG (const octave_float_scalar&); - return new octave_matrix (Matrix (1, 1, static_cast<double>(v.float_value ()))); + return new octave_matrix (Matrix (1, 1, + static_cast<double>(v.float_value ()))); } void @@ -173,12 +175,16 @@ INSTALL_CATOP (octave_scalar, octave_float_scalar, s_fs); INSTALL_CATOP (octave_float_scalar, octave_scalar, fs_s); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_float_scalar, octave_float_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_float_scalar, + octave_float_matrix); INSTALL_ASSIGNCONV (octave_scalar, octave_float_scalar, octave_matrix); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_matrix, octave_float_matrix); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_str, octave_float_matrix); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_sq_str, octave_float_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_matrix, + octave_float_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_str, + octave_float_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_sq_str, + octave_float_matrix); INSTALL_CONVOP (octave_float_scalar, octave_matrix, float_to_scalar); }
--- a/libinterp/operators/op-m-cm.cc +++ b/libinterp/operators/op-m-cm.cc @@ -95,7 +95,7 @@ MatrixType typ = v1.matrix_type (); ComplexMatrix ret = xleftdiv (v1.matrix_value (), - v2.complex_matrix_value (), typ, blas_trans); + v2.complex_matrix_value (), typ, blas_trans); v1.matrix_type (typ); return ret; @@ -154,13 +154,17 @@ INSTALL_BINOP (op_el_or, octave_matrix, octave_complex_matrix, el_or); INSTALL_BINOP (op_trans_mul, octave_matrix, octave_complex_matrix, trans_mul); INSTALL_BINOP (op_herm_mul, octave_matrix, octave_complex_matrix, trans_mul); - INSTALL_BINOP (op_trans_ldiv, octave_matrix, octave_complex_matrix, trans_ldiv); - INSTALL_BINOP (op_herm_ldiv, octave_matrix, octave_complex_matrix, trans_ldiv); + INSTALL_BINOP (op_trans_ldiv, octave_matrix, octave_complex_matrix, + trans_ldiv); + INSTALL_BINOP (op_herm_ldiv, octave_matrix, octave_complex_matrix, + trans_ldiv); INSTALL_CATOP (octave_matrix, octave_complex_matrix, m_cm); - INSTALL_ASSIGNCONV (octave_matrix, octave_complex_matrix, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_matrix, octave_complex_matrix, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_matrix, octave_complex_matrix, + octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_matrix, octave_complex_matrix, + octave_float_complex_matrix); INSTALL_WIDENOP (octave_matrix, octave_complex_matrix, complex_matrix_conv); }
--- a/libinterp/operators/op-m-cs.cc +++ b/libinterp/operators/op-m-cs.cc @@ -136,5 +136,6 @@ INSTALL_CATOP (octave_matrix, octave_complex, m_cs); INSTALL_ASSIGNCONV (octave_matrix, octave_complex, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_matrix, octave_complex, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_matrix, octave_complex, + octave_float_complex_matrix); }
--- a/libinterp/operators/op-m-m.cc +++ b/libinterp/operators/op-m-m.cc @@ -112,7 +112,8 @@ CAST_BINOP_ARGS (const octave_matrix&, const octave_matrix&); MatrixType typ = v1.matrix_type (); - Matrix ret = xleftdiv (v1.matrix_value (), v2.matrix_value (), typ, blas_trans); + Matrix ret = xleftdiv (v1.matrix_value (), v2.matrix_value (), + typ, blas_trans); v1.matrix_type (typ); return ret;
--- a/libinterp/operators/op-m-s.cc +++ b/libinterp/operators/op-m-s.cc @@ -107,7 +107,8 @@ DEFNDASSIGNOP_FN (assign, matrix, scalar, scalar, assign) DEFNDASSIGNOP_FN (sgl_assign, float_matrix, scalar, float_scalar, assign) -DEFNDASSIGNOP_FN (clx_sgl_assign, float_complex_matrix, scalar, float_complex, assign) +DEFNDASSIGNOP_FN (clx_sgl_assign, float_complex_matrix, scalar, float_complex, + assign) DEFNDASSIGNOP_OP (assign_add, matrix, scalar, scalar, +=) DEFNDASSIGNOP_OP (assign_sub, matrix, scalar, scalar, -=) @@ -146,7 +147,8 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_scalar, assign); INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_scalar, sgl_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_scalar, clx_sgl_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_scalar, + clx_sgl_assign); INSTALL_ASSIGNOP (op_add_eq, octave_matrix, octave_scalar, assign_add); INSTALL_ASSIGNOP (op_sub_eq, octave_matrix, octave_scalar, assign_sub);
--- a/libinterp/operators/op-m-scm.cc +++ b/libinterp/operators/op-m-scm.cc @@ -107,8 +107,8 @@ const octave_sparse_complex_matrix&); return octave_value - (elem_xpow (SparseMatrix (v1.matrix_value ()), - v2.sparse_complex_matrix_value ())); + (elem_xpow (SparseMatrix (v1.matrix_value ()), + v2.sparse_complex_matrix_value ())); } DEFBINOP (el_ldiv, matrix, sparse_complex_matrix) @@ -116,7 +116,7 @@ CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_complex_matrix&); return octave_value - (quotient (v2.sparse_complex_matrix_value (), v1.matrix_value ())); + (quotient (v2.sparse_complex_matrix_value (), v1.matrix_value ())); } DEFBINOP_FN (el_and, matrix, sparse_complex_matrix, mx_el_and) @@ -134,7 +134,7 @@ { CAST_CONV_ARG (const octave_matrix&); return new octave_sparse_complex_matrix - (SparseComplexMatrix (v.complex_matrix_value ())); + (SparseComplexMatrix (v.complex_matrix_value ())); } void
--- a/libinterp/operators/op-m-sm.cc +++ b/libinterp/operators/op-m-sm.cc @@ -112,7 +112,7 @@ CAST_BINOP_ARGS (const octave_matrix&, const octave_sparse_matrix&); return octave_value - (quotient (v2.sparse_matrix_value (), v1.matrix_value ())); + (quotient (v2.sparse_matrix_value (), v1.matrix_value ())); } DEFBINOP_FN (el_and, matrix, sparse_matrix, mx_el_and)
--- a/libinterp/operators/op-pm-scm.cc +++ b/libinterp/operators/op-pm-scm.cc @@ -37,7 +37,8 @@ DEFBINOP (mul_pm_scm, perm_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_perm_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_perm_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -53,7 +54,8 @@ DEFBINOP (ldiv_pm_scm, perm_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_perm_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_perm_matrix&, + const octave_sparse_complex_matrix&); return v1.perm_matrix_value ().inverse () * v2.sparse_complex_matrix_value (); } @@ -62,7 +64,8 @@ DEFBINOP (mul_scm_pm, sparse_complex_matrix, perm_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_perm_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_perm_matrix&); if (v1.rows () == 1 && v1.columns () == 1) { @@ -78,7 +81,8 @@ DEFBINOP (div_scm_pm, sparse_complex_matrix, perm_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_perm_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_perm_matrix&); return v1.sparse_complex_matrix_value () * v2.perm_matrix_value ().inverse (); }
--- a/libinterp/operators/op-range.cc +++ b/libinterp/operators/op-range.cc @@ -128,7 +128,7 @@ INSTALL_CATOP (octave_bool_matrix, octave_range, bm_r); INSTALL_CATOP (octave_char_matrix, octave_range, chm_r); - // FIXME -- this would be unneccessary if + // FIXME: this would be unneccessary if // octave_base_value::numeric_assign always tried converting lhs // before rhs.
--- a/libinterp/operators/op-s-cm.cc +++ b/libinterp/operators/op-s-cm.cc @@ -135,8 +135,10 @@ INSTALL_CATOP (octave_scalar, octave_complex_matrix, s_cm); - INSTALL_ASSIGNCONV (octave_scalar, octave_complex_matrix, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_complex_matrix, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_scalar, octave_complex_matrix, + octave_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_complex_matrix, + octave_float_complex_matrix); INSTALL_WIDENOP (octave_scalar, octave_complex_matrix, complex_matrix_conv); }
--- a/libinterp/operators/op-s-cs.cc +++ b/libinterp/operators/op-s-cs.cc @@ -145,5 +145,6 @@ INSTALL_CATOP (octave_scalar, octave_complex, s_cs); INSTALL_ASSIGNCONV (octave_scalar, octave_complex, octave_complex_matrix); - INSTALL_ASSIGNCONV (octave_float_scalar, octave_complex, octave_float_complex_matrix); + INSTALL_ASSIGNCONV (octave_float_scalar, octave_complex, + octave_float_complex_matrix); }
--- a/libinterp/operators/op-s-scm.cc +++ b/libinterp/operators/op-s-scm.cc @@ -129,7 +129,7 @@ CAST_BINOP_ARGS (octave_scalar&, const octave_sparse_complex_matrix&); SparseMatrix tmp (1, 1, v1.scalar_value ()); return octave_value - (tmp.concat (v2.sparse_complex_matrix_value (), ra_idx)); + (tmp.concat (v2.sparse_complex_matrix_value (), ra_idx)); } DEFCONV (sparse_complex_matrix_conv, scalar, sparse_complex_matrix) @@ -137,7 +137,7 @@ CAST_CONV_ARG (const octave_scalar&); return new octave_sparse_complex_matrix - (SparseComplexMatrix (v.complex_matrix_value ())); + (SparseComplexMatrix (v.complex_matrix_value ())); } void
--- a/libinterp/operators/op-sbm-b.cc +++ b/libinterp/operators/op-sbm-b.cc @@ -92,7 +92,7 @@ { octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1); - // FIXME -- perhaps add a warning for this conversion if the values + // FIXME: perhaps add a warning for this conversion if the values // are not all 0 or 1? SparseBoolMatrix v2 (1, 1, a2.bool_value ());
--- a/libinterp/operators/op-sbm-bm.cc +++ b/libinterp/operators/op-sbm-bm.cc @@ -98,7 +98,7 @@ { octave_sparse_bool_matrix& v1 = dynamic_cast<octave_sparse_bool_matrix&> (a1); - // FIXME -- perhaps add a warning for this conversion if the values + // FIXME: perhaps add a warning for this conversion if the values // are not all 0 or 1? SparseBoolMatrix v2 (a2.bool_array_value ());
--- a/libinterp/operators/op-sbm-sbm.cc +++ b/libinterp/operators/op-sbm-sbm.cc @@ -79,7 +79,8 @@ { CAST_CONV_ARG (const octave_sparse_bool_matrix&); - return new octave_sparse_matrix (SparseMatrix (v.sparse_bool_matrix_value ())); + return new octave_sparse_matrix (SparseMatrix + (v.sparse_bool_matrix_value ())); } void
--- a/libinterp/operators/op-scm-cm.cc +++ b/libinterp/operators/op-scm-cm.cc @@ -67,7 +67,8 @@ DEFBINOP (ldiv, sparse_complex_matrix, complex_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_complex_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_complex_matrix&); if (v1.rows () == 1 && v1.columns () == 1) { @@ -83,7 +84,7 @@ MatrixType typ = v1.matrix_type (); ComplexMatrix ret = xleftdiv (v1.sparse_complex_matrix_value (), - v2.complex_matrix_value (), typ); + v2.complex_matrix_value (), typ); v1.matrix_type (typ); return ret; @@ -109,8 +110,8 @@ const octave_complex_matrix&); return octave_value - (elem_xpow (v1.sparse_complex_matrix_value (), SparseComplexMatrix - (v2.complex_matrix_value ()))); + (elem_xpow (v1.sparse_complex_matrix_value (), SparseComplexMatrix + (v2.complex_matrix_value ()))); } DEFBINOP (el_ldiv, sparse_complex_matrix, matrix) @@ -131,7 +132,7 @@ const octave_complex_matrix&); SparseComplexMatrix tmp (v2.complex_matrix_value ()); return octave_value - (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); + (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); } DEFASSIGNOP (assign, sparse_complex_matrix, complex_matrix)
--- a/libinterp/operators/op-scm-cs.cc +++ b/libinterp/operators/op-scm-cs.cc @@ -125,7 +125,7 @@ const octave_complex&); return octave_value - (x_el_div (v2.complex_value (), v1.sparse_complex_matrix_value ())); + (x_el_div (v2.complex_value (), v1.sparse_complex_matrix_value ())); } DEFBINOP_FN (el_and, sparse_complex_matrix, complex, mx_el_and) @@ -136,7 +136,7 @@ CAST_BINOP_ARGS (octave_sparse_complex_matrix&, const octave_complex&); SparseComplexMatrix tmp (1, 1, v2.complex_value ()); return octave_value - (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); + (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); } DEFASSIGNOP (assign, sparse_complex_matrix, complex)
--- a/libinterp/operators/op-scm-m.cc +++ b/libinterp/operators/op-scm-m.cc @@ -107,8 +107,8 @@ const octave_matrix&); return octave_value - (elem_xpow (v1.sparse_complex_matrix_value (), SparseMatrix - (v2.matrix_value ()))); + (elem_xpow (v1.sparse_complex_matrix_value (), SparseMatrix + (v2.matrix_value ()))); } DEFBINOP (el_ldiv, sparse_complex_matrix, matrix) @@ -117,7 +117,7 @@ const octave_matrix&); return octave_value - (quotient (v2.matrix_value (), v1.sparse_complex_matrix_value ())); + (quotient (v2.matrix_value (), v1.sparse_complex_matrix_value ())); } DEFBINOP_FN (el_and, sparse_complex_matrix, matrix, mx_el_and) @@ -128,7 +128,7 @@ CAST_BINOP_ARGS (octave_sparse_complex_matrix&, const octave_matrix&); SparseMatrix tmp (v2.matrix_value ()); return octave_value - (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); + (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); } DEFASSIGNOP (assign, sparse_complex_matrix, matrix)
--- a/libinterp/operators/op-scm-s.cc +++ b/libinterp/operators/op-scm-s.cc @@ -131,7 +131,7 @@ CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_scalar&); return octave_value - (x_el_div (v2.double_value (), v1.sparse_complex_matrix_value ())); + (x_el_div (v2.double_value (), v1.sparse_complex_matrix_value ())); } DEFBINOP_FN (el_and, sparse_complex_matrix, scalar, mx_el_and) @@ -142,7 +142,7 @@ CAST_BINOP_ARGS (octave_sparse_complex_matrix&, const octave_scalar&); SparseComplexMatrix tmp (1, 1, v2.complex_value ()); return octave_value - (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); + (v1.sparse_complex_matrix_value (). concat (tmp, ra_idx)); } DEFASSIGNOP (assign, sparse_complex_matrix, scalar)
--- a/libinterp/operators/op-scm-scm.cc +++ b/libinterp/operators/op-scm-scm.cc @@ -60,16 +60,16 @@ { CAST_UNOP_ARG (const octave_sparse_complex_matrix&); return octave_value - (v.sparse_complex_matrix_value ().transpose (), - v.matrix_type ().transpose ()); + (v.sparse_complex_matrix_value ().transpose (), + v.matrix_type ().transpose ()); } DEFUNOP (hermitian, sparse_complex_matrix) { CAST_UNOP_ARG (const octave_sparse_complex_matrix&); return octave_value - (v.sparse_complex_matrix_value ().hermitian (), - v.matrix_type ().transpose ()); + (v.sparse_complex_matrix_value ().hermitian (), + v.matrix_type ().transpose ()); } #if 0
--- a/libinterp/operators/op-scm-sm.cc +++ b/libinterp/operators/op-scm-sm.cc @@ -47,7 +47,8 @@ DEFBINOP (div, sparse_complex_matrix, sparse_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_sparse_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_sparse_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -77,7 +78,8 @@ DEFBINOP (ldiv, sparse_complex_matrix, sparse_matrix) { - CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_sparse_matrix&); + CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, + const octave_sparse_matrix&); if (v1.rows () == 1 && v1.columns () == 1) { @@ -116,8 +118,8 @@ CAST_BINOP_ARGS (const octave_sparse_complex_matrix&, const octave_sparse_matrix&); - return octave_value - (quotient (v2.sparse_matrix_value (), v1.sparse_complex_matrix_value ())); + return octave_value (quotient (v2.sparse_matrix_value (), + v1.sparse_complex_matrix_value ())); } DEFBINOP_FN (el_and, sparse_complex_matrix, sparse_matrix, mx_el_and)
--- a/libinterp/operators/op-sm-cm.cc +++ b/libinterp/operators/op-sm-cm.cc @@ -106,8 +106,8 @@ const octave_complex_matrix&); return octave_value - (elem_xpow (v1.sparse_matrix_value (), SparseComplexMatrix - (v2.complex_matrix_value ()))); + (elem_xpow (v1.sparse_matrix_value (), SparseComplexMatrix + (v2.complex_matrix_value ()))); } DEFBINOP (el_ldiv, sparse_matrix, complex_matrix) @@ -116,7 +116,7 @@ const octave_complex_matrix&); return octave_value - (quotient (v2.complex_matrix_value (), v1.sparse_matrix_value ())); + (quotient (v2.complex_matrix_value (), v1.sparse_matrix_value ())); } DEFBINOP_FN (el_and, sparse_matrix, complex_matrix, mx_el_and)
--- a/libinterp/operators/op-sm-m.cc +++ b/libinterp/operators/op-sm-m.cc @@ -113,7 +113,7 @@ CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_matrix&); return octave_value - (quotient (v2.matrix_value (), v1.sparse_matrix_value ())); + (quotient (v2.matrix_value (), v1.sparse_matrix_value ())); } DEFBINOP_FN (el_and, sparse_matrix, matrix, mx_el_and)
--- a/libinterp/operators/op-sm-s.cc +++ b/libinterp/operators/op-sm-s.cc @@ -124,7 +124,7 @@ CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_scalar&); return octave_value - (x_el_div (v2.complex_value (), v1.sparse_matrix_value ())); + (x_el_div (v2.complex_value (), v1.sparse_matrix_value ())); } DEFBINOP_FN (el_and, sparse_matrix, scalar, mx_el_and)
--- a/libinterp/operators/op-sm-scm.cc +++ b/libinterp/operators/op-sm-scm.cc @@ -47,7 +47,8 @@ DEFBINOP (div, sparse_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_sparse_complex_matrix&); if (v2.rows () == 1 && v2.columns () == 1) { @@ -62,7 +63,7 @@ { MatrixType typ = v2.matrix_type (); SparseComplexMatrix ret = xdiv (v1.sparse_matrix_value (), - v2.sparse_complex_matrix_value (), typ); + v2.sparse_complex_matrix_value (), typ); v2.matrix_type (typ); return ret; @@ -77,7 +78,8 @@ DEFBINOP (ldiv, sparse_matrix, sparse_complex_matrix) { - CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_complex_matrix&); + CAST_BINOP_ARGS (const octave_sparse_matrix&, + const octave_sparse_complex_matrix&); if (v1.rows () == 1 && v1.columns () == 1) { @@ -117,8 +119,8 @@ CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_complex_matrix&); - return octave_value - (quotient (v2.sparse_complex_matrix_value (), v1.sparse_matrix_value ())); + return octave_value (quotient (v2.sparse_complex_matrix_value (), + v1.sparse_matrix_value ())); } DEFBINOP_FN (el_and, sparse_matrix, sparse_complex_matrix, mx_el_and)
--- a/libinterp/operators/op-sm-sm.cc +++ b/libinterp/operators/op-sm-sm.cc @@ -56,15 +56,17 @@ // DEFBINOP_OP (sub, sparse_matrix, sparse_matrix, -) - static octave_value - oct_binop_sub (const octave_base_value& a1, const octave_base_value& a2) - { - const octave_sparse_matrix& v1 = dynamic_cast<const octave_sparse_matrix&> (a1); - const octave_sparse_matrix& v2 = dynamic_cast<const octave_sparse_matrix&> (a2); - SparseMatrix m = v1.sparse_matrix_value () - v2.sparse_matrix_value (); +static octave_value +oct_binop_sub (const octave_base_value& a1, const octave_base_value& a2) +{ + const octave_sparse_matrix& v1 = + dynamic_cast<const octave_sparse_matrix&> (a1); + const octave_sparse_matrix& v2 = + dynamic_cast<const octave_sparse_matrix&> (a2); + SparseMatrix m = v1.sparse_matrix_value () - v2.sparse_matrix_value (); - return octave_value (m); - } + return octave_value (m); +} DEFBINOP_OP (mul, sparse_matrix, sparse_matrix, *) @@ -139,7 +141,7 @@ { CAST_BINOP_ARGS (const octave_sparse_matrix&, const octave_sparse_matrix&); return octave_value - (quotient (v2.sparse_matrix_value (), v1.sparse_matrix_value ())); + (quotient (v2.sparse_matrix_value (), v1.sparse_matrix_value ())); } DEFBINOP_FN (el_and, sparse_matrix, sparse_matrix, mx_el_and) @@ -190,7 +192,10 @@ INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_sparse_matrix, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_sq_str, null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_sparse_matrix, octave_null_sq_str, + null_assign); }
--- a/libinterp/operators/op-str-m.cc +++ b/libinterp/operators/op-str-m.cc @@ -54,7 +54,8 @@ install_str_m_ops (void) { INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_matrix, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_matrix, assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_matrix, + assign); INSTALL_CATOP (octave_char_matrix_str, octave_matrix, str_m); INSTALL_CATOP (octave_char_matrix_sq_str, octave_matrix, str_m);
--- a/libinterp/operators/op-str-s.cc +++ b/libinterp/operators/op-str-s.cc @@ -54,7 +54,8 @@ install_str_s_ops (void) { INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_scalar, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_scalar, assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_scalar, + assign); INSTALL_CATOP (octave_char_matrix_str, octave_scalar, str_s); INSTALL_CATOP (octave_char_matrix_sq_str, octave_scalar, str_s);
--- a/libinterp/operators/op-str-str.cc +++ b/libinterp/operators/op-str-str.cc @@ -77,12 +77,18 @@ } \ } -DEFCHARNDBINOP_FN (lt, <, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_lt) -DEFCHARNDBINOP_FN (le, <=, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_le) -DEFCHARNDBINOP_FN (eq, ==, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_eq) -DEFCHARNDBINOP_FN (ge, >=, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_ge) -DEFCHARNDBINOP_FN (gt, >, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_gt) -DEFCHARNDBINOP_FN (ne, !=, char_matrix_str, char_matrix_str, char_array, char_array, mx_el_ne) +DEFCHARNDBINOP_FN (lt, <, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_lt) +DEFCHARNDBINOP_FN (le, <=, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_le) +DEFCHARNDBINOP_FN (eq, ==, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_eq) +DEFCHARNDBINOP_FN (ge, >=, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_ge) +DEFCHARNDBINOP_FN (gt, >, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_gt) +DEFCHARNDBINOP_FN (ne, !=, char_matrix_str, char_matrix_str, char_array, + char_array, mx_el_ne) DEFASSIGNOP (assign, char_matrix_str, char_matrix_str) { @@ -108,48 +114,66 @@ INSTALL_BINOP (op_lt, octave_char_matrix_str, octave_char_matrix_str, lt); INSTALL_BINOP (op_lt, octave_char_matrix_str, octave_char_matrix_sq_str, lt); INSTALL_BINOP (op_lt, octave_char_matrix_sq_str, octave_char_matrix_str, lt); - INSTALL_BINOP (op_lt, octave_char_matrix_sq_str, octave_char_matrix_sq_str, lt); + INSTALL_BINOP (op_lt, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + lt); INSTALL_BINOP (op_le, octave_char_matrix_str, octave_char_matrix_str, le); INSTALL_BINOP (op_le, octave_char_matrix_str, octave_char_matrix_sq_str, le); INSTALL_BINOP (op_le, octave_char_matrix_sq_str, octave_char_matrix_str, le); - INSTALL_BINOP (op_le, octave_char_matrix_sq_str, octave_char_matrix_sq_str, le); + INSTALL_BINOP (op_le, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + le); INSTALL_BINOP (op_eq, octave_char_matrix_str, octave_char_matrix_str, eq); INSTALL_BINOP (op_eq, octave_char_matrix_str, octave_char_matrix_sq_str, eq); INSTALL_BINOP (op_eq, octave_char_matrix_sq_str, octave_char_matrix_str, eq); - INSTALL_BINOP (op_eq, octave_char_matrix_sq_str, octave_char_matrix_sq_str, eq); + INSTALL_BINOP (op_eq, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + eq); INSTALL_BINOP (op_ge, octave_char_matrix_str, octave_char_matrix_str, ge); INSTALL_BINOP (op_ge, octave_char_matrix_str, octave_char_matrix_sq_str, ge); INSTALL_BINOP (op_ge, octave_char_matrix_sq_str, octave_char_matrix_str, ge); - INSTALL_BINOP (op_ge, octave_char_matrix_sq_str, octave_char_matrix_sq_str, ge); + INSTALL_BINOP (op_ge, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + ge); INSTALL_BINOP (op_gt, octave_char_matrix_str, octave_char_matrix_str, gt); INSTALL_BINOP (op_gt, octave_char_matrix_str, octave_char_matrix_sq_str, gt); INSTALL_BINOP (op_gt, octave_char_matrix_sq_str, octave_char_matrix_str, gt); - INSTALL_BINOP (op_gt, octave_char_matrix_sq_str, octave_char_matrix_sq_str, gt); + INSTALL_BINOP (op_gt, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + gt); INSTALL_BINOP (op_ne, octave_char_matrix_str, octave_char_matrix_str, ne); INSTALL_BINOP (op_ne, octave_char_matrix_str, octave_char_matrix_sq_str, ne); INSTALL_BINOP (op_ne, octave_char_matrix_sq_str, octave_char_matrix_str, ne); - INSTALL_BINOP (op_ne, octave_char_matrix_sq_str, octave_char_matrix_sq_str, ne); + INSTALL_BINOP (op_ne, octave_char_matrix_sq_str, octave_char_matrix_sq_str, + ne); INSTALL_CATOP (octave_char_matrix_str, octave_char_matrix_str, str_str); INSTALL_CATOP (octave_char_matrix_str, octave_char_matrix_sq_str, str_str); INSTALL_CATOP (octave_char_matrix_sq_str, octave_char_matrix_str, str_str); INSTALL_CATOP (octave_char_matrix_sq_str, octave_char_matrix_sq_str, str_str); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_char_matrix_str, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_char_matrix_sq_str, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_char_matrix_str, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_char_matrix_sq_str, assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_char_matrix_str, + assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, + octave_char_matrix_sq_str, + assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, + octave_char_matrix_str, + assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, + octave_char_matrix_sq_str, assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_sq_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_matrix, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_str, null_assign); - INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_sq_str, null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_null_sq_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_matrix, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_str, + null_assign); + INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_null_sq_str, + null_assign); }
--- a/libinterp/operators/ops.h +++ b/libinterp/operators/ops.h @@ -245,7 +245,7 @@ return octave_value (op v.CONCAT2(e, _value) ()); \ } -// FIXME -- in some cases, the constructor isn't necessary. +// FIXME: in some cases, the constructor isn't necessary. #define DEFUNOP_FN(name, t, f) \ UNOPDECL (name, a) \ @@ -318,7 +318,7 @@ (v1.CONCAT2(e1, _value) () op v2.CONCAT2(e2, _value) ()); \ } -// FIXME -- in some cases, the constructor isn't necessary. +// FIXME: in some cases, the constructor isn't necessary. #define DEFBINOP_FN(name, t1, t2, f) \ BINOPDECL (name, a1, a2) \ @@ -352,7 +352,7 @@ #define DEFCATOP(name, t1, t2) \ CATOPDECL (name, a1, a2) -// FIXME -- in some cases, the constructor isn't necessary. +// FIXME: in some cases, the constructor isn't necessary. #define DEFCATOP_FN(name, t1, t2, f) \ CATOPDECL (name, a1, a2) \
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -99,12 +99,12 @@ private: enum bracket_type - { - BRACKET = 1, - BRACE = 2, - PAREN = 3, - ANON_FCN_BODY = 4 - }; + { + BRACKET = 1, + BRACE = 2, + PAREN = 3, + ANON_FCN_BODY = 4 + }; public: @@ -262,14 +262,14 @@ token_cache& operator = (const token_cache&); }; - + lexical_feedback (void) : end_of_input (false), at_beginning_of_statement (true), looking_at_anon_fcn_args (false), looking_at_return_list (false), looking_at_parameter_list (false), looking_at_decl_list (false), looking_at_initializer_expression (false), looking_at_matrix_or_assign_lhs (false), - looking_for_object_index (false), + looking_for_object_index (false), looking_at_indirect_ref (false), parsing_class_method (false), maybe_classdef_get_set_method (false), parsing_classdef (false), quote_is_transpose (false), force_script (false),
--- a/libinterp/parse-tree/parse.h +++ b/libinterp/parse-tree/parse.h @@ -85,7 +85,8 @@ extern OCTINTERP_API string_vector autoloaded_functions (void); -extern OCTINTERP_API string_vector reverse_lookup_autoload (const std::string& nm); +extern OCTINTERP_API string_vector +reverse_lookup_autoload (const std::string& nm); extern OCTINTERP_API octave_function * load_fcn_from_file (const std::string& file_name, @@ -122,7 +123,7 @@ extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst); // Global access to currently active lexer. -// FIXME -- to be removed after more parser+lexer refactoring. +// FIXME: to be removed after more parser+lexer refactoring. extern octave_base_lexer *LEXER; class
--- a/libinterp/parse-tree/pt-arg-list.cc +++ b/libinterp/parse-tree/pt-arg-list.cc @@ -127,7 +127,7 @@ static int num_indices = 0; DEFCONSTFUN (end, , , - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} end\n\ The magic index @qcode{\"end\"} refers to the last valid entry in an indexing\n\ operation.\n\ @@ -314,7 +314,7 @@ if (elt->is_identifier ()) { tree_identifier *id = dynamic_cast<tree_identifier *> (elt); - + retval.push_back (id->name ()); } else if (elt->is_index_expression ())
--- a/libinterp/parse-tree/pt-arg-list.h +++ b/libinterp/parse-tree/pt-arg-list.h @@ -47,11 +47,11 @@ tree_argument_list (void) : list_includes_magic_end (false), list_includes_magic_tilde (false), - simple_assign_lhs (false) { } + simple_assign_lhs (false) { } tree_argument_list (tree_expression *t) : list_includes_magic_end (false), list_includes_magic_tilde (false), - simple_assign_lhs (false) + simple_assign_lhs (false) { append (t); } ~tree_argument_list (void); @@ -59,15 +59,15 @@ bool has_magic_end (void) const; bool has_magic_tilde (void) const - { return list_includes_magic_tilde; } + { return list_includes_magic_tilde; } tree_expression *remove_front (void) - { - iterator p = begin (); - tree_expression *retval = *p; - erase (p); - return retval; - } + { + iterator p = begin (); + tree_expression *retval = *p; + erase (p); + return retval; + } void append (const element_type& s);
--- a/libinterp/parse-tree/pt-assign.cc +++ b/libinterp/parse-tree/pt-assign.cc @@ -48,7 +48,8 @@ tree_simple_assignment::tree_simple_assignment (tree_expression *le, tree_expression *re, bool plhs, int l, int c, octave_value::assign_op t) - : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t) { } + : tree_expression (l, c), lhs (le), rhs (re), preserve (plhs), etype (t) +{ } tree_simple_assignment::~tree_simple_assignment (void) { @@ -178,7 +179,8 @@ tree_multi_assignment::tree_multi_assignment (tree_argument_list *lst, tree_expression *r, bool plhs, int l, int c) - : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs) { } + : tree_expression (l, c), lhs (lst), rhs (r), preserve (plhs) +{ } tree_multi_assignment::~tree_multi_assignment (void) { @@ -201,7 +203,7 @@ return retval; } -// FIXME -- this works, but it would look a little better if +// FIXME: this works, but it would look a little better if // it were broken up into a couple of separate functions. octave_value_list @@ -228,8 +230,10 @@ // The following trick is used to keep rhs_val constant. const octave_value_list rhs_val1 = rhs->rvalue (n_out, &lvalue_list); - const octave_value_list rhs_val = (rhs_val1.length () == 1 && rhs_val1(0).is_cs_list () - ? rhs_val1(0).list_value () : rhs_val1); + const octave_value_list rhs_val = (rhs_val1.length () == 1 + && rhs_val1(0).is_cs_list () + ? rhs_val1(0).list_value () + : rhs_val1); if (error_state) return retval; @@ -261,7 +265,8 @@ // This won't do a copy. octave_value_list ovl = rhs_val.slice (k, nel); - ult.assign (octave_value::op_asn_eq, octave_value (ovl, true)); + ult.assign (octave_value::op_asn_eq, + octave_value (ovl, true)); if (! error_state) {
--- a/libinterp/parse-tree/pt-assign.h +++ b/libinterp/parse-tree/pt-assign.h @@ -143,7 +143,8 @@ void accept (tree_walker& tw); - octave_value::assign_op op_type (void) const { return octave_value::op_asn_eq; } + octave_value::assign_op op_type (void) const + { return octave_value::op_asn_eq; } private:
--- a/libinterp/parse-tree/pt-binop.cc +++ b/libinterp/parse-tree/pt-binop.cc @@ -279,7 +279,7 @@ } DEFUN (do_braindead_shortcircuit_evaluation, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} do_braindead_shortcircuit_evaluation ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} do_braindead_shortcircuit_evaluation (@var{new_val})\n\ @deftypefnx {Built-in Function} {} do_braindead_shortcircuit_evaluation (@var{new_val}, \"local\")\n\
--- a/libinterp/parse-tree/pt-binop.h +++ b/libinterp/parse-tree/pt-binop.h @@ -56,37 +56,36 @@ eligible_for_braindead_shortcircuit (false) { } ~tree_binary_expression (void) - { - delete op_lhs; - delete op_rhs; - } + { + delete op_lhs; + delete op_rhs; + } void mark_braindead_shortcircuit (const std::string& file) - { - if (etype == octave_value::op_el_and - || etype == octave_value::op_el_or) - { - if (file.empty ()) - warning_with_id ("Octave:possible-matlab-short-circuit-operator", - "possible Matlab-style short-circuit operator at line %d, column %d", - line (), column ()); - else - warning_with_id ("Octave:possible-matlab-short-circuit-operator", - "%s: possible Matlab-style short-circuit operator at line %d, column %d", - file.c_str (), line (), column ()); + { + if (etype == octave_value::op_el_and || etype == octave_value::op_el_or) + { + if (file.empty ()) + warning_with_id ("Octave:possible-matlab-short-circuit-operator", + "possible Matlab-style short-circuit operator at line %d, column %d", + line (), column ()); + else + warning_with_id ("Octave:possible-matlab-short-circuit-operator", + "%s: possible Matlab-style short-circuit operator at line %d, column %d", + file.c_str (), line (), column ()); - eligible_for_braindead_shortcircuit = true; + eligible_for_braindead_shortcircuit = true; - op_lhs->mark_braindead_shortcircuit (file); - op_rhs->mark_braindead_shortcircuit (file); - } - } + op_lhs->mark_braindead_shortcircuit (file); + op_rhs->mark_braindead_shortcircuit (file); + } + } bool has_magic_end (void) const - { - return ((op_lhs && op_lhs->has_magic_end ()) - || (op_rhs && op_rhs->has_magic_end ())); - } + { + return ((op_lhs && op_lhs->has_magic_end ()) + || (op_rhs && op_rhs->has_magic_end ())); + } bool is_binary_expression (void) const { return true; } @@ -138,11 +137,11 @@ public: enum type - { - unknown, - bool_and, - bool_or - }; + { + unknown, + bool_and, + bool_or + }; tree_boolean_expression (int l = -1, int c = -1, type t = unknown) : tree_binary_expression (l, c), etype (t) { }
--- a/libinterp/parse-tree/pt-bp.h +++ b/libinterp/parse-tree/pt-bp.h @@ -35,7 +35,7 @@ class tree_breakpoint : public tree_walker { - public: +public: enum action { set = 1, clear = 2, list = 3 }; @@ -136,7 +136,7 @@ int get_line (void) { return found ? line : 0; } - private: +private: void do_decl_command (tree_decl_command&);
--- a/libinterp/parse-tree/pt-cbinop.cc +++ b/libinterp/parse-tree/pt-cbinop.cc @@ -127,7 +127,8 @@ // Possibly contract and/or with negation. static octave_value::compound_binary_op -simplify_and_or_op (tree_expression *&a, tree_expression *&b, octave_value::binary_op op) +simplify_and_or_op (tree_expression *&a, tree_expression *&b, + octave_value::binary_op op) { octave_value::compound_binary_op retop = octave_value::unknown_compound_binary_op; @@ -185,8 +186,10 @@ } tree_binary_expression *ret = (ct == octave_value::unknown_compound_binary_op) - ? new tree_binary_expression (a, b, l, c, t) - : new tree_compound_binary_expression (a, b, l, c, t, ca, cb, ct); + ? new tree_binary_expression (a, b, l, c, t) + : new tree_compound_binary_expression (a, b, l, + c, t, ca, + cb, ct); return ret; }
--- a/libinterp/parse-tree/pt-check.cc +++ b/libinterp/parse-tree/pt-check.cc @@ -518,8 +518,7 @@ } void -tree_checker::visit_unwind_protect_command - (tree_unwind_protect_command& cmd) +tree_checker::visit_unwind_protect_command (tree_unwind_protect_command& cmd) { tree_statement_list *unwind_protect_code = cmd.body ();
--- a/libinterp/parse-tree/pt-colon.cc +++ b/libinterp/parse-tree/pt-colon.cc @@ -270,7 +270,8 @@ tree_colon_expression *new_ce = new tree_colon_expression (op_base ? op_base->dup (scope, context) : 0, op_limit ? op_limit->dup (scope, context) : 0, - op_increment ? op_increment->dup (scope, context) : 0, + op_increment ? op_increment->dup (scope, context) + : 0, line (), column ()); new_ce->copy_base (*new_ce);
--- a/libinterp/parse-tree/pt-colon.h +++ b/libinterp/parse-tree/pt-colon.h @@ -55,20 +55,20 @@ op_increment (inc), save_base (false) { } ~tree_colon_expression (void) - { - if (! save_base) - delete op_base; + { + if (! save_base) + delete op_base; - delete op_limit; - delete op_increment; - } + delete op_limit; + delete op_increment; + } bool has_magic_end (void) const - { - return ((op_base && op_base->has_magic_end ()) - || (op_limit && op_limit->has_magic_end ()) - || (op_increment && op_increment->has_magic_end ())); - } + { + return ((op_base && op_base->has_magic_end ()) + || (op_limit && op_limit->has_magic_end ()) + || (op_increment && op_increment->has_magic_end ())); + } void preserve_base (void) { save_base = true; }
--- a/libinterp/parse-tree/pt-const.cc +++ b/libinterp/parse-tree/pt-const.cc @@ -37,7 +37,8 @@ DEFINE_OCTAVE_ALLOCATOR2 (tree_constant, 1024); void -tree_constant::print (std::ostream& os, bool pr_as_read_syntax, bool pr_orig_text) +tree_constant::print (std::ostream& os, bool pr_as_read_syntax, + bool pr_orig_text) { if (pr_orig_text && ! orig_text.empty ()) os << orig_text;
--- a/libinterp/parse-tree/pt-decl.cc +++ b/libinterp/parse-tree/pt-decl.cc @@ -133,10 +133,11 @@ tree_command * tree_persistent_command::dup (symbol_table::scope_id scope, - symbol_table::context_id context) const + symbol_table::context_id context) const { return - new tree_persistent_command (init_list ? init_list->dup (scope, context) : 0, + new tree_persistent_command (init_list ? init_list->dup (scope, context) + : 0, line (), column ()); }
--- a/libinterp/parse-tree/pt-decl.h +++ b/libinterp/parse-tree/pt-decl.h @@ -118,14 +118,14 @@ tree_decl_init_list (tree_decl_elt *t) { append (t); } ~tree_decl_init_list (void) - { - while (! empty ()) - { - iterator p = begin (); - delete *p; - erase (p); - } - } + { + while (! empty ()) + { + iterator p = begin (); + delete *p; + erase (p); + } + } tree_decl_init_list *dup (symbol_table::scope_id scope, symbol_table::context_id context) const;
--- a/libinterp/parse-tree/pt-eval.cc +++ b/libinterp/parse-tree/pt-eval.cc @@ -252,11 +252,11 @@ octave_value init_val = expr->rvalue1 (); if (! error_state) - { - ult.assign (octave_value::op_asn_eq, init_val); + { + ult.assign (octave_value::op_asn_eq, init_val); - retval = true; - } + retval = true; + } } return retval; @@ -300,7 +300,7 @@ if (debug_mode) do_breakpoint (cmd.is_breakpoint ()); - // FIXME -- need to handle PARFOR loops here using cmd.in_parallel () + // FIXME: need to handle PARFOR loops here using cmd.in_parallel () // and cmd.maxproc_expr (); unwind_protect frame; @@ -705,8 +705,8 @@ if (! Vdebugging) octave_call_stack::set_location (stmt.line (), stmt.column ()); - // FIXME -- we need to distinguish functions from scripts to - // get this right. + // FIXME: we need to distinguish functions from scripts + // to get this right. if ((statement_context == script && ((Vecho_executing_commands & ECHO_SCRIPTS) || (Vecho_executing_commands & ECHO_FUNCTIONS))) @@ -724,12 +724,12 @@ if (debug_mode) do_breakpoint (expr->is_breakpoint ()); - // FIXME -- maybe all of this should be packaged in + // FIXME: maybe all of this should be packaged in // one virtual function that returns a flag saying whether // or not the expression will take care of binding ans and // printing the result. - // FIXME -- it seems that we should just have to + // FIXME: it seems that we should just have to // call expr->rvalue1 () and that should take care of // everything, binding ans as necessary? @@ -760,7 +760,7 @@ } catch (std::bad_alloc) { - // FIXME -- We want to use error_with_id here so that we set + // FIXME: We want to use error_with_id here so that we set // the error state, give users control over this error // message, and so that we set the error_state appropriately // so we'll get stack trace info when appropriate. But @@ -988,7 +988,7 @@ // The unwind_protects are popped off the stack in the reverse of // the order they are pushed on. - // FIXME -- these statements say that if we see a break or + // FIXME: these statements say that if we see a break or // return statement in the cleanup block, that we want to use the // new value of the breaking or returning flag instead of restoring // the previous value. Is that the right thing to do? I think so. @@ -1251,7 +1251,7 @@ } DEFUN (max_recursion_depth, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} max_recursion_depth ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} max_recursion_depth (@var{new_val})\n\ @deftypefnx {Built-in Function} {} max_recursion_depth (@var{new_val}, \"local\")\n\ @@ -1280,7 +1280,7 @@ */ DEFUN (silent_functions, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} silent_functions ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} silent_functions (@var{new_val})\n\ @deftypefnx {Built-in Function} {} silent_functions (@var{new_val}, \"local\")\n\
--- a/libinterp/parse-tree/pt-except.h +++ b/libinterp/parse-tree/pt-except.h @@ -40,8 +40,8 @@ public: tree_try_catch_command (int l = -1, int c = -1) - : tree_command (l, c), try_code (0), catch_code (0), expr_id (0), lead_comm (0), - mid_comm (0), trail_comm (0) { } + : tree_command (l, c), try_code (0), catch_code (0), expr_id (0), + lead_comm (0), mid_comm (0), trail_comm (0) { } tree_try_catch_command (tree_statement_list *tc, tree_statement_list *cc, tree_identifier *id,
--- a/libinterp/parse-tree/pt-exp.h +++ b/libinterp/parse-tree/pt-exp.h @@ -80,8 +80,8 @@ virtual octave_value_list rvalue (int nargout); - virtual octave_value_list rvalue (int nargout, - const std::list<octave_lvalue> *lvalue_list); + virtual octave_value_list + rvalue (int nargout, const std::list<octave_lvalue> *lvalue_list); virtual octave_lvalue lvalue (void); @@ -103,29 +103,29 @@ virtual void mark_braindead_shortcircuit (const std::string&) { } tree_expression *mark_in_parens (void) - { - num_parens++; - return this; - } + { + num_parens++; + return this; + } tree_expression *mark_postfix_indexed (void) - { - postfix_indexed = true; - return this; - } + { + postfix_indexed = true; + return this; + } tree_expression *set_print_flag (bool print) - { - print_flag = print; - return this; - } + { + print_flag = print; + return this; + } virtual void copy_base (const tree_expression& e) - { - num_parens = e.num_parens; - postfix_indexed = e.postfix_indexed; - print_flag = e.print_flag; - } + { + num_parens = e.num_parens; + postfix_indexed = e.postfix_indexed; + print_flag = e.print_flag; + } protected:
--- a/libinterp/parse-tree/pt-fcn-handle.cc +++ b/libinterp/parse-tree/pt-fcn-handle.cc @@ -88,7 +88,7 @@ octave_value tree_anon_fcn_handle::rvalue1 (int) { - // FIXME -- should CMD_LIST be limited to a single expression? + // FIXME: should CMD_LIST be limited to a single expression? // I think that is what Matlab does. tree_parameter_list *param_list = parameter_list (); @@ -112,7 +112,7 @@ if (curr_fcn) { - // FIXME -- maybe it would be better to just stash curr_fcn + // FIXME: maybe it would be better to just stash curr_fcn // instead of individual bits of info about it? uf->stash_parent_fcn_name (curr_fcn->name ());
--- a/libinterp/parse-tree/pt-id.cc +++ b/libinterp/parse-tree/pt-id.cc @@ -136,7 +136,7 @@ // The new tree_identifier object contains a symbol_record // entry from the duplicated scope. - // FIXME -- is this the best way? + // FIXME: is this the best way? symbol_table::symbol_record new_sym = symbol_table::find_symbol (name (), sc);
--- a/libinterp/parse-tree/pt-id.h +++ b/libinterp/parse-tree/pt-id.h @@ -156,12 +156,12 @@ bool is_black_hole (void) { return true; } tree_black_hole *dup (void) const - { return new tree_black_hole; } + { return new tree_black_hole; } octave_lvalue lvalue (void) - { - return octave_lvalue (); // black hole lvalue - } + { + return octave_lvalue (); // black hole lvalue + } }; #endif
--- a/libinterp/parse-tree/pt-idx.cc +++ b/libinterp/parse-tree/pt-idx.cc @@ -285,7 +285,8 @@ } octave_value_list -tree_index_expression::rvalue (int nargout, const std::list<octave_lvalue> *lvalue_list) +tree_index_expression::rvalue (int nargout, + const std::list<octave_lvalue> *lvalue_list) { octave_value_list retval; @@ -394,7 +395,8 @@ break; case '.': - idx.push_back (octave_value (get_struct_index (p_arg_nm, p_dyn_field))); + idx.push_back (octave_value (get_struct_index (p_arg_nm, + p_dyn_field))); break; default:
--- a/libinterp/parse-tree/pt-idx.h +++ b/libinterp/parse-tree/pt-idx.h @@ -85,7 +85,8 @@ octave_value_list rvalue (int nargout); - octave_value_list rvalue (int nargout, const std::list<octave_lvalue> *lvalue_list); + octave_value_list rvalue (int nargout, + const std::list<octave_lvalue> *lvalue_list); octave_lvalue lvalue (void);
--- a/libinterp/parse-tree/pt-loop.h +++ b/libinterp/parse-tree/pt-loop.h @@ -49,7 +49,7 @@ : tree_command (l, c), expr (0), list (0), lead_comm (0), trail_comm (0) #ifdef HAVE_LLVM - , compiled (0) + , compiled (0) #endif { } @@ -60,7 +60,7 @@ : tree_command (l, c), expr (e), list (0), lead_comm (lc), trail_comm (tc) #ifdef HAVE_LLVM - , compiled (0) + , compiled (0) #endif { } @@ -71,7 +71,7 @@ : tree_command (l, c), expr (e), list (lst), lead_comm (lc), trail_comm (tc) #ifdef HAVE_LLVM - , compiled (0) + , compiled (0) #endif { } @@ -180,7 +180,7 @@ : tree_command (l, c), parallel (false), lhs (0), expr (0), maxproc (0), list (0), lead_comm (0), trail_comm (0) #ifdef HAVE_LLVM - , compiled (0) + , compiled (0) #endif { } @@ -195,7 +195,7 @@ expr (re), maxproc (maxproc_arg), list (lst), lead_comm (lc), trail_comm (tc) #ifdef HAVE_LLVM - , compiled (0) + , compiled (0) #endif { }
--- a/libinterp/parse-tree/pt-mat.cc +++ b/libinterp/parse-tree/pt-mat.cc @@ -452,7 +452,8 @@ } else if (! dv.hvcat (this_elt_dv, 1)) { - eval_error ("horizontal dimensions mismatch", dv, this_elt_dv); + eval_error ("horizontal dimensions mismatch", + dv, this_elt_dv); break; } } @@ -747,7 +748,7 @@ octave_idx_type i = 0; for (tm_row_const::iterator q = row.begin (); q != row.end () && ! error_state; q++) - result(i++) = octave_value_extract<T> (*q); + result(i++) = octave_value_extract<T> (*q); return; } @@ -1368,7 +1369,7 @@ */ DEFUN (string_fill_char, args, nargout, - "-*- texinfo -*-\n\ + "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} string_fill_char ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} string_fill_char (@var{new_val})\n\ @deftypefnx {Built-in Function} {} string_fill_char (@var{new_val}, \"local\")\n\
--- a/libinterp/parse-tree/pt-misc.cc +++ b/libinterp/parse-tree/pt-misc.cc @@ -124,7 +124,8 @@ void tree_parameter_list::initialize_undefined_elements (const std::string& warnfor, - int nargout, const octave_value& val) + int nargout, + const octave_value& val) { bool warned = false; @@ -236,7 +237,7 @@ for (const_iterator p = begin (); p != end (); p++) { tree_decl_elt *elt = *p; - + retval.push_back (elt->name ()); }
--- a/libinterp/parse-tree/pt-misc.h +++ b/libinterp/parse-tree/pt-misc.h @@ -48,10 +48,10 @@ public: enum in_or_out - { - in = 1, - out = 2 - }; + { + in = 1, + out = 2 + }; tree_parameter_list (void) : marked_for_varargs (0) { } @@ -83,7 +83,8 @@ std::list<std::string> variable_names (void) const; - octave_value_list convert_to_const_vector (int nargout, const Cell& varargout); + octave_value_list convert_to_const_vector (int nargout, + const Cell& varargout); tree_parameter_list *dup (symbol_table::scope_id scope, symbol_table::context_id context) const;
--- a/libinterp/parse-tree/pt-pr-code.cc +++ b/libinterp/parse-tree/pt-pr-code.cc @@ -1037,8 +1037,7 @@ } void -tree_print_code::visit_unwind_protect_command - (tree_unwind_protect_command& cmd) +tree_print_code::visit_unwind_protect_command (tree_unwind_protect_command& cmd) { print_comment_list (cmd.leading_comment ());
--- a/libinterp/parse-tree/pt-select.h +++ b/libinterp/parse-tree/pt-select.h @@ -95,14 +95,14 @@ tree_if_command_list (tree_if_clause *t) { append (t); } ~tree_if_command_list (void) - { - while (! empty ()) - { - iterator p = begin (); - delete *p; - erase (p); - } - } + { + while (! empty ()) + { + iterator p = begin (); + delete *p; + erase (p); + } + } tree_if_command_list *dup (symbol_table::scope_id scope, symbol_table::context_id context) const; @@ -225,14 +225,14 @@ tree_switch_case_list (tree_switch_case *t) { append (t); } ~tree_switch_case_list (void) - { - while (! empty ()) - { - iterator p = begin (); - delete *p; - erase (p); - } - } + { + while (! empty ()) + { + iterator p = begin (); + delete *p; + erase (p); + } + } tree_switch_case_list *dup (symbol_table::scope_id scope, symbol_table::context_id context) const;
--- a/libinterp/parse-tree/pt-stmt.h +++ b/libinterp/parse-tree/pt-stmt.h @@ -138,14 +138,14 @@ script_body (false) { append (s); } ~tree_statement_list (void) - { - while (! empty ()) - { - iterator p = begin (); - delete *p; - erase (p); - } - } + { + while (! empty ()) + { + iterator p = begin (); + delete *p; + erase (p); + } + } void mark_as_function_body (void) { function_body = true; }
--- a/libinterp/parse-tree/token.h +++ b/libinterp/parse-tree/token.h @@ -33,34 +33,34 @@ public: enum token_type - { - generic_token, - keyword_token, - string_token, - double_token, - ettype_token, - sym_rec_token, - scls_rec_token, - meta_rec_token - }; + { + generic_token, + keyword_token, + string_token, + double_token, + ettype_token, + sym_rec_token, + scls_rec_token, + meta_rec_token + }; enum end_tok_type - { - simple_end, - classdef_end, - enumeration_end, - events_end, - for_end, - function_end, - if_end, - methods_end, - parfor_end, - properties_end, - switch_end, - while_end, - try_catch_end, - unwind_protect_end - }; + { + simple_end, + classdef_end, + enumeration_end, + events_end, + for_end, + function_end, + if_end, + methods_end, + parfor_end, + properties_end, + switch_end, + while_end, + try_catch_end, + unwind_protect_end + }; token (int tv, int l = -1, int c = -1); token (int tv, bool is_keyword, int l = -1, int c = -1); @@ -130,23 +130,23 @@ int tok_val; token_type type_tag; union + { + std::string *str; + double num; + end_tok_type et; + symbol_table::symbol_record *sr; + struct { - std::string *str; - double num; - end_tok_type et; - symbol_table::symbol_record *sr; - struct - { - symbol_table::symbol_record *mr; - symbol_table::symbol_record *cr; - symbol_table::symbol_record *pr; - } sc; - struct - { - symbol_table::symbol_record *cr; - symbol_table::symbol_record *pr; - } mc; - }; + symbol_table::symbol_record *mr; + symbol_table::symbol_record *cr; + symbol_table::symbol_record *pr; + } sc; + struct + { + symbol_table::symbol_record *cr; + symbol_table::symbol_record *pr; + } mc; + }; std::string orig_text; };
--- a/libinterp/version.cc +++ b/libinterp/version.cc @@ -34,7 +34,7 @@ { return "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or\n\ FITNESS FOR A PARTICULAR PURPOSE." - + extra_info; + + extra_info; } static std::string @@ -47,7 +47,7 @@ octave_www_statement (bool html) { return "Additional information about Octave is available at " - + format_url (html, "http://www.octave.org."); + + format_url (html, "http://www.octave.org."); } std::string @@ -55,14 +55,14 @@ { return "Please contribute if you find this software useful.\n\ For more information, visit " - + format_url (html, "http://www.octave.org/get-involved.html"); + + format_url (html, "http://www.octave.org/get-involved.html"); } std::string octave_bugs_statement (bool html) { return "Read " + format_url (html, "http://www.octave.org/bugs.html") - + " to learn how to submit bug reports."; + + " to learn how to submit bug reports."; } std::string @@ -83,12 +83,12 @@ std::string sep = html ? "\n</p>\n<p>\n" : "\n\n"; return octave_name_version_and_copyright () - + br - + "This is free software; see the source code for copying conditions." - + br - + octave_warranty_statement (extra_info) - + sep - + "Octave was configured for \"" OCTAVE_CANONICAL_HOST_TYPE "\"."; + + br + + "This is free software; see the source code for copying conditions." + + br + + octave_warranty_statement (extra_info) + + sep + + "Octave was configured for \"" OCTAVE_CANONICAL_HOST_TYPE "\"."; } std::string @@ -103,13 +103,13 @@ msg = "<p>\n"; msg += octave_name_version_copyright_copying_and_warranty (html, extra_info) - + sep - + octave_www_statement (html) - + sep - + octave_contrib_statement (html) - + sep - + octave_bugs_statement (html) - + (html ? "\n</p>" : ""); + + sep + + octave_www_statement (html) + + sep + + octave_contrib_statement (html) + + sep + + octave_bugs_statement (html) + + (html ? "\n</p>" : ""); return msg; }