Mercurial > octave
annotate src/octave-value/ov-intx.h @ 15057:46b19589b593
maint: Partition src/ directory with more code in subdirs.
Create new octave-value dir for ov* code.
Create new parse-tre dir for pt* code.
Move OPERATORS and TEMPLATE-INST directories to lowercase names
* octave-value/module.mk: Hook code in octave-value dir into build system.
* octave-value/ov-base-diag.cc,
octave-value/ov-base-diag.h, octave-value/ov-base-int.cc,
octave-value/ov-base-int.h, octave-value/ov-base-mat.cc,
octave-value/ov-base-mat.h, octave-value/ov-base-scalar.cc,
octave-value/ov-base-scalar.h, octave-value/ov-base-sparse.cc,
octave-value/ov-base-sparse.h, octave-value/ov-base.cc, octave-value/ov-base.h,
octave-value/ov-bool-mat.cc, octave-value/ov-bool-mat.h,
octave-value/ov-bool-sparse.cc, octave-value/ov-bool-sparse.h,
octave-value/ov-bool.cc, octave-value/ov-bool.h, octave-value/ov-builtin.cc,
octave-value/ov-builtin.h, octave-value/ov-cell.cc, octave-value/ov-cell.h,
octave-value/ov-ch-mat.cc, octave-value/ov-ch-mat.h, octave-value/ov-class.cc,
octave-value/ov-class.h, octave-value/ov-colon.cc, octave-value/ov-colon.h,
octave-value/ov-complex.cc, octave-value/ov-complex.h,
octave-value/ov-cs-list.cc, octave-value/ov-cs-list.h,
octave-value/ov-cx-diag.cc, octave-value/ov-cx-diag.h,
octave-value/ov-cx-mat.cc, octave-value/ov-cx-mat.h,
octave-value/ov-cx-sparse.cc, octave-value/ov-cx-sparse.h,
octave-value/ov-dld-fcn.cc, octave-value/ov-dld-fcn.h,
octave-value/ov-fcn-handle.cc, octave-value/ov-fcn-handle.h,
octave-value/ov-fcn-inline.cc, octave-value/ov-fcn-inline.h,
octave-value/ov-fcn.cc, octave-value/ov-fcn.h, octave-value/ov-float.cc,
octave-value/ov-float.h, octave-value/ov-flt-complex.cc,
octave-value/ov-flt-complex.h, octave-value/ov-flt-cx-diag.cc,
octave-value/ov-flt-cx-diag.h, octave-value/ov-flt-cx-mat.cc,
octave-value/ov-flt-cx-mat.h, octave-value/ov-flt-re-diag.cc,
octave-value/ov-flt-re-diag.h, octave-value/ov-flt-re-mat.cc,
octave-value/ov-flt-re-mat.h, octave-value/ov-int-traits.h,
octave-value/ov-int16.cc, octave-value/ov-int16.h, octave-value/ov-int32.cc,
octave-value/ov-int32.h, octave-value/ov-int64.cc, octave-value/ov-int64.h,
octave-value/ov-int8.cc, octave-value/ov-int8.h, octave-value/ov-intx.h,
octave-value/ov-lazy-idx.cc, octave-value/ov-lazy-idx.h,
octave-value/ov-mex-fcn.cc, octave-value/ov-mex-fcn.h,
octave-value/ov-null-mat.cc, octave-value/ov-null-mat.h,
octave-value/ov-oncleanup.cc, octave-value/ov-oncleanup.h,
octave-value/ov-perm.cc, octave-value/ov-perm.h, octave-value/ov-range.cc,
octave-value/ov-range.h, octave-value/ov-re-diag.cc, octave-value/ov-re-diag.h,
octave-value/ov-re-mat.cc, octave-value/ov-re-mat.h,
octave-value/ov-re-sparse.cc, octave-value/ov-re-sparse.h,
octave-value/ov-scalar.cc, octave-value/ov-scalar.h,
octave-value/ov-str-mat.cc, octave-value/ov-str-mat.h,
octave-value/ov-struct.cc, octave-value/ov-struct.h,
octave-value/ov-type-conv.h, octave-value/ov-typeinfo.cc,
octave-value/ov-typeinfo.h, octave-value/ov-uint16.cc,
octave-value/ov-uint16.h, octave-value/ov-uint32.cc, octave-value/ov-uint32.h,
octave-value/ov-uint64.cc, octave-value/ov-uint64.h, octave-value/ov-uint8.cc,
octave-value/ov-uint8.h, octave-value/ov-usr-fcn.cc, octave-value/ov-usr-fcn.h,
octave-value/ov.cc, octave-value/ov.h: Moved from src/ dir to octave-value dir.
* operators/module.mk, operators/op-b-b.cc, operators/op-b-bm.cc,
operators/op-b-sbm.cc, operators/op-bm-b.cc, operators/op-bm-bm.cc,
operators/op-bm-sbm.cc, operators/op-cdm-cdm.cc, operators/op-cdm-cm.cc,
operators/op-cdm-cs.cc, operators/op-cdm-dm.cc, operators/op-cdm-m.cc,
operators/op-cdm-s.cc, operators/op-cell.cc, operators/op-chm.cc,
operators/op-class.cc, operators/op-cm-cdm.cc, operators/op-cm-cm.cc,
operators/op-cm-cs.cc, operators/op-cm-dm.cc, operators/op-cm-m.cc,
operators/op-cm-pm.cc, operators/op-cm-s.cc, operators/op-cm-scm.cc,
operators/op-cm-sm.cc, operators/op-cs-cm.cc, operators/op-cs-cs.cc,
operators/op-cs-m.cc, operators/op-cs-s.cc, operators/op-cs-scm.cc,
operators/op-cs-sm.cc, operators/op-dm-cdm.cc, operators/op-dm-cm.cc,
operators/op-dm-cs.cc, operators/op-dm-dm.cc, operators/op-dm-m.cc,
operators/op-dm-s.cc, operators/op-dm-scm.cc, operators/op-dm-sm.cc,
operators/op-dm-template.cc, operators/op-dms-template.cc,
operators/op-double-conv.cc, operators/op-fcdm-fcdm.cc,
operators/op-fcdm-fcm.cc, operators/op-fcdm-fcs.cc, operators/op-fcdm-fdm.cc,
operators/op-fcdm-fm.cc, operators/op-fcdm-fs.cc, operators/op-fcm-fcdm.cc,
operators/op-fcm-fcm.cc, operators/op-fcm-fcs.cc, operators/op-fcm-fdm.cc,
operators/op-fcm-fm.cc, operators/op-fcm-fs.cc, operators/op-fcm-pm.cc,
operators/op-fcn.cc, operators/op-fcs-fcm.cc, operators/op-fcs-fcs.cc,
operators/op-fcs-fm.cc, operators/op-fcs-fs.cc, operators/op-fdm-fcdm.cc,
operators/op-fdm-fcm.cc, operators/op-fdm-fcs.cc, operators/op-fdm-fdm.cc,
operators/op-fdm-fm.cc, operators/op-fdm-fs.cc, operators/op-float-conv.cc,
operators/op-fm-fcdm.cc, operators/op-fm-fcm.cc, operators/op-fm-fcs.cc,
operators/op-fm-fdm.cc, operators/op-fm-fm.cc, operators/op-fm-fs.cc,
operators/op-fm-pm.cc, operators/op-fs-fcm.cc, operators/op-fs-fcs.cc,
operators/op-fs-fm.cc, operators/op-fs-fs.cc, operators/op-i16-i16.cc,
operators/op-i32-i32.cc, operators/op-i64-i64.cc, operators/op-i8-i8.cc,
operators/op-int-concat.cc, operators/op-int-conv.cc, operators/op-int.h,
operators/op-m-cdm.cc, operators/op-m-cm.cc, operators/op-m-cs.cc,
operators/op-m-dm.cc, operators/op-m-m.cc, operators/op-m-pm.cc,
operators/op-m-s.cc, operators/op-m-scm.cc, operators/op-m-sm.cc,
operators/op-pm-cm.cc, operators/op-pm-fcm.cc, operators/op-pm-fm.cc,
operators/op-pm-m.cc, operators/op-pm-pm.cc, operators/op-pm-scm.cc,
operators/op-pm-sm.cc, operators/op-pm-template.cc, operators/op-range.cc,
operators/op-s-cm.cc, operators/op-s-cs.cc, operators/op-s-m.cc,
operators/op-s-s.cc, operators/op-s-scm.cc, operators/op-s-sm.cc,
operators/op-sbm-b.cc, operators/op-sbm-bm.cc, operators/op-sbm-sbm.cc,
operators/op-scm-cm.cc, operators/op-scm-cs.cc, operators/op-scm-m.cc,
operators/op-scm-s.cc, operators/op-scm-scm.cc, operators/op-scm-sm.cc,
operators/op-sm-cm.cc, operators/op-sm-cs.cc, operators/op-sm-m.cc,
operators/op-sm-s.cc, operators/op-sm-scm.cc, operators/op-sm-sm.cc,
operators/op-str-m.cc, operators/op-str-s.cc, operators/op-str-str.cc,
operators/op-struct.cc, operators/op-ui16-ui16.cc, operators/op-ui32-ui32.cc,
operators/op-ui64-ui64.cc, operators/op-ui8-ui8.cc: Moved from OPERATORS/
dir to operators/ directory.
* mkops: Correctly print comment in generated file ops.cc that it is made by
mkops. Change sed expression for OPERATORS/ to operators/.
* parse-tree/module.mk: Hook code in parse-tree dir into build system.
* parse-tree/pt-all.h, parse-tree/pt-arg-list.cc, parse-tree/pt-arg-list.h,
parse-tree/pt-assign.cc, parse-tree/pt-assign.h, parse-tree/pt-binop.cc,
parse-tree/pt-binop.h, parse-tree/pt-bp.cc, parse-tree/pt-bp.h,
parse-tree/pt-cbinop.cc, parse-tree/pt-cbinop.h, parse-tree/pt-cell.cc,
parse-tree/pt-cell.h, parse-tree/pt-check.cc, parse-tree/pt-check.h,
parse-tree/pt-cmd.cc, parse-tree/pt-cmd.h, parse-tree/pt-colon.cc,
parse-tree/pt-colon.h, parse-tree/pt-const.cc, parse-tree/pt-const.h,
parse-tree/pt-decl.cc, parse-tree/pt-decl.h, parse-tree/pt-eval.cc,
parse-tree/pt-eval.h, parse-tree/pt-except.cc, parse-tree/pt-except.h,
parse-tree/pt-exp.cc, parse-tree/pt-exp.h, parse-tree/pt-fcn-handle.cc,
parse-tree/pt-fcn-handle.h, parse-tree/pt-id.cc, parse-tree/pt-id.h,
parse-tree/pt-idx.cc, parse-tree/pt-idx.h, parse-tree/pt-jump.cc,
parse-tree/pt-jump.h, parse-tree/pt-loop.cc, parse-tree/pt-loop.h,
parse-tree/pt-mat.cc, parse-tree/pt-mat.h, parse-tree/pt-misc.cc,
parse-tree/pt-misc.h, parse-tree/pt-pr-code.cc, parse-tree/pt-pr-code.h,
parse-tree/pt-select.cc, parse-tree/pt-select.h, parse-tree/pt-stmt.cc,
parse-tree/pt-stmt.h, parse-tree/pt-unop.cc, parse-tree/pt-unop.h,
parse-tree/pt-walk.h, parse-tree/pt.cc, parse-tree/pt.h:
Moved from src/ dir to parse-tree dir.
* template-inst/Array-jit.cc, template-inst/Array-os.cc,
template-inst/Array-sym.cc, template-inst/Array-tc.cc, template-inst/module.mk:
Moved from TEMPLATE-INST dir to template-inst/ directory.
* src/Makefile.am: Add new directories to build system.
* corefcn/module.mk: Use COREFCN_SRC with all capitals to indicate it is not an
Automake special target.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 30 Jul 2012 15:29:19 -0700 |
parents | src/ov-intx.h@460a3c6d8bf1 |
children | 62a35ae7d6a2 |
rev | line source |
---|---|
4904 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12645
diff
changeset
|
3 Copyright (C) 2004-2012 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10405
diff
changeset
|
4 Copyright (C) 2010 VZLU Prague |
4904 | 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. | |
4904 | 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/>. | |
4904 | 21 |
22 */ | |
23 | |
24 #include <cstdlib> | |
25 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
26 #include <iosfwd> |
4904 | 27 #include <string> |
28 | |
29 #include "mx-base.h" | |
30 #include "oct-alloc.h" | |
31 #include "str-vec.h" | |
32 | |
33 #include "error.h" | |
4944 | 34 #include "oct-stream.h" |
4904 | 35 #include "ov-base.h" |
36 #include "ov-base-int.h" | |
37 #include "ov-typeinfo.h" | |
4982 | 38 #include "gripes.h" |
4904 | 39 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
40 #include "ov-re-mat.h" |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
41 #include "ov-scalar.h" |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
42 |
4904 | 43 class |
6693 | 44 OCTINTERP_API |
4904 | 45 OCTAVE_VALUE_INT_MATRIX_T |
8321
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
46 : public octave_base_int_matrix<intNDArray<OCTAVE_INT_T> > |
4904 | 47 { |
48 public: | |
49 | |
50 OCTAVE_VALUE_INT_MATRIX_T (void) | |
8321
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
51 : octave_base_int_matrix<intNDArray<OCTAVE_INT_T> > () { } |
4904 | 52 |
8321
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
53 OCTAVE_VALUE_INT_MATRIX_T (const intNDArray<OCTAVE_INT_T>& nda) |
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
54 : octave_base_int_matrix<intNDArray<OCTAVE_INT_T> > (nda) { } |
4904 | 55 |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9685
diff
changeset
|
56 OCTAVE_VALUE_INT_MATRIX_T (const Array<OCTAVE_INT_T>& nda) |
8321
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
57 : octave_base_int_matrix<intNDArray<OCTAVE_INT_T> > |
69b6127f6962
better use of templates in ov-intx.h
John W. Eaton <jwe@octave.org>
parents:
8039
diff
changeset
|
58 (intNDArray<OCTAVE_INT_T> (nda)) { } |
7064 | 59 |
4904 | 60 ~OCTAVE_VALUE_INT_MATRIX_T (void) { } |
61 | |
5759 | 62 octave_base_value *clone (void) const |
4904 | 63 { return new OCTAVE_VALUE_INT_MATRIX_T (*this); } |
64 | |
5759 | 65 octave_base_value *empty_clone (void) const |
4904 | 66 { return new OCTAVE_VALUE_INT_MATRIX_T (); } |
67 | |
6069 | 68 bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } |
5895 | 69 |
6223 | 70 bool is_integer_type (void) const { return true; } |
71 | |
9685 | 72 builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; } |
73 | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
74 public: |
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
75 |
5533 | 76 int8NDArray |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
77 int8_array_value (void) const { return int8NDArray (matrix); } |
5533 | 78 |
79 int16NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
80 int16_array_value (void) const { return int16NDArray (matrix); } |
5533 | 81 |
82 int32NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
83 int32_array_value (void) const { return int32NDArray (matrix); } |
5533 | 84 |
85 int64NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
86 int64_array_value (void) const { return int64NDArray (matrix); } |
5533 | 87 |
88 uint8NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
89 uint8_array_value (void) const { return uint8NDArray (matrix); } |
5533 | 90 |
91 uint16NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
92 uint16_array_value (void) const { return uint16NDArray (matrix); } |
5533 | 93 |
94 uint32NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
95 uint32_array_value (void) const { return uint32NDArray (matrix); } |
5533 | 96 |
97 uint64NDArray | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
98 uint64_array_value (void) const { return uint64NDArray (matrix); } |
4904 | 99 |
4982 | 100 double |
101 double_value (bool = false) const | |
102 { | |
103 double retval = lo_ieee_nan_value (); | |
104 | |
105 if (numel () > 0) | |
10313 | 106 { |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
107 gripe_implicit_conversion ("Octave:array-to-scalar", |
10313 | 108 type_name (), "real scalar"); |
4982 | 109 |
10313 | 110 retval = matrix(0).double_value (); |
111 } | |
4982 | 112 else |
10313 | 113 gripe_invalid_conversion (type_name (), "real scalar"); |
4982 | 114 |
115 return retval; | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
116 |
4982 | 117 } |
118 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
119 float |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
120 float_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
121 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
122 float retval = lo_ieee_float_nan_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
123 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
124 if (numel () > 0) |
10313 | 125 { |
14469
29aabe9b37a2
Rename array-as-vector, array-as-scalar warning IDs to match documentation (bug #35838)
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
126 gripe_implicit_conversion ("Octave:array-to-scalar", |
10313 | 127 type_name (), "real scalar"); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
128 |
10313 | 129 retval = matrix(0).float_value (); |
130 } | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
131 else |
10313 | 132 gripe_invalid_conversion (type_name (), "real scalar"); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
133 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
134 return retval; |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
135 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
136 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
137 |
4983 | 138 double scalar_value (bool = false) const { return double_value (); } |
4982 | 139 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
140 float float_scalar_value (bool = false) const { return float_value (); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
141 |
6214 | 142 Matrix |
143 matrix_value (bool = false) const | |
144 { | |
145 Matrix retval; | |
146 dim_vector dv = dims (); | |
147 if (dv.length () > 2) | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
148 error ("invalid conversion of %s to Matrix", type_name ().c_str ()); |
6214 | 149 else |
10313 | 150 { |
151 retval = Matrix (dv(0), dv(1)); | |
152 double *vec = retval.fortran_vec (); | |
153 octave_idx_type nel = matrix.numel (); | |
154 for (octave_idx_type i = 0; i < nel; i++) | |
155 vec[i] = matrix(i).double_value (); | |
156 } | |
6214 | 157 return retval; |
158 } | |
159 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
160 FloatMatrix |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
161 float_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
162 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
163 FloatMatrix retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
164 dim_vector dv = dims (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
165 if (dv.length () > 2) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
166 error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
167 else |
10313 | 168 { |
169 retval = FloatMatrix (dv(0), dv(1)); | |
170 float *vec = retval.fortran_vec (); | |
171 octave_idx_type nel = matrix.numel (); | |
172 for (octave_idx_type i = 0; i < nel; i++) | |
173 vec[i] = matrix(i).float_value (); | |
174 } | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
175 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
176 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
177 |
6214 | 178 ComplexMatrix |
179 complex_matrix_value (bool = false) const | |
180 { | |
181 ComplexMatrix retval; | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
182 dim_vector dv = dims (); |
6214 | 183 if (dv.length () > 2) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
184 error ("invalid conversion of %s to Matrix", type_name ().c_str ()); |
6214 | 185 else |
10313 | 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 } | |
6214 | 193 return retval; |
194 } | |
195 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
196 FloatComplexMatrix |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
197 float_complex_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
198 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
199 FloatComplexMatrix retval; |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
200 dim_vector dv = dims (); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
201 if (dv.length () > 2) |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
202 error ("invalid conversion of %s to FloatMatrix", type_name ().c_str ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
203 else |
10313 | 204 { |
205 retval = FloatComplexMatrix (dv(0), dv(1)); | |
206 FloatComplex *vec = retval.fortran_vec (); | |
207 octave_idx_type nel = matrix.numel (); | |
208 for (octave_idx_type i = 0; i < nel; i++) | |
209 vec[i] = FloatComplex (matrix(i).float_value ()); | |
210 } | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
211 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
212 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
213 |
4915 | 214 NDArray |
215 array_value (bool = false) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
216 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
217 NDArray retval (matrix.dims ()); |
6214 | 218 double *vec = retval.fortran_vec (); |
219 octave_idx_type nel = matrix.numel (); | |
220 for (octave_idx_type i = 0; i < nel; i++) | |
7198 | 221 vec[i] = matrix(i).double_value (); |
4963 | 222 return retval; |
223 } | |
224 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
225 FloatNDArray |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
226 float_array_value (bool = false) const |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
227 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
228 FloatNDArray retval (matrix.dims ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
229 float *vec = retval.fortran_vec (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
230 octave_idx_type nel = matrix.numel (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
231 for (octave_idx_type i = 0; i < nel; i++) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
232 vec[i] = matrix(i).float_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
233 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
234 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
235 |
4963 | 236 ComplexNDArray |
237 complex_array_value (bool = false) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
238 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
239 ComplexNDArray retval (matrix.dims ()); |
6214 | 240 Complex *vec = retval.fortran_vec (); |
241 octave_idx_type nel = matrix.numel (); | |
242 for (octave_idx_type i = 0; i < nel; i++) | |
7198 | 243 vec[i] = Complex (matrix(i).double_value ()); |
4915 | 244 return retval; |
245 } | |
246 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
247 FloatComplexNDArray |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
248 float_complex_array_value (bool = false) const |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
249 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
250 FloatComplexNDArray retval (matrix.dims ()); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
251 FloatComplex *vec = retval.fortran_vec (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
252 octave_idx_type nel = matrix.numel (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
253 for (octave_idx_type i = 0; i < nel; i++) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
254 vec[i] = FloatComplex (matrix(i).float_value ()); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
255 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
256 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
257 |
5898 | 258 boolNDArray |
5943 | 259 bool_array_value (bool warn = false) const |
5898 | 260 { |
261 boolNDArray retval (dims ()); | |
262 | |
263 octave_idx_type nel = numel (); | |
5943 | 264 |
265 if (warn && matrix.any_element_not_one_or_zero ()) | |
266 gripe_logical_conversion (); | |
267 | |
6214 | 268 bool *vec = retval.fortran_vec (); |
5898 | 269 for (octave_idx_type i = 0; i < nel; i++) |
7198 | 270 vec[i] = matrix(i).bool_value (); |
5898 | 271 |
272 return retval; | |
273 } | |
274 | |
5533 | 275 charNDArray |
276 char_array_value (bool = false) const | |
277 { | |
278 charNDArray retval (dims ()); | |
279 | |
280 octave_idx_type nel = numel (); | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
281 |
6214 | 282 char *vec = retval.fortran_vec (); |
5533 | 283 for (octave_idx_type i = 0; i < nel; i++) |
7198 | 284 vec[i] = matrix(i).char_value (); |
5533 | 285 |
286 return retval; | |
287 } | |
288 | |
9606
a04352386a6b
clear index cache on ++,-- operators
Jaroslav Hajek <highegg@gmail.com>
parents:
9358
diff
changeset
|
289 // Use matrix_ref here to clear index cache. |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
290 void increment (void) |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
291 { |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
292 matrix_ref () += OCTAVE_INT_T (1); |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
293 } |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
294 |
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
295 void decrement (void) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
296 { |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
297 matrix_ref () -= OCTAVE_INT_T (1); |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
298 } |
5829 | 299 |
9607
1be3c73ed7b5
reuse temporary arrays in nested expressions
Jaroslav Hajek <highegg@gmail.com>
parents:
9606
diff
changeset
|
300 void changesign (void) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
301 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
302 matrix_ref ().changesign (); |
9607
1be3c73ed7b5
reuse temporary arrays in nested expressions
Jaroslav Hajek <highegg@gmail.com>
parents:
9606
diff
changeset
|
303 } |
1be3c73ed7b5
reuse temporary arrays in nested expressions
Jaroslav Hajek <highegg@gmail.com>
parents:
9606
diff
changeset
|
304 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
305 idx_vector index_vector (void) const |
9350
16a5f9e1fdb3
cache idx_vector result in matrices once used for indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
306 { return idx_cache ? *idx_cache : set_idx_cache (idx_vector (matrix)); } |
4938 | 307 |
4944 | 308 int write (octave_stream& os, int block_size, |
10313 | 309 oct_data_conv::data_type output_type, int skip, |
310 oct_mach_info::float_format flt_fmt) const | |
4944 | 311 { return os.write (matrix, block_size, output_type, skip, flt_fmt); } |
312 | |
9358
d4b1314a7c31
mex.cc (mxArray_octave_value::get_data): avoid enumerating types that can be handled as foreign
John W. Eaton <jwe@octave.org>
parents:
9350
diff
changeset
|
313 // Unsafe. This function exists to support the MEX interface. |
d4b1314a7c31
mex.cc (mxArray_octave_value::get_data): avoid enumerating types that can be handled as foreign
John W. Eaton <jwe@octave.org>
parents:
9350
diff
changeset
|
314 // You should not use it anywhere else. |
d4b1314a7c31
mex.cc (mxArray_octave_value::get_data): avoid enumerating types that can be handled as foreign
John W. Eaton <jwe@octave.org>
parents:
9350
diff
changeset
|
315 void *mex_get_data (void) const { return matrix.mex_get_data (); } |
d4b1314a7c31
mex.cc (mxArray_octave_value::get_data): avoid enumerating types that can be handled as foreign
John W. Eaton <jwe@octave.org>
parents:
9350
diff
changeset
|
316 |
5900 | 317 mxArray *as_mxArray (void) const |
318 { | |
319 mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, dims (), mxREAL); | |
320 | |
321 OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ()); | |
322 | |
6686 | 323 mwSize nel = numel (); |
5900 | 324 |
325 const OCTAVE_INT_T *p = matrix.data (); | |
326 | |
6686 | 327 for (mwIndex i = 0; i < nel; i++) |
5900 | 328 pr[i] = p[i].value (); |
329 | |
330 return retval; | |
331 } | |
332 | |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
333 octave_value map (unary_mapper_t umap) const |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
334 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
335 switch (umap) |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
336 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
337 case umap_abs: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
338 return matrix.abs (); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
339 case umap_signum: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
340 return matrix.signum (); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
341 case umap_ceil: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
342 case umap_conj: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
343 case umap_fix: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
344 case umap_floor: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
345 case umap_real: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
346 case umap_round: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
347 return matrix; |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
348 case umap_imag: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
349 return intNDArray<OCTAVE_INT_T> (matrix.dims (), OCTAVE_INT_T ()); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
350 case umap_isnan: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
351 case umap_isna: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
352 case umap_isinf: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
353 return boolNDArray (matrix.dims (), false); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
354 case umap_finite: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
355 return boolNDArray (matrix.dims (), true); |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
356 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
357 default: |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
358 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
359 octave_matrix m (array_value ()); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
360 return m.map (umap); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
361 } |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
362 } |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
363 } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
364 |
4904 | 365 private: |
366 | |
367 DECLARE_OCTAVE_ALLOCATOR | |
368 | |
369 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
370 }; | |
371 | |
372 class | |
6693 | 373 OCTINTERP_API |
4904 | 374 OCTAVE_VALUE_INT_SCALAR_T |
375 : public octave_base_int_scalar<OCTAVE_INT_T> | |
376 { | |
377 public: | |
378 | |
379 OCTAVE_VALUE_INT_SCALAR_T (void) | |
380 : octave_base_int_scalar<OCTAVE_INT_T> () { } | |
381 | |
382 OCTAVE_VALUE_INT_SCALAR_T (const OCTAVE_INT_T& nda) | |
383 : octave_base_int_scalar<OCTAVE_INT_T> (nda) { } | |
384 | |
385 ~OCTAVE_VALUE_INT_SCALAR_T (void) { } | |
386 | |
5759 | 387 octave_base_value *clone (void) const |
4904 | 388 { return new OCTAVE_VALUE_INT_SCALAR_T (*this); } |
389 | |
5759 | 390 octave_base_value *empty_clone (void) const |
8389
ff5892c8ddd0
fix integer assignment to non-existing variables
Jaroslav Hajek <highegg@gmail.com>
parents:
8321
diff
changeset
|
391 { return new OCTAVE_VALUE_INT_MATRIX_T (); } |
4904 | 392 |
5885 | 393 octave_value do_index_op (const octave_value_list& idx, |
10313 | 394 bool resize_ok = false) |
4983 | 395 { |
8437
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
396 // FIXME -- this doesn't solve the problem of |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
397 // |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
398 // a = 1; a([1,1], [1,1], [1,1]) |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
399 // |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
400 // and similar constructions. Hmm... |
4964 | 401 |
8437
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
402 // FIXME -- using this constructor avoids narrowing the |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
403 // 1x1 matrix back to a scalar value. Need a better solution |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
404 // to this problem. |
4964 | 405 |
8437
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
406 octave_value tmp |
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
407 (new OCTAVE_VALUE_INT_MATRIX_T |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
408 (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION ())); |
4964 | 409 |
8437
f00578b495e9
remove valid_as_scalar_index
Jaroslav Hajek <highegg@gmail.com>
parents:
8389
diff
changeset
|
410 return tmp.do_index_op (idx, resize_ok); |
4983 | 411 } |
4964 | 412 |
6069 | 413 bool OCTAVE_TYPE_PREDICATE_FUNCTION (void) const { return true; } |
5895 | 414 |
6223 | 415 bool is_integer_type (void) const { return true; } |
416 | |
9685 | 417 builtin_type_t builtin_type (void) const { return OCTAVE_INT_BTYP; } |
418 | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
419 public: |
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
420 |
5533 | 421 octave_int8 |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
422 int8_scalar_value (void) const { return octave_int8 (scalar); } |
5533 | 423 |
424 octave_int16 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
425 int16_scalar_value (void) const { return octave_int16 (scalar); } |
5533 | 426 |
427 octave_int32 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
428 int32_scalar_value (void) const { return octave_int32 (scalar); } |
5533 | 429 |
430 octave_int64 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
431 int64_scalar_value (void) const { return octave_int64 (scalar); } |
5533 | 432 |
433 octave_uint8 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
434 uint8_scalar_value (void) const { return octave_uint8 (scalar); } |
5533 | 435 |
436 octave_uint16 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
437 uint16_scalar_value (void) const { return octave_uint16 (scalar); } |
5533 | 438 |
439 octave_uint32 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
440 uint32_scalar_value (void) const { return octave_uint32 (scalar); } |
5533 | 441 |
442 octave_uint64 | |
10405
cc69a17ec801
remove integer math warnings
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
443 uint64_scalar_value (void) const { return octave_uint64 (scalar); } |
5533 | 444 |
445 int8NDArray | |
446 int8_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
447 { return int8NDArray (dim_vector (1, 1), int8_scalar_value ()); } |
4904 | 448 |
5533 | 449 int16NDArray |
450 int16_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
451 { return int16NDArray (dim_vector (1, 1), int16_scalar_value ()); } |
5533 | 452 |
453 int32NDArray | |
454 int32_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
455 { return int32NDArray (dim_vector (1, 1), int32_scalar_value ()); } |
5533 | 456 |
457 int64NDArray | |
458 int64_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
459 { return int64NDArray (dim_vector (1, 1), int64_scalar_value ()); } |
5533 | 460 |
461 uint8NDArray | |
462 uint8_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
463 { return uint8NDArray (dim_vector (1, 1), uint8_scalar_value ()); } |
5533 | 464 |
465 uint16NDArray | |
466 uint16_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
467 { return uint16NDArray (dim_vector (1, 1), uint16_scalar_value ()); } |
5533 | 468 |
469 uint32NDArray | |
470 uint32_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
471 { return uint32NDArray (dim_vector (1, 1), uint32_scalar_value ()); } |
5533 | 472 |
473 uint64NDArray | |
474 uint64_array_value (void) const | |
7997
2b8952e133c9
implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
475 { return uint64NDArray (dim_vector (1, 1), uint64_scalar_value ()); } |
4904 | 476 |
5731 | 477 octave_value resize (const dim_vector& dv, bool fill = false) const |
4982 | 478 { |
5731 | 479 if (fill) |
10313 | 480 { |
481 intNDArray<OCTAVE_INT_T> retval (dv, 0); | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
482 if (dv.numel ()) |
10313 | 483 retval(0) = scalar; |
484 return retval; | |
485 } | |
5731 | 486 else |
10313 | 487 { |
488 intNDArray<OCTAVE_INT_T> retval (dv); | |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14469
diff
changeset
|
489 if (dv.numel ()) |
10313 | 490 retval(0) = scalar; |
491 return retval; | |
492 } | |
4982 | 493 } |
494 | |
7198 | 495 double double_value (bool = false) const { return scalar.double_value (); } |
4983 | 496 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
497 float float_value (bool = false) const { return scalar.float_value (); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
498 |
7198 | 499 double scalar_value (bool = false) const { return scalar.double_value (); } |
4982 | 500 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
501 float float_scalar_value (bool = false) const { return scalar.float_value (); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
502 |
6214 | 503 Matrix |
504 matrix_value (bool = false) const | |
505 { | |
506 Matrix retval (1, 1); | |
7198 | 507 retval(0,0) = scalar.double_value (); |
6214 | 508 return retval; |
509 } | |
510 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
511 FloatMatrix |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
512 float_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
513 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
514 FloatMatrix retval (1, 1); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
515 retval(0,0) = scalar.float_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
516 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
517 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
518 |
6214 | 519 ComplexMatrix |
520 complex_matrix_value (bool = false) const | |
521 { | |
522 ComplexMatrix retval (1, 1); | |
7198 | 523 retval(0,0) = Complex (scalar.double_value ()); |
6214 | 524 return retval; |
525 } | |
526 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
527 FloatComplexMatrix |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
528 float_complex_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
529 { |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
530 FloatComplexMatrix retval (1, 1); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
531 retval(0,0) = FloatComplex (scalar.float_value ()); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
532 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
533 } |
6214 | 534 |
4915 | 535 NDArray |
536 array_value (bool = false) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
537 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
538 NDArray retval (dim_vector (1, 1)); |
7198 | 539 retval(0) = scalar.double_value (); |
4963 | 540 return retval; |
541 } | |
542 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
543 FloatNDArray |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
544 float_array_value (bool = false) const |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
545 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
546 FloatNDArray retval (dim_vector (1, 1)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
547 retval(0) = scalar.float_value (); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
548 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
549 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
550 |
4963 | 551 ComplexNDArray |
552 complex_array_value (bool = false) const | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
553 { |
5533 | 554 ComplexNDArray retval (dim_vector (1, 1)); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
555 retval(0) = FloatComplex (scalar.double_value ()); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
556 return retval; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
557 } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
558 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
559 FloatComplexNDArray |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
560 float_complex_array_value (bool = false) const |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
561 { |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
562 FloatComplexNDArray retval (dim_vector (1, 1)); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7636
diff
changeset
|
563 retval(0) = FloatComplex (scalar.float_value ()); |
4915 | 564 return retval; |
565 } | |
566 | |
12645
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
567 bool bool_value (bool warn = false) const |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
568 { |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
569 if (warn && scalar != 0.0 && scalar != 1.0) |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
570 gripe_logical_conversion (); |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
571 |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
572 return scalar.bool_value (); |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
573 } |
d3ccd2e37de6
Allow scalar integer to logical conversion (bug #33219)
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
574 |
5898 | 575 boolNDArray |
5943 | 576 bool_array_value (bool warn = false) const |
5898 | 577 { |
578 boolNDArray retval (dim_vector (1, 1)); | |
5943 | 579 |
580 if (warn && scalar != 0.0 && scalar != 1.0) | |
581 gripe_logical_conversion (); | |
582 | |
7198 | 583 retval(0) = scalar.bool_value (); |
5943 | 584 |
5898 | 585 return retval; |
586 } | |
587 | |
5533 | 588 charNDArray |
589 char_array_value (bool = false) const | |
590 { | |
591 charNDArray retval (dim_vector (1, 1)); | |
7198 | 592 retval(0) = scalar.char_value (); |
5533 | 593 return retval; |
594 } | |
595 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
596 void increment (void) |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
597 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
598 scalar += OCTAVE_INT_T (1); |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
599 } |
5829 | 600 |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
601 void decrement (void) |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
602 { |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
603 scalar -= OCTAVE_INT_T (1); |
8039
cd90e2842080
Add additional integer math and conversion warnings, set their default state to be off and add the intwarning function
David Bateman <dbateman@free.fr>
parents:
7999
diff
changeset
|
604 } |
5829 | 605 |
4938 | 606 idx_vector index_vector (void) const { return idx_vector (scalar); } |
607 | |
4944 | 608 int write (octave_stream& os, int block_size, |
10313 | 609 oct_data_conv::data_type output_type, octave_idx_type skip, |
610 oct_mach_info::float_format flt_fmt) const | |
4944 | 611 { |
612 return os.write (OCTAVE_VALUE_INT_NDARRAY_EXTRACTOR_FUNCTION (), | |
10313 | 613 block_size, output_type, skip, flt_fmt); |
4944 | 614 } |
615 | |
5900 | 616 // Unsafe. This function exists to support the MEX interface. |
617 // You should not use it anywhere else. | |
618 void *mex_get_data (void) const { return scalar.mex_get_data (); } | |
619 | |
620 mxArray *as_mxArray (void) const | |
621 { | |
622 mxArray *retval = new mxArray (OCTAVE_INT_MX_CLASS, 1, 1, mxREAL); | |
623 | |
624 OCTAVE_INT_T::val_type *pr = static_cast<OCTAVE_INT_T::val_type *> (retval->get_data ()); | |
625 | |
626 pr[0] = scalar.value (); | |
627 | |
628 return retval; | |
629 } | |
630 | |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
631 octave_value map (unary_mapper_t umap) const |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
632 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
633 switch (umap) |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
634 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
635 case umap_abs: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
636 return scalar.abs (); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
637 case umap_signum: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
638 return scalar.signum (); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
639 case umap_ceil: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
640 case umap_conj: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
641 case umap_fix: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
642 case umap_floor: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
643 case umap_real: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
644 case umap_round: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
645 return scalar; |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
646 case umap_imag: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
647 return OCTAVE_INT_T (); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
648 case umap_isnan: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
649 case umap_isna: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
650 case umap_isinf: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
651 return false; |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
652 case umap_finite: |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
653 return true; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
654 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
655 default: |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
656 { |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
657 octave_scalar m (scalar_value ()); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
658 return m.map (umap); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
659 } |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
660 } |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
661 } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7201
diff
changeset
|
662 |
4904 | 663 private: |
664 | |
665 DECLARE_OCTAVE_ALLOCATOR | |
666 | |
667 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
668 }; |