GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
ov-intx.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2004-2025 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
52extern template class OCTINTERP_EXTERN_TEMPLATE_API octave_base_int_matrix<intNDArray<OCTAVE_INT_T>>;
53
54class OCTINTERP_API OCTAVE_VALUE_INT_MATRIX_T
55 : public octave_base_int_matrix<intNDArray<OCTAVE_INT_T>>
56{
57public:
58
61
64
68
69 ~OCTAVE_VALUE_INT_MATRIX_T () = default;
70
72 { return new OCTAVE_VALUE_INT_MATRIX_T (*this); }
73
76
77 bool OCTAVE_TYPE_PREDICATE_FUNCTION () const { return true; }
78
79 bool isinteger () const { return true; }
80
82
83public:
84
86 int8_array_value () const { return int8NDArray (m_matrix); }
87
89 int16_array_value () const { return int16NDArray (m_matrix); }
90
92 int32_array_value () const { return int32NDArray (m_matrix); }
93
95 int64_array_value () const { return int64NDArray (m_matrix); }
96
98 uint8_array_value () const { return uint8NDArray (m_matrix); }
99
101 uint16_array_value () const { return uint16NDArray (m_matrix); }
102
104 uint32_array_value () const { return uint32NDArray (m_matrix); }
105
107 uint64_array_value () const { return uint64NDArray (m_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 = m_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 = m_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 const 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.rwdata ();
155 octave_idx_type nel = m_matrix.numel ();
156 for (octave_idx_type i = 0; i < nel; i++)
157 vec[i] = m_matrix(i).double_value ();
158
159 return retval;
160 }
161
163 float_matrix_value (bool = false) const
164 {
165 FloatMatrix retval;
166 const 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.rwdata ();
172 octave_idx_type nel = m_matrix.numel ();
173 for (octave_idx_type i = 0; i < nel; i++)
174 vec[i] = m_matrix(i).float_value ();
175
176 return retval;
177 }
178
180 complex_matrix_value (bool = false) const
181 {
182 ComplexMatrix retval;
183 const 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.rwdata ();
189 octave_idx_type nel = m_matrix.numel ();
190 for (octave_idx_type i = 0; i < nel; i++)
191 vec[i] = Complex (m_matrix(i).double_value ());
192
193 return retval;
194 }
195
197 float_complex_matrix_value (bool = false) const
198 {
199 FloatComplexMatrix retval;
200 const 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.rwdata ();
206 octave_idx_type nel = m_matrix.numel ();
207 for (octave_idx_type i = 0; i < nel; i++)
208 vec[i] = FloatComplex (m_matrix(i).float_value ());
209
210 return retval;
211 }
212
213 NDArray
214 array_value (bool = false) const
215 {
216 NDArray retval (m_matrix.dims ());
217 double *vec = retval.rwdata ();
218 octave_idx_type nel = m_matrix.numel ();
219 for (octave_idx_type i = 0; i < nel; i++)
220 vec[i] = m_matrix(i).double_value ();
221 return retval;
222 }
223
225 float_array_value (bool = false) const
226 {
227 FloatNDArray retval (m_matrix.dims ());
228 float *vec = retval.rwdata ();
229 octave_idx_type nel = m_matrix.numel ();
230 for (octave_idx_type i = 0; i < nel; i++)
231 vec[i] = m_matrix(i).float_value ();
232 return retval;
233 }
234
236 complex_array_value (bool = false) const
237 {
238 ComplexNDArray retval (m_matrix.dims ());
239 Complex *vec = retval.rwdata ();
240 octave_idx_type nel = m_matrix.numel ();
241 for (octave_idx_type i = 0; i < nel; i++)
242 vec[i] = Complex (m_matrix(i).double_value ());
243 return retval;
244 }
245
247 float_complex_array_value (bool = false) const
248 {
249 FloatComplexNDArray retval (m_matrix.dims ());
250 FloatComplex *vec = retval.rwdata ();
251 octave_idx_type nel = m_matrix.numel ();
252 for (octave_idx_type i = 0; i < nel; i++)
253 vec[i] = FloatComplex (m_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 && m_matrix.any_element_not_one_or_zero ())
266
267 bool *vec = retval.rwdata ();
268 for (octave_idx_type i = 0; i < nel; i++)
269 vec[i] = m_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.rwdata ();
282 for (octave_idx_type i = 0; i < nel; i++)
283 vec[i] = m_matrix(i).char_value ();
284
285 return retval;
286 }
287
288 // Use matrix_ref here to clear index cache.
289 void increment ()
290 {
291 matrix_ref () += OCTAVE_INT_T (1);
292 }
293
294 void decrement ()
295 {
296 matrix_ref () -= OCTAVE_INT_T (1);
297 }
298
300 {
301 matrix_ref ().changesign ();
302 }
303
304 octave::idx_vector index_vector (bool /* require_integers */ = false) const
305 {
306 return m_idx_cache ? *m_idx_cache
307 : set_idx_cache (octave::idx_vector (m_matrix));
308 }
309
310 int write (octave::stream& os, int block_size,
311 oct_data_conv::data_type output_type, int skip,
312 octave::mach_info::float_format flt_fmt) const
313 { return os.write (m_matrix, block_size, output_type, skip, flt_fmt); }
314
315 mxArray * as_mxArray (bool interleaved) const
316 {
317 mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, dims (),
318 mxREAL);
319
320 OCTAVE_INT_T::val_type *pd
321 = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
322
323 mwSize nel = numel ();
324
325 const OCTAVE_INT_T *pdata = m_matrix.data ();
326
327 for (mwIndex i = 0; i < nel; i++)
328 pd[i] = pdata[i].value ();
329
330 return retval;
331 }
332
334 {
335 switch (umap)
336 {
337 case umap_abs:
338 return m_matrix.abs ();
339 case umap_signum:
340 return m_matrix.signum ();
341 case umap_ceil:
342 case umap_conj:
343 case umap_fix:
344 case umap_floor:
345 case umap_real:
346 case umap_round:
347 return m_matrix;
348 case umap_imag:
349 return intNDArray<OCTAVE_INT_T> (m_matrix.dims (), OCTAVE_INT_T ());
350 case umap_isnan:
351 case umap_isna:
352 case umap_isinf:
353 return boolNDArray (m_matrix.dims (), false);
354 case umap_isfinite:
355 return boolNDArray (m_matrix.dims (), true);
356
357 // Special cases for Matlab compatibility.
358 case umap_xtolower:
359 case umap_xtoupper:
360 return m_matrix;
361
362 default:
363 {
364 // FIXME: we should be able to do better than converting to
365 // double here.
366 octave_matrix m (array_value ());
367 return m.map (umap);
368 }
369 }
370 }
371
372 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
373 {
374 return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
375 }
376
377 bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
378 {
379 return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
380 }
381
382private:
383
384 static octave_hdf5_id s_hdf5_save_type;
385
387};
388
389extern template class OCTINTERP_EXTERN_TEMPLATE_API octave_base_int_scalar<OCTAVE_INT_T>;
390
391class
392OCTINTERP_API
395{
396public:
397
400
403
404 ~OCTAVE_VALUE_INT_SCALAR_T () = default;
405
407 { return new OCTAVE_VALUE_INT_SCALAR_T (*this); }
408
410 { return new OCTAVE_VALUE_INT_MATRIX_T (); }
411
413 bool resize_ok = false)
414 {
415 // FIXME: this doesn't solve the problem of
416 //
417 // a = 1; a([1,1], [1,1], [1,1])
418 //
419 // and similar constructions. Hmm...
420
421 // FIXME: using this constructor avoids narrowing the
422 // 1x1 matrix back to a scalar value. Need a better solution
423 // to this problem.
424
425 octave_value tmp
428
429 return tmp.index_op (idx, resize_ok);
430 }
431
432 bool OCTAVE_TYPE_PREDICATE_FUNCTION () const { return true; }
433
434 bool isinteger () const { return true; }
435
437
438public:
439
441 int8_scalar_value () const { return octave_int8 (scalar); }
442
444 int16_scalar_value () const { return octave_int16 (scalar); }
445
447 int32_scalar_value () const { return octave_int32 (scalar); }
448
450 int64_scalar_value () const { return octave_int64 (scalar); }
451
453 uint8_scalar_value () const { return octave_uint8 (scalar); }
454
456 uint16_scalar_value () const { return octave_uint16 (scalar); }
457
459 uint32_scalar_value () const { return octave_uint32 (scalar); }
460
462 uint64_scalar_value () const { return octave_uint64 (scalar); }
463
466 { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); }
467
470 { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); }
471
474 { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); }
475
478 { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); }
479
482 { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); }
483
486 { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); }
487
490 { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); }
491
494 { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); }
495
496 octave_value resize (const dim_vector& dv, bool fill = false) const
497 {
498 if (fill)
499 {
500 intNDArray<OCTAVE_INT_T> retval (dv, 0);
501 if (dv.numel ())
502 retval(0) = scalar;
503 return retval;
504 }
505 else
506 {
507 intNDArray<OCTAVE_INT_T> retval (dv);
508 if (dv.numel ())
509 retval(0) = scalar;
510 return retval;
511 }
512 }
513
514 double double_value (bool = false) const { return scalar.double_value (); }
515
516 float float_value (bool = false) const { return scalar.float_value (); }
517
518 double scalar_value (bool = false) const { return scalar.double_value (); }
519
520 float float_scalar_value (bool = false) const
521 { return scalar.float_value (); }
522
523 Matrix
524 matrix_value (bool = false) const
525 {
526 Matrix retval (1, 1);
527 retval(0, 0) = scalar.double_value ();
528 return retval;
529 }
530
532 float_matrix_value (bool = false) const
533 {
534 FloatMatrix retval (1, 1);
535 retval(0, 0) = scalar.float_value ();
536 return retval;
537 }
538
540 complex_matrix_value (bool = false) const
541 {
542 ComplexMatrix retval (1, 1);
543 retval(0, 0) = Complex (scalar.double_value ());
544 return retval;
545 }
546
548 float_complex_matrix_value (bool = false) const
549 {
550 FloatComplexMatrix retval (1, 1);
551 retval(0, 0) = FloatComplex (scalar.float_value ());
552 return retval;
553 }
554
555 NDArray
556 array_value (bool = false) const
557 {
558 NDArray retval (dim_vector (1, 1));
559 retval(0) = scalar.double_value ();
560 return retval;
561 }
562
564 float_array_value (bool = false) const
565 {
566 FloatNDArray retval (dim_vector (1, 1));
567 retval(0) = scalar.float_value ();
568 return retval;
569 }
570
572 complex_array_value (bool = false) const
573 {
574 ComplexNDArray retval (dim_vector (1, 1));
575 retval(0) = Complex (scalar.double_value ());
576 return retval;
577 }
578
580 float_complex_array_value (bool = false) const
581 {
582 FloatComplexNDArray retval (dim_vector (1, 1));
583 retval(0) = FloatComplex (scalar.float_value ());
584 return retval;
585 }
586
587 bool bool_value (bool warn = false) const
588 {
589 if (warn && scalar != 0.0 && scalar != 1.0)
591
592 return scalar.bool_value ();
593 }
594
596 bool_array_value (bool warn = false) const
597 {
598 boolNDArray retval (dim_vector (1, 1));
599
600 if (warn && scalar != 0.0 && scalar != 1.0)
602
603 retval(0) = scalar.bool_value ();
604
605 return retval;
606 }
607
609 char_array_value (bool = false) const
610 {
611 charNDArray retval (dim_vector (1, 1));
612 retval(0) = scalar.char_value ();
613 return retval;
614 }
615
616 void increment ()
617 {
618 scalar += OCTAVE_INT_T (1);
619 }
620
621 void decrement ()
622 {
623 scalar -= OCTAVE_INT_T (1);
624 }
625
626 octave::idx_vector index_vector (bool /* require_integers */ = false) const
627 { return octave::idx_vector (scalar); }
628
629 int write (octave::stream& os, int block_size,
630 oct_data_conv::data_type output_type, int skip,
631 octave::mach_info::float_format flt_fmt) const
632 {
634 block_size, output_type, skip, flt_fmt);
635 }
636
637 mxArray * as_mxArray (bool interleaved) const
638 {
639 mxArray *retval = new mxArray (interleaved, OCTAVE_INT_MX_CLASS, 1, 1,
640 mxREAL);
641
642 OCTAVE_INT_T::val_type *pd
643 = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ());
644
645 pd[0] = scalar.value ();
646
647 return retval;
648 }
649
651 {
652 switch (umap)
653 {
654 case umap_abs:
655 return scalar.abs ();
656 case umap_signum:
657 return scalar.signum ();
658 case umap_ceil:
659 case umap_conj:
660 case umap_fix:
661 case umap_floor:
662 case umap_real:
663 case umap_round:
664 return scalar;
665 case umap_imag:
666 return OCTAVE_INT_T ();
667 case umap_isnan:
668 case umap_isna:
669 case umap_isinf:
670 return false;
671 case umap_isfinite:
672 return true;
673
674 // Special cases for Matlab compatibility.
675 case umap_xtolower:
676 case umap_xtoupper:
677 return scalar;
678
679 default:
680 {
681 octave_scalar m (scalar_value ());
682 return m.map (umap);
683 }
684 }
685 }
686
687 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool flag)
688 {
689 return save_hdf5_internal (loc_id, s_hdf5_save_type, name, flag);
690 }
691
692 bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
693 {
694 return load_hdf5_internal (loc_id, s_hdf5_save_type, name);
695 }
696
697private:
698
699 static octave_hdf5_id s_hdf5_save_type;
700
702};
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
T * rwdata()
Size of the specified dimension.
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
octave_idx_type numel(int n=0) const
Number of elements that a matrix with this dimensions would have.
Definition dim-vector.h:331
octave_idx_type ndims() const
Number of dimensions.
Definition dim-vector.h:253
void * get_data() const
Definition mxarray.h:482
bool save_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name, bool)
bool load_hdf5_internal(octave_hdf5_id loc_id, octave_hdf5_id save_type, const char *name)
octave::idx_vector set_idx_cache(const octave::idx_vector &idx) const
octave::idx_vector * m_idx_cache
octave_idx_type numel() const
dim_vector dims() const
virtual float float_value(bool=false) const
Definition ov-base.cc:585
virtual double double_value(bool=false) const
Definition ov-base.cc:579
octave_value map(unary_mapper_t umap) const
Definition ov-re-mat.cc:910
octave_value map(unary_mapper_t umap) const
Definition ov-scalar.cc:370
octave::idx_vector index_vector(bool=false) const
Definition ov-intx.h:304
bool isinteger() const
Definition ov-intx.h:79
double double_value(bool=false) const
Definition ov-intx.h:110
uint64NDArray uint64_array_value() const
Definition ov-intx.h:107
float float_value(bool=false) const
Definition ov-intx.h:126
uint32NDArray uint32_array_value() const
Definition ov-intx.h:104
FloatMatrix float_matrix_value(bool=false) const
Definition ov-intx.h:163
octave_base_value * empty_clone() const
Definition ov-intx.h:74
octave_value map(unary_mapper_t umap) const
Definition ov-intx.h:333
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
int16NDArray int16_array_value() const
Definition ov-intx.h:89
builtin_type_t builtin_type() const
Definition ov-intx.h:81
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition ov-intx.h:372
float float_scalar_value(bool=false) const
Definition ov-intx.h:143
uint16NDArray uint16_array_value() const
Definition ov-intx.h:101
FloatNDArray float_array_value(bool=false) const
Definition ov-intx.h:225
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:310
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition ov-intx.h:247
int32NDArray int32_array_value() const
Definition ov-intx.h:92
ComplexNDArray complex_array_value(bool=false) const
Definition ov-intx.h:236
int8NDArray int8_array_value() const
Definition ov-intx.h:86
NDArray array_value(bool=false) const
Definition ov-intx.h:214
int64NDArray int64_array_value() const
Definition ov-intx.h:95
octave_base_value * clone() const
Definition ov-intx.h:71
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition ov-intx.h:377
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:315
uint8NDArray uint8_array_value() const
Definition ov-intx.h:98
double scalar_value(bool=false) const
Definition ov-intx.h:141
octave_uint8 uint8_scalar_value() const
Definition ov-intx.h:453
Matrix matrix_value(bool=false) const
Definition ov-intx.h:524
uint16NDArray uint16_array_value() const
Definition ov-intx.h:485
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition ov-intx.h:412
uint32NDArray uint32_array_value() const
Definition ov-intx.h:489
octave_base_value * empty_clone() const
Definition ov-intx.h:409
FloatNDArray float_array_value(bool=false) const
Definition ov-intx.h:564
bool bool_value(bool warn=false) const
Definition ov-intx.h:587
FloatMatrix float_matrix_value(bool=false) const
Definition ov-intx.h:532
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool flag)
Definition ov-intx.h:687
octave_int32 int32_scalar_value() const
Definition ov-intx.h:447
octave_uint32 uint32_scalar_value() const
Definition ov-intx.h:459
builtin_type_t builtin_type() const
Definition ov-intx.h:436
octave_int16 int16_scalar_value() const
Definition ov-intx.h:444
int64NDArray int64_array_value() const
Definition ov-intx.h:477
NDArray array_value(bool=false) const
Definition ov-intx.h:556
ComplexNDArray complex_array_value(bool=false) const
Definition ov-intx.h:572
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:629
octave_uint16 uint16_scalar_value() const
Definition ov-intx.h:456
octave_base_value * clone() const
Definition ov-intx.h:406
float float_value(bool=false) const
Definition ov-intx.h:516
double double_value(bool=false) const
Definition ov-intx.h:514
uint8NDArray uint8_array_value() const
Definition ov-intx.h:481
ComplexMatrix complex_matrix_value(bool=false) const
Definition ov-intx.h:540
octave::idx_vector index_vector(bool=false) const
Definition ov-intx.h:626
int16NDArray int16_array_value() const
Definition ov-intx.h:469
octave_int8 int8_scalar_value() const
Definition ov-intx.h:441
FloatComplexNDArray float_complex_array_value(bool=false) const
Definition ov-intx.h:580
double scalar_value(bool=false) const
Definition ov-intx.h:518
FloatComplexMatrix float_complex_matrix_value(bool=false) const
Definition ov-intx.h:548
octave_int64 int64_scalar_value() const
Definition ov-intx.h:450
int8NDArray int8_array_value() const
Definition ov-intx.h:465
float float_scalar_value(bool=false) const
Definition ov-intx.h:520
octave_uint64 uint64_scalar_value() const
Definition ov-intx.h:462
int32NDArray int32_array_value() const
Definition ov-intx.h:473
octave_value map(unary_mapper_t umap) const
Definition ov-intx.h:650
uint64NDArray uint64_array_value() const
Definition ov-intx.h:493
bool isinteger() const
Definition ov-intx.h:434
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition ov-intx.h:496
mxArray * as_mxArray(bool interleaved) const
Definition ov-intx.h:637
charNDArray char_array_value(bool=false) const
Definition ov-intx.h:609
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition ov-intx.h:692
boolNDArray bool_array_value(bool warn=false) const
Definition ov-intx.h:596
octave_value index_op(const octave_value_list &idx, bool resize_ok=false)
Definition ov.h:504
octave_value signum() const
Definition ov.h:1501
octave_value abs() const
Definition ov.h:1462
void error(const char *fmt,...)
Definition error.cc:1003
void err_invalid_conversion(const std::string &from, const std::string &to)
Definition errwarn.cc:71
void warn_logical_conversion()
Definition errwarn.cc:365
void warn_implicit_conversion(const char *id, const char *from, const char *to)
Definition errwarn.cc:344
intNDArray< octave_int16 > int16NDArray
intNDArray< octave_int32 > int32NDArray
intNDArray< octave_int64 > int64NDArray
intNDArray< octave_int8 > int8NDArray
Definition int8NDArray.h:36
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
#define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA_API(API)
Definition ov-base.h:185
builtin_type_t
Definition ov-base.h:83
#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
intNDArray< octave_uint16 > uint16NDArray
intNDArray< octave_uint32 > uint32NDArray
intNDArray< octave_uint64 > uint64NDArray
intNDArray< octave_uint8 > uint8NDArray