Mercurial > octave
annotate libinterp/octave-value/ov-magic-int.h @ 32628:ae4e19c0a2b1
maint: Place class name and class keyword on one line.
* libinterp/corefcn/Cell.h, libinterp/corefcn/__magick_read__.cc,
libinterp/corefcn/auto-shlib.h, libinterp/corefcn/base-text-renderer.h,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/call-stack.h,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/event-manager.h,
libinterp/corefcn/event-queue.h, libinterp/corefcn/ft-text-renderer.cc,
libinterp/corefcn/gl-render.cc, libinterp/corefcn/gl-render.h,
libinterp/corefcn/gl2ps-print.cc, libinterp/corefcn/graphics.cc,
libinterp/corefcn/graphics.in.h, libinterp/corefcn/input.cc,
libinterp/corefcn/latex-text-renderer.cc, libinterp/corefcn/load-path.h,
libinterp/corefcn/mx-type-traits.h, libinterp/corefcn/oct-errno.h,
libinterp/corefcn/oct-fstrm.h, libinterp/corefcn/oct-iostrm.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-procbuf.h,
libinterp/corefcn/oct-process.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/oct-strstrm.h, libinterp/corefcn/pager.h,
libinterp/corefcn/pr-flt-fmt.h, libinterp/corefcn/pr-output.cc,
libinterp/corefcn/pr-output.h, libinterp/corefcn/procstream.h,
libinterp/corefcn/syminfo.h, libinterp/corefcn/text-engine.h,
libinterp/corefcn/text-renderer.h, libinterp/corefcn/utils.h,
libinterp/octave-value/cdef-class.h, libinterp/octave-value/cdef-manager.h,
libinterp/octave-value/cdef-method.h, libinterp/octave-value/cdef-object.h,
libinterp/octave-value/cdef-package.h, libinterp/octave-value/cdef-property.h,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.h,
libinterp/octave-value/ov-base-mat.h, libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.h,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.h,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.h,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.h,
libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h,
libinterp/octave-value/ov-classdef.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.h, libinterp/octave-value/ov-cs-list.h,
libinterp/octave-value/ov-cx-diag.h, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.h, libinterp/octave-value/ov-dld-fcn.h,
libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.h, libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int-traits.h,
libinterp/octave-value/ov-intx.h, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-legacy-range.cc,
libinterp/octave-value/ov-legacy-range.h,
libinterp/octave-value/ov-magic-int.h, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.h, libinterp/octave-value/ov-perm.h,
libinterp/octave-value/ov-range-traits.h, libinterp/octave-value/ov-range.h,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.h,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.h,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.h,
libinterp/octave-value/ov-typeinfo.h, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.h, libinterp/octave-value/ovl.h,
libinterp/parse-tree/comment-list.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/profiler.h, libinterp/parse-tree/pt-anon-scopes.h,
liboctave/array/Array.h, liboctave/array/CColVector.h,
liboctave/array/CDiagMatrix.h, liboctave/array/CMatrix.h,
liboctave/array/CNDArray.h, liboctave/array/CRowVector.h,
liboctave/array/CSparse.h, liboctave/array/DiagArray2.h,
liboctave/array/MArray.h, liboctave/array/MDiagArray2.h,
liboctave/array/MSparse.h, liboctave/array/MatrixType.h,
liboctave/array/Range.h, liboctave/array/Sparse.h,
liboctave/array/boolMatrix.h, liboctave/array/boolNDArray.h,
liboctave/array/boolSparse.h, liboctave/array/chMatrix.h,
liboctave/array/chNDArray.h, liboctave/array/dColVector.h,
liboctave/array/dDiagMatrix.h, liboctave/array/dMatrix.h,
liboctave/array/dNDArray.h, liboctave/array/dRowVector.h,
liboctave/array/dSparse.h, liboctave/array/dim-vector.h,
liboctave/array/fCColVector.h, liboctave/array/fCDiagMatrix.h,
liboctave/array/fCMatrix.h, liboctave/array/fCNDArray.h,
liboctave/array/fCRowVector.h, liboctave/array/fColVector.h,
liboctave/array/fDiagMatrix.h, liboctave/array/fMatrix.h,
liboctave/array/fNDArray.h, liboctave/array/fRowVector.h,
liboctave/array/idx-vector.h, liboctave/array/intNDArray.h,
liboctave/numeric/DAE.h, liboctave/numeric/DAEFunc.h,
liboctave/numeric/DAERT.h, liboctave/numeric/DAERTFunc.h,
liboctave/numeric/DASPK.h, liboctave/numeric/DASRT.h,
liboctave/numeric/DASSL.h, liboctave/numeric/DET.h, liboctave/numeric/EIG.h,
liboctave/numeric/LSODE.h, liboctave/numeric/ODE.h,
liboctave/numeric/ODEFunc.h, liboctave/numeric/ODES.h,
liboctave/numeric/ODESFunc.h, liboctave/numeric/Quad.h,
liboctave/numeric/aepbalance.h, liboctave/numeric/base-dae.h,
liboctave/numeric/base-de.h, liboctave/numeric/chol.h,
liboctave/numeric/fEIG.h, liboctave/numeric/gepbalance.h,
liboctave/numeric/gsvd.h, liboctave/numeric/hess.h, liboctave/numeric/lu.h,
liboctave/numeric/oct-fftw.h, liboctave/numeric/qr.h, liboctave/numeric/qrp.h,
liboctave/numeric/schur.h, liboctave/numeric/sparse-chol.h,
liboctave/numeric/sparse-lu.h, liboctave/numeric/sparse-qr.cc,
liboctave/numeric/sparse-qr.h, liboctave/numeric/svd.cc,
liboctave/numeric/svd.h, liboctave/system/dir-ops.h,
liboctave/system/file-stat.h, liboctave/system/oct-env.h,
liboctave/system/oct-group.h, liboctave/system/oct-password.h,
liboctave/system/oct-time.h, liboctave/system/oct-uname.h,
liboctave/util/action-container.h, liboctave/util/base-list.h,
liboctave/util/cmd-edit.cc, liboctave/util/cmd-edit.h,
liboctave/util/cmd-hist.cc, liboctave/util/cmd-hist.h,
liboctave/util/data-conv.h, liboctave/util/glob-match.h,
liboctave/util/lo-regexp.h, liboctave/util/oct-inttypes.h,
liboctave/util/oct-mutex.cc, liboctave/util/oct-mutex.h,
liboctave/util/oct-shlib.cc, liboctave/util/oct-shlib.h,
liboctave/util/oct-sort.h, liboctave/util/oct-string.h,
liboctave/util/octave-preserve-stream-state.h, liboctave/util/pathsearch.h,
liboctave/util/singleton-cleanup.h, liboctave/util/str-vec.h,
liboctave/util/unwind-prot.h, liboctave/util/url-transfer.h:
Place class name and class keyword on one line.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 21 Dec 2023 11:22:26 -0800 |
parents | 0cafa72d1408 |
children | 4b601ca024d5 |
rev | line source |
---|---|
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 // |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
3 // Copyright (C) 2020-2023 The Octave Project Developers |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 // This file is part of Octave. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 // (at your option) any later version. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 // GNU General Public License for more details. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 // |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #if ! defined (octave_ov_magic_int_h) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 #define octave_ov_magic_int_h 1 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include "octave-config.h" |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include <iosfwd> |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 #include <string> |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 |
30435
1f0a2689cab2
Use forward declarations for octave_int<T> where possible (bug #59820).
Markus Mützel <markus.muetzel@gmx.de>
parents:
29569
diff
changeset
|
34 #include "oct-inttypes-fwd.h" |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 #include "ov-base.h" |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 #include "ov-re-mat.h" |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 #include "ov-base-scalar.h" |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 #include "ov-typeinfo.h" |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 class octave_value_list; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 // Large integer scalar values. The uint64 or int64 value they contain may be |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
44 // accessed without loss of precision when needed (for example, when |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 // directly converted to a uint64 or int64 value). Otherwise, they |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 // behave like real scalars, so any operation on them will result in |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 // type conversion. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 template <typename T> |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
32511
diff
changeset
|
50 class octave_base_magic_int : public octave_base_scalar<T> |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 public: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
54 octave_base_magic_int () |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 : octave_base_scalar<T> (0) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 octave_base_magic_int (const T& val) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 : octave_base_scalar<T> (val) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
60 ~octave_base_magic_int () = default; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 // We return an octave_matrix here instead of an octave_scalar so |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 // that in expressions like A(2,2,2) = 2 (for A previously |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 // undefined), A will be empty instead of a 1x1 object. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
65 octave_base_value * empty_clone () const { return new octave_matrix (); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 // Although SCALAR is a protected member of the base class, it is not |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 // directly visible here without the explicit octave_base_slalar<T>:: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 // qualification. Why not? |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
71 const T& scalar_ref () const { return octave_base_scalar<T>::scalar; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
73 T& scalar_ref () { return octave_base_scalar<T>::scalar; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 octave_value do_index_op (const octave_value_list& idx, |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 bool resize_ok = false); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 |
29569
29a1f8fd8ee6
move idx_vector classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
78 octave::idx_vector index_vector (bool require_integers = false) const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 octave_value any (int = 0) const { return scalar_ref () != T (0); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
82 builtin_type_t builtin_type () const { return btyp_double; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
84 bool is_storable () const { return false; } |
29353
715344f405f0
improve handling of nan, infinite value, and empty ranges (bug #59229)
John W. Eaton <jwe@octave.org>
parents:
28590
diff
changeset
|
85 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
86 bool is_magic_int () const { return true; } |
32511
0cafa72d1408
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Markus Mützel <markus.muetzel@gmx.de>
parents:
32148
diff
changeset
|
87 |
0cafa72d1408
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Markus Mützel <markus.muetzel@gmx.de>
parents:
32148
diff
changeset
|
88 bool vm_need_storable_call () const { return true; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
90 bool is_real_scalar () const { return true; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
92 bool isreal () const { return true; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
93 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
94 bool is_double_type () const { return true; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
95 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
96 bool isfloat () const { return true; } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
97 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
98 int8NDArray int8_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
99 { return int8NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
100 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
101 int16NDArray int16_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
102 { return int16NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
103 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
104 int32NDArray int32_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
105 { return int32NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
107 int64NDArray int64_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
108 { return int64NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
109 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
110 uint8NDArray uint8_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
111 { return uint8NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
112 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
113 uint16NDArray uint16_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
114 { return uint16NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
115 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
116 uint32NDArray uint32_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
117 { return uint32NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
118 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
119 uint64NDArray uint64_array_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
120 { return uint64NDArray (dim_vector (1, 1), double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
121 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
122 octave_int8 int8_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
123 { return octave_int8 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
124 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
125 octave_int16 int16_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
126 { return octave_int16 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
127 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
128 octave_int32 int32_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
129 { return octave_int32 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
130 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
131 octave_int64 int64_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
132 { return octave_int64 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
133 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
134 octave_uint8 uint8_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
135 { return octave_uint8 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
136 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
137 octave_uint16 uint16_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
138 { return octave_uint16 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
139 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
140 octave_uint32 uint32_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
141 { return octave_uint32 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
142 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
143 octave_uint64 uint64_scalar_value () const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
144 { return octave_uint64 (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
145 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 double double_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
147 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
148 return scalar_ref ().double_value (); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
150 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
151 float float_value (bool = false) const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
152 { return static_cast<float> (double_value ()); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
153 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
154 double scalar_value (bool = false) const |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
155 { return double_value (); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
156 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
157 float float_scalar_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
158 { return float_value (); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
159 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
160 Matrix matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 { return Matrix (1, 1, double_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
162 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
163 FloatMatrix float_matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
164 { return FloatMatrix (1, 1, float_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
165 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
166 NDArray array_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
167 { return NDArray (dim_vector (1, 1), double_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
168 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
169 FloatNDArray float_array_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
170 { return FloatNDArray (dim_vector (1, 1), float_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
171 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
172 SparseMatrix sparse_matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
173 { return SparseMatrix (Matrix (1, 1, double_value ())); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
174 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
175 // FIXME: Need SparseComplexMatrix (Matrix) constructor! |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
176 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
177 { return SparseComplexMatrix (sparse_matrix_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
178 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
179 octave_value resize (const dim_vector& dv, bool fill = false) const; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
180 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
181 Complex complex_value (bool = false) const { return double_value (); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
182 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
183 FloatComplex float_complex_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
184 { return FloatComplex (float_value ()); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
185 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
186 ComplexMatrix complex_matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
187 { return ComplexMatrix (1, 1, Complex (double_value ())); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
188 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
189 FloatComplexMatrix float_complex_matrix_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
190 { return FloatComplexMatrix (1, 1, FloatComplex (float_value ())); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
191 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
192 ComplexNDArray complex_array_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
193 { return ComplexNDArray (dim_vector (1, 1), Complex (double_value ())); } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
194 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
195 FloatComplexNDArray float_complex_array_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
196 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
197 return FloatComplexNDArray (dim_vector (1, 1), |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
198 FloatComplex (float_value ())); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
199 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
200 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
201 charNDArray |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
202 char_array_value (bool = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
203 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
204 charNDArray retval (dim_vector (1, 1)); |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
205 retval(0) = static_cast<char> (double_value ()); |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
206 return retval; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
207 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
208 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
209 bool bool_value (bool warn = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
210 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
211 if (warn && scalar_ref () != T (0) && scalar_ref () != T (1)) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
212 warn_logical_conversion (); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
213 |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
214 return double_value (); |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
215 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
216 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
217 boolNDArray bool_array_value (bool warn = false) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
218 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
219 if (warn && scalar_ref () != T (0) && scalar_ref () != T (1)) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
220 warn_logical_conversion (); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
221 |
28590
5b1143d1d74b
improve compatibility of concatenation for large integer constants (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
28588
diff
changeset
|
222 return boolNDArray (dim_vector (1, 1), double_value ()); |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
223 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
224 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
225 octave_value as_double () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
226 octave_value as_single () const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
227 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
228 octave_value as_int8 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
229 octave_value as_int16 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
230 octave_value as_int32 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
231 octave_value as_int64 () const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
232 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
233 octave_value as_uint8 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
234 octave_value as_uint16 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
235 octave_value as_uint32 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
236 octave_value as_uint64 () const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
237 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
238 // We don't need to override both forms of the diag method. The using |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
239 // declaration will avoid warnings about partially-overloaded virtual |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
240 // functions. |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
241 using octave_base_scalar<T>::diag; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
242 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
243 octave_value diag (octave_idx_type m, octave_idx_type n) const; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
244 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
245 octave_value convert_to_str_internal (bool pad, bool force, char type) const; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
246 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
247 void increment () { scalar_ref () += T (1); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
248 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
249 void decrement () { scalar_ref () -= T (1); } |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
250 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
251 bool save_ascii (std::ostream& os); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
252 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
253 bool load_ascii (std::istream& is); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
254 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
255 bool save_binary (std::ostream& os, bool save_as_floats); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
256 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
257 bool load_binary (std::istream& is, bool swap, |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
258 octave::mach_info::float_format fmt); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
259 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
260 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
261 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
262 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
263 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
264 int write (octave::stream& os, int block_size, |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
265 oct_data_conv::data_type output_type, int skip, |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
266 octave::mach_info::float_format flt_fmt) const |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
267 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
268 return os.write (array_value (), block_size, output_type, |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
269 skip, flt_fmt); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
270 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
271 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
272 mxArray * as_mxArray (bool interleaved) const; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
273 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
274 octave_value map (octave_base_value::unary_mapper_t umap) const; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
275 }; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
276 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
32511
diff
changeset
|
277 class OCTINTERP_API octave_magic_uint : public octave_base_magic_int<octave_uint64> |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
278 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
279 public: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
280 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
281 octave_magic_uint () |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
282 : octave_base_magic_int<octave_uint64> (0) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
283 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
284 octave_magic_uint (const octave_uint64& val) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
285 : octave_base_magic_int<octave_uint64> (val) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
286 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
287 ~octave_magic_uint () = default; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
288 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
289 octave_base_value * clone () const |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
290 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
291 return new octave_magic_uint (*this); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
292 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
293 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
294 type_conv_info numeric_conversion_function () const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
295 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
296 private: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
297 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
298 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
299 }; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
300 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
32511
diff
changeset
|
301 class OCTINTERP_API octave_magic_int : public octave_base_magic_int<octave_int64> |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
302 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
303 public: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
304 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
305 octave_magic_int () |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
306 : octave_base_magic_int<octave_int64> (0) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
307 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
308 octave_magic_int (const octave_int64& val) |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
309 : octave_base_magic_int<octave_int64> (val) { } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
310 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
311 ~octave_magic_int () = default; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
312 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
313 octave_base_value * clone () const |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
314 { |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
315 return new octave_magic_int (*this); |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
316 } |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
317 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
318 type_conv_info numeric_conversion_function () const; |
28588
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
319 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
320 private: |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
321 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
322 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
323 }; |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
324 |
ee9b1081471f
allow integer constants > flintmax to be represented exactly (bug #45945)
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
325 #endif |