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