annotate src/ov.h @ 7885:f336dd8e96d0

eliminate streamoff type
author John W. Eaton <jwe@octave.org>
date Thu, 12 Jun 2008 10:42:56 -0400
parents 8447a5024650
children 260294a5520f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1 /*
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005,
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
4 2006, 2007 John W. Eaton
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
5
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
7
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
11 option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
16 for more details.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
17
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6974
diff changeset
20 <http://www.gnu.org/licenses/>.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
21
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
22 */
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
23
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_value_h)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
25 #define octave_value_h 1
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
26
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
27 #include <cstdlib>
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
28
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3419
diff changeset
29 #include <iostream>
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
30 #include <string>
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
31 #include <list>
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
32
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
33 #if defined (HAVE_HDF5)
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
34 #include <hdf5.h>
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
35 #endif
4507
65f47f8a92a2 [project @ 2003-09-10 15:48:02 by jwe]
jwe
parents: 4505
diff changeset
36
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
37 #include "Range.h"
5828
22e23bee74c8 [project @ 2006-05-23 06:05:14 by jwe]
jwe
parents: 5785
diff changeset
38 #include "data-conv.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
39 #include "idx-vector.h"
5828
22e23bee74c8 [project @ 2006-05-23 06:05:14 by jwe]
jwe
parents: 5785
diff changeset
40 #include "mach-info.h"
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
41 #include "mxarray.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
42 #include "mx-base.h"
2477
3d905d3820a4 [project @ 1996-11-07 16:46:11 by jwe]
jwe
parents: 2475
diff changeset
43 #include "oct-alloc.h"
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
44 #include "oct-time.h"
2942
026f342c2019 [project @ 1997-05-08 02:20:57 by jwe]
jwe
parents: 2916
diff changeset
45 #include "str-vec.h"
026f342c2019 [project @ 1997-05-08 02:20:57 by jwe]
jwe
parents: 2916
diff changeset
46
7433
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
47 #include "oct-sort.h"
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
48
3351
8623649c967c [project @ 1999-11-15 16:17:01 by jwe]
jwe
parents: 3340
diff changeset
49 class Cell;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
50 class Octave_map;
2903
facd9d10e5c1 [project @ 1997-04-30 03:53:07 by jwe]
jwe
parents: 2891
diff changeset
51 class octave_stream;
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
52 class octave_function;
4700
ca3a1d687bba [project @ 2004-01-21 03:28:31 by jwe]
jwe
parents: 4687
diff changeset
53 class octave_user_function;
4342
813effe14ee1 [project @ 2003-02-20 08:35:55 by jwe]
jwe
parents: 4271
diff changeset
54 class octave_fcn_handle;
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents: 4930
diff changeset
55 class octave_fcn_inline;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
56 class octave_value_list;
2979
a3556d2adec9 [project @ 1997-05-15 22:35:37 by jwe]
jwe
parents: 2974
diff changeset
57 class octave_lvalue;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
58
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
59 #include "ov-base.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
60
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
61 // Constants.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
62
2427
2f50b24ce84f [project @ 1996-10-25 06:15:28 by jwe]
jwe
parents: 2423
diff changeset
63 class octave_value;
2f50b24ce84f [project @ 1996-10-25 06:15:28 by jwe]
jwe
parents: 2423
diff changeset
64
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
65 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
66 OCTINTERP_API
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
67 octave_value
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
68 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
69 public:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
70
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
71 enum unary_op
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
72 {
6518
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
73 op_not, // not
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
74 op_uplus, // uplus
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
75 op_uminus, // uminus
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
76 op_transpose, // transpose
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
77 op_hermitian, // ctranspose
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
78 op_incr,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
79 op_decr,
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
80 num_unary_ops,
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
81 unknown_unary_op
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
82 };
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
83
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
84 enum binary_op
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
85 {
6518
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
86 op_add, // plus
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
87 op_sub, // minus
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
88 op_mul, // mtimes
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
89 op_div, // mrdivide
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
90 op_pow, // mpower
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
91 op_ldiv, // mldivide
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
92 op_lshift,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
93 op_rshift,
6518
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
94 op_lt, // lt
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
95 op_le, // le
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
96 op_eq, // eq
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
97 op_ge, // ge
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
98 op_gt, // gt
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
99 op_ne, // ne
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
100 op_el_mul, // times
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
101 op_el_div, // rdivide
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
102 op_el_pow, // power
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
103 op_el_ldiv, // ldivide
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
104 op_el_and, // and
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
105 op_el_or, // or
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
106 op_struct_ref,
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
107 num_binary_ops,
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
108 unknown_binary_op
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
109 };
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
110
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
111 enum compound_binary_op
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
112 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
113 // ** compound operations **
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
114 op_trans_mul,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
115 op_mul_trans,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
116 op_herm_mul,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
117 op_mul_herm,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
118 num_compound_binary_ops,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
119 unknown_compound_binary_op
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
120 };
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
121
2880
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
122 enum assign_op
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
123 {
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
124 op_asn_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
125 op_add_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
126 op_sub_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
127 op_mul_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
128 op_div_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
129 op_ldiv_eq,
4018
a8621d87fbf5 [project @ 2002-08-05 03:17:25 by jwe]
jwe
parents: 4015
diff changeset
130 op_pow_eq,
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
131 op_lshift_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
132 op_rshift_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
133 op_el_mul_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
134 op_el_div_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
135 op_el_ldiv_eq,
4018
a8621d87fbf5 [project @ 2002-08-05 03:17:25 by jwe]
jwe
parents: 4015
diff changeset
136 op_el_pow_eq,
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
137 op_el_and_eq,
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
138 op_el_or_eq,
2880
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
139 num_assign_ops,
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
140 unknown_assign_op
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
141 };
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
142
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
143 static std::string unary_op_as_string (unary_op);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
144 static std::string unary_op_fcn_name (unary_op);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
145
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
146 static std::string binary_op_as_string (binary_op);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
147 static std::string binary_op_fcn_name (binary_op);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
148
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
149 static std::string binary_op_fcn_name (compound_binary_op);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
150
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
151 static std::string assign_op_as_string (assign_op);
2880
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
152
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
153 static octave_value empty_conv (const std::string& type,
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
154 const octave_value& rhs = octave_value ());
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
155
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
156 enum magic_colon { magic_colon_t };
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
157
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
158 octave_value (void);
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
159 octave_value (short int i);
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
160 octave_value (unsigned short int i);
4233
ccfdb55c8156 [project @ 2002-12-20 22:43:54 by jwe]
jwe
parents: 4219
diff changeset
161 octave_value (int i);
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
162 octave_value (unsigned int i);
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
163 octave_value (long int i);
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
164 octave_value (unsigned long int i);
4353
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
165
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5759
diff changeset
166 // FIXME -- these are kluges. They turn into doubles
4353
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
167 // internally, which will break for very large values. We just use
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
168 // them to store things like 64-bit ino_t, etc, and hope that those
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
169 // values are never actually larger than can be represented exactly
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
170 // in a double.
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
171
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
172 #if defined (HAVE_LONG_LONG_INT)
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
173 octave_value (long long int i);
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
174 #endif
4356
b6ad3db48255 [project @ 2003-02-22 02:57:33 by jwe]
jwe
parents: 4353
diff changeset
175 #if defined (HAVE_UNSIGNED_LONG_LONG_INT)
4353
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
176 octave_value (unsigned long long int i);
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
177 #endif
ea4b8c35ac9d [project @ 2003-02-21 21:04:41 by jwe]
jwe
parents: 4346
diff changeset
178
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
179 octave_value (octave_time t);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
180 octave_value (double d);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
181 octave_value (float d);
5147
47e4c91e5799 [project @ 2005-02-16 21:06:19 by jwe]
jwe
parents: 5146
diff changeset
182 octave_value (const ArrayN<octave_value>& a, bool is_cs_list = false);
4532
01ee68d18069 [project @ 2003-10-10 00:49:54 by jwe]
jwe
parents: 4513
diff changeset
183 octave_value (const Cell& c, bool is_cs_list = false);
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
184 octave_value (const Matrix& m, const MatrixType& t = MatrixType());
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
185 octave_value (const FloatMatrix& m, const MatrixType& t = MatrixType());
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4507
diff changeset
186 octave_value (const NDArray& nda);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
187 octave_value (const FloatNDArray& nda);
4911
14027e0bafa4 [project @ 2004-07-22 19:58:06 by jwe]
jwe
parents: 4910
diff changeset
188 octave_value (const ArrayN<double>& m);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
189 octave_value (const ArrayN<float>& m);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
190 octave_value (const DiagMatrix& d);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
191 octave_value (const FloatDiagMatrix& d);
3418
ca92c9d3f882 [project @ 2000-01-12 03:07:47 by jwe]
jwe
parents: 3351
diff changeset
192 octave_value (const RowVector& v);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
193 octave_value (const FloatRowVector& v);
3418
ca92c9d3f882 [project @ 2000-01-12 03:07:47 by jwe]
jwe
parents: 3351
diff changeset
194 octave_value (const ColumnVector& v);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
195 octave_value (const FloatColumnVector& v);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
196 octave_value (const Complex& C);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
197 octave_value (const FloatComplex& C);
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
198 octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType());
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
199 octave_value (const FloatComplexMatrix& m, const MatrixType& t = MatrixType());
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4507
diff changeset
200 octave_value (const ComplexNDArray& cnda);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
201 octave_value (const FloatComplexNDArray& cnda);
4478
7afd4bf05aa8 [project @ 2003-07-30 19:15:31 by jwe]
jwe
parents: 4461
diff changeset
202 octave_value (const ArrayN<Complex>& m);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
203 octave_value (const ArrayN<FloatComplex>& m);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
204 octave_value (const ComplexDiagMatrix& d);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
205 octave_value (const FloatComplexDiagMatrix& d);
3418
ca92c9d3f882 [project @ 2000-01-12 03:07:47 by jwe]
jwe
parents: 3351
diff changeset
206 octave_value (const ComplexRowVector& v);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
207 octave_value (const FloatComplexRowVector& v);
3418
ca92c9d3f882 [project @ 2000-01-12 03:07:47 by jwe]
jwe
parents: 3351
diff changeset
208 octave_value (const ComplexColumnVector& v);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
209 octave_value (const FloatComplexColumnVector& v);
2825
60ae49e1284f [project @ 1997-03-25 23:17:36 by jwe]
jwe
parents: 2804
diff changeset
210 octave_value (bool b);
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
211 octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType());
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4507
diff changeset
212 octave_value (const boolNDArray& bnda);
7433
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
213 octave_value (const ArrayN<bool>& bnda);
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
214 octave_value (char c, char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
215 octave_value (const char *s, char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
216 octave_value (const std::string& s, char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
217 octave_value (const string_vector& s, char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
218 octave_value (const charMatrix& chm, bool is_string = false,
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
219 char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
220 octave_value (const charNDArray& chnda, bool is_string = false,
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
221 char type = '"');
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
222 octave_value (const ArrayN<char>& chnda, bool is_string = false,
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
223 char type = '"');
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
224 octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ());
6863
3c64128e621c [project @ 2007-09-05 07:52:48 by dbateman]
dbateman
parents: 6705
diff changeset
225 octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ());
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
226 octave_value (const SparseComplexMatrix& m,
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
227 const MatrixType& t = MatrixType ());
6863
3c64128e621c [project @ 2007-09-05 07:52:48 by dbateman]
dbateman
parents: 6705
diff changeset
228 octave_value (const Sparse<Complex>& m, const MatrixType& t = MatrixType ());
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
229 octave_value (const SparseBoolMatrix& bm,
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
230 const MatrixType& t = MatrixType ());
7433
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
231 octave_value (const Sparse<bool>& m, const MatrixType& t = MatrixType ());
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
232 octave_value (const octave_int8& i);
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
233 octave_value (const octave_int16& i);
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
234 octave_value (const octave_int32& i);
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
235 octave_value (const octave_int64& i);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
236 octave_value (const octave_uint8& i);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
237 octave_value (const octave_uint16& i);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
238 octave_value (const octave_uint32& i);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
239 octave_value (const octave_uint64& i);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
240 octave_value (const int8NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
241 octave_value (const ArrayN<octave_int8>& inda);
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
242 octave_value (const int16NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
243 octave_value (const ArrayN<octave_int16>& inda);
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
244 octave_value (const int32NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
245 octave_value (const ArrayN<octave_int32>& inda);
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
246 octave_value (const int64NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
247 octave_value (const ArrayN<octave_int64>& inda);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
248 octave_value (const uint8NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
249 octave_value (const ArrayN<octave_uint8>& inda);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
250 octave_value (const uint16NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
251 octave_value (const ArrayN<octave_uint16>& inda);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
252 octave_value (const uint32NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
253 octave_value (const ArrayN<octave_uint32>& inda);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
254 octave_value (const uint64NDArray& inda);
7064
faff87ff9d5a [project @ 2007-10-24 21:09:43 by dbateman]
dbateman
parents: 7017
diff changeset
255 octave_value (const ArrayN<octave_uint64>& inda);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
256 octave_value (double base, double limit, double inc);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
257 octave_value (const Range& r);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
258 octave_value (const Octave_map& m);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
259 octave_value (const Octave_map& m, const std::string& id);
3977
95663a3a2682 [project @ 2002-07-05 17:43:37 by jwe]
jwe
parents: 3933
diff changeset
260 octave_value (const octave_value_list& m, bool is_cs_list = false);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
261 octave_value (octave_value::magic_colon);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
262
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
263 octave_value (octave_base_value *new_rep);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
264 octave_value (octave_base_value *new_rep, int xcount);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
265
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
266 // Copy constructor.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
267
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
268 octave_value (const octave_value& a)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
269 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
270 rep = a.rep;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
271 rep->count++;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
272 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
273
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
274 // This should only be called for derived types.
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
275
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
276 octave_base_value *clone (void) const;
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
277
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
278 octave_base_value *empty_clone (void) const
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
279 { return rep->empty_clone (); }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
280
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
281 // Delete the representation of this constant if the count drops to
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
282 // zero.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
283
6338
ec88b4ab6d10 [project @ 2007-02-22 07:07:19 by jwe]
jwe
parents: 6223
diff changeset
284 ~octave_value (void)
ec88b4ab6d10 [project @ 2007-02-22 07:07:19 by jwe]
jwe
parents: 6223
diff changeset
285 {
ec88b4ab6d10 [project @ 2007-02-22 07:07:19 by jwe]
jwe
parents: 6223
diff changeset
286 if (--rep->count == 0)
ec88b4ab6d10 [project @ 2007-02-22 07:07:19 by jwe]
jwe
parents: 6223
diff changeset
287 delete rep;
ec88b4ab6d10 [project @ 2007-02-22 07:07:19 by jwe]
jwe
parents: 6223
diff changeset
288 }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
289
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
290 void make_unique (void)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
291 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
292 if (rep->count > 1)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
293 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
294 --rep->count;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
295 rep = rep->clone ();
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
296 rep->count = 1;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
297 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
298 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
299
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
300 // Simple assignment.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
301
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
302 octave_value& operator = (const octave_value& a)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
303 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
304 if (rep != a.rep)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
305 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
306 if (--rep->count == 0)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
307 delete rep;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
308
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
309 rep = a.rep;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
310 rep->count++;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
311 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
312
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
313 return *this;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
314 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
315
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
316 int get_count (void) const { return rep->count; }
3239
d54ef0aa6e82 [project @ 1999-03-27 17:40:45 by jwe]
jwe
parents: 3219
diff changeset
317
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
318 octave_base_value::type_conv_fcn numeric_conversion_function (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
319 { return rep->numeric_conversion_function (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
320
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
321 octave_base_value::type_conv_fcn numeric_demotion_function (void) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
322 { return rep->numeric_demotion_function (); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
323
2409
47e5f57fb4bd [project @ 1996-10-15 16:44:26 by jwe]
jwe
parents: 2376
diff changeset
324 void maybe_mutate (void);
47e5f57fb4bd [project @ 1996-10-15 16:44:26 by jwe]
jwe
parents: 2376
diff changeset
325
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
326 octave_value squeeze (void) const
4532
01ee68d18069 [project @ 2003-10-10 00:49:54 by jwe]
jwe
parents: 4513
diff changeset
327 { return rep->squeeze (); }
01ee68d18069 [project @ 2003-10-10 00:49:54 by jwe]
jwe
parents: 4513
diff changeset
328
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
329 octave_base_value *try_narrowing_conversion (void)
2410
367485171742 [project @ 1996-10-15 16:50:27 by jwe]
jwe
parents: 2409
diff changeset
330 { return rep->try_narrowing_conversion (); }
2409
47e5f57fb4bd [project @ 1996-10-15 16:44:26 by jwe]
jwe
parents: 2376
diff changeset
331
4271
be631c1720ea [project @ 2003-01-03 19:36:04 by jwe]
jwe
parents: 4257
diff changeset
332 octave_value single_subsref (const std::string& type,
be631c1720ea [project @ 2003-01-03 19:36:04 by jwe]
jwe
parents: 4257
diff changeset
333 const octave_value_list& idx);
be631c1720ea [project @ 2003-01-03 19:36:04 by jwe]
jwe
parents: 4257
diff changeset
334
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
335 octave_value subsref (const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
336 const std::list<octave_value_list>& idx)
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
337 { return rep->subsref (type, idx); }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
338
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
339 octave_value_list subsref (const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
340 const std::list<octave_value_list>& idx,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
341 int nargout);
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
342
4247
fc9a075d10fb [project @ 2002-12-30 23:05:27 by jwe]
jwe
parents: 4233
diff changeset
343 octave_value next_subsref (const std::string& type, const
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
344 std::list<octave_value_list>& idx,
4233
ccfdb55c8156 [project @ 2002-12-20 22:43:54 by jwe]
jwe
parents: 4219
diff changeset
345 size_t skip = 1);
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
346
4994
48d0defe9445 [project @ 2004-09-15 20:31:31 by jwe]
jwe
parents: 4970
diff changeset
347 octave_value_list next_subsref (int nargout,
48d0defe9445 [project @ 2004-09-15 20:31:31 by jwe]
jwe
parents: 4970
diff changeset
348 const std::string& type, const
48d0defe9445 [project @ 2004-09-15 20:31:31 by jwe]
jwe
parents: 4970
diff changeset
349 std::list<octave_value_list>& idx,
48d0defe9445 [project @ 2004-09-15 20:31:31 by jwe]
jwe
parents: 4970
diff changeset
350 size_t skip = 1);
48d0defe9445 [project @ 2004-09-15 20:31:31 by jwe]
jwe
parents: 4970
diff changeset
351
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
352 octave_value do_index_op (const octave_value_list& idx,
5885
bd3041e30d97 [project @ 2006-07-14 20:29:35 by jwe]
jwe
parents: 5881
diff changeset
353 bool resize_ok = false)
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
354 { return rep->do_index_op (idx, resize_ok); }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
355
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
356 octave_value_list
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3525
diff changeset
357 do_multi_index_op (int nargout, const octave_value_list& idx);
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
358
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
359 octave_value subsasgn (const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
360 const std::list<octave_value_list>& idx,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
361 const octave_value& rhs);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
362
4247
fc9a075d10fb [project @ 2002-12-30 23:05:27 by jwe]
jwe
parents: 4233
diff changeset
363 octave_value assign (assign_op op, const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
364 const std::list<octave_value_list>& idx,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
365 const octave_value& rhs);
2948
56be458e237f [project @ 1997-05-09 13:37:35 by jwe]
jwe
parents: 2942
diff changeset
366
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
367 const octave_value& assign (assign_op, const octave_value& rhs);
2948
56be458e237f [project @ 1997-05-09 13:37:35 by jwe]
jwe
parents: 2942
diff changeset
368
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
369 idx_vector index_vector (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
370 { return rep->index_vector (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
371
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
372 // Size.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
373
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
374 dim_vector dims (void) const
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4507
diff changeset
375 { return rep->dims (); }
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4507
diff changeset
376
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
377 octave_idx_type rows (void) const { return rep->rows (); }
4563
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4559
diff changeset
378
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
379 octave_idx_type columns (void) const { return rep->columns (); }
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 3189
diff changeset
380
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5164
diff changeset
381 octave_idx_type length (void) const;
4554
78e34346f6fd [project @ 2003-10-27 22:01:49 by jwe]
jwe
parents: 4550
diff changeset
382
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
383 int ndims (void) const { return rep->ndims (); }
4563
742993a501b9 [project @ 2003-10-29 06:25:12 by jwe]
jwe
parents: 4559
diff changeset
384
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
385 bool all_zero_dims (void) const { return dims().all_zero (); }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
386
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
387 octave_idx_type numel (void) const
5080
7929486ef2ed [project @ 2004-11-16 21:57:50 by jwe]
jwe
parents: 5073
diff changeset
388 { return rep->numel (); }
4559
802818bfac91 [project @ 2003-10-28 19:13:43 by jwe]
jwe
parents: 4554
diff changeset
389
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
390 octave_idx_type capacity (void) const
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
391 { return rep->capacity (); }
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
392
5659
960f4b9a26af [project @ 2006-03-10 15:35:20 by jwe]
jwe
parents: 5631
diff changeset
393 Matrix size (void) const;
960f4b9a26af [project @ 2006-03-10 15:35:20 by jwe]
jwe
parents: 5631
diff changeset
394
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
395 size_t byte_size (void) const
4791
62f2fb593455 [project @ 2004-02-20 18:02:59 by jwe]
jwe
parents: 4700
diff changeset
396 { return rep->byte_size (); }
62f2fb593455 [project @ 2004-02-20 18:02:59 by jwe]
jwe
parents: 4700
diff changeset
397
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
398 octave_idx_type nnz (void) const { return rep->nnz (); }
5602
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5508
diff changeset
399
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
400 octave_idx_type nzmax (void) const { return rep->nzmax (); }
5604
2857357f9d3c [project @ 2006-01-31 18:22:59 by jwe]
jwe
parents: 5602
diff changeset
401
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
402 octave_idx_type nfields (void) const { return rep->nfields (); }
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
403
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
404 octave_value reshape (const dim_vector& dv) const
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4567
diff changeset
405 { return rep->reshape (dv); }
4567
fc30061d01da [project @ 2003-10-29 20:11:15 by jwe]
jwe
parents: 4563
diff changeset
406
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
407 octave_value permute (const Array<int>& vec, bool inv = false) const
4593
77566be8b9e9 [project @ 2003-11-11 17:25:42 by jwe]
jwe
parents: 4587
diff changeset
408 { return rep->permute (vec, inv); }
77566be8b9e9 [project @ 2003-11-11 17:25:42 by jwe]
jwe
parents: 4587
diff changeset
409
77566be8b9e9 [project @ 2003-11-11 17:25:42 by jwe]
jwe
parents: 4587
diff changeset
410 octave_value ipermute (const Array<int>& vec) const
77566be8b9e9 [project @ 2003-11-11 17:25:42 by jwe]
jwe
parents: 4587
diff changeset
411 { return rep->permute (vec, true); }
77566be8b9e9 [project @ 2003-11-11 17:25:42 by jwe]
jwe
parents: 4587
diff changeset
412
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
413 octave_value resize (const dim_vector& dv, bool fill = false) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
414 { return rep->resize (dv, fill);}
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4911
diff changeset
415
5785
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
416 MatrixType matrix_type (void) const
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
417 { return rep->matrix_type (); }
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
418
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
419 MatrixType matrix_type (const MatrixType& typ) const
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
420 { return rep->matrix_type (typ); }
6b9cec830d72 [project @ 2006-05-03 19:32:46 by dbateman]
dbateman
parents: 5781
diff changeset
421
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
422 // Does this constant have a type? Both of these are provided since
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
423 // it is sometimes more natural to write is_undefined() instead of
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
424 // ! is_defined().
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
425
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
426 bool is_defined (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
427 { return rep->is_defined (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
428
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
429 bool is_undefined (void) const
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
430 { return ! is_defined (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
431
4559
802818bfac91 [project @ 2003-10-28 19:13:43 by jwe]
jwe
parents: 4554
diff changeset
432 bool is_empty (void) const
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
433 { return rep->is_empty (); }
4559
802818bfac91 [project @ 2003-10-28 19:13:43 by jwe]
jwe
parents: 4554
diff changeset
434
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
435 bool is_cell (void) const
3351
8623649c967c [project @ 1999-11-15 16:17:01 by jwe]
jwe
parents: 3340
diff changeset
436 { return rep->is_cell (); }
8623649c967c [project @ 1999-11-15 16:17:01 by jwe]
jwe
parents: 3340
diff changeset
437
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6109
diff changeset
438 bool is_cellstr (void) const
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6109
diff changeset
439 { return rep->is_cellstr (); }
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 6109
diff changeset
440
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
441 bool is_real_scalar (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
442 { return rep->is_real_scalar (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
443
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
444 bool is_real_matrix (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
445 { return rep->is_real_matrix (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
446
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
447 bool is_real_nd_array (void) const
4505
e944fbe3fff2 [project @ 2003-09-09 19:14:06 by jwe]
jwe
parents: 4478
diff changeset
448 { return rep->is_real_nd_array (); }
e944fbe3fff2 [project @ 2003-09-09 19:14:06 by jwe]
jwe
parents: 4478
diff changeset
449
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
450 bool is_complex_scalar (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
451 { return rep->is_complex_scalar (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
452
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
453 bool is_complex_matrix (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
454 { return rep->is_complex_matrix (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
455
5881
70b3f8f1a793 [project @ 2006-07-08 03:54:17 by jwe]
jwe
parents: 5864
diff changeset
456 bool is_bool_scalar (void) const
70b3f8f1a793 [project @ 2006-07-08 03:54:17 by jwe]
jwe
parents: 5864
diff changeset
457 { return rep->is_bool_scalar (); }
70b3f8f1a793 [project @ 2006-07-08 03:54:17 by jwe]
jwe
parents: 5864
diff changeset
458
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
459 bool is_bool_matrix (void) const
4587
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4567
diff changeset
460 { return rep->is_bool_matrix (); }
7b957b442818 [project @ 2003-11-10 15:50:39 by jwe]
jwe
parents: 4567
diff changeset
461
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
462 bool is_char_matrix (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
463 { return rep->is_char_matrix (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
464
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
465 bool is_string (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
466 { return rep->is_string (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
467
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
468 bool is_sq_string (void) const
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
469 { return rep->is_sq_string (); }
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
470
5280
25c12c80ccc3 [project @ 2005-04-14 19:19:45 by jwe]
jwe
parents: 5279
diff changeset
471 bool is_dq_string (void) const
25c12c80ccc3 [project @ 2005-04-14 19:19:45 by jwe]
jwe
parents: 5279
diff changeset
472 { return rep->is_string () && ! rep->is_sq_string (); }
25c12c80ccc3 [project @ 2005-04-14 19:19:45 by jwe]
jwe
parents: 5279
diff changeset
473
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
474 bool is_range (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
475 { return rep->is_range (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
476
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
477 bool is_map (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
478 { return rep->is_map (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
479
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
480 bool is_object (void) const
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
481 { return rep->is_object (); }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
482
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
483 bool is_cs_list (void) const
3977
95663a3a2682 [project @ 2002-07-05 17:43:37 by jwe]
jwe
parents: 3933
diff changeset
484 { return rep->is_cs_list (); }
95663a3a2682 [project @ 2002-07-05 17:43:37 by jwe]
jwe
parents: 3933
diff changeset
485
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
486 bool is_list (void) const
2880
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
487 { return rep->is_list (); }
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
488
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
489 bool is_magic_colon (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
490 { return rep->is_magic_colon (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
491
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
492 // Are any or all of the elements in this constant nonzero?
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
493
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
494 octave_value all (int dim = 0) const
4015
6476dd85a65f [project @ 2002-08-02 07:59:19 by jwe]
jwe
parents: 3977
diff changeset
495 { return rep->all (dim); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
496
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
497 octave_value any (int dim = 0) const
4015
6476dd85a65f [project @ 2002-08-02 07:59:19 by jwe]
jwe
parents: 3977
diff changeset
498 { return rep->any (dim); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
499
5895
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
500 // Floating point types.
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
501
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
502 bool is_double_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
503 { return rep->is_double_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
504
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
505 bool is_single_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
506 { return rep->is_single_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
507
7576
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7528
diff changeset
508 bool is_float_type (void) const
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7528
diff changeset
509 { return rep->is_float_type (); }
7ebdc99a0bab new isfloat function
John W. Eaton <jwe@octave.org>
parents: 7528
diff changeset
510
5895
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
511 // Integer types.
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
512
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
513 bool is_int8_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
514 { return rep->is_int8_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
515
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
516 bool is_int16_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
517 { return rep->is_int16_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
518
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
519 bool is_int32_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
520 { return rep->is_int32_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
521
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
522 bool is_int64_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
523 { return rep->is_int64_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
524
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
525 bool is_uint8_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
526 { return rep->is_uint8_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
527
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
528 bool is_uint16_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
529 { return rep->is_uint16_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
530
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
531 bool is_uint32_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
532 { return rep->is_uint32_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
533
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
534 bool is_uint64_type (void) const
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
535 { return rep->is_uint64_type (); }
b9c45e0cf685 [project @ 2006-07-19 01:57:44 by jwe]
jwe
parents: 5885
diff changeset
536
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
537 // Other type stuff.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
538
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
539 bool is_bool_type (void) const
3209
fbb332b96e4f [project @ 1998-11-03 20:48:54 by jwe]
jwe
parents: 3205
diff changeset
540 { return rep->is_bool_type (); }
fbb332b96e4f [project @ 1998-11-03 20:48:54 by jwe]
jwe
parents: 3205
diff changeset
541
6223
a6cc01dd09f9 [project @ 2007-01-03 20:59:28 by jwe]
jwe
parents: 6133
diff changeset
542 bool is_integer_type (void) const
a6cc01dd09f9 [project @ 2007-01-03 20:59:28 by jwe]
jwe
parents: 6133
diff changeset
543 { return rep->is_integer_type (); }
a6cc01dd09f9 [project @ 2007-01-03 20:59:28 by jwe]
jwe
parents: 6133
diff changeset
544
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
545 bool is_real_type (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
546 { return rep->is_real_type (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
547
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
548 bool is_complex_type (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
549 { return rep->is_complex_type (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
550
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
551 bool is_scalar_type (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
552 { return rep->is_scalar_type (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
553
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
554 bool is_matrix_type (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
555 { return rep->is_matrix_type (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
556
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
557 bool is_numeric_type (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
558 { return rep->is_numeric_type (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
559
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
560 bool is_sparse_type (void) const
5631
7171d19706df [project @ 2006-02-22 20:15:06 by dbateman]
dbateman
parents: 5604
diff changeset
561 { return rep->is_sparse_type (); }
7171d19706df [project @ 2006-02-22 20:15:06 by dbateman]
dbateman
parents: 5604
diff changeset
562
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
563 bool valid_as_scalar_index (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
564 { return rep->valid_as_scalar_index (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
565
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
566 bool valid_as_zero_index (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
567 { return rep->valid_as_zero_index (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
568
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
569 // Does this constant correspond to a truth value?
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
570
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
571 bool is_true (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
572 { return rep->is_true (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
573
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
574 // Are the dimensions of this constant zero by zero?
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
575
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
576 bool is_zero_by_zero (void) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
577 { return (rows () == 0 && columns () == 0); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
578
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
579 bool is_constant (void) const
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
580 { return rep->is_constant (); }
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
581
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
582 bool is_function_handle (void) const
4654
a9b22513b7a6 [project @ 2003-11-24 18:56:35 by jwe]
jwe
parents: 4645
diff changeset
583 { return rep->is_function_handle (); }
a9b22513b7a6 [project @ 2003-11-24 18:56:35 by jwe]
jwe
parents: 4645
diff changeset
584
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
585 bool is_inline_function (void) const
4954
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4946
diff changeset
586 { return rep->is_inline_function (); }
ed0f3cb6d3d4 [project @ 2004-09-01 21:24:53 by jwe]
jwe
parents: 4946
diff changeset
587
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
588 bool is_function (void) const
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
589 { return rep->is_function (); }
2891
1a30f46e1870 [project @ 1997-04-28 01:49:00 by jwe]
jwe
parents: 2880
diff changeset
590
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
591 bool is_user_script (void) const
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
592 { return rep->is_user_script (); }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
593
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
594 bool is_user_function (void) const
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
595 { return rep->is_user_function (); }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7064
diff changeset
596
7719
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
597 bool is_user_code (void) const
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
598 { return rep->is_user_code (); }
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
599
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
600 bool is_builtin_function (void) const
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3301
diff changeset
601 { return rep->is_builtin_function (); }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3301
diff changeset
602
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
603 bool is_dld_function (void) const
3325
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3301
diff changeset
604 { return rep->is_dld_function (); }
2efa28a91e7a [project @ 1999-10-29 21:39:20 by jwe]
jwe
parents: 3301
diff changeset
605
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5848
diff changeset
606 bool is_mex_function (void) const
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5848
diff changeset
607 { return rep->is_mex_function (); }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents: 5848
diff changeset
608
7876
8447a5024650 clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents: 7800
diff changeset
609 void erase_subfunctions (void) { rep->erase_subfunctions (); }
8447a5024650 clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents: 7800
diff changeset
610
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
611 // Values.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
612
2891
1a30f46e1870 [project @ 1997-04-28 01:49:00 by jwe]
jwe
parents: 2880
diff changeset
613 octave_value eval (void) { return *this; }
1a30f46e1870 [project @ 1997-04-28 01:49:00 by jwe]
jwe
parents: 2880
diff changeset
614
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
615 short int
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
616 short_value (bool req_int = false, bool frc_str_conv = false) const
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
617 { return rep->short_value (req_int, frc_str_conv); }
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
618
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
619 unsigned short int
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
620 ushort_value (bool req_int = false, bool frc_str_conv = false) const
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
621 { return rep->ushort_value (req_int, frc_str_conv); }
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
622
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
623 int int_value (bool req_int = false, bool frc_str_conv = false) const
3202
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 3195
diff changeset
624 { return rep->int_value (req_int, frc_str_conv); }
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 3195
diff changeset
625
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
626 unsigned int
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
627 uint_value (bool req_int = false, bool frc_str_conv = false) const
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
628 { return rep->uint_value (req_int, frc_str_conv); }
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
629
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
630 int nint_value (bool frc_str_conv = false) const
3202
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 3195
diff changeset
631 { return rep->nint_value (frc_str_conv); }
44d82b369c78 [project @ 1998-10-29 20:27:57 by jwe]
jwe
parents: 3195
diff changeset
632
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
633 long int
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
634 long_value (bool req_int = false, bool frc_str_conv = false) const
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
635 { return rep->long_value (req_int, frc_str_conv); }
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
636
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
637 unsigned long int
4254
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
638 ulong_value (bool req_int = false, bool frc_str_conv = false) const
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
639 { return rep->ulong_value (req_int, frc_str_conv); }
df5f2e433a11 [project @ 2002-12-31 19:43:07 by jwe]
jwe
parents: 4252
diff changeset
640
6133
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
641 octave_idx_type
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
642 idx_type_value (bool req_int = false, bool frc_str_conv = false) const
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
643 {
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
644 #if SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_LONG
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
645 return long_value (req_int, frc_str_conv);
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
646 #elif SIZEOF_OCTAVE_IDX_TYPE == SIZEOF_INT
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
647 return int_value (req_int, frc_str_conv);
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
648 #else
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
649 #error "no octave_value extractor for octave_idx_type"
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
650 #endif
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
651 }
e0065af38cf4 [project @ 2006-11-02 03:33:50 by jwe]
jwe
parents: 6116
diff changeset
652
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
653 double double_value (bool frc_str_conv = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
654 { return rep->double_value (frc_str_conv); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
655
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
656 float float_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
657 { return rep->float_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
658
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
659 double scalar_value (bool frc_str_conv = false) const
2916
4e7bea116f24 [project @ 1997-04-30 20:56:31 by jwe]
jwe
parents: 2909
diff changeset
660 { return rep->scalar_value (frc_str_conv); }
4e7bea116f24 [project @ 1997-04-30 20:56:31 by jwe]
jwe
parents: 2909
diff changeset
661
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
662 float float_scalar_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
663 { return rep->float_scalar_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
664
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
665 Cell cell_value (void) const;
3351
8623649c967c [project @ 1999-11-15 16:17:01 by jwe]
jwe
parents: 3340
diff changeset
666
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
667 Matrix matrix_value (bool frc_str_conv = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
668 { return rep->matrix_value (frc_str_conv); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
669
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
670 FloatMatrix float_matrix_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
671 { return rep->float_matrix_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
672
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
673 NDArray array_value (bool frc_str_conv = false) const
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
674 { return rep->array_value (frc_str_conv); }
4505
e944fbe3fff2 [project @ 2003-09-09 19:14:06 by jwe]
jwe
parents: 4478
diff changeset
675
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
676 FloatNDArray float_array_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
677 { return rep->float_array_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
678
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
679 Complex complex_value (bool frc_str_conv = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
680 { return rep->complex_value (frc_str_conv); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
681
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
682 FloatComplex float_complex_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
683 { return rep->float_complex_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
684
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
685 ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
686 { return rep->complex_matrix_value (frc_str_conv); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
687
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
688 FloatComplexMatrix float_complex_matrix_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
689 { return rep->float_complex_matrix_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
690
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
691 ComplexNDArray complex_array_value (bool frc_str_conv = false) const
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
692 { return rep->complex_array_value (frc_str_conv); }
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
693
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
694 FloatComplexNDArray float_complex_array_value (bool frc_str_conv = false) const
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
695 { return rep->float_complex_array_value (frc_str_conv); }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
696
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
697 bool bool_value (bool warn = false) const
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
698 { return rep->bool_value (warn); }
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
699
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
700 boolMatrix bool_matrix_value (bool warn = false) const
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
701 { return rep->bool_matrix_value (warn); }
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
702
5943
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
703 boolNDArray bool_array_value (bool warn = false) const
c038c2947ee1 [project @ 2006-08-18 21:27:03 by jwe]
jwe
parents: 5900
diff changeset
704 { return rep->bool_array_value (warn); }
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
705
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
706 charMatrix char_matrix_value (bool frc_str_conv = false) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
707 { return rep->char_matrix_value (frc_str_conv); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
708
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
709 charNDArray char_array_value (bool frc_str_conv = false) const
4550
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
710 { return rep->char_array_value (frc_str_conv); }
69a9b22a72a2 [project @ 2003-10-27 15:41:55 by jwe]
jwe
parents: 4532
diff changeset
711
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
712 SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
713 { return rep->sparse_matrix_value (frc_str_conv); }
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
714
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
715 SparseComplexMatrix sparse_complex_matrix_value (bool frc_str_conv = false) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
716 { return rep->sparse_complex_matrix_value (frc_str_conv); }
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
717
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
718 SparseBoolMatrix sparse_bool_matrix_value (bool frc_str_conv = false) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
719 { return rep->sparse_bool_matrix_value (frc_str_conv); }
5164
57077d0ddc8e [project @ 2005-02-25 19:55:24 by jwe]
jwe
parents: 5147
diff changeset
720
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
721 octave_int8 int8_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
722 { return rep->int8_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
723
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
724 octave_int16 int16_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
725 { return rep->int16_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
726
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
727 octave_int32 int32_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
728 { return rep->int32_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
729
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
730 octave_int64 int64_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
731 { return rep->int64_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
732
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
733 octave_uint8 uint8_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
734 { return rep->uint8_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
735
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
736 octave_uint16 uint16_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
737 { return rep->uint16_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
738
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
739 octave_uint32 uint32_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
740 { return rep->uint32_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
741
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
742 octave_uint64 uint64_scalar_value (void) const
4910
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
743 { return rep->uint64_scalar_value (); }
1242acab4246 [project @ 2004-07-12 17:14:13 by jwe]
jwe
parents: 4906
diff changeset
744
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
745 int8NDArray int8_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
746 { return rep->int8_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
747
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
748 int16NDArray int16_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
749 { return rep->int16_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
750
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
751 int32NDArray int32_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
752 { return rep->int32_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
753
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
754 int64NDArray int64_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
755 { return rep->int64_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
756
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
757 uint8NDArray uint8_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
758 { return rep->uint8_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
759
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
760 uint16NDArray uint16_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
761 { return rep->uint16_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
762
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
763 uint32NDArray uint32_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
764 { return rep->uint32_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
765
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
766 uint64NDArray uint64_array_value (void) const
4906
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
767 { return rep->uint64_array_value (); }
6754342ef7ad [project @ 2004-06-23 11:11:50 by jwe]
jwe
parents: 4901
diff changeset
768
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
769 string_vector all_strings (bool pad = false) const
5715
edf82d02be75 [project @ 2006-03-24 16:42:43 by jwe]
jwe
parents: 5707
diff changeset
770 { return rep->all_strings (pad); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
771
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
772 std::string string_value (bool force = false) const
4665
dece11da64ed [project @ 2003-11-25 15:37:32 by jwe]
jwe
parents: 4661
diff changeset
773 { return rep->string_value (force); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
774
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
775 Range range_value (void) const
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
776 { return rep->range_value (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
777
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
778 Octave_map map_value (void) const;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
779
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
780 string_vector map_keys (void) const
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
781 { return rep->map_keys (); }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
782
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
783 octave_function *function_value (bool silent = false);
2974
ebbc34ff7f66 [project @ 1997-05-15 19:36:16 by jwe]
jwe
parents: 2963
diff changeset
784
7761
5adeea5de26c symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents: 7740
diff changeset
785 const octave_function *function_value (bool silent = false) const;
5adeea5de26c symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents: 7740
diff changeset
786
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
787 octave_user_function *user_function_value (bool silent = false);
4700
ca3a1d687bba [project @ 2004-01-21 03:28:31 by jwe]
jwe
parents: 4687
diff changeset
788
7719
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
789 octave_user_script *user_script_value (bool silent = false);
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
790
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
791 octave_user_code *user_code_value (bool silent = false);
87eda1f8faaa octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents: 7638
diff changeset
792
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
793 octave_fcn_handle *fcn_handle_value (bool silent = false);
4343
db5e0814277a [project @ 2003-02-20 16:44:16 by jwe]
jwe
parents: 4342
diff changeset
794
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
795 octave_fcn_inline *fcn_inline_value (bool silent = false);
4933
cd58733c326b [project @ 2004-08-05 16:08:28 by jwe]
jwe
parents: 4930
diff changeset
796
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
797 octave_value_list list_value (void) const;
2880
0a076230ca87 [project @ 1997-04-24 09:47:41 by jwe]
jwe
parents: 2847
diff changeset
798
3419
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
799 ColumnVector column_vector_value (bool frc_str_conv = false,
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
800 bool frc_vec_conv = false) const;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
801
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
802 ComplexColumnVector
3419
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
803 complex_column_vector_value (bool frc_str_conv = false,
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
804 bool frc_vec_conv = false) const;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
805
3419
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
806 RowVector row_vector_value (bool frc_str_conv = false,
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
807 bool frc_vec_conv = false) const;
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
808
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
809 ComplexRowVector
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
810 complex_row_vector_value (bool frc_str_conv = false,
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
811 bool frc_vec_conv = false) const;
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
812
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
813
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
814 FloatColumnVector float_column_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
815 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
816
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
817 FloatComplexColumnVector
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
818 float_complex_column_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
819 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
820
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
821 FloatRowVector float_row_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
822 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
823
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
824 FloatComplexRowVector
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
825 float_complex_row_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
826 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
827
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
828
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
829
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
830
4044
9678c5526190 [project @ 2002-08-15 16:54:55 by jwe]
jwe
parents: 4018
diff changeset
831 Array<int> int_vector_value (bool req_int = false,
9678c5526190 [project @ 2002-08-15 16:54:55 by jwe]
jwe
parents: 4018
diff changeset
832 bool frc_str_conv = false,
9678c5526190 [project @ 2002-08-15 16:54:55 by jwe]
jwe
parents: 4018
diff changeset
833 bool frc_vec_conv = false) const;
9678c5526190 [project @ 2002-08-15 16:54:55 by jwe]
jwe
parents: 4018
diff changeset
834
3419
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
835 Array<double> vector_value (bool frc_str_conv = false,
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
836 bool frc_vec_conv = false) const;
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
837
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
838 Array<Complex> complex_vector_value (bool frc_str_conv = false,
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
839 bool frc_vec_conv = false) const;
e71b3d1dd327 [project @ 2000-01-12 05:23:34 by jwe]
jwe
parents: 3418
diff changeset
840
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
841 Array<float> float_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
842 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
843
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
844 Array<FloatComplex> float_complex_vector_value (bool frc_str_conv = false,
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
845 bool frc_vec_conv = false) const;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
846
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
847 // Conversions. These should probably be private. If a user of this
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
848 // class wants a certain kind of constant, he should simply ask for
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
849 // it, and we should convert it if possible.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
850
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
851 octave_value convert_to_str (bool pad = false, bool force = false,
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
852 char type = '"') const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
853 { return rep->convert_to_str (pad, force, type); }
4452
f3c21a1d1c62 [project @ 2003-07-09 23:20:18 by jwe]
jwe
parents: 4451
diff changeset
854
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
855 octave_value
5279
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
856 convert_to_str_internal (bool pad, bool force, char type) const
bd32f770c09a [project @ 2005-04-12 21:55:31 by jwe]
jwe
parents: 5275
diff changeset
857 { return rep->convert_to_str_internal (pad, force, type); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
858
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
859 void convert_to_row_or_column_vector (void)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
860 { rep->convert_to_row_or_column_vector (); }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
861
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
862 bool print_as_scalar (void) const
4604
cba347c642e2 [project @ 2003-11-13 04:38:05 by jwe]
jwe
parents: 4593
diff changeset
863 { return rep->print_as_scalar (); }
cba347c642e2 [project @ 2003-11-13 04:38:05 by jwe]
jwe
parents: 4593
diff changeset
864
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
865 void print (std::ostream& os, bool pr_as_read_syntax = false) const
2466
1573640a9994 [project @ 1996-11-04 03:56:11 by jwe]
jwe
parents: 2427
diff changeset
866 { rep->print (os, pr_as_read_syntax); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
867
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
868 void print_raw (std::ostream& os,
4457
d7d9ca19960a [project @ 2003-07-11 03:05:38 by jwe]
jwe
parents: 4455
diff changeset
869 bool pr_as_read_syntax = false) const
2903
facd9d10e5c1 [project @ 1997-04-30 03:53:07 by jwe]
jwe
parents: 2891
diff changeset
870 { rep->print_raw (os, pr_as_read_syntax); }
facd9d10e5c1 [project @ 1997-04-30 03:53:07 by jwe]
jwe
parents: 2891
diff changeset
871
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
872 bool print_name_tag (std::ostream& os, const std::string& name) const
2903
facd9d10e5c1 [project @ 1997-04-30 03:53:07 by jwe]
jwe
parents: 2891
diff changeset
873 { return rep->print_name_tag (os, name); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
874
3523
b80bbb43a1a9 [project @ 2000-02-02 10:25:52 by jwe]
jwe
parents: 3503
diff changeset
875 void print_with_name (std::ostream& os, const std::string& name,
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
876 bool print_padding = true) const
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
877 { rep->print_with_name (os, name, print_padding); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
878
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
879 int type_id (void) const { return rep->type_id (); }
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
880
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
881 std::string type_name (void) const { return rep->type_name (); }
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
882
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
883 std::string class_name (void) const { return rep->class_name (); }
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4604
diff changeset
884
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
885 // Unary and binary operations.
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
886
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
887 friend OCTINTERP_API octave_value do_unary_op (unary_op op,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
888 const octave_value& a);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
889
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
890 const octave_value& do_non_const_unary_op (unary_op op);
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
891
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
892 void do_non_const_unary_op (unary_op op, const octave_value_list& idx);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
893
4247
fc9a075d10fb [project @ 2002-12-30 23:05:27 by jwe]
jwe
parents: 4233
diff changeset
894 octave_value do_non_const_unary_op (unary_op op, const std::string& type,
4219
23d06c9e1edd [project @ 2002-12-06 21:29:17 by jwe]
jwe
parents: 4192
diff changeset
895 const std::list<octave_value_list>& idx);
3205
549691faa638 [project @ 1998-10-31 04:20:15 by jwe]
jwe
parents: 3204
diff changeset
896
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
897 friend OCTINTERP_API octave_value do_binary_op (binary_op op,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
898 const octave_value& a,
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
899 const octave_value& b);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
900
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
901 friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
902 const octave_value& a,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
903 const octave_value& b);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
904
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
905 friend OCTINTERP_API octave_value do_cat_op (const octave_value& a,
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4911
diff changeset
906 const octave_value& b,
6867
83619ae96c1d [project @ 2007-09-06 12:08:44 by dbateman]
dbateman
parents: 6863
diff changeset
907 const Array<octave_idx_type>& ra_idx);
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4911
diff changeset
908
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
909 const octave_base_value& get_rep (void) const { return *rep; }
3301
02866242d3ae [project @ 1999-10-20 04:10:46 by jwe]
jwe
parents: 3240
diff changeset
910
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
911 void print_info (std::ostream& os,
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
912 const std::string& prefix = std::string ()) const;
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
913
6974
9e32bb109980 [project @ 2007-10-08 11:06:47 by jwe]
jwe
parents: 6867
diff changeset
914 bool save_ascii (std::ostream& os) { return rep->save_ascii (os); }
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
915
6974
9e32bb109980 [project @ 2007-10-08 11:06:47 by jwe]
jwe
parents: 6867
diff changeset
916 bool load_ascii (std::istream& is) { return rep->load_ascii (is); }
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
917
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
918 bool save_binary (std::ostream& os, bool& save_as_floats)
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
919 { return rep->save_binary (os, save_as_floats); }
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
920
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
921 bool load_binary (std::istream& is, bool swap,
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
922 oct_mach_info::float_format fmt)
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
923 { return rep->load_binary (is, swap, fmt); }
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
924
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
925 #if defined (HAVE_HDF5)
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
926 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats)
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
927 { return rep->save_hdf5 (loc_id, name, save_as_floats); }
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
928
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
929 bool load_hdf5 (hid_t loc_id, const char *name,
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
930 bool have_h5giterate_bug)
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
931 { return rep->load_hdf5 (loc_id, name, have_h5giterate_bug); }
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
932 #endif
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4665
diff changeset
933
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
934 int write (octave_stream& os, int block_size,
4944
44046bbaa52c [project @ 2004-08-31 05:30:46 by jwe]
jwe
parents: 4933
diff changeset
935 oct_data_conv::data_type output_type, int skip,
44046bbaa52c [project @ 2004-08-31 05:30:46 by jwe]
jwe
parents: 4933
diff changeset
936 oct_mach_info::float_format flt_fmt) const;
44046bbaa52c [project @ 2004-08-31 05:30:46 by jwe]
jwe
parents: 4933
diff changeset
937
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
938 octave_base_value *internal_rep (void) const { return rep; }
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4791
diff changeset
939
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
940 // Unsafe. These functions exist to support the MEX interface.
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
941 // You should not use them anywhere else.
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
942 void *mex_get_data (void) const { return rep->mex_get_data (); }
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
943
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
944 octave_idx_type *mex_get_ir (void) const { return rep->mex_get_ir (); }
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
945
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
946 octave_idx_type *mex_get_jc (void) const { return rep->mex_get_jc (); }
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
947
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
948 mxArray *as_mxArray (void) const { return rep->as_mxArray (); }
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5895
diff changeset
949
7620
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
950 octave_value diag (octave_idx_type k = 0) const
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
951 { return rep->diag (k); }
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7576
diff changeset
952
7463
2467639bd8c0 eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents: 7433
diff changeset
953 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const
7433
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
954 { return rep->sort (dim, mode); }
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
955 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0,
7463
2467639bd8c0 eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents: 7433
diff changeset
956 sortmode mode = ASCENDING) const
7433
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
957 { return rep->sort (sidx, dim, mode); }
402168152bb9 [project @ 2008-01-31 18:59:09 by dbateman]
dbateman
parents: 7336
diff changeset
958
7489
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
959 void lock (void) { rep->lock (); }
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
960
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
961 void unlock (void) { rep->unlock (); }
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
962
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
963 bool islocked (void) const { return rep->islocked (); }
8e4592e49fa7 don't clear locked functions
John W. Eaton <jwe@octave.org>
parents: 7463
diff changeset
964
7761
5adeea5de26c symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents: 7740
diff changeset
965 void dump (std::ostream& os) const { rep->dump (os); }
5adeea5de26c symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents: 7740
diff changeset
966
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
967 #define MAPPER_FORWARD(F) \
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
968 octave_value F (void) const { return rep->F (); }
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
969
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
970 MAPPER_FORWARD (abs)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
971 MAPPER_FORWARD (acos)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
972 MAPPER_FORWARD (acosh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
973 MAPPER_FORWARD (angle)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
974 MAPPER_FORWARD (arg)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
975 MAPPER_FORWARD (asin)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
976 MAPPER_FORWARD (asinh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
977 MAPPER_FORWARD (atan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
978 MAPPER_FORWARD (atanh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
979 MAPPER_FORWARD (ceil)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
980 MAPPER_FORWARD (conj)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
981 MAPPER_FORWARD (cos)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
982 MAPPER_FORWARD (cosh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
983 MAPPER_FORWARD (erf)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
984 MAPPER_FORWARD (erfc)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
985 MAPPER_FORWARD (exp)
7638
2df457529cfa implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents: 7636
diff changeset
986 MAPPER_FORWARD (expm1)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
987 MAPPER_FORWARD (finite)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
988 MAPPER_FORWARD (fix)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
989 MAPPER_FORWARD (floor)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
990 MAPPER_FORWARD (gamma)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
991 MAPPER_FORWARD (imag)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
992 MAPPER_FORWARD (isinf)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
993 MAPPER_FORWARD (isna)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
994 MAPPER_FORWARD (isnan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
995 MAPPER_FORWARD (lgamma)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
996 MAPPER_FORWARD (log)
7740
39930366b709 implement builtin log2
Jaroslav Hajek <highegg@gmail.com>
parents: 7719
diff changeset
997 MAPPER_FORWARD (log2)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
998 MAPPER_FORWARD (log10)
7638
2df457529cfa implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents: 7636
diff changeset
999 MAPPER_FORWARD (log1p)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1000 MAPPER_FORWARD (real)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1001 MAPPER_FORWARD (round)
7636
99c410f7f0b0 implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents: 7620
diff changeset
1002 MAPPER_FORWARD (roundb)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1003 MAPPER_FORWARD (signum)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1004 MAPPER_FORWARD (sin)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1005 MAPPER_FORWARD (sinh)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1006 MAPPER_FORWARD (sqrt)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1007 MAPPER_FORWARD (tan)
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1008 MAPPER_FORWARD (tanh)
7528
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1009
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1010 // These functions are prefixed with X to avoid potential macro
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1011 // conflicts.
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1012
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1013 MAPPER_FORWARD (xisalnum)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1014 MAPPER_FORWARD (xisalpha)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1015 MAPPER_FORWARD (xisascii)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1016 MAPPER_FORWARD (xiscntrl)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1017 MAPPER_FORWARD (xisdigit)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1018 MAPPER_FORWARD (xisgraph)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1019 MAPPER_FORWARD (xislower)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1020 MAPPER_FORWARD (xisprint)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1021 MAPPER_FORWARD (xispunct)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1022 MAPPER_FORWARD (xisspace)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1023 MAPPER_FORWARD (xisupper)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1024 MAPPER_FORWARD (xisxdigit)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1025 MAPPER_FORWARD (xtoascii)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1026 MAPPER_FORWARD (xtolower)
26d8a92644de try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents: 7503
diff changeset
1027 MAPPER_FORWARD (xtoupper)
7503
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1028
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1029 #undef MAPPER_FORWARD
8c32f95c2639 convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents: 7489
diff changeset
1030
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1031 protected:
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1032
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1033 // The real representation.
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1034 octave_base_value *rep;
2413
44753e0cadf2 [project @ 1996-10-15 17:02:26 by jwe]
jwe
parents: 2410
diff changeset
1035
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3930
diff changeset
1036 private:
2903
facd9d10e5c1 [project @ 1997-04-30 03:53:07 by jwe]
jwe
parents: 2891
diff changeset
1037
3205
549691faa638 [project @ 1998-10-31 04:20:15 by jwe]
jwe
parents: 3204
diff changeset
1038 assign_op unary_op_to_assign_op (unary_op op);
549691faa638 [project @ 1998-10-31 04:20:15 by jwe]
jwe
parents: 3204
diff changeset
1039
3204
81738e630f57 [project @ 1998-10-30 23:28:29 by jwe]
jwe
parents: 3203
diff changeset
1040 binary_op op_eq_to_binary_op (assign_op op);
81738e630f57 [project @ 1998-10-30 23:28:29 by jwe]
jwe
parents: 3203
diff changeset
1041
3219
30770ba4457a [project @ 1998-11-13 03:44:31 by jwe]
jwe
parents: 3209
diff changeset
1042 DECLARE_OCTAVE_ALLOCATOR
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1043 };
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1044
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1045 // Publish externally used friend functions.
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1046
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
1047 extern OCTINTERP_API octave_value
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1048 do_unary_op (octave_value::unary_op op, const octave_value& a);
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1049
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
1050 extern OCTINTERP_API octave_value
5508
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1051 do_binary_op (octave_value::binary_op op,
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1052 const octave_value& a, const octave_value& b);
7865515fc6c2 [project @ 2005-10-26 15:24:07 by jwe]
jwe
parents: 5353
diff changeset
1053
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1054 extern OCTINTERP_API octave_value
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1055 do_binary_op (octave_value::compound_binary_op op,
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1056 const octave_value& a, const octave_value& b);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1057
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1058 #define OV_UNOP_FN(name) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1059 inline octave_value \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1060 name (const octave_value& a) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1061 { \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1062 return do_unary_op (octave_value::name, a); \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1063 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1064
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1065 #define OV_UNOP_OP(name, op) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1066 inline octave_value \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1067 operator op (const octave_value& a) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1068 { \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1069 return name (a); \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1070 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1071
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1072 #define OV_UNOP_FN_OP(name, op) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1073 OV_UNOP_FN (name) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1074 OV_UNOP_OP (name, op)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1075
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1076 OV_UNOP_FN_OP (op_not, !)
6518
952c8b00525e [project @ 2007-04-11 20:50:22 by jwe]
jwe
parents: 6338
diff changeset
1077 OV_UNOP_FN_OP (op_uplus, +)
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1078 OV_UNOP_FN_OP (op_uminus, -)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1079
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1080 OV_UNOP_FN (op_transpose)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1081 OV_UNOP_FN (op_hermitian)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1082
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1083 // No simple way to define these for prefix and suffix ops?
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1084 //
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1085 // incr
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1086 // decr
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1087
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1088 #define OV_BINOP_FN(name) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1089 inline octave_value \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1090 name (const octave_value& a1, const octave_value& a2) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1091 { \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1092 return do_binary_op (octave_value::name, a1, a2); \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1093 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1094
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1095 #define OV_BINOP_OP(name, op) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1096 inline octave_value \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1097 operator op (const octave_value& a1, const octave_value& a2) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1098 { \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1099 return name (a1, a2); \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1100 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1101
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1102 #define OV_BINOP_FN_OP(name, op) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1103 OV_BINOP_FN (name) \
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1104 OV_BINOP_OP (name, op)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1105
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1106 OV_BINOP_FN_OP (op_add, +)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1107 OV_BINOP_FN_OP (op_sub, -)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1108 OV_BINOP_FN_OP (op_mul, *)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1109 OV_BINOP_FN_OP (op_div, /)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1110
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1111 OV_BINOP_FN (op_pow)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1112 OV_BINOP_FN (op_ldiv)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1113 OV_BINOP_FN (op_lshift)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1114 OV_BINOP_FN (op_rshift)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1115
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1116 OV_BINOP_FN_OP (op_lt, <)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1117 OV_BINOP_FN_OP (op_le, <=)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1118 OV_BINOP_FN_OP (op_eq, ==)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1119 OV_BINOP_FN_OP (op_ge, >=)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1120 OV_BINOP_FN_OP (op_gt, >)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1121 OV_BINOP_FN_OP (op_ne, !=)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1122
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1123 OV_BINOP_FN (op_el_mul)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1124 OV_BINOP_FN (op_el_div)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1125 OV_BINOP_FN (op_el_pow)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1126 OV_BINOP_FN (op_el_ldiv)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1127 OV_BINOP_FN (op_el_and)
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1128 OV_BINOP_FN (op_el_or)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1129
3525
6cfa474c5b99 [project @ 2000-02-02 10:48:41 by jwe]
jwe
parents: 3523
diff changeset
1130 OV_BINOP_FN (op_struct_ref)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3202
diff changeset
1131
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1132 #define OV_COMP_BINOP_FN(name) \
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1133 inline octave_value \
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1134 name (const octave_value& a1, const octave_value& a2) \
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1135 { \
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1136 return do_binary_op (octave_value::name, a1, a2); \
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1137 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1138
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1139 OV_COMP_BINOP_FN (op_trans_mul)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1140 OV_COMP_BINOP_FN (op_mul_trans)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1141 OV_COMP_BINOP_FN (op_herm_mul)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1142 OV_COMP_BINOP_FN (op_mul_herm)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7789
diff changeset
1143
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5958
diff changeset
1144 extern OCTINTERP_API void install_types (void);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1145
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5759
diff changeset
1146 // FIXME -- these trait classes probably belong somehwere else...
4946
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1147
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1148 template <typename T>
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1149 class
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1150 octave_type_traits
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1151 {
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1152 public:
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1153 typedef T val_type;
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1154 };
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1155
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1156 #define OCTAVE_TYPE_TRAIT(T, VAL_T) \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1157 template <> \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1158 class \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1159 octave_type_traits<T> \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1160 { \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1161 public: \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1162 typedef VAL_T val_type; \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1163 }
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1164
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1165 OCTAVE_TYPE_TRAIT (octave_int8, octave_int8::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1166 OCTAVE_TYPE_TRAIT (octave_uint8, octave_uint8::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1167 OCTAVE_TYPE_TRAIT (octave_int16, octave_int16::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1168 OCTAVE_TYPE_TRAIT (octave_uint16, octave_uint16::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1169 OCTAVE_TYPE_TRAIT (octave_int32, octave_int32::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1170 OCTAVE_TYPE_TRAIT (octave_uint32, octave_uint32::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1171 OCTAVE_TYPE_TRAIT (octave_int64, octave_int64::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1172 OCTAVE_TYPE_TRAIT (octave_uint64, octave_uint64::val_type);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1173
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1174 template <typename T>
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1175 class octave_array_type_traits
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1176 {
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1177 public:
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1178 typedef T element_type;
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1179 };
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1180
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1181 #define OCTAVE_ARRAY_TYPE_TRAIT(T, ELT_T) \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1182 template <> \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1183 class \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1184 octave_array_type_traits<T> \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1185 { \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1186 public: \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1187 typedef ELT_T element_type; \
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1188 }
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1189
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1190 OCTAVE_ARRAY_TYPE_TRAIT (charNDArray, char);
4970
25c2664861bc [project @ 2004-09-08 05:02:32 by jwe]
jwe
parents: 4965
diff changeset
1191 OCTAVE_ARRAY_TYPE_TRAIT (boolNDArray, bool);
4946
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1192 OCTAVE_ARRAY_TYPE_TRAIT (int8NDArray, octave_int8);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1193 OCTAVE_ARRAY_TYPE_TRAIT (uint8NDArray, octave_uint8);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1194 OCTAVE_ARRAY_TYPE_TRAIT (int16NDArray, octave_int16);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1195 OCTAVE_ARRAY_TYPE_TRAIT (uint16NDArray, octave_uint16);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1196 OCTAVE_ARRAY_TYPE_TRAIT (int32NDArray, octave_int32);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1197 OCTAVE_ARRAY_TYPE_TRAIT (uint32NDArray, octave_uint32);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1198 OCTAVE_ARRAY_TYPE_TRAIT (int64NDArray, octave_int64);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1199 OCTAVE_ARRAY_TYPE_TRAIT (uint64NDArray, octave_uint64);
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1200 OCTAVE_ARRAY_TYPE_TRAIT (NDArray, double);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7761
diff changeset
1201 OCTAVE_ARRAY_TYPE_TRAIT (FloatNDArray, float);
4946
48a39e2b2ab7 [project @ 2004-08-31 17:27:04 by jwe]
jwe
parents: 4944
diff changeset
1202
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1203 // This will eventually go away, but for now it can be used to
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1204 // simplify the transition to the new octave_value class hierarchy,
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1205 // which uses octave_base_value instead of octave_value for the type
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1206 // of octave_value::rep.
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1207 #define OV_REP_TYPE octave_base_value
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5758
diff changeset
1208
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1209 #endif
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1210
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1211 /*
6705
0ee6bda23b87 [project @ 2007-06-13 05:42:24 by jwe]
jwe
parents: 6518
diff changeset
1212 ;;; Local Variables: ***
0ee6bda23b87 [project @ 2007-06-13 05:42:24 by jwe]
jwe
parents: 6518
diff changeset
1213 ;;; mode: C++ ***
0ee6bda23b87 [project @ 2007-06-13 05:42:24 by jwe]
jwe
parents: 6518
diff changeset
1214 ;;; End: ***
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1215 */