Mercurial > octave
annotate libinterp/octave-value/ov-lazy-idx.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 | 21f9b34eb893 |
children | 4b601ca024d5 |
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:
30565
diff
changeset
|
3 // Copyright (C) 2010-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 //////////////////////////////////////////////////////////////////////// |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20131
diff
changeset
|
26 #if ! defined (octave_ov_lazy_idx_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
27 #define octave_ov_lazy_idx_h 1 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
30 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
31 #include "ov-re-mat.h" |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
32 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 // Lazy indices that stay in idx_vector form until the conversion to NDArray is |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 // actually needed. |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 |
32628
ae4e19c0a2b1
maint: Place class name and class keyword on one line.
Rik <rik@octave.org>
parents:
31771
diff
changeset
|
36 class OCTINTERP_API octave_lazy_index : public octave_base_value |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
37 { |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 public: |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
40 octave_lazy_index () |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
41 : octave_base_value (), m_index (), m_value () { } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
42 |
29569
29a1f8fd8ee6
move idx_vector classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
43 octave_lazy_index (const octave::idx_vector& idx) |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
44 : octave_base_value (), m_index (idx), m_value () { } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
45 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
46 octave_lazy_index (const octave_lazy_index& i) |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
47 : octave_base_value (), m_index (i.m_index), m_value (i.m_value) { } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
48 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
49 ~octave_lazy_index () = default; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
50 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
51 octave_base_value * clone () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
52 { return new octave_lazy_index (*this); } |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
53 octave_base_value * empty_clone () const { return new octave_matrix (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
55 type_conv_info numeric_conversion_function () const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
56 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
57 octave_base_value * try_narrowing_conversion (); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
58 |
20131
0d56160e346d
make printf of lazy-index object work again (bug #44864)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
59 octave_value fast_elem_extract (octave_idx_type n) const; |
0d56160e346d
make printf of lazy-index object work again (bug #44864)
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
60 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
61 std::size_t byte_size () const |
30346
91c6288781ba
maint: Shorten some long lines in libinterp to <= 80 characters (bug #57599)
Rik <rik@octave.org>
parents:
30232
diff
changeset
|
62 { return numel () * sizeof (octave_idx_type); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
63 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
64 octave_value squeeze () const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
65 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
66 octave_value full_value () const { return make_value (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
67 |
29569
29a1f8fd8ee6
move idx_vector classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
68 octave::idx_vector index_vector (bool /* require_integers */ = false) const |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
69 { return m_index; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
70 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
71 builtin_type_t builtin_type () const { return btyp_double; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
72 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
73 bool is_real_matrix () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
74 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
75 bool isreal () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
76 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
77 bool is_double_type () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
78 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
79 bool isfloat () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
80 |
26916
9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
81 // We don't need to override all three forms of subsref. The using |
9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
82 // declaration will avoid warnings about partially-overloaded virtual |
9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
83 // functions. |
9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
84 using octave_base_value::subsref; |
9cd4b045fe3d
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
85 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
86 octave_value subsref (const std::string& type, |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
87 const std::list<octave_value_list>& idx) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
88 { return make_value ().subsref (type, idx); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
89 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
90 octave_value_list subsref (const std::string& type, |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
91 const std::list<octave_value_list>& idx, int) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
92 { return subsref (type, idx); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
93 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
94 octave_value do_index_op (const octave_value_list& idx, |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
95 bool resize_ok = false) |
28631
70cdf8de553d
move non-member octave_value operator functions to octave namespace
John W. Eaton <jwe@octave.org>
parents:
28126
diff
changeset
|
96 { return make_value ().index_op (idx, resize_ok); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
97 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
98 dim_vector dims () const { return m_index.orig_dimensions (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
99 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
100 octave_idx_type numel () const { return m_index.length (0); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
101 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
102 octave_idx_type nnz () const { return numel (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
103 |
10339
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
104 octave_value reshape (const dim_vector& new_dims) const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
105 |
10339
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
106 octave_value permute (const Array<int>& vec, bool inv = false) const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
107 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
108 octave_value resize (const dim_vector& dv, bool fill = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
109 { return make_value ().resize (dv, fill); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
110 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
111 octave_value all (int dim = 0) const { return make_value ().all (dim); } |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 octave_value any (int dim = 0) const { return make_value ().any (dim); } |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
113 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
114 MatrixType matrix_type () const { return make_value ().matrix_type (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
115 MatrixType matrix_type (const MatrixType& _typ) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
116 { return make_value ().matrix_type (_typ); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
117 |
10339
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
118 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const; |
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
119 |
30390
a61e1a0f6024
maint: style check C++ files in libinterp/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30232
diff
changeset
|
120 octave_value sort (Array<octave_idx_type>& sidx, octave_idx_type dim = 0, |
10339
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
121 sortmode mode = ASCENDING) const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
122 |
23588
0549061d35b9
maint: Deprecate is_sorted and replace with issorted.
Rik <rik@octave.org>
parents:
23586
diff
changeset
|
123 sortmode issorted (sortmode mode = UNSORTED) const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
124 |
10339
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
125 Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const; |
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
126 |
de2d43bcb083
optimize some lazy index operations
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
127 sortmode is_sorted_rows (sortmode mode = UNSORTED) const; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
128 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
129 bool is_matrix_type () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
130 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
131 bool isnumeric () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
132 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
133 bool is_defined () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
134 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
135 bool is_constant () const { return true; } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
136 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
137 bool is_true () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
138 { return make_value ().is_true (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
139 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
140 bool print_as_scalar () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
141 { return make_value ().print_as_scalar (); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
142 |
18416
bcd71a2531d3
Support disp/display overloading in classdef
Michael Goffioul <michael.goffioul@gmail.com>
parents:
18130
diff
changeset
|
143 void print (std::ostream& os, bool pr_as_read_syntax = false) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
144 { make_value ().print (os, pr_as_read_syntax); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
145 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
146 void print_info (std::ostream& os, const std::string& prefix) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
147 { make_value ().print_info (os, prefix); } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
148 |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
149 #define FORWARD_VALUE_QUERY(TYPE, NAME) \ |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
150 TYPE NAME () const \ |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
151 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
152 return make_value ().NAME (); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
153 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
154 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
155 FORWARD_VALUE_QUERY (int8NDArray, int8_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
156 FORWARD_VALUE_QUERY (int16NDArray, int16_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
157 FORWARD_VALUE_QUERY (int32NDArray, int32_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
158 FORWARD_VALUE_QUERY (int64NDArray, int64_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
159 FORWARD_VALUE_QUERY (uint8NDArray, uint8_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
160 FORWARD_VALUE_QUERY (uint16NDArray, uint16_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
161 FORWARD_VALUE_QUERY (uint32NDArray, uint32_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
162 FORWARD_VALUE_QUERY (uint64NDArray, uint64_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
163 |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
164 #define FORWARD_VALUE_QUERY1(TYPE, NAME) \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
165 TYPE NAME (bool flag = false) const \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
166 { \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
167 return make_value ().NAME (flag); \ |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
168 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
169 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
170 FORWARD_VALUE_QUERY1 (double, double_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
171 FORWARD_VALUE_QUERY1 (float, float_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
172 FORWARD_VALUE_QUERY1 (double, scalar_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
173 FORWARD_VALUE_QUERY1 (Matrix, matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
174 FORWARD_VALUE_QUERY1 (FloatMatrix, float_matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
175 FORWARD_VALUE_QUERY1 (Complex, complex_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
176 FORWARD_VALUE_QUERY1 (FloatComplex, float_complex_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
177 FORWARD_VALUE_QUERY1 (ComplexMatrix, complex_matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
178 FORWARD_VALUE_QUERY1 (FloatComplexMatrix, float_complex_matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
179 FORWARD_VALUE_QUERY1 (ComplexNDArray, complex_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
180 FORWARD_VALUE_QUERY1 (FloatComplexNDArray, float_complex_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
181 FORWARD_VALUE_QUERY1 (boolNDArray, bool_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
182 FORWARD_VALUE_QUERY1 (charNDArray, char_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
183 FORWARD_VALUE_QUERY1 (NDArray, array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
184 FORWARD_VALUE_QUERY1 (FloatNDArray, float_array_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
185 FORWARD_VALUE_QUERY1 (SparseMatrix, sparse_matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
186 FORWARD_VALUE_QUERY1 (SparseComplexMatrix, sparse_complex_matrix_value) |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
187 |
26919
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26916
diff
changeset
|
188 // We don't need to override both forms of the diag method. The using |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26916
diff
changeset
|
189 // declaration will avoid warnings about partially-overloaded virtual |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26916
diff
changeset
|
190 // functions. |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26916
diff
changeset
|
191 using octave_base_value::diag; |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26916
diff
changeset
|
192 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
193 octave_value diag (octave_idx_type k = 0) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
194 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
195 return make_value ().diag (k); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
196 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
197 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
198 octave_value convert_to_str_internal (bool pad, bool force, char type) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
199 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
200 return make_value ().convert_to_str_internal (pad, force, type); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
201 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
202 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
203 octave_value as_double () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
204 octave_value as_single () const; |
25287
f692728de113
enable lazy index to numeric conversion (bug #53681)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
205 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
206 octave_value as_int8 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
207 octave_value as_int16 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
208 octave_value as_int32 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
209 octave_value as_int64 () const; |
25287
f692728de113
enable lazy index to numeric conversion (bug #53681)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
210 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
211 octave_value as_uint8 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
212 octave_value as_uint16 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
213 octave_value as_uint32 () const; |
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
214 octave_value as_uint64 () const; |
25287
f692728de113
enable lazy index to numeric conversion (bug #53681)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
215 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
216 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
217 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
218 return make_value ().print_raw (os, pr_as_read_syntax); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
219 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
220 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
221 bool save_ascii (std::ostream& os); |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
222 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
223 bool load_ascii (std::istream& is); |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
224 |
26399
586413770c7f
pass save_as_floats by value in octave_value save_binary functions
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
225 bool save_binary (std::ostream& os, bool save_as_floats); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
226 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11584
diff
changeset
|
227 bool load_binary (std::istream& is, bool swap, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
228 octave::mach_info::float_format fmt); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
229 |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
230 int write (octave::stream& os, int block_size, |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
231 oct_data_conv::data_type output_type, int skip, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
232 octave::mach_info::float_format flt_fmt) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
233 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
234 return make_value ().write (os, block_size, output_type, skip, flt_fmt); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
235 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
236 |
30232
a2936935c7c8
attempt to limit possible const_cast damage
John W. Eaton <jwe@octave.org>
parents:
30077
diff
changeset
|
237 // This function exists to support the MEX interface. |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
238 // You should not use it anywhere else. |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
239 const void * mex_get_data () const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
240 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
241 return make_value ().mex_get_data (); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
242 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
243 |
28126
4c21f99b4ad5
handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
244 mxArray * as_mxArray (bool interleaved) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
245 { |
28126
4c21f99b4ad5
handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
246 return make_value ().as_mxArray (interleaved); |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
247 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
248 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
249 octave_value map (unary_mapper_t umap) const |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
250 { |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
251 return make_value ().map (umap); |
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
252 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
253 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
254 private: |
22197
e43d83253e28
refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
255 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
256 const octave_value& make_value () const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
257 { |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
258 if (m_value.is_undefined ()) |
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
259 m_value = octave_value (m_index, false); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
260 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
261 return m_value; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
262 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
263 |
31771
21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
Rik <rik@octave.org>
parents:
31706
diff
changeset
|
264 octave_value& make_value () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
265 { |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
266 if (m_value.is_undefined ()) |
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
267 m_value = octave_value (m_index, false); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
268 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
269 return m_value; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
270 } |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
271 |
30077
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
272 octave::idx_vector m_index; |
b16e0d357437
maint: use "m_" prefix for member variables in some octave-value classes.
John W. Eaton <jwe@octave.org>
parents:
29655
diff
changeset
|
273 mutable octave_value m_value; |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
274 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
275 static octave_base_value * |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
276 numeric_conversion_function (const octave_base_value&); |
10886 | 277 |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
278 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
279 }; |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
280 |
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
281 #endif |