2828
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
2828
|
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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
2828
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_boolMatrix_int_h) |
|
25 #define octave_boolMatrix_int_h 1 |
|
26 |
2844
|
27 #include "Array2.h" |
2828
|
28 |
|
29 #include "mx-defs.h" |
3685
|
30 #include "mx-op-defs.h" |
2828
|
31 |
|
32 class |
2844
|
33 boolMatrix : public Array2<bool> |
2828
|
34 { |
|
35 public: |
|
36 |
2844
|
37 boolMatrix (void) : Array2<bool> () { } |
5275
|
38 boolMatrix (octave_idx_type r, octave_idx_type c) : Array2<bool> (r, c) { } |
|
39 boolMatrix (octave_idx_type r, octave_idx_type c, bool val) : Array2<bool> (r, c, val) { } |
2844
|
40 boolMatrix (const Array2<bool>& a) : Array2<bool> (a) { } |
|
41 boolMatrix (const boolMatrix& a) : Array2<bool> (a) { } |
2828
|
42 |
|
43 boolMatrix& operator = (const boolMatrix& a) |
|
44 { |
2844
|
45 Array2<bool>::operator = (a); |
2828
|
46 return *this; |
|
47 } |
|
48 |
|
49 bool operator == (const boolMatrix& a) const; |
|
50 bool operator != (const boolMatrix& a) const; |
|
51 |
3225
|
52 boolMatrix transpose (void) const { return Array2<bool>::transpose (); } |
|
53 |
2828
|
54 // destructive insert/delete/reorder operations |
|
55 |
5275
|
56 boolMatrix& insert (const boolMatrix& a, octave_idx_type r, octave_idx_type c); |
2828
|
57 |
3203
|
58 // unary operations |
|
59 |
|
60 boolMatrix operator ! (void) const; |
|
61 |
|
62 // other operations |
|
63 |
4017
|
64 boolMatrix all (int dim = -1) const; |
|
65 boolMatrix any (int dim = -1) const; |
2832
|
66 |
2828
|
67 #if 0 |
|
68 // i/o |
|
69 |
3504
|
70 friend std::ostream& operator << (std::ostream& os, const Matrix& a); |
|
71 friend std::istream& operator >> (std::istream& is, Matrix& a); |
2828
|
72 #endif |
|
73 |
3933
|
74 static bool resize_fill_value (void) { return false; } |
|
75 |
2828
|
76 private: |
|
77 |
5275
|
78 boolMatrix (bool *b, octave_idx_type r, octave_idx_type c) : Array2<bool> (b, r, c) { } |
2828
|
79 }; |
|
80 |
3685
|
81 MM_CMP_OP_DECLS (boolMatrix, boolMatrix) |
|
82 |
2828
|
83 #endif |
|
84 |
|
85 /* |
|
86 ;;; Local Variables: *** |
|
87 ;;; mode: C++ *** |
|
88 ;;; End: *** |
|
89 */ |