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 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
2871
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
3503
|
32 #include <iostream> |
2871
|
33 #include <string> |
|
34 |
|
35 #include "mx-base.h" |
|
36 #include "oct-alloc.h" |
|
37 |
|
38 #include "error.h" |
|
39 #include "ov-base.h" |
3219
|
40 #include "ov-base-mat.h" |
2871
|
41 #include "ov-typeinfo.h" |
|
42 |
|
43 class Octave_map; |
|
44 class octave_value_list; |
|
45 |
|
46 class tree_walker; |
|
47 |
|
48 // Character matrix values. |
|
49 |
|
50 class |
3219
|
51 octave_bool_matrix : public octave_base_matrix<boolMatrix> |
2871
|
52 { |
|
53 public: |
|
54 |
|
55 octave_bool_matrix (void) |
3220
|
56 : octave_base_matrix<boolMatrix> () { } |
2871
|
57 |
|
58 octave_bool_matrix (const boolMatrix& bm) |
3220
|
59 : octave_base_matrix<boolMatrix> (bm) { } |
2871
|
60 |
3225
|
61 octave_bool_matrix (const Array2<bool>& a) |
|
62 : octave_base_matrix<boolMatrix> (a) { } |
|
63 |
2871
|
64 octave_bool_matrix (const octave_bool_matrix& bm) |
3220
|
65 : octave_base_matrix<boolMatrix> (bm) { } |
2871
|
66 |
|
67 ~octave_bool_matrix (void) { } |
|
68 |
3933
|
69 octave_value *clone (void) const { return new octave_bool_matrix (*this); } |
|
70 octave_value *empty_clone (void) const { return new octave_bool_matrix (); } |
2871
|
71 |
|
72 type_conv_fcn numeric_conversion_function (void) const; |
|
73 |
|
74 octave_value *try_narrowing_conversion (void); |
|
75 |
|
76 idx_vector index_vector (void) const { return idx_vector (matrix); } |
|
77 |
|
78 bool is_bool_matrix (void) const { return true; } |
|
79 |
3209
|
80 bool is_bool_type (void) const { return true; } |
|
81 |
2871
|
82 bool is_real_type (void) const { return true; } |
|
83 |
|
84 bool valid_as_scalar_index (void) const; |
|
85 |
|
86 double double_value (bool = false) const; |
|
87 |
3145
|
88 double scalar_value (bool frc_str_conv = false) const |
|
89 { return double_value (frc_str_conv); } |
2916
|
90 |
3587
|
91 Matrix matrix_value (bool = false) const { return Matrix (matrix); } |
2871
|
92 |
|
93 Complex complex_value (bool = false) const; |
|
94 |
3145
|
95 ComplexMatrix complex_matrix_value (bool = false) const |
3587
|
96 { return ComplexMatrix (matrix); } |
2871
|
97 |
3545
|
98 boolMatrix bool_matrix_value (void) const |
3145
|
99 { return matrix; } |
2871
|
100 |
|
101 octave_value convert_to_str (void) const |
|
102 { return octave_value (matrix); } |
|
103 |
|
104 protected: |
|
105 |
3219
|
106 DECLARE_OCTAVE_ALLOCATOR |
2871
|
107 |
3219
|
108 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2871
|
109 }; |
|
110 |
|
111 #endif |
|
112 |
|
113 /* |
|
114 ;;; Local Variables: *** |
|
115 ;;; mode: C++ *** |
|
116 ;;; End: *** |
|
117 */ |