Mercurial > octave
annotate libinterp/octave-value/ov-bool.h @ 29358:0a5b15007766 stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2021 09:52:15 -0500 |
parents | bd51beb6205e |
children | 7854d5752dd2 |
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 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 // Copyright (C) 1996-2021 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 //////////////////////////////////////////////////////////////////////// |
2871 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19863
diff
changeset
|
26 #if ! defined (octave_ov_bool_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_bool_h 1 |
2871 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21066
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21066
diff
changeset
|
30 |
2871 | 31 #include <cstdlib> |
32 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
33 #include <iosfwd> |
2871 | 34 #include <string> |
35 | |
36 #include "lo-utils.h" | |
37 #include "mx-base.h" | |
38 #include "str-vec.h" | |
39 | |
4970 | 40 #include "oct-stream.h" |
2871 | 41 #include "ov-base.h" |
3223 | 42 #include "ov-base-scalar.h" |
10544
9961fc022d9d
fix assignment to non-existing variables and octave_value::assign
Jaroslav Hajek <highegg@gmail.com>
parents:
10343
diff
changeset
|
43 #include "ov-bool-mat.h" |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
44 #include "ov-scalar.h" |
2871 | 45 #include "ov-typeinfo.h" |
46 | |
47 class octave_value_list; | |
48 | |
49 // Real scalar values. | |
50 | |
51 class | |
10343
2ef5144ccb0d
Add few OCTINTERP_API tags.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
10313
diff
changeset
|
52 OCTINTERP_API |
3223 | 53 octave_bool : public octave_base_scalar<bool> |
2871 | 54 { |
55 public: | |
56 | |
57 octave_bool (void) | |
3223 | 58 : octave_base_scalar<bool> (false) { } |
2871 | 59 |
60 octave_bool (bool b) | |
3223 | 61 : octave_base_scalar<bool> (b) { } |
2871 | 62 |
63 octave_bool (const octave_bool& s) | |
3223 | 64 : octave_base_scalar<bool> (s) { } |
2871 | 65 |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22861
diff
changeset
|
66 ~octave_bool (void) = default; |
2871 | 67 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
68 octave_base_value * clone (void) const { return new octave_bool (*this); } |
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
69 octave_base_value * empty_clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
70 { return new octave_bool_matrix (); } |
2871 | 71 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8202
diff
changeset
|
72 type_conv_info numeric_conversion_function (void) const; |
2871 | 73 |
5885 | 74 octave_value do_index_op (const octave_value_list& idx, |
10313 | 75 bool resize_ok = false); |
2871 | 76 |
18130
e473c4853afc
enable non-integer ranges as indices by default and deprecate preference
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
77 idx_vector index_vector (bool /* require_integers */ = false) const { return idx_vector (scalar); } |
2871 | 78 |
9685 | 79 builtin_type_t builtin_type (void) const { return btyp_bool; } |
80 | |
2871 | 81 bool is_real_scalar (void) const { return true; } |
82 | |
5881 | 83 bool is_bool_scalar (void) const { return true; } |
84 | |
23579
c20a0fa91c0c
maint: Deprecate is_bool_type and replace with islogical.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
85 bool islogical (void) const { return true; } |
3209 | 86 |
23582
0cc2011d800e
maint: Deprecate is_real_type and replace with isreal.
Rik <rik@octave.org>
parents:
23579
diff
changeset
|
87 bool isreal (void) const { return true; } |
3209 | 88 |
23586
f6c5db0a02e7
maint: Deprecate is_numeric_type and replace with isnumeric.
Rik <rik@octave.org>
parents:
23582
diff
changeset
|
89 bool isnumeric (void) const { return false; } |
9841
6f1ea8241c99
make isnumeric yield false on logicals
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
90 |
2871 | 91 bool is_true (void) const { return scalar; } |
92 | |
5533 | 93 int8NDArray |
94 int8_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
95 { return int8NDArray (dim_vector (1, 1), scalar); } |
5533 | 96 |
97 int16NDArray | |
98 int16_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
99 { return int16NDArray (dim_vector (1, 1), scalar); } |
5533 | 100 |
101 int32NDArray | |
102 int32_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
103 { return int32NDArray (dim_vector (1, 1), scalar); } |
5533 | 104 |
105 int64NDArray | |
106 int64_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
107 { return int64NDArray (dim_vector (1, 1), scalar); } |
5533 | 108 |
109 uint8NDArray | |
110 uint8_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
111 { return uint8NDArray (dim_vector (1, 1), scalar); } |
5533 | 112 |
113 uint16NDArray | |
114 uint16_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
115 { return uint16NDArray (dim_vector (1, 1), scalar); } |
5533 | 116 |
117 uint32NDArray | |
118 uint32_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
119 { return uint32NDArray (dim_vector (1, 1), scalar); } |
5533 | 120 |
121 uint64NDArray | |
122 uint64_array_value (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
123 { return uint64NDArray (dim_vector (1, 1), scalar); } |
5533 | 124 |
13142
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
125 octave_int8 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
126 int8_scalar_value (void) const { return octave_int8 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
127 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
128 octave_int16 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
129 int16_scalar_value (void) const { return octave_int16 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
130 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
131 octave_int32 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
132 int32_scalar_value (void) const { return octave_int32 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
133 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
134 octave_int64 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
135 int64_scalar_value (void) const { return octave_int64 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
136 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
137 octave_uint8 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
138 uint8_scalar_value (void) const { return octave_uint8 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
139 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
140 octave_uint16 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
141 uint16_scalar_value (void) const { return octave_uint16 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
142 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
143 octave_uint32 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
144 uint32_scalar_value (void) const { return octave_uint32 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
145 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
146 octave_uint64 |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
147 uint64_scalar_value (void) const { return octave_uint64 (scalar); } |
d803d2702a39
improve compatibility of concatenation (bug #33966)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
148 |
2871 | 149 double double_value (bool = false) const { return scalar; } |
150 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
151 float float_value (bool = false) const { return scalar; } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
152 |
2916 | 153 double scalar_value (bool = false) const { return scalar; } |
154 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
155 float float_scalar_value (bool = false) const { return scalar; } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
156 |
3145 | 157 Matrix matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
158 { return Matrix (1, 1, scalar); } |
2871 | 159 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
160 FloatMatrix float_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
161 { return FloatMatrix (1, 1, scalar); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
162 |
4630 | 163 NDArray array_value (bool = false) const |
22861
0ab9c3548b1f
avoid some double to float conversion warnings
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
164 { return NDArray (dim_vector (1, 1), double_value ()); } |
4630 | 165 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
166 FloatNDArray float_array_value (bool = false) const |
22861
0ab9c3548b1f
avoid some double to float conversion warnings
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
167 { return FloatNDArray (dim_vector (1, 1), float_value ()); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
168 |
2871 | 169 Complex complex_value (bool = false) const { return scalar; } |
170 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
171 FloatComplex float_complex_value (bool = false) const { return scalar; } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
172 |
2871 | 173 ComplexMatrix complex_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 { return ComplexMatrix (1, 1, Complex (scalar)); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
175 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
176 FloatComplexMatrix float_complex_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
177 { return FloatComplexMatrix (1, 1, FloatComplex (scalar)); } |
2871 | 178 |
4630 | 179 ComplexNDArray complex_array_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
180 { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); } |
4630 | 181 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
182 FloatComplexNDArray float_complex_array_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
183 { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
184 |
6099 | 185 SparseMatrix sparse_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
186 { return SparseMatrix (Matrix (1, 1, scalar)); } |
6099 | 187 |
21066
258c787cd9ce
maint: Use "FIXME:" consistently in code base.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
188 // FIXME: Need SparseComplexMatrix (Matrix) constructor! |
6099 | 189 SparseComplexMatrix sparse_complex_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
190 { return SparseComplexMatrix (sparse_matrix_value ()); } |
6099 | 191 |
192 SparseBoolMatrix sparse_bool_matrix_value (bool = false) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
193 { return SparseBoolMatrix (boolMatrix (1, 1, scalar)); } |
6099 | 194 |
5533 | 195 charNDArray |
196 char_array_value (bool = false) const | |
197 { | |
198 charNDArray retval (dim_vector (1, 1)); | |
199 retval(0) = static_cast<char> (scalar); | |
200 return retval; | |
201 } | |
202 | |
5944 | 203 bool bool_value (bool = false) const { return scalar; } |
2871 | 204 |
5944 | 205 boolMatrix bool_matrix_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
206 { return boolMatrix (1, 1, scalar); } |
2871 | 207 |
5944 | 208 boolNDArray bool_array_value (bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
209 { return boolNDArray (dim_vector (1, 1), scalar); } |
4847 | 210 |
22296
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
211 octave_value as_double (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
212 octave_value as_single (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
213 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
214 octave_value as_int8 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
215 octave_value as_int16 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
216 octave_value as_int32 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
217 octave_value as_int64 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
218 |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
219 octave_value as_uint8 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
220 octave_value as_uint16 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
221 octave_value as_uint32 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
222 octave_value as_uint64 (void) const; |
8b18f46f6427
revamp double, single, int type conversions
John W. Eaton <jwe@octave.org>
parents:
22022
diff
changeset
|
223 |
5731 | 224 octave_value resize (const dim_vector& dv, bool fill = false) const; |
4915 | 225 |
5279 | 226 octave_value convert_to_str_internal (bool pad, bool force, char type) const; |
2871 | 227 |
6974 | 228 bool save_ascii (std::ostream& os); |
4687 | 229 |
230 bool load_ascii (std::istream& is); | |
231 | |
26399
586413770c7f
pass save_as_floats by value in octave_value save_binary functions
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
232 bool save_binary (std::ostream& os, bool save_as_floats); |
4687 | 233 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
234 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
|
235 octave::mach_info::float_format fmt); |
4687 | 236 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
237 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); |
4687 | 238 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
239 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
4687 | 240 |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
241 int write (octave::stream& os, int block_size, |
10313 | 242 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
|
243 octave::mach_info::float_format flt_fmt) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
244 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
245 return os.write (bool_array_value (), block_size, output_type, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
246 skip, flt_fmt); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
247 } |
4970 | 248 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
249 mxArray * as_mxArray (void) const; |
5900 | 250 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
251 // Mapper functions are converted to double for treatment |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
252 octave_value map (unary_mapper_t umap) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
253 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
254 octave_scalar m (scalar_value ()); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
255 return m.map (umap); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
256 } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
257 |
2871 | 258 private: |
259 | |
4612 | 260 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2871 | 261 }; |
262 | |
263 #endif |