Mercurial > hg > octave-lyh
annotate liboctave/boolMatrix.h @ 11449:93b8c7ca211f
isa.m: Add tests against logical types
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 05 Jan 2011 21:21:37 -0800 |
parents | 4d1fc073fbb7 |
children | fd0a3ac60b0e |
rev | line source |
---|---|
2828 | 1 /* |
2 | |
8920 | 3 Copyright (C) 1996, 1997, 1998, 2000, 2002, 2004, 2005, 2006, 2007, |
4 2008, 2009 John W. Eaton | |
10521
4d1fc073fbb7
add some missing copyright stmts
Jaroslav Hajek <highegg@gmail.com>
parents:
10364
diff
changeset
|
5 Copyright (C) 2010 VZLU Prague |
2828 | 6 |
7 This file is part of Octave. | |
8 | |
9 Octave is free software; you can redistribute it and/or modify it | |
10 under the terms of the GNU General Public License as published by the | |
7016 | 11 Free Software Foundation; either version 3 of the License, or (at your |
12 option) any later version. | |
2828 | 13 |
14 Octave is distributed in the hope that it will be useful, but WITHOUT | |
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
17 for more details. | |
18 | |
19 You should have received a copy of the GNU General Public License | |
7016 | 20 along with Octave; see the file COPYING. If not, see |
21 <http://www.gnu.org/licenses/>. | |
2828 | 22 |
23 */ | |
24 | |
25 #if !defined (octave_boolMatrix_int_h) | |
26 #define octave_boolMatrix_int_h 1 | |
27 | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
28 #include "Array.h" |
2828 | 29 |
30 #include "mx-defs.h" | |
8774
b756ce0002db
split implementation and interface in mx-op-defs and MArray-defs
Jaroslav Hajek <highegg@gmail.com>
parents:
7620
diff
changeset
|
31 #include "mx-op-decl.h" |
2828 | 32 |
33 class | |
6108 | 34 OCTAVE_API |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
35 boolMatrix : public Array<bool> |
2828 | 36 { |
37 public: | |
38 | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
39 boolMatrix (void) : Array<bool> () { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
40 boolMatrix (octave_idx_type r, octave_idx_type c) : Array<bool> (r, c) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
41 boolMatrix (octave_idx_type r, octave_idx_type c, bool val) : Array<bool> (r, c, val) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
42 boolMatrix (const dim_vector& dv) : Array<bool> (dv) { } |
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
43 boolMatrix (const dim_vector& dv, bool val) : Array<bool> (dv, val) { } |
10352 | 44 boolMatrix (const Array<bool>& a) : Array<bool> (a.as_matrix ()) { } |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
45 boolMatrix (const boolMatrix& a) : Array<bool> (a) { } |
2828 | 46 |
47 boolMatrix& operator = (const boolMatrix& a) | |
48 { | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
49 Array<bool>::operator = (a); |
2828 | 50 return *this; |
51 } | |
52 | |
53 bool operator == (const boolMatrix& a) const; | |
54 bool operator != (const boolMatrix& a) const; | |
55 | |
10351
5150ceb4dbb4
base charMatrix and boolMatrix on Array<char>
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
56 boolMatrix transpose (void) const { return Array<bool>::transpose (); } |
3225 | 57 |
2828 | 58 // destructive insert/delete/reorder operations |
59 | |
5275 | 60 boolMatrix& insert (const boolMatrix& a, octave_idx_type r, octave_idx_type c); |
2828 | 61 |
3203 | 62 // unary operations |
63 | |
64 boolMatrix operator ! (void) const; | |
65 | |
66 // other operations | |
67 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
68 boolMatrix diag (octave_idx_type k = 0) const; |
6979 | 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 }; |
83 | |
9550
3d6a9aea2aea
refactor binary & bool ops in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
84 MM_BOOL_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API) |
3d6a9aea2aea
refactor binary & bool ops in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
85 MS_BOOL_OP_DECLS (boolMatrix, bool, OCTAVE_API) |
3d6a9aea2aea
refactor binary & bool ops in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
86 SM_BOOL_OP_DECLS (bool, boolMatrix, OCTAVE_API) |
6708 | 87 MM_CMP_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API) |
3685 | 88 |
2828 | 89 #endif |