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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
2828
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
2828
|
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 |
6108
|
32 OCTAVE_API |
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) { } |
6979
|
40 boolMatrix (const dim_vector& dv) : Array2<bool> (dv) { } |
|
41 boolMatrix (const dim_vector& dv, bool val) : Array2<bool> (dv, val) { } |
2844
|
42 boolMatrix (const Array2<bool>& a) : Array2<bool> (a) { } |
|
43 boolMatrix (const boolMatrix& a) : Array2<bool> (a) { } |
2828
|
44 |
|
45 boolMatrix& operator = (const boolMatrix& a) |
|
46 { |
2844
|
47 Array2<bool>::operator = (a); |
2828
|
48 return *this; |
|
49 } |
|
50 |
|
51 bool operator == (const boolMatrix& a) const; |
|
52 bool operator != (const boolMatrix& a) const; |
|
53 |
3225
|
54 boolMatrix transpose (void) const { return Array2<bool>::transpose (); } |
|
55 |
2828
|
56 // destructive insert/delete/reorder operations |
|
57 |
5275
|
58 boolMatrix& insert (const boolMatrix& a, octave_idx_type r, octave_idx_type c); |
2828
|
59 |
3203
|
60 // unary operations |
|
61 |
|
62 boolMatrix operator ! (void) const; |
|
63 |
|
64 // other operations |
|
65 |
6979
|
66 boolMatrix diag (void) const; |
|
67 boolMatrix diag (octave_idx_type k) const; |
|
68 |
4017
|
69 boolMatrix all (int dim = -1) const; |
|
70 boolMatrix any (int dim = -1) const; |
2832
|
71 |
2828
|
72 #if 0 |
|
73 // i/o |
|
74 |
3504
|
75 friend std::ostream& operator << (std::ostream& os, const Matrix& a); |
|
76 friend std::istream& operator >> (std::istream& is, Matrix& a); |
2828
|
77 #endif |
|
78 |
3933
|
79 static bool resize_fill_value (void) { return false; } |
|
80 |
2828
|
81 private: |
|
82 |
5275
|
83 boolMatrix (bool *b, octave_idx_type r, octave_idx_type c) : Array2<bool> (b, r, c) { } |
2828
|
84 }; |
|
85 |
6708
|
86 MM_CMP_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API) |
3685
|
87 |
2828
|
88 #endif |
|
89 |
|
90 /* |
|
91 ;;; Local Variables: *** |
|
92 ;;; mode: C++ *** |
|
93 ;;; End: *** |
|
94 */ |