Mercurial > hg > octave-nkf
annotate src/ov-ch-mat.h @ 8950:d865363208d6
include <iosfwd> instead of <iostream> in header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 10 Mar 2009 13:55:52 -0400 |
parents | eb63fbe60fab |
children | e793865ede63 |
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 |
2376 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2376 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2376 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_char_matrix_h) | |
25 #define octave_char_matrix_h 1 | |
26 | |
27 #include <cstdlib> | |
28 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
29 #include <iosfwd> |
2376 | 30 #include <string> |
31 | |
32 #include "mx-base.h" | |
2477 | 33 #include "oct-alloc.h" |
2376 | 34 #include "str-vec.h" |
35 | |
36 #include "error.h" | |
37 #include "ov-base.h" | |
4513 | 38 |
3219 | 39 #include "ov-base-mat.h" |
2376 | 40 #include "ov-typeinfo.h" |
41 | |
42 class Octave_map; | |
43 class octave_value_list; | |
44 | |
45 class tree_walker; | |
46 | |
2477 | 47 // Character matrix values. |
2376 | 48 |
49 class | |
4513 | 50 octave_char_matrix : public octave_base_matrix<charNDArray> |
2376 | 51 { |
52 public: | |
53 | |
54 octave_char_matrix (void) | |
4513 | 55 : octave_base_matrix<charNDArray> () { } |
2376 | 56 |
57 octave_char_matrix (const charMatrix& chm, bool = false) | |
4513 | 58 : octave_base_matrix<charNDArray> (chm) { } |
59 | |
60 octave_char_matrix (const charNDArray& chm, bool = false) | |
61 : octave_base_matrix<charNDArray> (chm) { } | |
2376 | 62 |
3189 | 63 octave_char_matrix (char c) |
4513 | 64 : octave_base_matrix<charNDArray> (c) { } |
3189 | 65 |
2376 | 66 octave_char_matrix (const char *s) |
4513 | 67 : octave_base_matrix<charNDArray> (s) { } |
2376 | 68 |
3523 | 69 octave_char_matrix (const std::string& s) |
4513 | 70 : octave_base_matrix<charNDArray> (s) { } |
2376 | 71 |
72 octave_char_matrix (const string_vector& s) | |
4513 | 73 : octave_base_matrix<charNDArray> (s) { } |
2376 | 74 |
75 octave_char_matrix (const octave_char_matrix& chm) | |
4513 | 76 : octave_base_matrix<charNDArray> (chm) { } |
2376 | 77 |
78 ~octave_char_matrix (void) { } | |
79 | |
5759 | 80 octave_base_value *clone (void) const { return new octave_char_matrix (*this); } |
81 octave_base_value *empty_clone (void) const { return new octave_char_matrix (); } | |
2376 | 82 |
6720 | 83 idx_vector index_vector (void) const; |
5267 | 84 |
2376 | 85 bool is_char_matrix (void) const { return true; } |
3180 | 86 bool is_real_matrix (void) const { return true; } |
2376 | 87 |
88 bool is_real_type (void) const { return true; } | |
89 | |
90 double double_value (bool = false) const; | |
91 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
92 float float_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
93 |
3145 | 94 double scalar_value (bool frc_str_conv = false) const |
95 { return double_value (frc_str_conv); } | |
2916 | 96 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
97 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
|
98 { return float_value (frc_str_conv); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
99 |
4513 | 100 Matrix matrix_value (bool = false) const |
101 { return Matrix (matrix.matrix_value ()); } | |
2376 | 102 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
103 FloatMatrix float_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
104 { return FloatMatrix (matrix.matrix_value ()); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
105 |
4668 | 106 NDArray array_value (bool = false) const |
107 { return NDArray (matrix); } | |
108 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
109 FloatNDArray float_array_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
110 { return FloatNDArray (matrix); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
111 |
2376 | 112 Complex complex_value (bool = false) const; |
113 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
114 FloatComplex float_complex_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
115 |
3145 | 116 ComplexMatrix complex_matrix_value (bool = false) const |
4513 | 117 { return ComplexMatrix (matrix.matrix_value ()); } |
2376 | 118 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
119 FloatComplexMatrix float_complex_matrix_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
120 { return FloatComplexMatrix (matrix.matrix_value ()); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
121 |
4668 | 122 ComplexNDArray complex_array_value (bool = false) const |
123 { return ComplexNDArray (matrix); } | |
124 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
125 FloatComplexNDArray float_complex_array_value (bool = false) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
126 { return FloatComplexNDArray (matrix); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
127 |
3145 | 128 charMatrix char_matrix_value (bool = false) const |
4513 | 129 { return matrix.matrix_value (); } |
2376 | 130 |
4550 | 131 charNDArray char_array_value (bool = false) const |
4543 | 132 { return matrix; } |
133 | |
5279 | 134 octave_value convert_to_str_internal (bool, bool, char type) const |
135 { return octave_value (matrix, true, type); } | |
2449 | 136 |
4643 | 137 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; |
138 | |
5900 | 139 mxArray *as_mxArray (void) const; |
140 | |
2376 | 141 protected: |
142 | |
3219 | 143 DECLARE_OCTAVE_ALLOCATOR |
2477 | 144 |
3219 | 145 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2376 | 146 }; |
147 | |
148 #endif | |
149 | |
150 /* | |
151 ;;; Local Variables: *** | |
152 ;;; mode: C++ *** | |
153 ;;; End: *** | |
154 */ |