Mercurial > octave
annotate libinterp/octave-value/ov-base-int.cc @ 31771:21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
* mk-opts.pl, external.txi, embedded.cc, make_int.cc, standalone.cc,
standalonebuiltin.cc, BaseControl.cc, BaseControl.h, ButtonControl.cc,
ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc,
Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h,
GenericEventNotify.h, KeyMap.cc, ListBoxControl.cc, ListBoxControl.h,
Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, Object.cc, Object.h,
ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc,
PushTool.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h, TextEdit.h,
ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h,
ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, gl-select.cc,
gl-select.h, qopengl-functions.h, qt-graphics-toolkit.h, qdialog.cpp,
qfontdialog.cpp, qprintdialog_win.cpp, liboctgui-build-info.h,
liboctgui-build-info.in.cc, color-picker.cc, color-picker.h, command-widget.cc,
command-widget.h, community-news.cc, community-news.h, dialog.cc, dialog.h,
documentation-bookmarks.cc, documentation-bookmarks.h,
documentation-dock-widget.cc, documentation-dock-widget.h, documentation.cc,
documentation.h, dw-main-window.cc, dw-main-window.h,
external-editor-interface.cc, external-editor-interface.h,
files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc,
find-files-dialog.h, find-files-model.cc, find-files-model.h,
gui-preferences.cc, gui-preferences.h, gui-settings.cc, gui-settings.h,
history-dock-widget.cc, history-dock-widget.h, interpreter-qobject.cc,
interpreter-qobject.h, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h,
octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h,
news-reader.cc, news-reader.h, octave-dock-widget.cc, octave-dock-widget.h,
octave-qobject.cc, octave-qobject.h, qt-application.cc, qt-application.h,
qt-interpreter-events.cc, qt-interpreter-events.h, release-notes.cc,
release-notes.h, set-path-dialog.cc, set-path-dialog.h, set-path-model.cc,
set-path-model.h, settings-dialog.cc, settings-dialog.h,
shortcuts-tree-widget.cc, shortcuts-tree-widget.h, tab-bar.cc, tab-bar.h,
terminal-dock-widget.cc, terminal-dock-widget.h, variable-editor-model.cc,
variable-editor-model.h, variable-editor.cc, variable-editor.h,
welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h,
workspace-view.cc, workspace-view.h, build-env.h, Cell.cc, Cell.h,
__contourc__.cc, __magick_read__.cc, auto-shlib.cc, auto-shlib.h,
base-text-renderer.h, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, debug.cc, defaults.cc, defaults.h, defun.cc,
display.cc, display.h, dynamic-ld.cc, dynamic-ld.h, environment.cc,
environment.h, error.cc, error.h, errwarn.cc, errwarn.h, event-manager.cc,
event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h,
ft-text-renderer.cc, ft-text-renderer.h, genprops.awk, gh-manager.cc,
gh-manager.h, gl-render.cc, gl-render.h, gl2ps-print.cc, graphics-toolkit.h,
graphics.cc, graphics.in.h, gtk-manager.cc, gtk-manager.h, help.cc, help.h,
hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h,
interpreter.cc, interpreter.h, jsondecode.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
ls-hdf5.cc, ls-hdf5.h, mxarray.h, oct-errno.h, oct-errno.in.cc, oct-fstrm.cc,
oct-fstrm.h, oct-handle.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc,
oct-iostrm.h, oct-map.cc, oct-map.h, oct-opengl.h, oct-prcstrm.cc,
oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-process.h, oct-stdstrm.h,
oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h,
oct-tex-lexer.in.ll, pager.cc, pager.h, pr-flt-fmt.cc, pr-flt-fmt.h,
pr-output.cc, pr-output.h, procstream.cc, procstream.h, settings.cc,
settings.h, sighandlers.cc, sighandlers.h, stack-frame.cc, stack-frame.h,
svd.cc, syminfo.cc, syminfo.h, symrec.cc, symrec.h, symscope.cc, symscope.h,
symtab.cc, symtab.h, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h,
text-renderer.cc, text-renderer.h, toplev.cc, url-handle-manager.cc,
url-handle-manager.h, variables.cc, xpow.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, audiodevinfo.cc, gzip.cc,
liboctinterp-build-info.h, liboctinterp-build-info.in.cc,
mk-build-env-features.sh, mk-builtins.pl, cdef-class.cc, cdef-class.h,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc,
ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc,
ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.cc, ov-base.h,
ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc,
ov-bool.h, ov-builtin.cc, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc,
ov-ch-mat.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h,
ov-colon.h, ov-complex.cc, ov-complex.h, ov-cs-list.h, ov-cx-diag.cc,
ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h,
ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.cc,
ov-fcn.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h,
ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h,
ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-flt-re-mat.h,
ov-intx.h, ov-java.cc, ov-java.h, ov-lazy-idx.cc, ov-lazy-idx.h,
ov-legacy-range.cc, ov-legacy-range.h, ov-magic-int.cc, ov-magic-int.h,
ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-null-mat.h, ov-oncleanup.cc,
ov-oncleanup.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc,
ov-re-diag.h, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h,
ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-str-mat.h, ov-struct.cc,
ov-struct.h, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc,
ov.h, ovl.cc, ovl.h, octave.cc, octave.h, anon-fcn-validator.h, bp-table.cc,
bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll,
oct-lvalue.cc, oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc,
pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h,
pt-binop.cc, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.cc,
pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc,
pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc,
pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.h, pt-misc.cc, pt-misc.h,
pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h,
pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h,
pt-walk.h, pt.cc, pt.h, token.cc, token.h, usage.h, Array-base.cc, Array.h,
CColVector.cc, CColVector.h, CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc,
CMatrix.h, CNDArray.cc, CNDArray.h, CRowVector.cc, CRowVector.h, CSparse.cc,
CSparse.h, DiagArray2.cc, DiagArray2.h, MArray.cc, MArray.h, MDiagArray2.h,
MSparse.h, MatrixType.cc, MatrixType.h, PermMatrix.cc, PermMatrix.h, Range.cc,
Range.h, Sparse-b.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h,
boolNDArray.cc, boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.h,
chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc, dDiagMatrix.h,
dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc, dRowVector.h,
dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h, fCColVector.cc,
fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc, fCMatrix.h,
fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h, fColVector.cc,
fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc, fMatrix.h,
fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc,
idx-vector.h, intNDArray.cc, intNDArray.h, liboctave-build-info.h,
liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h,
DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h, DASSL.cc, DASSL.h, DET.h,
EIG.h, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h, ODES.h, ODESFunc.h, Quad.h,
aepbalance.cc, aepbalance.h, base-dae.h, base-de.h, chol.cc, chol.h,
eigs-base.cc, fEIG.h, gepbalance.h, gsvd.cc, gsvd.h, hess.h, lu.cc, lu.h,
oct-fftw.cc, oct-fftw.h, oct-rand.cc, oct-rand.h, oct-spparms.cc,
oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randmtzig.cc, randmtzig.h, schur.h,
sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc,
sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h,
file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h,
lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h,
oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc,
oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h,
action-container.h, base-list.h, caseless-str.h, cmd-edit.cc, cmd-edit.h,
cmd-hist.cc, cmd-hist.h, data-conv.cc, file-info.h, glob-match.cc,
glob-match.h, kpse.cc, kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h,
lo-hash.cc, lo-hash.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-regexp.h,
oct-inttypes.cc, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h,
oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sort.h, oct-sparse.cc,
octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc,
singleton-cleanup.cc, singleton-cleanup.h, str-vec.cc, str-vec.h,
unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h, version.cc,
version.in.h, cxx-signal-helpers.cc, acinclude.m4, main-cli.cc, main-gui.cc,
main.in.cc, mkoctfile.in.cc, octave-build-info.h, octave-build-info.in.cc,
octave-config.in.cc, octave-svgconvert.cc, shared-fcns.h:
maint: Eliminate "(void)" in C++ function prototypes/declarations.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 24 Jan 2023 17:19:44 -0800 |
parents | 597f3ee61a48 |
children | 2f3b54f81947 2e484f9f1f18 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31607
diff
changeset
|
3 // Copyright (C) 2004-2023 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
4903 | 25 |
21690
b6a686543080
Only include config.h in files that are compiled separately.
John W. Eaton <jwe@octave.org>
parents:
21660
diff
changeset
|
26 // This file should not include config.h. It is only included in other |
b6a686543080
Only include config.h in files that are compiled separately.
John W. Eaton <jwe@octave.org>
parents:
21660
diff
changeset
|
27 // C++ source files that should have included config.h before including |
b6a686543080
Only include config.h in files that are compiled separately.
John W. Eaton <jwe@octave.org>
parents:
21660
diff
changeset
|
28 // this file. |
4903 | 29 |
25438
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
30 #include <istream> |
15215
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
31 #include <limits> |
25438
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
32 #include <ostream> |
cb1606f78f6b
prefer <istream>, <ostream>, or <iosfwd> to <iostream> where possible
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
33 #include <sstream> |
4903 | 34 #include <vector> |
35 | |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
36 #include "dNDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
37 #include "fNDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
38 #include "int8NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
39 #include "int16NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
40 #include "int32NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
41 #include "int64NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
42 #include "uint8NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
43 #include "uint16NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
44 #include "uint32NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
45 #include "uint64NDArray.h" |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
46 |
4903 | 47 #include "lo-ieee.h" |
48 #include "lo-utils.h" | |
49 #include "mx-base.h" | |
50 #include "quit.h" | |
8377
25bc2d31e1bf
improve OCTAVE_LOCAL_BUFFER
Jaroslav Hajek <highegg@gmail.com>
parents:
7534
diff
changeset
|
51 #include "oct-locbuf.h" |
4903 | 52 |
53 #include "defun.h" | |
21100
e39e05d90788
Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents:
21022
diff
changeset
|
54 #include "errwarn.h" |
20940
48b2ad5ee801
maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents:
20893
diff
changeset
|
55 #include "ovl.h" |
4903 | 56 #include "oct-lvalue.h" |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
57 #include "oct-hdf5.h" |
4944 | 58 #include "oct-stream.h" |
4903 | 59 #include "ops.h" |
60 #include "ov-base.h" | |
61 #include "ov-base-mat.h" | |
62 #include "ov-base-mat.cc" | |
63 #include "ov-base-scalar.h" | |
64 #include "ov-base-scalar.cc" | |
65 #include "ov-base-int.h" | |
66 #include "ov-int-traits.h" | |
67 #include "pr-output.h" | |
68 #include "variables.h" | |
69 | |
70 #include "byte-swap.h" | |
20447
c6224b4e7774
maint: Rename instances of LS_ASCII to LS_TEXT for clarity.
Rik <rik@octave.org>
parents:
20228
diff
changeset
|
71 #include "ls-oct-text.h" |
4903 | 72 #include "ls-utils.h" |
73 #include "ls-hdf5.h" | |
74 | |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
75 // We have all the machinery below (octave_base_int_helper and |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
76 // octave_base_int_helper_traits) to avoid a few warnings from GCC |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
77 // about comparisons always false due to limited range of data types. |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
78 // Ugh. The cure may be worse than the disease. |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
79 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
80 template <typename T, bool is_signed = true, bool can_be_too_big = true> |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
81 struct octave_base_int_helper |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
82 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
29607
diff
changeset
|
83 public: |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
84 static bool |
15215
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
85 char_value_out_of_range (T val) |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
86 { |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
87 return val < 0 || val > std::numeric_limits<unsigned char>::max (); |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
88 } |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
89 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
90 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
91 template <typename T> |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
92 struct octave_base_int_helper<T, false, false> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
93 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
29607
diff
changeset
|
94 public: |
9149
7120fbbecf97
ov-base-int.cc: correct result for template specialization
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
95 static bool char_value_out_of_range (T) { return false; } |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
96 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
97 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
98 template <typename T> |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
99 struct octave_base_int_helper<T, false, true> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
100 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
29607
diff
changeset
|
101 public: |
15215
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
102 static bool char_value_out_of_range (T val) |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
103 { |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
104 return val > std::numeric_limits<unsigned char>::max (); |
9020dddc925a
use std::numeric_limits for integer max and min values
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
105 } |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
106 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
107 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
108 template <typename T> |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
109 struct octave_base_int_helper<T, true, false> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
110 { |
30155
14b098a6ba46
maint: Use public: qualifier in structs that are really classes.
Rik <rik@octave.org>
parents:
29607
diff
changeset
|
111 public: |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
112 static bool char_value_out_of_range (T val) { return val < 0; } |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
113 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
114 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
115 // For all types other than char, signed char, and unsigned char, we |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
116 // assume that the upper limit for the range of allowable values is |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
117 // larger than the range for unsigned char. If that's not true, we |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
118 // are still OK, but will see the warnings again for any other types |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
119 // that do not meet this assumption. |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
120 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
121 template <typename T> |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
122 struct octave_base_int_helper_traits |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
123 { |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
124 static const bool can_be_larger_than_uchar_max = true; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
125 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
126 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
127 template <> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
128 struct octave_base_int_helper_traits<char> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
129 { |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
130 static const bool can_be_larger_than_uchar_max = false; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
131 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
132 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
133 template <> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
134 struct octave_base_int_helper_traits<signed char> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
135 { |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
136 static const bool can_be_larger_than_uchar_max = false; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
137 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
138 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
139 template <> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
140 struct octave_base_int_helper_traits<unsigned char> |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
141 { |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
142 static const bool can_be_larger_than_uchar_max = false; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
143 }; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
144 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
145 template <typename T> |
5759 | 146 octave_base_value * |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
147 octave_base_int_matrix<T>::try_narrowing_conversion () |
4903 | 148 { |
23457
21baad6b35c4
maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
149 octave_base_value *retval = nullptr; |
4903 | 150 |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
151 if (this->m_matrix.numel () == 1) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
152 retval = new typename octave_value_int_traits<T>::scalar_type |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
153 (this->m_matrix (0)); |
4903 | 154 |
155 return retval; | |
156 } | |
157 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
158 template <typename T> |
5992 | 159 octave_value |
160 octave_base_int_matrix<T>::convert_to_str_internal (bool, bool, char type) const | |
161 { | |
162 octave_value retval; | |
163 dim_vector dv = this->dims (); | |
164 octave_idx_type nel = dv.numel (); | |
165 | |
166 charNDArray chm (dv); | |
167 | |
168 bool warned = false; | |
169 | |
170 for (octave_idx_type i = 0; i < nel; i++) | |
171 { | |
10142
829e69ec3110
make OCTAVE_QUIT a function
Jaroslav Hajek <highegg@gmail.com>
parents:
9892
diff
changeset
|
172 octave_quit (); |
5992 | 173 |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
174 typename T::element_type tmp = this->m_matrix(i); |
5992 | 175 |
8918
f5408862892f
Consistently use element_type in the array classes.
Jason Riedy <jason@acm.org>
parents:
8377
diff
changeset
|
176 typedef typename T::element_type::val_type val_type; |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
177 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
178 val_type ival = tmp.value (); |
5992 | 179 |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
180 static const bool is_signed = std::numeric_limits<val_type>::is_signed; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
181 static const bool can_be_larger_than_uchar_max |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
182 = octave_base_int_helper_traits<val_type>::can_be_larger_than_uchar_max; |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
183 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
184 if (octave_base_int_helper<val_type, is_signed, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
185 can_be_larger_than_uchar_max>::char_value_out_of_range (ival)) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
186 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
187 // FIXME: is there something better we could do? |
5992 | 188 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
189 ival = 0; |
5992 | 190 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
191 if (! warned) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
192 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
193 ::warning ("range error for conversion to character value"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
194 warned = true; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
195 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
196 } |
5992 | 197 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
198 chm (i) = static_cast<char> (ival); |
5992 | 199 } |
200 | |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9149
diff
changeset
|
201 retval = octave_value (chm, type); |
5992 | 202 |
203 return retval; | |
204 } | |
205 | |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
206 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
207 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
208 octave_base_int_matrix<MT>::as_double () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
209 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
210 return NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
211 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
212 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
213 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
214 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
215 octave_base_int_matrix<MT>::as_single () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
216 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
217 return FloatNDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
218 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
219 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
220 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
221 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
222 octave_base_int_matrix<MT>::as_int8 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
223 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
224 return int8NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
225 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
226 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
227 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
228 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
229 octave_base_int_matrix<MT>::as_int16 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
230 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
231 return int16NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
232 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
233 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
234 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
235 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
236 octave_base_int_matrix<MT>::as_int32 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
237 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
238 return int32NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
239 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
240 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
241 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
242 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
243 octave_base_int_matrix<MT>::as_int64 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
244 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
245 return int64NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
246 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
247 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
248 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
249 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
250 octave_base_int_matrix<MT>::as_uint8 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
251 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
252 return uint8NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
253 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
254 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
255 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
256 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
257 octave_base_int_matrix<MT>::as_uint16 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
258 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
259 return uint16NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
260 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
261 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
262 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
263 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
264 octave_base_int_matrix<MT>::as_uint32 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
265 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
266 return uint32NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
267 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
268 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
269 template <typename MT> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
270 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
271 octave_base_int_matrix<MT>::as_uint64 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
272 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
273 return uint64NDArray (this->m_matrix); |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
274 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
275 |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
276 template <typename T> |
24745
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
277 std::string |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
278 octave_base_int_matrix<T>::edit_display (const float_display_format& fmt, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
279 octave_idx_type i, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
280 octave_idx_type j) const |
24745
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
281 { |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
282 std::ostringstream buf; |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
283 octave_print_internal (buf, fmt, this->m_matrix(i, j)); |
24745
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
284 return buf.str (); |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
285 } |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
286 |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
287 template <typename T> |
4903 | 288 bool |
6974 | 289 octave_base_int_matrix<T>::save_ascii (std::ostream& os) |
4903 | 290 { |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
291 dim_vector dv = this->dims (); |
4903 | 292 |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
293 os << "# ndims: " << dv.ndims () << "\n"; |
4903 | 294 |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
295 for (int i = 0; i < dv.ndims (); i++) |
23807
336f89b6208b
Use character literals 'c' rather than string literals "c" when possible.
Rik <rik@octave.org>
parents:
23795
diff
changeset
|
296 os << ' ' << dv(i); |
4903 | 297 |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
298 os << "\n" << this->m_matrix; |
4903 | 299 |
300 return true; | |
301 } | |
302 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
303 template <typename T> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
304 bool |
4903 | 305 octave_base_int_matrix<T>::load_ascii (std::istream& is) |
306 { | |
307 int mdims = 0; | |
308 | |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
309 if (! extract_keyword (is, "ndims", mdims, true)) |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
310 error ("load: failed to extract number of dimensions"); |
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
311 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
312 if (mdims < 0) |
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
313 error ("load: failed to extract number of rows and columns"); |
4903 | 314 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
315 dim_vector dv; |
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
316 dv.resize (mdims); |
4903 | 317 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
318 for (int i = 0; i < mdims; i++) |
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
319 is >> dv(i); |
4903 | 320 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
321 T tmp(dv); |
4903 | 322 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
323 is >> tmp; |
20962
3aa293be0e8d
maint: Invert simple conditionals in if/else/error paradigm.
Rik <rik@octave.org>
parents:
20955
diff
changeset
|
324 |
20978
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
325 if (! is) |
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
326 error ("load: failed to load matrix constant"); |
a5b500efca9f
maint: invert if/else/error instances.
John W. Eaton <jwe@octave.org>
parents:
20962
diff
changeset
|
327 |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
328 this->m_matrix = tmp; |
4903 | 329 |
21124
95f8c8cdbffe
maint: Eliminate 'bool success' variable where possible.
Rik <rik@octave.org>
parents:
21102
diff
changeset
|
330 return true; |
4903 | 331 } |
332 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
333 template <typename T> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
334 bool |
26399
586413770c7f
pass save_as_floats by value in octave_value save_binary functions
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
335 octave_base_int_matrix<T>::save_binary (std::ostream& os, bool) |
4903 | 336 { |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
337 dim_vector dv = this->dims (); |
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
338 if (dv.ndims () < 1) |
4903 | 339 return false; |
340 | |
341 // Use negative value for ndims to differentiate with old format!! | |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
342 int32_t tmp = - dv.ndims (); |
5760 | 343 os.write (reinterpret_cast<char *> (&tmp), 4); |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
344 for (int i=0; i < dv.ndims (); i++) |
4903 | 345 { |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
346 tmp = dv(i); |
5760 | 347 os.write (reinterpret_cast<char *> (&tmp), 4); |
4903 | 348 } |
349 | |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
350 os.write (reinterpret_cast<const char *> (this->m_matrix.data ()), |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
351 this->byte_size ()); |
4903 | 352 |
353 return true; | |
354 } | |
355 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
356 template <typename T> |
4903 | 357 bool |
358 octave_base_int_matrix<T>::load_binary (std::istream& is, bool swap, | |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21691
diff
changeset
|
359 octave::mach_info::float_format) |
4903 | 360 { |
5828 | 361 int32_t mdims; |
5760 | 362 if (! is.read (reinterpret_cast<char *> (&mdims), 4)) |
4903 | 363 return false; |
364 if (swap) | |
4944 | 365 swap_bytes<4> (&mdims); |
4917 | 366 if (mdims >= 0) |
367 return false; | |
4903 | 368 |
4917 | 369 mdims = - mdims; |
5828 | 370 int32_t di; |
4917 | 371 dim_vector dv; |
372 dv.resize (mdims); | |
4903 | 373 |
4917 | 374 for (int i = 0; i < mdims; i++) |
4903 | 375 { |
5760 | 376 if (! is.read (reinterpret_cast<char *> (&di), 4)) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
377 return false; |
4903 | 378 if (swap) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
379 swap_bytes<4> (&di); |
4917 | 380 dv(i) = di; |
4903 | 381 } |
382 | |
5157 | 383 // Convert an array with a single dimension to be a row vector. |
384 // Octave should never write files like this, other software | |
385 // might. | |
386 | |
387 if (mdims == 1) | |
388 { | |
389 mdims = 2; | |
390 dv.resize (mdims); | |
391 dv(1) = dv(0); | |
392 dv(0) = 1; | |
393 } | |
394 | |
4917 | 395 T m (dv); |
396 | |
5760 | 397 if (! is.read (reinterpret_cast<char *> (m.fortran_vec ()), m.byte_size ())) |
4917 | 398 return false; |
4903 | 399 |
4917 | 400 if (swap) |
401 { | |
402 int nel = dv.numel (); | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
403 int bytes = nel / m.byte_size (); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
404 for (int i = 0; i < nel; i++) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
405 switch (bytes) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
406 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
407 case 8: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
408 swap_bytes<8> (&m(i)); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
409 break; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
410 case 4: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
411 swap_bytes<4> (&m(i)); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
412 break; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
413 case 2: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
414 swap_bytes<2> (&m(i)); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
415 break; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
416 case 1: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
417 default: |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
418 break; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
419 } |
4917 | 420 } |
421 | |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
422 this->m_matrix = m; |
4903 | 423 return true; |
424 } | |
425 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
426 template <typename T> |
4903 | 427 bool |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
428 octave_base_int_matrix<T>::save_hdf5_internal (octave_hdf5_id loc_id, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
429 octave_hdf5_id save_type, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
430 const char *name, bool) |
4903 | 431 { |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
432 bool retval = false; |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
433 |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
434 #if defined (HAVE_HDF5) |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
435 |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
436 hid_t save_type_hid = save_type; |
4932 | 437 dim_vector dv = this->dims (); |
4903 | 438 int empty = save_hdf5_empty (loc_id, name, dv); |
439 if (empty) | |
440 return (empty > 0); | |
441 | |
21660
53728df3e4c9
maint: for clarity, call ndims() rather than length() on dimension vectors.
Rik <rik@octave.org>
parents:
21301
diff
changeset
|
442 int rank = dv.ndims (); |
18100
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
443 hid_t space_hid, data_hid; |
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
444 space_hid = data_hid = -1; |
4903 | 445 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); |
446 | |
447 // Octave uses column-major, while HDF5 uses row-major ordering | |
448 for (int i = 0; i < rank; i++) | |
20218
b2100e1659ac
maint: Use cuddled parentheses when indexing dimension_vectors.
Rik <rik@octave.org>
parents:
19875
diff
changeset
|
449 hdims[i] = dv(rank-i-1); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
450 |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23457
diff
changeset
|
451 space_hid = H5Screate_simple (rank, hdims, nullptr); |
4903 | 452 |
453 if (space_hid < 0) return false; | |
21211
2cf8bc5c7017
use "#if defined (HAVE_FOO)" instead of "#if HAVE_FOO" for feature tests
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
454 #if defined (HAVE_HDF5_18) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
455 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
456 octave_H5P_DEFAULT, octave_H5P_DEFAULT, |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
457 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
458 #else |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
459 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
460 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
461 #endif |
4903 | 462 if (data_hid < 0) |
463 { | |
464 H5Sclose (space_hid); | |
465 return false; | |
466 } | |
467 | |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
468 retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL, |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
469 octave_H5P_DEFAULT, this->m_matrix.data ()) >= 0; |
4903 | 470 |
471 H5Dclose (data_hid); | |
472 H5Sclose (space_hid); | |
473 | |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
474 #else |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
475 octave_unused_parameter (loc_id); |
24580
a276f008ea74
avoid unused variable warnings if compiling without HDF5 (bug #52850)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
476 octave_unused_parameter (save_type); |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
477 octave_unused_parameter (name); |
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
478 |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
479 this->warn_save ("hdf5"); |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
480 #endif |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
481 |
4903 | 482 return retval; |
483 } | |
484 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
485 template <typename T> |
4903 | 486 bool |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
487 octave_base_int_matrix<T>::load_hdf5_internal (octave_hdf5_id loc_id, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
488 octave_hdf5_id save_type, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
489 const char *name) |
4903 | 490 { |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
491 bool retval = false; |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
492 |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
493 #if defined (HAVE_HDF5) |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
494 |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
495 hid_t save_type_hid = save_type; |
4903 | 496 dim_vector dv; |
497 int empty = load_hdf5_empty (loc_id, name, dv); | |
498 if (empty > 0) | |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
499 this->m_matrix.resize (dv); |
4903 | 500 if (empty) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
501 return (empty > 0); |
4903 | 502 |
21211
2cf8bc5c7017
use "#if defined (HAVE_FOO)" instead of "#if HAVE_FOO" for feature tests
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
503 #if defined (HAVE_HDF5_18) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
504 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
505 #else |
4903 | 506 hid_t data_hid = H5Dopen (loc_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
507 #endif |
4903 | 508 hid_t space_id = H5Dget_space (data_hid); |
509 | |
510 hsize_t rank = H5Sget_simple_extent_ndims (space_id); | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
511 |
4903 | 512 if (rank < 1) |
513 { | |
514 H5Sclose (space_id); | |
515 H5Dclose (data_hid); | |
516 return false; | |
517 } | |
518 | |
519 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); | |
520 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank); | |
521 | |
522 H5Sget_simple_extent_dims (space_id, hdims, maxdims); | |
523 | |
524 // Octave uses column-major, while HDF5 uses row-major ordering | |
525 if (rank == 1) | |
526 { | |
527 dv.resize (2); | |
528 dv(0) = 1; | |
529 dv(1) = hdims[0]; | |
530 } | |
531 else | |
532 { | |
533 dv.resize (rank); | |
534 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
535 dv(j) = hdims[i]; |
4903 | 536 } |
537 | |
4917 | 538 T m (dv); |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
539 if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
540 octave_H5P_DEFAULT, m.fortran_vec ()) >= 0) |
4903 | 541 { |
542 retval = true; | |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
543 this->m_matrix = m; |
4903 | 544 } |
545 | |
546 H5Sclose (space_id); | |
547 H5Dclose (data_hid); | |
548 | |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
549 #else |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
550 octave_unused_parameter (loc_id); |
24580
a276f008ea74
avoid unused variable warnings if compiling without HDF5 (bug #52850)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
551 octave_unused_parameter (save_type); |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
552 octave_unused_parameter (name); |
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
553 |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
554 this->warn_load ("hdf5"); |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
555 #endif |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
556 |
4903 | 557 return retval; |
558 } | |
559 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
560 template <typename T> |
4903 | 561 void |
562 octave_base_int_matrix<T>::print_raw (std::ostream& os, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
563 bool pr_as_read_syntax) const |
4903 | 564 { |
31138
b3ca7f891750
maint: use "m_" prefix for member variables in class octave_base_matrix.
Rik <rik@octave.org>
parents:
30565
diff
changeset
|
565 octave_print_internal (os, this->m_matrix, pr_as_read_syntax, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
566 this->current_print_indent_level ()); |
4903 | 567 } |
568 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
569 template <typename T> |
5992 | 570 octave_value |
571 octave_base_int_scalar<T>::convert_to_str_internal (bool, bool, char type) const | |
572 { | |
573 octave_value retval; | |
574 | |
575 T tmp = this->scalar; | |
576 | |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
577 typedef typename T::val_type val_type; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
578 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
579 val_type ival = tmp.value (); |
5992 | 580 |
7534
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
581 static const bool is_signed = std::numeric_limits<val_type>::is_signed; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
582 static const bool can_be_larger_than_uchar_max |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
583 = octave_base_int_helper_traits<val_type>::can_be_larger_than_uchar_max; |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
584 |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
585 if (octave_base_int_helper<val_type, is_signed, |
ef755c763b62
avoid more "comparison is always false due to limited range of data type" warnings from GCC
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
586 can_be_larger_than_uchar_max>::char_value_out_of_range (ival)) |
5992 | 587 { |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
588 // FIXME: is there something better we could do? |
5992 | 589 |
590 ival = 0; | |
591 | |
592 ::warning ("range error for conversion to character value"); | |
593 } | |
594 else | |
595 retval = octave_value (std::string (1, static_cast<char> (ival)), type); | |
596 | |
597 return retval; | |
598 } | |
599 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
600 template <typename T> |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
601 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
602 octave_base_int_scalar<T>::as_double () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
603 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
604 return static_cast<double> (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
605 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
606 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
607 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
608 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
609 octave_base_int_scalar<T>::as_single () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
610 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
611 return static_cast<float> (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
612 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
613 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
614 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
615 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
616 octave_base_int_scalar<T>::as_int8 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
617 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
618 return octave_int8 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
619 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
620 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
621 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
622 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
623 octave_base_int_scalar<T>::as_int16 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
624 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
625 return octave_int16 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
626 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
627 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
628 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
629 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
630 octave_base_int_scalar<T>::as_int32 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
631 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
632 return octave_int32 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
633 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
634 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
635 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
636 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
637 octave_base_int_scalar<T>::as_int64 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
638 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
639 return octave_int64 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
640 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
641 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
642 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
643 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
644 octave_base_int_scalar<T>::as_uint8 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
645 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
646 return octave_uint8 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
647 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
648 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
649 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
650 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
651 octave_base_int_scalar<T>::as_uint16 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
652 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
653 return octave_uint16 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
654 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
655 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
656 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
657 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
658 octave_base_int_scalar<T>::as_uint32 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
659 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
660 return octave_uint32 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
661 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
662 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
663 template <typename T> |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
664 octave_value |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
665 octave_base_int_scalar<T>::as_uint64 () const |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
666 { |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
667 return octave_uint64 (this->scalar); |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
668 } |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
669 |
24745
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
670 template <typename ST> |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
671 std::string |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
672 octave_base_int_scalar<ST>::edit_display (const float_display_format& fmt, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
673 octave_idx_type, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
674 octave_idx_type) const |
24745
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
675 { |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
676 std::ostringstream buf; |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
677 octave_print_internal (buf, fmt, this->scalar); |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
678 return buf.str (); |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
679 } |
d2467914ce33
enable (or improve) display for more types in the variable editor
John W. Eaton <jwe@octave.org>
parents:
24580
diff
changeset
|
680 |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
681 template <typename T> |
4903 | 682 bool |
6974 | 683 octave_base_int_scalar<T>::save_ascii (std::ostream& os) |
4903 | 684 { |
4932 | 685 os << this->scalar << "\n"; |
4903 | 686 return true; |
687 } | |
688 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
689 template <typename T> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
690 bool |
4903 | 691 octave_base_int_scalar<T>::load_ascii (std::istream& is) |
692 { | |
4932 | 693 is >> this->scalar; |
20893
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20447
diff
changeset
|
694 if (! is) |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20447
diff
changeset
|
695 error ("load: failed to load scalar constant"); |
384ff5aa9437
2015 Code Sprint: Eliminate useless return statements after error ().
Rik <rik@octave.org>
parents:
20447
diff
changeset
|
696 |
4903 | 697 return true; |
698 } | |
699 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
700 template <typename T> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
701 bool |
26399
586413770c7f
pass save_as_floats by value in octave_value save_binary functions
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
702 octave_base_int_scalar<T>::save_binary (std::ostream& os, bool) |
4903 | 703 { |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
704 os.write (reinterpret_cast<char *> (&(this->scalar)), this->byte_size ()); |
4903 | 705 return true; |
706 } | |
707 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
708 template <typename T> |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
709 bool |
4903 | 710 octave_base_int_scalar<T>::load_binary (std::istream& is, bool swap, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21691
diff
changeset
|
711 octave::mach_info::float_format) |
4903 | 712 { |
4917 | 713 T tmp; |
28826
0b5b223f6d93
avoid warnings from template specializations that won't be used
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
714 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
715 if (! is.read (reinterpret_cast<char *> (&tmp), this->byte_size ())) |
4903 | 716 return false; |
717 | |
4917 | 718 if (swap) |
28826
0b5b223f6d93
avoid warnings from template specializations that won't be used
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
719 swap_bytes<sizeof (T)> (&tmp); |
0b5b223f6d93
avoid warnings from template specializations that won't be used
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
720 |
4932 | 721 this->scalar = tmp; |
28826
0b5b223f6d93
avoid warnings from template specializations that won't be used
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
722 |
4903 | 723 return true; |
724 } | |
725 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
726 template <typename T> |
4903 | 727 bool |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
728 octave_base_int_scalar<T>::save_hdf5_internal (octave_hdf5_id loc_id, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
729 octave_hdf5_id save_type, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
730 const char *name, bool) |
4903 | 731 { |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
732 bool retval = false; |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
733 |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
734 #if defined (HAVE_HDF5) |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
735 |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
736 hid_t save_type_hid = save_type; |
29607
0169ffb3fe5d
hdf5: Initialize array before use.
Markus Mützel <markus.muetzel@gmx.de>
parents:
29358
diff
changeset
|
737 hsize_t dimens[3] = {0}; |
18100
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
738 hid_t space_hid, data_hid; |
6a71e5030df5
Follow coding convention of defining and initializing only 1 variable per line in liboctinterp.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
739 space_hid = data_hid = -1; |
4903 | 740 |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23457
diff
changeset
|
741 space_hid = H5Screate_simple (0, dimens, nullptr); |
4903 | 742 if (space_hid < 0) return false; |
743 | |
21211
2cf8bc5c7017
use "#if defined (HAVE_FOO)" instead of "#if HAVE_FOO" for feature tests
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
744 #if defined (HAVE_HDF5_18) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
745 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
746 octave_H5P_DEFAULT, octave_H5P_DEFAULT, |
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30155
diff
changeset
|
747 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
748 #else |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
749 data_hid = H5Dcreate (loc_id, name, save_type_hid, space_hid, |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
750 octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
751 #endif |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
752 if (data_hid < 0) |
4903 | 753 { |
754 H5Sclose (space_hid); | |
755 return false; | |
756 } | |
757 | |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
758 retval = H5Dwrite (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
759 octave_H5P_DEFAULT, &(this->scalar)) >= 0; |
4903 | 760 |
761 H5Dclose (data_hid); | |
762 H5Sclose (space_hid); | |
763 | |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
764 #else |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
765 octave_unused_parameter (loc_id); |
24580
a276f008ea74
avoid unused variable warnings if compiling without HDF5 (bug #52850)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
766 octave_unused_parameter (save_type); |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
767 octave_unused_parameter (name); |
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
768 |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
769 this->warn_save ("hdf5"); |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
770 #endif |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
771 |
4903 | 772 return retval; |
773 } | |
774 | |
21139
538b57866b90
consistently use "typename" intead of "class" in template declarations
John W. Eaton <jwe@octave.org>
parents:
21124
diff
changeset
|
775 template <typename T> |
4903 | 776 bool |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
777 octave_base_int_scalar<T>::load_hdf5_internal (octave_hdf5_id loc_id, |
31607
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
778 octave_hdf5_id save_type, |
aac27ad79be6
maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents:
31138
diff
changeset
|
779 const char *name) |
4903 | 780 { |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
781 #if defined (HAVE_HDF5) |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
782 |
24224
ff81c6772664
avoid issue with link-time optimization
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
783 hid_t save_type_hid = save_type; |
21211
2cf8bc5c7017
use "#if defined (HAVE_FOO)" instead of "#if HAVE_FOO" for feature tests
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
784 #if defined (HAVE_HDF5_18) |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
785 hid_t data_hid = H5Dopen (loc_id, name, octave_H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
786 #else |
4903 | 787 hid_t data_hid = H5Dopen (loc_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
788 #endif |
4903 | 789 hid_t space_id = H5Dget_space (data_hid); |
790 | |
791 hsize_t rank = H5Sget_simple_extent_ndims (space_id); | |
792 | |
793 if (rank != 0) | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
794 { |
4903 | 795 H5Dclose (data_hid); |
796 return false; | |
797 } | |
798 | |
4917 | 799 T tmp; |
21022
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
800 if (H5Dread (data_hid, save_type_hid, octave_H5S_ALL, octave_H5S_ALL, |
ebc439187d29
avoid old-style cast warnings from HDF5 macros used in C++ sources
John W. Eaton <jwe@octave.org>
parents:
20978
diff
changeset
|
801 octave_H5P_DEFAULT, &tmp) < 0) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
802 { |
4903 | 803 H5Dclose (data_hid); |
804 return false; | |
805 } | |
806 | |
4932 | 807 this->scalar = tmp; |
4903 | 808 |
809 H5Dclose (data_hid); | |
810 | |
811 return true; | |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
812 |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
813 #else |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
814 octave_unused_parameter (loc_id); |
24580
a276f008ea74
avoid unused variable warnings if compiling without HDF5 (bug #52850)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
815 octave_unused_parameter (save_type); |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
816 octave_unused_parameter (name); |
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
817 |
21102
dfcb9d74b253
Rename local gripe_XXX functions to err_XXX or warn_XXX.
Rik <rik@octave.org>
parents:
21100
diff
changeset
|
818 this->warn_load ("hdf5"); |
21691
263d18409fdf
Eliminate unused variable warnings for conditionally compiled code.
John W. Eaton <jwe@octave.org>
parents:
21690
diff
changeset
|
819 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
820 return false; |
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
821 #endif |
4903 | 822 } |