Mercurial > hg > octave-nkf
annotate src/ov-ch-mat.h @ 10759:d9e57045b9e1
remove redundant fwd decls of Octave_map from header files
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 29 Jun 2010 09:05:19 +0200 |
parents | 4d1fc073fbb7 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
2376 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005, 2006, |
8920 | 4 2007, 2008 John W. Eaton |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10503
diff
changeset
|
5 Copyright (C) 2009, 2010 VZLU Prague |
2376 | 6 |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
7016 | 11 Free Software Foundation; either version 3 of the License, or (at your |
12 option) any later version. | |
2376 | 13 |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
7016 | 20 along with Octave; see the file COPYING. If not, see |
21 <http://www.gnu.org/licenses/>. | |
2376 | 22 |
23 */ | |
24 | |
25 #if !defined (octave_char_matrix_h) | |
26 #define octave_char_matrix_h 1 | |
27 | |
28 #include <cstdlib> | |
29 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
30 #include <iosfwd> |
2376 | 31 #include <string> |
32 | |
33 #include "mx-base.h" | |
2477 | 34 #include "oct-alloc.h" |
2376 | 35 #include "str-vec.h" |
36 | |
37 #include "error.h" | |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
38 #include "ov.h" |
2376 | 39 #include "ov-base.h" |
3219 | 40 #include "ov-base-mat.h" |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
41 #include "ov-re-mat.h" |
2376 | 42 #include "ov-typeinfo.h" |
43 | |
44 class octave_value_list; | |
45 | |
46 class tree_walker; | |
47 | |
2477 | 48 // Character matrix values. |
2376 | 49 |
50 class | |
4513 | 51 octave_char_matrix : public octave_base_matrix<charNDArray> |
2376 | 52 { |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
53 protected: |
2376 | 54 |
55 octave_char_matrix (void) | |
4513 | 56 : octave_base_matrix<charNDArray> () { } |
2376 | 57 |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
58 octave_char_matrix (const charMatrix& chm) |
4513 | 59 : octave_base_matrix<charNDArray> (chm) { } |
60 | |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
61 octave_char_matrix (const charNDArray& chm) |
4513 | 62 : octave_base_matrix<charNDArray> (chm) { } |
2376 | 63 |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
64 octave_char_matrix (const Array<char>& chm) |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
65 : octave_base_matrix<charNDArray> (chm) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10160
diff
changeset
|
66 |
3189 | 67 octave_char_matrix (char c) |
4513 | 68 : octave_base_matrix<charNDArray> (c) { } |
3189 | 69 |
2376 | 70 octave_char_matrix (const char *s) |
4513 | 71 : octave_base_matrix<charNDArray> (s) { } |
2376 | 72 |
3523 | 73 octave_char_matrix (const std::string& s) |
4513 | 74 : octave_base_matrix<charNDArray> (s) { } |
2376 | 75 |
76 octave_char_matrix (const string_vector& s) | |
4513 | 77 : octave_base_matrix<charNDArray> (s) { } |
2376 | 78 |
79 octave_char_matrix (const octave_char_matrix& chm) | |
4513 | 80 : octave_base_matrix<charNDArray> (chm) { } |
2376 | 81 |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
82 public: |
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
83 |
2376 | 84 ~octave_char_matrix (void) { } |
85 | |
5759 | 86 octave_base_value *clone (void) const { return new octave_char_matrix (*this); } |
87 octave_base_value *empty_clone (void) const { return new octave_char_matrix (); } | |
2376 | 88 |
6720 | 89 idx_vector index_vector (void) const; |
5267 | 90 |
9685 | 91 builtin_type_t builtin_type (void) const { return btyp_char; } |
92 | |
2376 | 93 bool is_char_matrix (void) const { return true; } |
3180 | 94 bool is_real_matrix (void) const { return true; } |
2376 | 95 |
96 bool is_real_type (void) const { return true; } | |
97 | |
98 double double_value (bool = false) const; | |
99 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
100 float float_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
101 |
3145 | 102 double scalar_value (bool frc_str_conv = false) const |
103 { return double_value (frc_str_conv); } | |
2916 | 104 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
105 float float_scalar_value (bool frc_str_conv = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
106 { return float_value (frc_str_conv); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
107 |
4513 | 108 Matrix matrix_value (bool = false) const |
109 { return Matrix (matrix.matrix_value ()); } | |
2376 | 110 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
111 FloatMatrix float_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
112 { return FloatMatrix (matrix.matrix_value ()); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
113 |
4668 | 114 NDArray array_value (bool = false) const |
115 { return NDArray (matrix); } | |
116 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
117 FloatNDArray float_array_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
118 { return FloatNDArray (matrix); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
119 |
2376 | 120 Complex complex_value (bool = false) const; |
121 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
122 FloatComplex float_complex_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
123 |
3145 | 124 ComplexMatrix complex_matrix_value (bool = false) const |
4513 | 125 { return ComplexMatrix (matrix.matrix_value ()); } |
2376 | 126 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
127 FloatComplexMatrix float_complex_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
128 { return FloatComplexMatrix (matrix.matrix_value ()); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
129 |
4668 | 130 ComplexNDArray complex_array_value (bool = false) const |
131 { return ComplexNDArray (matrix); } | |
132 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
133 FloatComplexNDArray float_complex_array_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
134 { return FloatComplexNDArray (matrix); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
135 |
3145 | 136 charMatrix char_matrix_value (bool = false) const |
4513 | 137 { return matrix.matrix_value (); } |
2376 | 138 |
4550 | 139 charNDArray char_array_value (bool = false) const |
4543 | 140 { return matrix; } |
141 | |
5279 | 142 octave_value convert_to_str_internal (bool, bool, char type) const |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
143 { return octave_value (matrix, type); } |
2449 | 144 |
4643 | 145 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
146 | |
10503
fcf6341a8cab
octave_char_matrix::mex_get_data: new function
John W. Eaton <jwe@octave.org>
parents:
10351
diff
changeset
|
147 // Unsafe. This function exists to support the MEX interface. |
fcf6341a8cab
octave_char_matrix::mex_get_data: new function
John W. Eaton <jwe@octave.org>
parents:
10351
diff
changeset
|
148 // You should not use it anywhere else. |
fcf6341a8cab
octave_char_matrix::mex_get_data: new function
John W. Eaton <jwe@octave.org>
parents:
10351
diff
changeset
|
149 void *mex_get_data (void) const { return matrix.mex_get_data (); } |
fcf6341a8cab
octave_char_matrix::mex_get_data: new function
John W. Eaton <jwe@octave.org>
parents:
10351
diff
changeset
|
150 |
5900 | 151 mxArray *as_mxArray (void) const; |
152 | |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9690
diff
changeset
|
153 octave_value map (unary_mapper_t umap) const; |
2376 | 154 }; |
155 | |
156 #endif |