GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov-intx.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2004-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26// FIXME: Do not uncomment these lines to have this file included only once.
27// The build will break (2/6/2016).
28// #if ! defined (octave_ov_intx_h)
29// #define octave_ov_intx_h 1
30
31#include "octave-config.h"
32
33#include <cstdlib>
34
35#include <iosfwd>
36#include <string>
37
38#include "mx-base.h"
39#include "str-vec.h"
40
41#include "error.h"
42#include "mxarray.h"
43#include "oct-stream.h"
44#include "ov-base.h"
45#include "ov-base-int.h"
46#include "ov-typeinfo.h"
47#include "errwarn.h"
48
49#include "ov-re-mat.h"
50#include "ov-scalar.h"
51
52class
53OCTINTERP_API
56{
57public:
58
61
64
67 (intNDArray<OCTAVE_INT_T> (nda)) { }
68
69 ~OCTAVE_VALUE_INT_MATRIX_T (void) = default;
70
71 octave_base_value * clone (void) const
72 { return new OCTAVE_VALUE_INT_MATRIX_T (*this); }
73
75 { return new OCTAVE_VALUE_INT_MATRIX_T (); }
76
77 bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
78
79 bool isinteger (void) const { return true; }
80
82
83public:
84
86 int8_array_value (void) const { return int8NDArray (matrix); }
87
89 int16_array_value (void) const { return int16NDArray (matrix); }
90
92 int32_array_value (void) const { return int32NDArray (matrix); }
93
95 int64_array_value (void) const { return int64NDArray (matrix); }
96
98 uint8_array_value (void) const { return uint8NDArray (matrix); }
99
101 uint16_array_value (void) const { return uint16NDArray (matrix); }
102
104 uint32_array_value (void) const { return uint32NDArray (matrix); }
105
107 uint64_array_value (void) const { return uint64NDArray (matrix); }
108
109 double
110 double_value (bool = false) const
111 {
112 double retval;
113
114 if (isempty ())
115 err_invalid_conversion (type_name (), "real scalar");
116
117 warn_implicit_conversion ("Octave:array-to-scalar",
118 type_name (), "real scalar");
119
120 retval = matrix(0).double_value ();
121
122 return retval;
123 }
124
125 float
126 float_value (bool = false) const
127 {
128 float retval;
129
130 if (isempty ())
131 err_invalid_conversion (type_name (), "real scalar");
132
133 warn_implicit_conversion ("Octave:array-to-scalar",
134 type_name (), "real scalar");
135
136 retval = matrix(0).float_value ();
137
138 return retval;
139 }
140
141 double scalar_value (bool = false) const { return double_value (); }
142
143 float float_scalar_value (bool = false) const { return float_value (); }
144
145 Matrix
146 matrix_value (bool = false) const
147 {
148 Matrix retval;
149 dim_vector dv = dims ();
150 if (dv.ndims () > 2)
151 error ("invalid conversion of %s to Matrix", type_name ().c_str ());
152
153 retval = Matrix (dv(0), dv(1));
154 double *vec = retval.fortran_vec ();
155 octave_idx_type nel = matrix.numel ();
156 for (octave_idx_type i = 0; i < nel; i++)
157 vec[i] = matrix(i).double_value ();
158
159 return retval;
160 }
161
163 float_matrix_value (bool = false) const
164 {
165 FloatMatrix retval;
166 dim_vector dv = dims ();
167 if (dv.ndims () > 2)
168 error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
169
170 retval = FloatMatrix (dv(0), dv(1));
171 float *vec = retval.fortran_vec ();
172 octave_idx_type nel = matrix.numel ();
173 for (octave_idx_type i = 0; i < nel; i++)
174 vec[i] = matrix(i).float_value ();
175
176 return retval;
177 }
178
180 complex_matrix_value (bool = false) const
181 {
182 ComplexMatrix retval;
183 dim_vector dv = dims ();
184 if (dv.ndims () > 2)
185 error ("invalid conversion of %s to Matrix", type_name ().c_str ());
186
187 retval = ComplexMatrix (dv(0), dv(1));
188 Complex *vec = retval.fortran_vec ();
189 octave_idx_type nel = matrix.numel ();
190 for (octave_idx_type i = 0; i < nel; i++)
191 vec[i] = Complex (matrix(i).double_value ());
192
193 return retval;
194 }
195
197 float_complex_matrix_value (bool = false) const
198 {
199 FloatComplexMatrix retval;
200 dim_vector dv = dims ();
201 if (dv.ndims () > 2)
202 error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ());
203
204 retval = FloatComplexMatrix (dv(0), dv(1));
205 FloatComplex *vec = retval.fortran_vec ();
206 octave_idx_type nel = matrix.numel ();
207 for (octave_idx_type i = 0; i < nel; i++)
208 vec[i] = FloatComplex (matrix(i).float_value ());
209
210 return retval;
211 }
212
213 NDArray
214 array_value (bool = false) const
215 {
216 NDArray retval (matrix.dims ());
217 double *vec = retval.fortran_vec ();
218 octave_idx_type nel = matrix.numel ();
219 for (octave_idx_type i = 0; i < nel; i++)
220 vec[i] = matrix(i).double_value ();
221 return retval;
222 }
223
225 float_array_value (bool = false) const
226 {
227 FloatNDArray retval (matrix.dims ());
228 float *vec = retval.fortran_vec ();
229 octave_idx_type nel = matrix.numel ();
230 for (octave_idx_type i = 0; i < nel; i++)
231 vec[i] = matrix(i).float_value ();
232 return retval;
233 }
234
236 complex_array_value (bool = false) const
237 {
238 ComplexNDArray retval (matrix.dims ());
239 Complex *vec = retval.fortran_vec ();
240 octave_idx_type nel = matrix.numel ();
241 for (octave_idx_type i = 0; i < nel; i++)
242 vec[i] = Complex (matrix(i).double_value ());
243 return retval;
244 }
245
247 float_complex_array_value (bool = false) const
248 {
249 FloatComplexNDArray retval (matrix.dims ());
250 FloatComplex *vec = retval.fortran_vec ();
251 octave_idx_type nel = matrix.numel ();
252 for (octave_idx_type i = 0; i < nel; i++)
253 vec[i] = FloatComplex (matrix(i).float_value ());
254 return retval;
255 }
256
258 bool_array_value (bool warn = false) const
259 {
260 boolNDArray retval (dims ());
261
262 octave_idx_type nel = numel ();
263
264 if (warn && matrix.any_element_not_one_or_zero ())
266
267 bool *vec = retval.fortran_vec ();
268 for (octave_idx_type i = 0; i < nel; i++)
269 vec[i] = matrix(i).bool_value ();
270
271 return retval;
272 }
273
275 char_array_value (bool = false) const
276 {
277 charNDArray retval (dims ());
278
279 octave_idx_type nel = numel ();
280
281 char *vec = retval.fortran_vec ();
282 for (octave_idx_type i = 0; i < nel; i++)
283 vec[i] = matrix(i).char_value ();
284
285 return retval;
286 }
287
288 // Use matrix_ref here to clear index cache.
289 void increment (void)
290 {
291 matrix_ref () += OCTAVE_INT_T (1);
292 }
293
294 void decrement (void)
295 {
296 matrix_ref () -= OCTAVE_INT_T (1);
297 }
298
299 void changesign (void)
300 {
301 matrix_ref ().changesign ();
302 }
303
304 octave::idx_vector index_vector (bool /* require_integers */ = false) const
305 {
306 return idx_cache ? *idx_cache : set_idx_cache (octave::idx_vector (matrix));
307 }
308
309 int write (octave::stream& os, int block_size,
310 oct_data_conv::data_type output_type, int skip,
312 { return os.write (matrix, block_size, output_type, skip, flt_fmt); }
313
314 mxArray * as_mxArray (bool interleaved) const
315 {
316 mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, dims (),
317 mxREAL);
318
319 OCTAVE_INT_T::val_type *pd
320 = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
321
322 mwSize nel = numel ();
323
324 const OCTAVE_INT_T *pdata = matrix.data ();
325
326 for (mwIndex i = 0; i < nel; i++)
327 pd[i] = pdata[i].value ();
328
329 return retval;
330 }
331
333 {
334 switch (umap)
335 {
336 case umap_abs:
337 return matrix.abs ();
338 case umap_signum:
339 return matrix.signum ();
340 case umap_ceil:
341 case umap_conj:
342 case umap_fix:
343 case umap_floor:
344 case umap_real:
345 case umap_round:
346 return matrix;
347 case umap_imag:
348 return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ());
349 case umap_isnan:
350 case umap_isna:
351 case umap_isinf:
352 return boolNDArray (matrix.dims (), false);
353 case umap_isfinite:
354 return boolNDArray (matrix.dims (), true);
355
356 // Special cases for Matlab compatibility.
357 case umap_xtolower:
358 case umap_xtoupper:
359 return matrix;
360
361 default:
362 {
363 // FIXME: we should be able to do better than converting to
364 // double here.
365 octave_matrix m (array_value ());
366 return m.map (umap);
367 }
368 }
369 }
370
371 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
372 {
373 return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
374 }
375
376 bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
377 {
378 return load_hdf5_internal (loc_id, hdf5_save_type, name);
379 }
380
381private:
382
384
386};
387
388class
389OCTINTERP_API
392{
393public:
394
397
400
401 ~OCTAVE_VALUE_INT_SCALAR_T (void) = default;
402
404 { return new OCTAVE_VALUE_INT_SCALAR_T (*this); }
405
407 { return new OCTAVE_VALUE_INT_MATRIX_T (); }
408
410 bool resize_ok = false)
411 {
412 // FIXME: this doesn't solve the problem of
413 //
414 // a = 1; a([1,1], [1,1], [1,1])
415 //
416 // and similar constructions. Hmm...
417
418 // FIXME: using this constructor avoids narrowing the
419 // 1x1 matrix back to a scalar value. Need a better solution
420 // to this problem.
421
422 octave_value tmp
425
426 return tmp.index_op (idx, resize_ok);
427 }
428
429 bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; }
430
431 bool isinteger (void) const { return true; }
432
434
435public:
436
438 int8_scalar_value (void) const { return octave_int8 (scalar); }
439
441 int16_scalar_value (void) const { return octave_int16 (scalar); }
442
444 int32_scalar_value (void) const { return octave_int32 (scalar); }
445
447 int64_scalar_value (void) const { return octave_int64 (scalar); }
448
450 uint8_scalar_value (void) const { return octave_uint8 (scalar); }
451
453 uint16_scalar_value (void) const { return octave_uint16 (scalar); }
454
456 uint32_scalar_value (void) const { return octave_uint32 (scalar); }
457
459 uint64_scalar_value (void) const { return octave_uint64 (scalar); }
460
462 int8_array_value (void) const
463 { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
464
466 int16_array_value (void) const
467 { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
468
470 int32_array_value (void) const
471 { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
472
474 int64_array_value (void) const
475 { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
476
478 uint8_array_value (void) const
479 { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
480
483 { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
484
487 { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
488
491 { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); }
492
493 octave_value resize (const dim_vector& dv, bool fill = false) const
494 {
495 if (fill)
496 {
497 intNDArray<OCTAVE_INT_T> retval (dv, 0);
498 if (dv.numel ())
499 retval(0) = scalar;
500 return retval;
501 }
502 else
503 {
504 intNDArray<OCTAVE_INT_T> retval (dv);
505 if (dv.numel ())
506 retval(0) = scalar;
507 return retval;
508 }
509 }
510
511 double double_value (bool = false) const { return scalar.double_value (); }
512
513 float float_value (bool = false) const { return scalar.float_value (); }
514
515 double scalar_value (bool = false) const { return scalar.double_value (); }
516
517 float float_scalar_value (bool = false) const
518 { return scalar.float_value (); }
519
520 Matrix
521 matrix_value (bool = false) const
522 {
523 Matrix retval (1, 1);
524 retval(0, 0) = scalar.double_value ();
525 return retval;
526 }
527
529 float_matrix_value (bool = false) const
530 {
531 FloatMatrix retval (1, 1);
532 retval(0, 0) = scalar.float_value ();
533 return retval;
534 }
535
537 complex_matrix_value (bool = false) const
538 {
539 ComplexMatrix retval (1, 1);
540 retval(0, 0) = Complex (scalar.double_value ());
541 return retval;
542 }
543
545 float_complex_matrix_value (bool = false) const
546 {
547 FloatComplexMatrix retval (1, 1);
548 retval(0, 0) = FloatComplex (scalar.float_value ());
549 return retval;
550 }
551
552 NDArray
553 array_value (bool = false) const
554 {
555 NDArray retval (dim_vector (1, 1));
556 retval(0) = scalar.double_value ();
557 return retval;
558 }
559
561 float_array_value (bool = false) const
562 {
563 FloatNDArray retval (dim_vector (1, 1));
564 retval(0) = scalar.float_value ();
565 return retval;
566 }
567
569 complex_array_value (bool = false) const
570 {
571 ComplexNDArray retval (dim_vector (1, 1));
572 retval(0) = Complex (scalar.double_value ());
573 return retval;
574 }
575
577 float_complex_array_value (bool = false) const
578 {
579 FloatComplexNDArray retval (dim_vector (1, 1));
580 retval(0) = FloatComplex (scalar.float_value ());
581 return retval;
582 }
583
584 bool bool_value (bool warn = false) const
585 {
586 if (warn && scalar != 0.0 && scalar != 1.0)
588
589 return scalar.bool_value ();
590 }
591
593 bool_array_value (bool warn = false) const
594 {
595 boolNDArray retval (dim_vector (1, 1));
596
597 if (warn && scalar != 0.0 && scalar != 1.0)
599
600 retval(0) = scalar.bool_value ();
601
602 return retval;
603 }
604
606 char_array_value (bool = false) const
607 {
608 charNDArray retval (dim_vector (1, 1));
609 retval(0) = scalar.char_value ();
610 return retval;
611 }
612
613 void increment (void)
614 {
615 scalar += OCTAVE_INT_T (1);
616 }
617
618 void decrement (void)
619 {
620 scalar -= OCTAVE_INT_T (1);
621 }
622
623 octave::idx_vector index_vector (bool /* require_integers */ = false) const
624 { return octave::idx_vector (scalar); }
625
626 int write (octave::stream& os, int block_size,
627 oct_data_conv::data_type output_type, int skip,
629 {
631 block_size, output_type, skip, flt_fmt);
632 }
633
634 mxArray * as_mxArray (bool interleaved) const
635 {
636 mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, 1, 1,
637 mxREAL);
638
639 OCTAVE_INT_T::val_type *pd
640 = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
641
642 pd[0] = scalar.value ();
643
644 return retval;
645 }
646
648 {
649 switch (umap)
650 {
651 case umap_abs:
652 return scalar.abs ();
653 case umap_signum:
654 return scalar.signum ();
655 case umap_ceil:
656 case umap_conj:
657 case umap_fix:
658 case umap_floor:
659 case umap_real:
660 case umap_round:
661 return scalar;
662 case umap_imag:
663 return OCTAVE_INT_T ();
664 case umap_isnan:
665 case umap_isna:
666 case umap_isinf:
667 return false;
668 case umap_isfinite:
669 return true;
670
671 // Special cases for Matlab compatibility.
672 case umap_xtolower:
673 case umap_xtoupper:
674 return scalar;
675
676 default:
677 {
678 octave_scalar m (scalar_value ());
679 return m.map (umap);
680 }
681 }
682 }
683
684 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
685 {
686 return save_hdf5_internal (loc_id, hdf5_save_type, name, flag);
687 }
688
689 bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
690 {
691 return load_hdf5_internal (loc_id, hdf5_save_type, name);
692 }
693
694private:
695
697
699};
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:129
OCTARRAY_API T * fortran_vec(void)
Size of the specified dimension.
Definition: Array.cc:1744
Definition: dMatrix.h:42
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition: dim-vector.h:335
octave_idx_type ndims(void) const
Number of dimensions.
Definition: dim-vector.h:257
void * get_data(void) const
Definition: mxarray.h:497
OCTINTERP_API octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, mach_info::float_format flt_fmt)
Definition: oct-stream.cc:6773
octave_value map(unary_mapper_t umap) const
Definition: ov-re-mat.cc:913
octave_value map(unary_mapper_t umap) const
Definition: ov-scalar.cc:371
octave::idx_vector index_vector(bool=false) const
Definition: ov-intx.h:304
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:81
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:383
double double_value(bool=false) const
Definition: ov-intx.h:110
float float_value(bool=false) const
Definition: ov-intx.h:126
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:95
void increment(void)
Definition: ov-intx.h:289
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:74
octave_base_value * clone(void) const
Definition: ov-intx.h:71
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:101
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:163
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:332
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:258
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:197
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:107
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:371
float float_scalar_value(bool=false) const
Definition: ov-intx.h:143
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:225
void changesign(void)
Definition: ov-intx.h:299
bool isinteger(void) const
Definition: ov-intx.h:79
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:146
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
Definition: ov-intx.h:309
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:247
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:236
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:98
NDArray array_value(bool=false) const
Definition: ov-intx.h:214
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:89
void decrement(void)
Definition: ov-intx.h:294
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:376
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:104
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:275
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:180
mxArray * as_mxArray(bool interleaved) const
Definition: ov-intx.h:314
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:86
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:92
double scalar_value(bool=false) const
Definition: ov-intx.h:141
Matrix matrix_value(bool=false) const
Definition: ov-intx.h:521
octave_uint32 uint32_scalar_value(void) const
Definition: ov-intx.h:456
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov-intx.h:409
int8NDArray int8_array_value(void) const
Definition: ov-intx.h:462
FloatNDArray float_array_value(bool=false) const
Definition: ov-intx.h:561
int32NDArray int32_array_value(void) const
Definition: ov-intx.h:470
uint64NDArray uint64_array_value(void) const
Definition: ov-intx.h:490
void increment(void)
Definition: ov-intx.h:613
bool bool_value(bool warn=false) const
Definition: ov-intx.h:584
FloatMatrix float_matrix_value(bool=false) const
Definition: ov-intx.h:529
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition: ov-intx.h:684
void decrement(void)
Definition: ov-intx.h:618
int64NDArray int64_array_value(void) const
Definition: ov-intx.h:474
uint8NDArray uint8_array_value(void) const
Definition: ov-intx.h:478
octave_int8 int8_scalar_value(void) const
Definition: ov-intx.h:438
NDArray array_value(bool=false) const
Definition: ov-intx.h:553
octave_base_value * empty_clone(void) const
Definition: ov-intx.h:406
ComplexNDArray complex_array_value(bool=false) const
Definition: ov-intx.h:569
static octave_hdf5_id hdf5_save_type
Definition: ov-intx.h:696
int write(octave::stream &os, int block_size, oct_data_conv::data_type output_type, int skip, octave::mach_info::float_format flt_fmt) const
Definition: ov-intx.h:626
octave_uint16 uint16_scalar_value(void) const
Definition: ov-intx.h:453
float float_value(bool=false) const
Definition: ov-intx.h:513
double double_value(bool=false) const
Definition: ov-intx.h:511
ComplexMatrix complex_matrix_value(bool=false) const
Definition: ov-intx.h:537
octave::idx_vector index_vector(bool=false) const
Definition: ov-intx.h:623
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition: ov-intx.h:577
double scalar_value(bool=false) const
Definition: ov-intx.h:515
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition: ov-intx.h:545
octave_base_value * clone(void) const
Definition: ov-intx.h:403
octave_uint8 uint8_scalar_value(void) const
Definition: ov-intx.h:450
octave_int64 int64_scalar_value(void) const
Definition: ov-intx.h:447
builtin_type_t builtin_type(void) const
Definition: ov-intx.h:433
int16NDArray int16_array_value(void) const
Definition: ov-intx.h:466
uint32NDArray uint32_array_value(void) const
Definition: ov-intx.h:486
float float_scalar_value(bool=false) const
Definition: ov-intx.h:517
octave_value map(unary_mapper_t umap) const
Definition: ov-intx.h:647
octave_uint64 uint64_scalar_value(void) const
Definition: ov-intx.h:459
bool isinteger(void) const
Definition: ov-intx.h:431
uint16NDArray uint16_array_value(void) const
Definition: ov-intx.h:482
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov-intx.h:493
mxArray * as_mxArray(bool interleaved) const
Definition: ov-intx.h:634
octave_int32 int32_scalar_value(void) const
Definition: ov-intx.h:444
octave_int16 int16_scalar_value(void) const
Definition: ov-intx.h:441
charNDArray char_array_value(bool=false) const
Definition: ov-intx.h:606
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov-intx.h:689
boolNDArray bool_array_value(bool warn=false) const
Definition: ov-intx.h:593
octave_value signum(void) const
Definition: ov.h:1607
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:550
octave_value abs(void) const
Definition: ov.h:1568
void error(const char *fmt,...)
Definition: error.cc:980
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition: errwarn.cc:71
void warn_logical_conversion(void)
Definition: errwarn.cc:365
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition: errwarn.cc:344
QString name
octave::idx_vector idx_vector
Definition: idx-vector.h:1037
intNDArray< octave_int16 > int16NDArray
Definition: int16NDArray.h:36
intNDArray< octave_int32 > int32NDArray
Definition: int32NDArray.h:36
intNDArray< octave_int64 > int64NDArray
Definition: int64NDArray.h:36
intNDArray< octave_int8 > int8NDArray
Definition: int8NDArray.h:36
void mxArray
Definition: mex.h:58
class OCTAVE_API boolNDArray
Definition: mx-fwd.h:42
class OCTAVE_API Matrix
Definition: mx-fwd.h:31
class OCTAVE_API ComplexMatrix
Definition: mx-fwd.h:32
class OCTAVE_API FloatComplexMatrix
Definition: mx-fwd.h:34
class OCTAVE_API FloatMatrix
Definition: mx-fwd.h:33
std::complex< double > Complex
Definition: oct-cmplx.h:33
std::complex< float > FloatComplex
Definition: oct-cmplx.h:34
int64_t octave_hdf5_id
octave_int< uint32_t > octave_uint32
octave_int< int32_t > octave_int32
octave_int< int16_t > octave_int16
octave_int< int8_t > octave_int8
octave_int< int64_t > octave_int64
octave_int< uint64_t > octave_uint64
octave_int< uint16_t > octave_uint16
octave_int< uint8_t > octave_uint8
T::size_type numel(const T &str)
Definition: oct-string.cc:71
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
Definition: ov-base.h:173
builtin_type_t
Definition: ov-base.h:75
#define OCTAVE_INT_MX_CLASS
Definition: ov-int16.h:41
#define OCTAVE_TYPE_PREDICATE_FUNCTION
Definition: ov-int16.h:39
#define OCTAVE_INT_BTYP
Definition: ov-int16.h:43
#define OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION
Definition: ov-int16.h:34
#define OCTAVE_INT_T
Definition: ov-int16.h:31
#define OCTAVE_VALUE_INT_MATRIX_T
Definition: ov-int16.h:33
#define OCTAVE_VALUE_INT_SCALAR_T
Definition: ov-int16.h:36
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:679
intNDArray< octave_uint16 > uint16NDArray
Definition: uint16NDArray.h:36
intNDArray< octave_uint32 > uint32NDArray
Definition: uint32NDArray.h:36
intNDArray< octave_uint64 > uint64NDArray
Definition: uint64NDArray.h:36
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:36