Mercurial > octave
annotate libinterp/octave-value/ov-str-mat.h @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
2376 | 1 /* |
2 | |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 Copyright (C) 1996-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26919
diff
changeset
|
4 |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26919
diff
changeset
|
5 See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26919
diff
changeset
|
6 or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26919
diff
changeset
|
7 |
2376 | 8 |
9 This file is part of Octave. | |
10 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23586
diff
changeset
|
11 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23586
diff
changeset
|
13 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 (at your option) any later version. |
2376 | 15 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
16 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
17 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
19 GNU General Public License for more details. |
2376 | 20 |
21 You should have received a copy of the GNU General Public License | |
7016 | 22 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23586
diff
changeset
|
23 <https://www.gnu.org/licenses/>. |
2376 | 24 |
25 */ | |
26 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20700
diff
changeset
|
27 #if ! defined (octave_ov_str_mat_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
28 #define octave_ov_str_mat_h 1 |
2376 | 29 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20990
diff
changeset
|
30 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20990
diff
changeset
|
31 |
2376 | 32 #include <cstdlib> |
33 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
34 #include <iosfwd> |
2376 | 35 #include <string> |
36 | |
37 #include "mx-base.h" | |
38 #include "str-vec.h" | |
39 | |
40 #include "error.h" | |
4944 | 41 #include "oct-stream.h" |
3202 | 42 #include "ov.h" |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9688
diff
changeset
|
43 #include "ov-ch-mat.h" |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7463
diff
changeset
|
44 #include "ov-re-mat.h" |
2376 | 45 #include "ov-typeinfo.h" |
46 | |
47 class octave_value_list; | |
48 | |
2477 | 49 // Character matrix values with special properties for use as |
50 // strings. | |
2376 | 51 |
52 class | |
6109 | 53 OCTINTERP_API |
2376 | 54 octave_char_matrix_str : public octave_char_matrix |
55 { | |
56 public: | |
57 | |
58 octave_char_matrix_str (void) | |
59 : octave_char_matrix () { } | |
60 | |
61 octave_char_matrix_str (const charMatrix& chm) | |
62 : octave_char_matrix (chm) { } | |
63 | |
4513 | 64 octave_char_matrix_str (const charNDArray& chm) |
65 : octave_char_matrix (chm) { } | |
66 | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
67 octave_char_matrix_str (const Array<char>& chm) |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
68 : octave_char_matrix (chm) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
69 |
3189 | 70 octave_char_matrix_str (char c) |
71 : octave_char_matrix (c) { } | |
72 | |
2376 | 73 octave_char_matrix_str (const char *s) |
74 : octave_char_matrix (s) { } | |
75 | |
3523 | 76 octave_char_matrix_str (const std::string& s) |
2376 | 77 : octave_char_matrix (s) { } |
78 | |
79 octave_char_matrix_str (const string_vector& s) | |
80 : octave_char_matrix (s) { } | |
81 | |
82 octave_char_matrix_str (const octave_char_matrix& chm) | |
83 : octave_char_matrix (chm) { } | |
84 | |
85 octave_char_matrix_str (const octave_char_matrix_str& chms) | |
86 : octave_char_matrix (chms) { } | |
87 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
88 ~octave_char_matrix_str (void) = default; |
2376 | 89 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
90 octave_base_value * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
91 { return new octave_char_matrix_str (*this); } |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
92 octave_base_value * empty_clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
93 { return new octave_char_matrix_str (); } |
2376 | 94 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8168
diff
changeset
|
95 type_conv_info numeric_conversion_function (void) const; |
2376 | 96 |
5885 | 97 octave_value do_index_op (const octave_value_list& idx, |
10313 | 98 bool resize_ok = false) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
99 { return do_index_op_internal (idx, resize_ok); } |
2407 | 100 |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
101 octave_value squeeze (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
102 { return octave_value (charNDArray (matrix.squeeze ())); } |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
103 |
4569 | 104 octave_value reshape (const dim_vector& new_dims) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
105 { return octave_value (charNDArray (matrix.reshape (new_dims))); } |
4569 | 106 |
5533 | 107 octave_value permute (const Array<int>& vec, bool inv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
108 { return octave_value (charNDArray (matrix.permute (vec, inv))); } |
5533 | 109 |
5731 | 110 octave_value resize (const dim_vector& dv, bool fill = false) const; |
5533 | 111 |
26919
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
112 // We don't need to override both forms of the diag method. The using |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
113 // declaration will avoid warnings about partially-overloaded virtual |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
114 // functions. |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
115 using octave_char_matrix::diag; |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
116 |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
117 octave_value diag (octave_idx_type k = 0) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
118 { return octave_value (matrix.diag (k)); } |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
119 |
2376 | 120 bool is_string (void) const { return true; } |
121 | |
23586
f6c5db0a02e7
maint: Deprecate is_numeric_type and replace with isnumeric.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
122 bool isnumeric (void) const { return false; } |
3221 | 123 |
4643 | 124 double double_value (bool = false) const; |
125 | |
2376 | 126 Matrix matrix_value (bool = false) const; |
127 | |
4668 | 128 NDArray array_value (bool = false) const; |
129 | |
130 Complex complex_value (bool = false) const; | |
131 | |
132 ComplexMatrix complex_matrix_value (bool = false) const; | |
133 | |
134 ComplexNDArray complex_array_value (bool = false) const; | |
135 | |
20990
fc9cca99b2de
Deprecate all_strings, replace with string_vector_value.
Rik <rik@octave.org>
parents:
20791
diff
changeset
|
136 string_vector string_vector_value (bool pad = false) const; |
2376 | 137 |
4457 | 138 std::string string_value (bool force = false) const; |
2376 | 139 |
20700
68e3a747ca02
rename octave_value value extractors that accept error message args
John W. Eaton <jwe@octave.org>
parents:
20681
diff
changeset
|
140 std::string xstring_value (void) const { return string_value (); } |
20576
40ed9b46a800
new octave_value::string_value method with optional error message
John W. Eaton <jwe@octave.org>
parents:
19863
diff
changeset
|
141 |
10729
172253d75d94
implement cellstr extractors for char matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10521
diff
changeset
|
142 Array<std::string> cellstr_value (void) const; |
172253d75d94
implement cellstr extractors for char matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
10521
diff
changeset
|
143 |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
144 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
145 { return octave_value (matrix.sort (dim, mode)); } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7463
diff
changeset
|
146 |
7433 | 147 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, |
10313 | 148 sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
149 { return octave_value (matrix.sort (sidx, dim, mode)); } |
7433 | 150 |
3219 | 151 bool print_as_scalar (void) const { return (rows () <= 1); } |
2901 | 152 |
3523 | 153 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
2901 | 154 |
17870 | 155 void short_disp (std::ostream& os) const; |
17825
53f433bae63b
display (possibly truncated) values of strings in workspace view
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
156 |
24668
d4dd741b2794
new octave_value functions for formatting output
John W. Eaton <jwe@octave.org>
parents:
24655
diff
changeset
|
157 std::string edit_display (const float_display_format& fmt, |
d4dd741b2794
new octave_value functions for formatting output
John W. Eaton <jwe@octave.org>
parents:
24655
diff
changeset
|
158 octave_idx_type i, octave_idx_type j) const; |
24655
3ceee1910e1a
allow single character strings to be edited (bug #51848)
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
159 |
6974 | 160 bool save_ascii (std::ostream& os); |
4687 | 161 |
162 bool load_ascii (std::istream& is); | |
163 | |
26399
586413770c7f
pass save_as_floats by value in octave_value save_binary functions
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
164 bool save_binary (std::ostream& os, bool save_as_floats); |
4687 | 165 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
166 bool load_binary (std::istream& is, bool swap, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
167 octave::mach_info::float_format fmt); |
4687 | 168 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
169 bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats); |
4687 | 170 |
19863
09ed6f7538dd
avoid needing to include hdf5 in public header files (bug #44370, #43180)
John W. Eaton <jwe@octave.org> and Mike Miller <mtmiller@ieee.org>
parents:
19697
diff
changeset
|
171 bool load_hdf5 (octave_hdf5_id loc_id, const char *name); |
4687 | 172 |
23059
b98ebcd7f11c
move some octave stream classes into octave namespace
John W. Eaton <jwe@octave.org>
parents:
22868
diff
changeset
|
173 int write (octave::stream& os, int block_size, |
10313 | 174 oct_data_conv::data_type output_type, int skip, |
21739
c4ab2e54f100
use namespace for oct_mach_info class
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
175 octave::mach_info::float_format flt_fmt) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
176 { return os.write (matrix, block_size, output_type, skip, flt_fmt); } |
4944 | 177 |
5400 | 178 protected: |
179 | |
180 octave_value do_index_op_internal (const octave_value_list& idx, | |
10313 | 181 bool resize_ok, char type = '"'); |
5400 | 182 |
2376 | 183 private: |
184 | |
3219 | 185 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376 | 186 }; |
187 | |
5279 | 188 typedef octave_char_matrix_str octave_char_matrix_dq_str; |
189 | |
190 class | |
191 octave_char_matrix_sq_str : public octave_char_matrix_str | |
192 { | |
193 public: | |
194 | |
195 octave_char_matrix_sq_str (void) | |
196 : octave_char_matrix_str () { } | |
197 | |
198 octave_char_matrix_sq_str (const charMatrix& chm) | |
199 : octave_char_matrix_str (chm) { } | |
200 | |
201 octave_char_matrix_sq_str (const charNDArray& chm) | |
202 : octave_char_matrix_str (chm) { } | |
203 | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
204 octave_char_matrix_sq_str (const Array<char>& chm) |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
205 : octave_char_matrix_str (chm) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
206 |
5279 | 207 octave_char_matrix_sq_str (char c) |
208 : octave_char_matrix_str (c) { } | |
209 | |
210 octave_char_matrix_sq_str (const char *s) | |
211 : octave_char_matrix_str (s) { } | |
212 | |
213 octave_char_matrix_sq_str (const std::string& s) | |
214 : octave_char_matrix_str (s) { } | |
215 | |
216 octave_char_matrix_sq_str (const string_vector& s) | |
217 : octave_char_matrix_str (s) { } | |
218 | |
219 octave_char_matrix_sq_str (const octave_char_matrix_str& chm) | |
220 : octave_char_matrix_str (chm) { } | |
221 | |
222 octave_char_matrix_sq_str (const octave_char_matrix_sq_str& chms) | |
223 : octave_char_matrix_str (chms) { } | |
224 | |
22868
87e3163f6c87
use c++11 "= default" syntax for declaration of trivial destructors
John W. Eaton <jwe@octave.org>
parents:
22755
diff
changeset
|
225 ~octave_char_matrix_sq_str (void) = default; |
5279 | 226 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
227 octave_base_value * clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
228 { return new octave_char_matrix_sq_str (*this); } |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
229 octave_base_value * empty_clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
230 { return new octave_char_matrix_sq_str (); } |
5279 | 231 |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
232 octave_value squeeze (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
233 { return octave_value (charNDArray (matrix.squeeze ()), '\''); } |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
234 |
5533 | 235 octave_value reshape (const dim_vector& new_dims) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
236 { return octave_value (charNDArray (matrix.reshape (new_dims)), '\''); } |
5533 | 237 |
238 octave_value permute (const Array<int>& vec, bool inv = false) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
239 { return octave_value (charNDArray (matrix.permute (vec, inv)), '\''); } |
5533 | 240 |
5890 | 241 octave_value resize (const dim_vector& dv, bool = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
242 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
243 charNDArray retval (matrix); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
244 retval.resize (dv); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
245 return octave_value (retval, '\''); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
246 } |
5533 | 247 |
26919
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
248 // We don't need to override both forms of the diag method. The using |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
249 // declaration will avoid warnings about partially-overloaded virtual |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
250 // functions. |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
251 using octave_char_matrix_str::diag; |
c33ac5ca0a7a
avoid some overloaded virtual warnings (bug #55741)
John W. Eaton <jwe@octave.org>
parents:
26399
diff
changeset
|
252 |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
253 octave_value diag (octave_idx_type k = 0) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
254 { return octave_value (matrix.diag (k), '\''); } |
9688
90abfd8a2895
make squeeze and diag return char for char argument
John W. Eaton <jwe@octave.org>
parents:
8950
diff
changeset
|
255 |
5279 | 256 bool is_sq_string (void) const { return true; } |
257 | |
5885 | 258 octave_value do_index_op (const octave_value_list& idx, |
10313 | 259 bool resize_ok = false) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
260 { return do_index_op_internal (idx, resize_ok, '\''); } |
5400 | 261 |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
262 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
263 { return octave_value (matrix.sort (dim, mode), '\''); } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7463
diff
changeset
|
264 |
7433 | 265 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, |
10313 | 266 sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
267 { return octave_value (matrix.sort (sidx, dim, mode), '\''); } |
7433 | 268 |
5279 | 269 private: |
270 | |
271 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA | |
272 }; | |
273 | |
2376 | 274 #endif |