Mercurial > hg > octave-lyh
annotate src/ov-bool-mat.cc @ 14470:aad7ad0e15c1
maint: Remove redundant private function from the package manager.
* pkg/private/isautoload.m: remove file.
* pkg/private/install.m: remove calls to isautoload.
author | Carlo de Falco <kingcrimson@tiscali.it> |
---|---|
date | Fri, 16 Mar 2012 18:54:34 +0100 |
parents | 29aabe9b37a2 |
children | 460a3c6d8bf1 |
rev | line source |
---|---|
2871 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12645
diff
changeset
|
3 Copyright (C) 1996-2012 John W. Eaton |
11523 | 4 Copyright (C) 2009-2010 VZLU Prague |
2871 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2871 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2871 | 21 |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include <config.h> | |
26 #endif | |
27 | |
3503 | 28 #include <iostream> |
4726 | 29 #include <vector> |
2901 | 30 |
2871 | 31 #include "lo-ieee.h" |
32 #include "mx-base.h" | |
8377
25bc2d31e1bf
improve OCTAVE_LOCAL_BUFFER
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
33 #include "oct-locbuf.h" |
2871 | 34 |
9852
aabf7a8c2e57
implement sparse logical conversion
Jaroslav Hajek <highegg@gmail.com>
parents:
9850
diff
changeset
|
35 #include "defun.h" |
2871 | 36 #include "gripes.h" |
37 #include "oct-obj.h" | |
38 #include "ops.h" | |
3219 | 39 #include "ov-base.h" |
40 #include "ov-base-mat.h" | |
41 #include "ov-base-mat.cc" | |
2871 | 42 #include "ov-bool.h" |
43 #include "ov-bool-mat.h" | |
44 #include "ov-re-mat.h" | |
45 #include "pr-output.h" | |
46 | |
4687 | 47 #include "byte-swap.h" |
48 #include "ls-oct-ascii.h" | |
49 #include "ls-hdf5.h" | |
50 #include "ls-utils.h" | |
51 | |
4513 | 52 template class octave_base_matrix<boolNDArray>; |
2871 | 53 |
3219 | 54 DEFINE_OCTAVE_ALLOCATOR (octave_bool_matrix); |
2871 | 55 |
4612 | 56 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_bool_matrix, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
57 "bool matrix", "logical"); |
2871 | 58 |
5759 | 59 static octave_base_value * |
60 default_numeric_conversion_function (const octave_base_value& a) | |
2871 | 61 { |
62 CAST_CONV_ARG (const octave_bool_matrix&); | |
63 | |
4668 | 64 return new octave_matrix (NDArray (v.bool_array_value ())); |
2871 | 65 } |
66 | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
67 octave_base_value::type_conv_info |
2871 | 68 octave_bool_matrix::numeric_conversion_function (void) const |
69 { | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
70 return octave_base_value::type_conv_info (default_numeric_conversion_function, |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
71 octave_matrix::static_type_id ()); |
2871 | 72 } |
73 | |
5759 | 74 octave_base_value * |
2871 | 75 octave_bool_matrix::try_narrowing_conversion (void) |
76 { | |
5759 | 77 octave_base_value *retval = 0; |
2871 | 78 |
4513 | 79 if (matrix.ndims () == 2) |
80 { | |
81 boolMatrix bm = matrix.matrix_value (); | |
2871 | 82 |
5275 | 83 octave_idx_type nr = bm.rows (); |
84 octave_idx_type nc = bm.cols (); | |
4513 | 85 |
86 if (nr == 1 && nc == 1) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
87 retval = new octave_bool (bm (0, 0)); |
4513 | 88 } |
2871 | 89 |
90 return retval; | |
91 } | |
92 | |
93 double | |
94 octave_bool_matrix::double_value (bool) const | |
95 { | |
4102 | 96 double retval = lo_ieee_nan_value (); |
2871 | 97 |
4455 | 98 if (rows () > 0 && columns () > 0) |
99 { | |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14429
diff
changeset
|
100 gripe_implicit_conversion ("Octave:array-to-scalar", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
101 "bool matrix", "real scalar"); |
4455 | 102 |
103 retval = matrix (0, 0); | |
104 } | |
2871 | 105 else |
106 gripe_invalid_conversion ("bool matrix", "real scalar"); | |
107 | |
108 return retval; | |
109 } | |
110 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
111 float |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
112 octave_bool_matrix::float_value (bool) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
113 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
114 float retval = lo_ieee_float_nan_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
115 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
116 if (rows () > 0 && columns () > 0) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
117 { |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14429
diff
changeset
|
118 gripe_implicit_conversion ("Octave:array-to-scalar", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
119 "bool matrix", "real scalar"); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
120 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
121 retval = matrix (0, 0); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
122 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 else |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
124 gripe_invalid_conversion ("bool matrix", "real scalar"); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
125 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
126 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
127 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
128 |
2871 | 129 Complex |
130 octave_bool_matrix::complex_value (bool) const | |
131 { | |
4102 | 132 double tmp = lo_ieee_nan_value (); |
133 | |
134 Complex retval (tmp, tmp); | |
2871 | 135 |
4455 | 136 if (rows () > 0 && columns () > 0) |
137 { | |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14429
diff
changeset
|
138 gripe_implicit_conversion ("Octave:array-to-scalar", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
139 "bool matrix", "complex scalar"); |
4455 | 140 |
141 retval = matrix (0, 0); | |
142 } | |
2871 | 143 else |
144 gripe_invalid_conversion ("bool matrix", "complex scalar"); | |
145 | |
146 return retval; | |
147 } | |
148 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
149 FloatComplex |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
150 octave_bool_matrix::float_complex_value (bool) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
151 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
152 float tmp = lo_ieee_float_nan_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
153 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
154 FloatComplex retval (tmp, tmp); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
155 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
156 if (rows () > 0 && columns () > 0) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
157 { |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14429
diff
changeset
|
158 gripe_implicit_conversion ("Octave:array-to-scalar", |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
159 "bool matrix", "complex scalar"); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
160 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
161 retval = matrix (0, 0); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
162 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
163 else |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
164 gripe_invalid_conversion ("bool matrix", "complex scalar"); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
165 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
166 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
167 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
168 |
4457 | 169 octave_value |
5279 | 170 octave_bool_matrix::convert_to_str_internal (bool pad, bool force, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
171 char type) const |
4457 | 172 { |
4844 | 173 octave_value tmp = octave_value (array_value ()); |
5279 | 174 return tmp.convert_to_str (pad, force, type); |
4457 | 175 } |
176 | |
4643 | 177 void |
178 octave_bool_matrix::print_raw (std::ostream& os, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
179 bool pr_as_read_syntax) const |
4643 | 180 { |
181 octave_print_internal (os, matrix, pr_as_read_syntax, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
182 current_print_indent_level ()); |
4643 | 183 } |
184 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
185 bool |
6974 | 186 octave_bool_matrix::save_ascii (std::ostream& os) |
4687 | 187 { |
188 dim_vector d = dims (); | |
189 if (d.length () > 2) | |
190 { | |
191 NDArray tmp = array_value (); | |
192 os << "# ndims: " << d.length () << "\n"; | |
193 | |
5275 | 194 for (int i = 0; i < d.length (); i++) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
195 os << " " << d (i); |
4687 | 196 |
197 os << "\n" << tmp; | |
198 } | |
199 else | |
200 { | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
201 // Keep this case, rather than use generic code above for backward |
4687 | 202 // compatiability. Makes load_ascii much more complex!! |
203 os << "# rows: " << rows () << "\n" | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
204 << "# columns: " << columns () << "\n"; |
4687 | 205 |
206 Matrix tmp = matrix_value (); | |
207 | |
208 os << tmp; | |
209 } | |
210 | |
211 return true; | |
212 } | |
213 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
214 bool |
4687 | 215 octave_bool_matrix::load_ascii (std::istream& is) |
216 { | |
217 bool success = true; | |
218 | |
5099 | 219 string_vector keywords (2); |
4687 | 220 |
5099 | 221 keywords[0] = "ndims"; |
222 keywords[1] = "rows"; | |
4687 | 223 |
5099 | 224 std::string kw; |
5275 | 225 octave_idx_type val = 0; |
4687 | 226 |
5099 | 227 if (extract_keyword (is, keywords, kw, val, true)) |
4687 | 228 { |
5099 | 229 if (kw == "ndims") |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
230 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
231 int mdims = static_cast<int> (val); |
4687 | 232 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
233 if (mdims >= 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
234 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
235 dim_vector dv; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
236 dv.resize (mdims); |
5099 | 237 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
238 for (int i = 0; i < mdims; i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
239 is >> dv(i); |
5099 | 240 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
241 if (is) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
242 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
243 boolNDArray btmp (dv); |
6717 | 244 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
245 if (btmp.is_empty ()) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
246 matrix = btmp; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
247 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
248 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
249 NDArray tmp(dv); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
250 is >> tmp; |
5099 | 251 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
252 if (is) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
253 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
254 for (octave_idx_type i = 0; i < btmp.nelem (); i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
255 btmp.elem (i) = (tmp.elem (i) != 0.); |
6717 | 256 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
257 matrix = btmp; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
258 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
259 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
260 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
261 error ("load: failed to load matrix constant"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
262 success = false; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
263 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
264 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
265 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
266 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
267 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
268 error ("load: failed to extract dimensions"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
269 success = false; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
270 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
271 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
272 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
273 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
274 error ("load: failed to extract number of dimensions"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
275 success = false; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
276 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
277 } |
5099 | 278 else if (kw == "rows") |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
279 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
280 octave_idx_type nr = val; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
281 octave_idx_type nc = 0; |
5099 | 282 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
283 if (nr >= 0 && extract_keyword (is, "columns", nc) && nc >= 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
284 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
285 if (nr > 0 && nc > 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
286 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
287 Matrix tmp (nr, nc); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
288 is >> tmp; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
289 if (is) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
290 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
291 boolMatrix btmp (nr, nc); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
292 for (octave_idx_type j = 0; j < nc; j++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
293 for (octave_idx_type i = 0; i < nr; i++) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
294 btmp.elem (i,j) = (tmp.elem (i, j) != 0.); |
6717 | 295 |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
296 matrix = btmp; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
297 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
298 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
299 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
300 error ("load: failed to load matrix constant"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
301 success = false; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
302 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
303 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
304 else if (nr == 0 || nc == 0) |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
305 matrix = boolMatrix (nr, nc); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
306 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
307 panic_impossible (); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
308 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
309 else |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
310 { |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
311 error ("load: failed to extract number of rows and columns"); |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
312 success = false; |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
313 } |
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
314 } |
5099 | 315 else |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
316 panic_impossible (); |
5099 | 317 } |
318 else | |
319 { | |
320 error ("load: failed to extract number of rows and columns"); | |
321 success = false; | |
4687 | 322 } |
323 | |
324 return success; | |
325 } | |
326 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
327 bool |
4687 | 328 octave_bool_matrix::save_binary (std::ostream& os, bool& /* save_as_floats */) |
329 { | |
330 | |
331 dim_vector d = dims (); | |
332 if (d.length() < 1) | |
333 return false; | |
334 | |
335 // Use negative value for ndims to differentiate with old format!! | |
5828 | 336 int32_t tmp = - d.length(); |
5760 | 337 os.write (reinterpret_cast<char *> (&tmp), 4); |
5275 | 338 for (int i = 0; i < d.length (); i++) |
4687 | 339 { |
340 tmp = d(i); | |
5760 | 341 os.write (reinterpret_cast<char *> (&tmp), 4); |
4687 | 342 } |
343 | |
344 boolNDArray m = bool_array_value (); | |
345 bool *mtmp = m.fortran_vec (); | |
5275 | 346 octave_idx_type nel = m.nelem (); |
4687 | 347 OCTAVE_LOCAL_BUFFER (char, htmp, nel); |
348 | |
5275 | 349 for (octave_idx_type i = 0; i < nel; i++) |
4687 | 350 htmp[i] = (mtmp[i] ? 1 : 0); |
351 | |
352 os.write (htmp, nel); | |
353 | |
354 return true; | |
355 } | |
356 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
357 bool |
4687 | 358 octave_bool_matrix::load_binary (std::istream& is, bool swap, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
359 oct_mach_info::float_format /* fmt */) |
4687 | 360 { |
5828 | 361 int32_t mdims; |
5760 | 362 if (! is.read (reinterpret_cast<char *> (&mdims), 4)) |
4687 | 363 return false; |
364 if (swap) | |
4944 | 365 swap_bytes<4> (&mdims); |
4687 | 366 if (mdims >= 0) |
367 return false; | |
368 | |
369 // mdims is negative for consistency with other matrices, where it is | |
370 // negative to allow the positive value to be used for rows/cols for | |
371 // backward compatibility | |
372 mdims = - mdims; | |
5828 | 373 int32_t di; |
4687 | 374 dim_vector dv; |
375 dv.resize (mdims); | |
376 | |
377 for (int i = 0; i < mdims; i++) | |
378 { | |
5760 | 379 if (! is.read (reinterpret_cast<char *> (&di), 4)) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
380 return false; |
4687 | 381 if (swap) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
382 swap_bytes<4> (&di); |
4687 | 383 dv(i) = di; |
384 } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
385 |
5157 | 386 // Convert an array with a single dimension to be a row vector. |
387 // Octave should never write files like this, other software | |
388 // might. | |
389 | |
390 if (mdims == 1) | |
391 { | |
392 mdims = 2; | |
393 dv.resize (mdims); | |
394 dv(1) = dv(0); | |
395 dv(0) = 1; | |
396 } | |
397 | |
5275 | 398 octave_idx_type nel = dv.numel (); |
4687 | 399 OCTAVE_LOCAL_BUFFER (char, htmp, nel); |
400 if (! is.read (htmp, nel)) | |
401 return false; | |
402 boolNDArray m(dv); | |
403 bool *mtmp = m.fortran_vec (); | |
5275 | 404 for (octave_idx_type i = 0; i < nel; i++) |
4687 | 405 mtmp[i] = (htmp[i] ? 1 : 0); |
406 matrix = m; | |
407 | |
408 return true; | |
409 } | |
410 | |
411 #if defined (HAVE_HDF5) | |
4944 | 412 |
4687 | 413 bool |
414 octave_bool_matrix::save_hdf5 (hid_t loc_id, const char *name, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
415 bool /* save_as_floats */) |
4687 | 416 { |
4837 | 417 dim_vector dv = dims (); |
418 int empty = save_hdf5_empty (loc_id, name, dv); | |
419 if (empty) | |
4805 | 420 return (empty > 0); |
421 | |
4837 | 422 int rank = dv.length (); |
4687 | 423 hid_t space_hid = -1, data_hid = -1; |
424 bool retval = true; | |
425 boolNDArray m = bool_array_value (); | |
426 | |
4805 | 427 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); |
428 | |
4687 | 429 // Octave uses column-major, while HDF5 uses row-major ordering |
4805 | 430 for (int i = 0; i < rank; i++) |
4837 | 431 hdims[i] = dv (rank-i-1); |
4687 | 432 |
4815 | 433 space_hid = H5Screate_simple (rank, hdims, 0); |
4687 | 434 if (space_hid < 0) return false; |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
435 #if HAVE_HDF5_18 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
436 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
437 H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
438 #else |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
439 data_hid = H5Dcreate (loc_id, name, H5T_NATIVE_HBOOL, space_hid, |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
440 H5P_DEFAULT); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
441 #endif |
4687 | 442 if (data_hid < 0) |
443 { | |
444 H5Sclose (space_hid); | |
445 return false; | |
446 } | |
447 | |
5275 | 448 octave_idx_type nel = m.nelem (); |
4687 | 449 bool *mtmp = m.fortran_vec (); |
6276 | 450 OCTAVE_LOCAL_BUFFER (hbool_t, htmp, nel); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
451 |
5275 | 452 for (octave_idx_type i = 0; i < nel; i++) |
4687 | 453 htmp[i] = mtmp[i]; |
454 | |
455 retval = H5Dwrite (data_hid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
456 H5P_DEFAULT, htmp) >= 0; |
4687 | 457 |
458 H5Dclose (data_hid); | |
459 H5Sclose (space_hid); | |
4837 | 460 |
4687 | 461 return retval; |
462 } | |
463 | |
464 bool | |
9881
b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents:
9852
diff
changeset
|
465 octave_bool_matrix::load_hdf5 (hid_t loc_id, const char *name) |
4687 | 466 { |
4837 | 467 bool retval = false; |
468 | |
4805 | 469 dim_vector dv; |
470 int empty = load_hdf5_empty (loc_id, name, dv); | |
471 if (empty > 0) | |
472 matrix.resize(dv); | |
4837 | 473 if (empty) |
474 return (empty > 0); | |
4805 | 475 |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
476 #if HAVE_HDF5_18 |
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
477 hid_t data_hid = H5Dopen (loc_id, name, H5P_DEFAULT); |
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
478 #else |
4687 | 479 hid_t data_hid = H5Dopen (loc_id, name); |
9892
ac69e6f4b33d
Add HDF5-1.8 compatibility while maintaining compatibility with HDF5-1.6 versions
Kacper Kowalik <xarthisius.kk@gmail.com>
parents:
9881
diff
changeset
|
480 #endif |
4687 | 481 hid_t space_id = H5Dget_space (data_hid); |
482 | |
483 hsize_t rank = H5Sget_simple_extent_ndims (space_id); | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
484 |
4687 | 485 if (rank < 1) |
486 { | |
487 H5Dclose (data_hid); | |
488 return false; | |
489 } | |
490 | |
491 OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank); | |
492 OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank); | |
493 | |
494 H5Sget_simple_extent_dims (space_id, hdims, maxdims); | |
495 | |
496 // Octave uses column-major, while HDF5 uses row-major ordering | |
497 if (rank == 1) | |
498 { | |
499 dv.resize (2); | |
500 dv(0) = 1; | |
501 dv(1) = hdims[0]; | |
502 } | |
503 else | |
504 { | |
505 dv.resize (rank); | |
4815 | 506 for (hsize_t i = 0, j = rank - 1; i < rank; i++, j--) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
507 dv(j) = hdims[i]; |
4687 | 508 } |
509 | |
5275 | 510 octave_idx_type nel = dv.numel (); |
6276 | 511 OCTAVE_LOCAL_BUFFER (hbool_t, htmp, nel); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
512 if (H5Dread (data_hid, H5T_NATIVE_HBOOL, H5S_ALL, H5S_ALL, H5P_DEFAULT, htmp) >= 0) |
4687 | 513 { |
514 retval = true; | |
515 | |
516 boolNDArray btmp (dv); | |
5275 | 517 for (octave_idx_type i = 0; i < nel; i++) |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10160
diff
changeset
|
518 btmp.elem (i) = htmp[i]; |
4687 | 519 |
520 matrix = btmp; | |
521 } | |
522 | |
523 H5Dclose (data_hid); | |
4837 | 524 |
4687 | 525 return retval; |
526 } | |
4944 | 527 |
4687 | 528 #endif |
529 | |
5900 | 530 mxArray * |
531 octave_bool_matrix::as_mxArray (void) const | |
532 { | |
533 mxArray *retval = new mxArray (mxLOGICAL_CLASS, dims (), mxREAL); | |
534 | |
535 bool *pr = static_cast<bool *> (retval->get_data ()); | |
536 | |
6686 | 537 mwSize nel = numel (); |
5900 | 538 |
539 const bool *p = matrix.data (); | |
540 | |
6686 | 541 for (mwIndex i = 0; i < nel; i++) |
5900 | 542 pr[i] = p[i]; |
543 | |
544 return retval; | |
545 } | |
546 | |
9850
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
547 DEFUN (logical, args, , |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
548 "-*- texinfo -*-\n\ |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
549 @deftypefn {Built-in Function} {} logical (@var{x})\n\ |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
550 Convert @var{x} to logical type.\n\ |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
551 @seealso{double, single, char}\n\ |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
552 @end deftypefn") |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
553 { |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
554 octave_value retval; |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
555 |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
556 if (args.length () == 1) |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
557 { |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
558 octave_value arg = args(0); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
559 if (arg.is_bool_type ()) |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
560 retval = arg; |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
561 else if (arg.is_numeric_type ()) |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
562 { |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
563 if (arg.is_sparse_type ()) |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
564 retval = arg.sparse_bool_matrix_value (); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
565 else if (arg.is_scalar_type ()) |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
566 retval = arg.bool_value (); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
567 else |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
568 retval = arg.bool_array_value (); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
569 } |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
570 else |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
571 gripe_wrong_type_arg ("logical", arg); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
572 } |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
573 else |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
574 print_usage (); |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
575 |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
576 return retval; |
85f6c386f2bb
implement built-in logical
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
577 } |
12645
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
578 |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
579 /* |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
580 %!test |
12645
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
581 %! m = eye (2) != 0; |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
582 %! s = !0; |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
583 %! c = {"double", "single", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "logical"}; |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
584 %! for i = 1:numel (c) |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
585 %! assert (logical (eye (2, c{i})), m) |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
586 %! assert (logical (eye (1, c{i})), s) |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
587 %! endfor |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
588 */ |