2871
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_bool_matrix_h) |
|
24 #define octave_bool_matrix_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
|
32 #include <string> |
|
33 |
|
34 class ostream; |
|
35 |
|
36 #include "mx-base.h" |
|
37 #include "oct-alloc.h" |
|
38 |
|
39 #include "error.h" |
|
40 #include "ov-base.h" |
3219
|
41 #include "ov-base-mat.h" |
2871
|
42 #include "ov-typeinfo.h" |
|
43 |
|
44 class Octave_map; |
|
45 class octave_value_list; |
|
46 |
|
47 class tree_walker; |
|
48 |
|
49 // Character matrix values. |
|
50 |
|
51 class |
3219
|
52 octave_bool_matrix : public octave_base_matrix<boolMatrix> |
2871
|
53 { |
|
54 public: |
|
55 |
|
56 octave_bool_matrix (void) |
3220
|
57 : octave_base_matrix<boolMatrix> () { } |
2871
|
58 |
|
59 octave_bool_matrix (const boolMatrix& bm) |
3220
|
60 : octave_base_matrix<boolMatrix> (bm) { } |
2871
|
61 |
3225
|
62 octave_bool_matrix (const Array2<bool>& a) |
|
63 : octave_base_matrix<boolMatrix> (a) { } |
|
64 |
2871
|
65 octave_bool_matrix (const octave_bool_matrix& bm) |
3220
|
66 : octave_base_matrix<boolMatrix> (bm) { } |
2871
|
67 |
|
68 ~octave_bool_matrix (void) { } |
|
69 |
|
70 octave_value *clone (void) { return new octave_bool_matrix (*this); } |
|
71 |
|
72 type_conv_fcn numeric_conversion_function (void) const; |
|
73 |
|
74 octave_value *try_narrowing_conversion (void); |
|
75 |
|
76 void assign (const octave_value_list& idx, const boolMatrix& rhs); |
|
77 |
|
78 idx_vector index_vector (void) const { return idx_vector (matrix); } |
|
79 |
|
80 bool is_bool_matrix (void) const { return true; } |
|
81 |
3209
|
82 bool is_bool_type (void) const { return true; } |
|
83 |
2871
|
84 bool is_real_type (void) const { return true; } |
|
85 |
|
86 bool valid_as_scalar_index (void) const; |
|
87 |
|
88 double double_value (bool = false) const; |
|
89 |
3145
|
90 double scalar_value (bool frc_str_conv = false) const |
|
91 { return double_value (frc_str_conv); } |
2916
|
92 |
2871
|
93 Matrix matrix_value (bool = false) const { return matrix; } |
|
94 |
|
95 Complex complex_value (bool = false) const; |
|
96 |
3145
|
97 ComplexMatrix complex_matrix_value (bool = false) const |
|
98 { return matrix; } |
2871
|
99 |
3145
|
100 boolMatrix bool_matrix_value (bool = false) const |
|
101 { return matrix; } |
2871
|
102 |
|
103 octave_value convert_to_str (void) const |
|
104 { return octave_value (matrix); } |
|
105 |
|
106 protected: |
|
107 |
3219
|
108 DECLARE_OCTAVE_ALLOCATOR |
2871
|
109 |
3219
|
110 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2871
|
111 }; |
|
112 |
|
113 #endif |
|
114 |
|
115 /* |
|
116 ;;; Local Variables: *** |
|
117 ;;; mode: C++ *** |
|
118 ;;; End: *** |
|
119 */ |