annotate src/Cell.h @ 14616:13cc11418393

improve handling of default resize fill value for arrays * Array.cc (Array<T>::resize_fill_value): Return T, not const T&. * Array.h (Array<T>::resize_fill_value): Now virtual member function instead of static. (Array<T>::resize1 (octave_idx_type)): New function. (Array<T>::resize1 (octave_idx_type, const T&)): Eliminate default value for second arg. (Array<T>::resize (octave_idx_type, octave_idx_type)): New function. (Array<T>::resize (octave_idx_type, octave_idx_type, const T&)): Eliminate default value for third arg. (Array<T>::resize (const dim_vector&)): New function. (Array<T>::resize (const dim_vector&, const T&)): New function. (Array<T>::resize2 (octave_idx_type, octave_idx_type)): New function. (Array<T>::resize2 (octave_idx_type, octave_idx_type, const T&)): Eliminate default value for third arg. (Array<T>::index (const idx_vector&, bool) const): New function. (Array<T>::index (const idx_vector&, bool, const T&) const): Eliminate default value for third arg. (Array<T>::index (const idx_vector&, const idx_vector&, bool) const): New function. (Array<T>::index (const idx_vector&, const idx_vector&, bool, const T&) const): Eliminate default value for third arg. (Array<T>::index (const Array<idx_vector>&, bool) const): New function. (Array<T>::index (const Array<idx_vector>&, const T&) const): Eliminate default value for third arg. (Array<T>::assign (const idx_vector&, const Array<T>&)): New function. (Array<T>::assign (const idx_vector&, const Array<T>&, const T&)): Eliminate default value for third arg. (Array<T>::assign (const idx_vector&, const idx_vector&, const Array<T>&)): New function. (Array<T>::assign (const idx_vector&, const idx_vector&, const Array<T>&, const T&)): Eliminate default value for third arg. (Array<T>::assign (const Array<idx_vector>&, const Array<T>&)): New function. (Array<T>::assign (const Array<idx_vector>&, const Array<T>&, const T&)): Eliminate default value for third arg. * DiagArray2.h (DiagArray2<T>::resize (octave_idx_type, octave_idx_type)): New function. (DiagArray2<T>::resize (octave_idx_type, octave_idx_type, const T&)): Eliminate default value for third arg. * CColVector.h (ComplexColumnVector::resize): Use Complex (0) as default value instead of Array<Complex>::resize_fill_value (). * CMatrix.h (ComplexMatrix::resize): Use Complex (0) as default value instead of Array<Complex>::resize_fill_value (). (ComplexMatrix::resize_fill_value): Delete. * CNDArray.h (ComplexNDArray::resize_fill_value): Delete. * CRowVector.h (ComplexRowVector::resize): Use Complex (0) as default value instead of Array<Complex>::resize_fill_value (). * boolMatrix.h (boolMatrix::resize): Use false as default value instead of resize_fill_value (). (boolMatrix::resize_fill_value): Delete. * boolNDArray.h (boolNDArray::resize_fill_value): Delete. * chMatrix.h (charMatrix::resize): Use 0 as default value instead of resize_fill_value. (charMatrix::resize_fill_value): Delete. * chNDArray.h (charNDArray::resize_fill_value): Delete. * dColVector.h (ColumnVector::resize): Use 0 as default value instead of Array<double>::resize_fill_value (). * dMatrix.h (Matrix::resize): Use 0 as default value instead of resize_fill_value (). (Matrix::resize_fill_value): Delete. * dNDArray.h (NDArray::resize_fill_value): Delete. * dRowVector.h (RowVector::resize): Use 0 as default value instead of Array<double>::resize_fill_value (). * fCColVector.h (FloatComplexColumnVector::resize): Use FloatComplex (0) as default value instead of Array<FloatComplex>::resize_fill_value (). * fCMatrix.h (FloatComplexMatrix::resize): Use FloatComplex (0) as default value instead of resize_fill_value ()). FloatCmplexMatrix::resize_fill_value): Delete. * fCNDArray.h (FloatComplexNDArray::resize_fill_value): Delete. * fCRowVector.h (FloatComplexRowVector::resize): Use FloatComplex (0) as default value instead of Array<FloatComplex>::resize_fill_value (). * fColVector.h (FloatColumnVector::resize): Use 0 as default value instead of Array<float>::resize_fill_value (). * fMatrix.h (FloatMatrix::resize): Use 0 as default value instead of resize_fill_value (). * fMatrix.h (FloatMatrix::resize_fill_value): Delete. * fNDArray.h (FloatNDArray::resize_fill_value): Delete. * fRowVector.h (FloatRowVector::resize): Use 0 as default value instead of Array<float>::resize_fill_value (). * intNDArray.h (intNDArray<T>::resize_fill_value): Delete. * str-vec.h (string_vector::resize): Use std::string as default value instead of resize_fill_value (). * Cell.cc, Cell.h (Cell::Cell, Cell::assign, Cell::index): Use Matrix () as default value instead of resize_fill_value (). (Cell::resize_fill_value): No longer static. * oct-map.cc (octave_map::resize, octave_map::assign, Octave_map::resize, Octave_map::assign): Use Matrix () as default value instead of Cell::resize_fill_value. * oct-obj.h (octave_value_list::resize): Use octave_value () instead of Array<octave_value>::resize_fill_value (). * ov-complex.cc (octave_complex::resize): Use Complex (0) for fill value instead of ComplexNDArray::resize_fill_value (). * ov-float.cc (octave_float_scalar::resize): Use 0 for fill value instead of NDArray::resize_fill_value (). * ov-flt-complex.cc (octave_float_complex_scalar::resize): Use Complex (0) for fill value instead of ComplexNDArray::resize_fill_value (). * ov-range.cc (octave_range::resize): Use 0 for fill value instead of NDArray::resize_fill_value (). * ov-scalar.cc (octave_scalar::resize): Use 0 for fill value instead of NDArray::resize_fill_value (). * ov-str-mat.cc (octave_char_matrix_str::resize): Use 0 for fill value instead of charNDArray::resize_fill_value ().
author John W. Eaton <jwe@octave.org>
date Thu, 10 May 2012 16:31:02 -0400
parents e8e86ae3abbc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
1 /*
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
2
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
3 Copyright (C) 1999-2012 John W. Eaton
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11037
diff changeset
4 Copyright (C) 2009-2010 VZLU Prague
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
5
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
7
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
6b36317855ff [project @ 1999-11-16 16:13:49 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: 6833
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: 6833
diff changeset
11 option) any later version.
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
12
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
16 for more details.
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
17
6b36317855ff [project @ 1999-11-16 16:13:49 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: 6833
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: 6833
diff changeset
20 <http://www.gnu.org/licenses/>.
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
21
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
22 */
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
23
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
24 #if !defined (Cell_h)
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
25 #define Cell_h 1
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
26
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
27 #include <string>
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
28
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
29 #include "Array.h"
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
30 #include "oct-alloc.h"
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
31 #include "str-vec.h"
8579
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8333
diff changeset
32 #include "ov.h"
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
33
8579
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8333
diff changeset
34 class octave_value_list;
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
35
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
36 class
6169
7ee64ed645a0 [project @ 2006-11-15 16:12:57 by jwe]
jwe
parents: 6116
diff changeset
37 OCTINTERP_API
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
38 Cell : public Array<octave_value>
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
39 {
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
40 public:
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
41
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
42 Cell (void)
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
43 : Array<octave_value> (dim_vector (0, 0)) { }
3928
e8627dc4bdf2 [project @ 2002-05-03 19:56:01 by jwe]
jwe
parents: 3354
diff changeset
44
e8627dc4bdf2 [project @ 2002-05-03 19:56:01 by jwe]
jwe
parents: 3354
diff changeset
45 Cell (const octave_value& val)
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
46 : Array<octave_value> (dim_vector (1, 1), val) { }
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4219
diff changeset
47
8579
7e0f36dfefbe implement octave_value_list using Array
Jaroslav Hajek <highegg@gmail.com>
parents: 8333
diff changeset
48 Cell (const octave_value_list& ovl);
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
49
7209
f06b8150fe56 [project @ 2007-11-28 05:46:58 by jwe]
jwe
parents: 7017
diff changeset
50 Cell (octave_idx_type n, octave_idx_type m,
14616
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
51 const octave_value& val = Matrix ())
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
52 : Array<octave_value> (dim_vector (n, m), val) { }
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
53
14616
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
54 Cell (const dim_vector& dv, const octave_value& val = Matrix ())
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
55 : Array<octave_value> (dv, val) { }
3354
87721841efd7 [project @ 1999-11-17 19:06:11 by jwe]
jwe
parents: 3353
diff changeset
56
4567
fc30061d01da [project @ 2003-10-29 20:11:15 by jwe]
jwe
parents: 4563
diff changeset
57 Cell (const Array<octave_value>& c)
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
58 : Array<octave_value> (c) { }
4567
fc30061d01da [project @ 2003-10-29 20:11:15 by jwe]
jwe
parents: 4563
diff changeset
59
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
60 Cell (const Array<octave_value>& c, octave_idx_type nr, octave_idx_type nc)
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
61 : Array<octave_value> (c, dim_vector (nr, nc)) { }
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3928
diff changeset
62
5805
5bfb24f90bdd [project @ 2006-05-10 21:15:37 by jwe]
jwe
parents: 5775
diff changeset
63 Cell (const string_vector& sv, bool trim = false);
4216
e613ffa9f0e6 [project @ 2002-12-04 17:37:09 by jwe]
jwe
parents: 4192
diff changeset
64
11037
e7864673c31f new Cell (std::list<std::string>&) constructor
John W. Eaton <jwe@octave.org>
parents: 10757
diff changeset
65 Cell (const std::list<std::string>& lst);
e7864673c31f new Cell (std::list<std::string>&) constructor
John W. Eaton <jwe@octave.org>
parents: 10757
diff changeset
66
8732
a669df7beb73 [mq]: x
John W. Eaton <jwe@octave.org>
parents: 8679
diff changeset
67 Cell (const Array<std::string>& sa);
a669df7beb73 [mq]: x
John W. Eaton <jwe@octave.org>
parents: 8679
diff changeset
68
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 5805
diff changeset
69 Cell (const dim_vector& dv, const string_vector& sv, bool trim = false);
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 5805
diff changeset
70
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
71 Cell (const Cell& c)
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
72 : Array<octave_value> (c) { }
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4219
diff changeset
73
6116
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 5805
diff changeset
74 bool is_cellstr (void) const;
b64fb24bf4a0 [project @ 2006-10-27 18:04:49 by jwe]
jwe
parents: 5805
diff changeset
75
10065
64a06079cae4 improve cellstr cache implementation
Jaroslav Hajek <highegg@gmail.com>
parents: 9813
diff changeset
76 Array<std::string> cellstr_value (void) const;
64a06079cae4 improve cellstr cache implementation
Jaroslav Hajek <highegg@gmail.com>
parents: 9813
diff changeset
77
10649
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
78 using Array<octave_value>::index;
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
79
4513
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4219
diff changeset
80 Cell index (const octave_value_list& idx, bool resize_ok = false) const;
508238e65af7 [project @ 2003-09-19 21:40:57 by jwe]
jwe
parents: 4219
diff changeset
81
10649
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
82 using Array<octave_value>::delete_elements;
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
83
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
84 void delete_elements (const octave_value_list& idx);
8175
977d5204cf67 fix null assignment for structs
Jaroslav Hajek <highegg@gmail.com>
parents: 7620
diff changeset
85
10649
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
86 using Array<octave_value>::assign;
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
87
64472dd48517 cosmetic changes in Cell interface
Jaroslav Hajek <highegg@gmail.com>
parents: 10521
diff changeset
88 void assign (const octave_value_list& idx, const Cell& rhs,
14616
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
89 const octave_value& fill_val = Matrix ());
8290
7cbe01c21986 improve dense array indexing
Jaroslav Hajek <highegg@gmail.com>
parents: 8175
diff changeset
90
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4806
diff changeset
91 Cell reshape (const dim_vector& new_dims) const
9732
b4fdfee405b5 remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
92 { return Array<octave_value>::reshape (new_dims); }
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4806
diff changeset
93
5602
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5570
diff changeset
94 octave_idx_type nnz (void) const;
dfa2da0563e5 [project @ 2006-01-31 03:43:40 by jwe]
jwe
parents: 5570
diff changeset
95
5570
3074a549d644 [project @ 2005-12-08 21:01:50 by jwe]
jwe
parents: 5307
diff changeset
96 Cell column (octave_idx_type i) const;
3074a549d644 [project @ 2005-12-08 21:01:50 by jwe]
jwe
parents: 5307
diff changeset
97
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5602
diff changeset
98 // FIXME
4932
43f4ebd2704c [project @ 2004-08-05 13:26:10 by jwe]
jwe
parents: 4915
diff changeset
99 boolMatrix all (int /* dim */ = 0) const { return boolMatrix (); }
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3928
diff changeset
100
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5602
diff changeset
101 // FIXME
4932
43f4ebd2704c [project @ 2004-08-05 13:26:10 by jwe]
jwe
parents: 4915
diff changeset
102 boolMatrix any (int /* dim */ = 0) const { return boolMatrix (); }
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3928
diff changeset
103
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
104 Cell concat (const Cell& rb, const Array<octave_idx_type>& ra_idx);
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
105
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
106 Cell& insert (const Cell& a, octave_idx_type r, octave_idx_type c);
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
107 Cell& insert (const Cell& a, const Array<octave_idx_type>& ra_idx);
4806
d3bd9c04147f [project @ 2004-03-02 05:12:32 by jwe]
jwe
parents: 4701
diff changeset
108
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5602
diff changeset
109 // FIXME
8626
1dce30ab0e72 don't convert NaN to logical in bool expressions
John W. Eaton <jwe@octave.org>
parents: 8579
diff changeset
110 bool any_element_is_nan (void) const { return false; }
3933
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3928
diff changeset
111 bool is_true (void) const { return false; }
f9ea3dcf58ee [project @ 2002-05-15 03:21:00 by jwe]
jwe
parents: 3928
diff changeset
112
14616
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
113 octave_value resize_fill_value (void) const
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
114 {
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
115 static Matrix rfv;
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
116 return rfv;
13cc11418393 improve handling of default resize fill value for arrays
John W. Eaton <jwe@octave.org>
parents: 14557
diff changeset
117 }
7530
bb0f2353cff5 new cell array ctype mappers
John W. Eaton <jwe@octave.org>
parents: 7209
diff changeset
118
7620
36594d5bbe13 Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents: 7618
diff changeset
119 Cell diag (octave_idx_type k = 0) const;
7618
3209a584e1ac Further type preservation tests and fix of diag for cell arrays
David Bateman <dbateman@free.fr>
parents: 7530
diff changeset
120
14557
e8e86ae3abbc make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
121 Cell diag (octave_idx_type m, octave_idx_type n) const;
e8e86ae3abbc make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
122
9813
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
123 Cell xisalnum (void) const { return map (&octave_value::xisalnum); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
124 Cell xisalpha (void) const { return map (&octave_value::xisalpha); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
125 Cell xisascii (void) const { return map (&octave_value::xisascii); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
126 Cell xiscntrl (void) const { return map (&octave_value::xiscntrl); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
127 Cell xisdigit (void) const { return map (&octave_value::xisdigit); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
128 Cell xisgraph (void) const { return map (&octave_value::xisgraph); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
129 Cell xislower (void) const { return map (&octave_value::xislower); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
130 Cell xisprint (void) const { return map (&octave_value::xisprint); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
131 Cell xispunct (void) const { return map (&octave_value::xispunct); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
132 Cell xisspace (void) const { return map (&octave_value::xisspace); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
133 Cell xisupper (void) const { return map (&octave_value::xisupper); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
134 Cell xisxdigit (void) const { return map (&octave_value::xisxdigit); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
135 Cell xtoascii (void) const { return map (&octave_value::xtoascii); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
136 Cell xtolower (void) const { return map (&octave_value::xtolower); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
137 Cell xtoupper (void) const { return map (&octave_value::xtoupper); }
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
138
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
139 private:
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
140
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
141 typedef octave_value (octave_value::*ctype_mapper) (void) const;
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
142
8fa32b527d9a improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents: 9812
diff changeset
143 Cell map (ctype_mapper) const;
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
144 };
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
145
10757
1cc44f3ec814 templated extractors for maps and cells
Jaroslav Hajek <highegg@gmail.com>
parents: 10649
diff changeset
146 template<>
1cc44f3ec814 templated extractors for maps and cells
Jaroslav Hajek <highegg@gmail.com>
parents: 10649
diff changeset
147 inline Cell octave_value_extract<Cell> (const octave_value& v)
1cc44f3ec814 templated extractors for maps and cells
Jaroslav Hajek <highegg@gmail.com>
parents: 10649
diff changeset
148 { return v.cell_value (); }
1cc44f3ec814 templated extractors for maps and cells
Jaroslav Hajek <highegg@gmail.com>
parents: 10649
diff changeset
149
3353
6b36317855ff [project @ 1999-11-16 16:13:49 by jwe]
jwe
parents:
diff changeset
150 #endif