2828
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2004, 2005, 2006, 2007 |
|
4 John W. Eaton |
2828
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
2828
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
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 |
6108
|
33 OCTAVE_API |
2844
|
34 boolMatrix : public Array2<bool> |
2828
|
35 { |
|
36 public: |
|
37 |
2844
|
38 boolMatrix (void) : Array2<bool> () { } |
5275
|
39 boolMatrix (octave_idx_type r, octave_idx_type c) : Array2<bool> (r, c) { } |
|
40 boolMatrix (octave_idx_type r, octave_idx_type c, bool val) : Array2<bool> (r, c, val) { } |
6979
|
41 boolMatrix (const dim_vector& dv) : Array2<bool> (dv) { } |
|
42 boolMatrix (const dim_vector& dv, bool val) : Array2<bool> (dv, val) { } |
2844
|
43 boolMatrix (const Array2<bool>& a) : Array2<bool> (a) { } |
|
44 boolMatrix (const boolMatrix& a) : Array2<bool> (a) { } |
2828
|
45 |
|
46 boolMatrix& operator = (const boolMatrix& a) |
|
47 { |
2844
|
48 Array2<bool>::operator = (a); |
2828
|
49 return *this; |
|
50 } |
|
51 |
|
52 bool operator == (const boolMatrix& a) const; |
|
53 bool operator != (const boolMatrix& a) const; |
|
54 |
3225
|
55 boolMatrix transpose (void) const { return Array2<bool>::transpose (); } |
|
56 |
2828
|
57 // destructive insert/delete/reorder operations |
|
58 |
5275
|
59 boolMatrix& insert (const boolMatrix& a, octave_idx_type r, octave_idx_type c); |
2828
|
60 |
3203
|
61 // unary operations |
|
62 |
|
63 boolMatrix operator ! (void) const; |
|
64 |
|
65 // other operations |
|
66 |
6979
|
67 boolMatrix diag (void) const; |
|
68 boolMatrix diag (octave_idx_type k) const; |
|
69 |
4017
|
70 boolMatrix all (int dim = -1) const; |
|
71 boolMatrix any (int dim = -1) const; |
2832
|
72 |
2828
|
73 #if 0 |
|
74 // i/o |
|
75 |
3504
|
76 friend std::ostream& operator << (std::ostream& os, const Matrix& a); |
|
77 friend std::istream& operator >> (std::istream& is, Matrix& a); |
2828
|
78 #endif |
|
79 |
3933
|
80 static bool resize_fill_value (void) { return false; } |
|
81 |
2828
|
82 private: |
|
83 |
5275
|
84 boolMatrix (bool *b, octave_idx_type r, octave_idx_type c) : Array2<bool> (b, r, c) { } |
2828
|
85 }; |
|
86 |
6708
|
87 MM_CMP_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API) |
3685
|
88 |
2828
|
89 #endif |
|
90 |
|
91 /* |
|
92 ;;; Local Variables: *** |
|
93 ;;; mode: C++ *** |
|
94 ;;; End: *** |
|
95 */ |