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 |
4513
|
51 octave_bool_matrix : public octave_base_matrix<boolNDArray> |
2871
|
52 { |
|
53 public: |
|
54 |
|
55 octave_bool_matrix (void) |
4513
|
56 : octave_base_matrix<boolNDArray> () { } |
|
57 |
|
58 octave_bool_matrix (const boolNDArray& bnda) |
|
59 : octave_base_matrix<boolNDArray> (bnda) { } |
2871
|
60 |
|
61 octave_bool_matrix (const boolMatrix& bm) |
4513
|
62 : octave_base_matrix<boolNDArray> (bm) { } |
2871
|
63 |
3225
|
64 octave_bool_matrix (const Array2<bool>& a) |
4513
|
65 : octave_base_matrix<boolNDArray> (a) { } |
3225
|
66 |
2871
|
67 octave_bool_matrix (const octave_bool_matrix& bm) |
4513
|
68 : octave_base_matrix<boolNDArray> (bm) { } |
2871
|
69 |
|
70 ~octave_bool_matrix (void) { } |
|
71 |
3933
|
72 octave_value *clone (void) const { return new octave_bool_matrix (*this); } |
|
73 octave_value *empty_clone (void) const { return new octave_bool_matrix (); } |
2871
|
74 |
|
75 type_conv_fcn numeric_conversion_function (void) const; |
|
76 |
|
77 octave_value *try_narrowing_conversion (void); |
|
78 |
4513
|
79 // XXX FIXME XXX |
|
80 idx_vector index_vector (void) const |
|
81 { return idx_vector (matrix.matrix_value ()); } |
2871
|
82 |
|
83 bool is_bool_matrix (void) const { return true; } |
|
84 |
3209
|
85 bool is_bool_type (void) const { return true; } |
|
86 |
2871
|
87 bool is_real_type (void) const { return true; } |
|
88 |
|
89 bool valid_as_scalar_index (void) const; |
|
90 |
|
91 double double_value (bool = false) const; |
|
92 |
3145
|
93 double scalar_value (bool frc_str_conv = false) const |
|
94 { return double_value (frc_str_conv); } |
2916
|
95 |
4513
|
96 Matrix matrix_value (bool = false) const |
|
97 { return Matrix (matrix.matrix_value ()); } |
2871
|
98 |
|
99 Complex complex_value (bool = false) const; |
|
100 |
3145
|
101 ComplexMatrix complex_matrix_value (bool = false) const |
4513
|
102 { return ComplexMatrix (matrix.matrix_value ( )); } |
2871
|
103 |
3545
|
104 boolMatrix bool_matrix_value (void) const |
4513
|
105 { return matrix.matrix_value (); } |
2871
|
106 |
4457
|
107 octave_value convert_to_str_internal (bool pad, bool force) const; |
2871
|
108 |
|
109 protected: |
|
110 |
3219
|
111 DECLARE_OCTAVE_ALLOCATOR |
2871
|
112 |
3219
|
113 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA |
2871
|
114 }; |
|
115 |
|
116 #endif |
|
117 |
|
118 /* |
|
119 ;;; Local Variables: *** |
|
120 ;;; mode: C++ *** |
|
121 ;;; End: *** |
|
122 */ |