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 |
|
62 octave_bool_matrix (const octave_bool_matrix& bm) |
3220
|
63 : octave_base_matrix<boolMatrix> (bm) { } |
2871
|
64 |
|
65 ~octave_bool_matrix (void) { } |
|
66 |
|
67 octave_value *clone (void) { return new octave_bool_matrix (*this); } |
|
68 |
|
69 type_conv_fcn numeric_conversion_function (void) const; |
|
70 |
|
71 octave_value *try_narrowing_conversion (void); |
|
72 |
|
73 void assign (const octave_value_list& idx, const boolMatrix& rhs); |
|
74 |
|
75 idx_vector index_vector (void) const { return idx_vector (matrix); } |
|
76 |
|
77 bool is_bool_matrix (void) const { return true; } |
|
78 |
|
79 octave_value all (void) const { return matrix.all (); } |
|
80 octave_value any (void) const { return matrix.any (); } |
|
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 is_matrix_type (void) const { return true; } |
|
87 |
|
88 bool is_numeric_type (void) const { return true; } |
|
89 |
|
90 bool valid_as_scalar_index (void) const; |
|
91 |
|
92 bool valid_as_zero_index (void) const { return is_zero_by_zero (); } |
|
93 |
|
94 double double_value (bool = false) const; |
|
95 |
3145
|
96 double scalar_value (bool frc_str_conv = false) const |
|
97 { return double_value (frc_str_conv); } |
2916
|
98 |
2871
|
99 Matrix matrix_value (bool = false) const { return matrix; } |
|
100 |
|
101 Complex complex_value (bool = false) const; |
|
102 |
3145
|
103 ComplexMatrix complex_matrix_value (bool = false) const |
|
104 { return matrix; } |
2871
|
105 |
3145
|
106 boolMatrix bool_matrix_value (bool = false) const |
|
107 { return matrix; } |
2871
|
108 |
|
109 octave_value convert_to_str (void) const |
|
110 { return octave_value (matrix); } |
|
111 |
|
112 protected: |
|
113 |
3219
|
114 DECLARE_OCTAVE_ALLOCATOR |
2871
|
115 |
3219
|
116 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2871
|
117 }; |
|
118 |
|
119 #endif |
|
120 |
|
121 /* |
|
122 ;;; Local Variables: *** |
|
123 ;;; mode: C++ *** |
|
124 ;;; End: *** |
|
125 */ |