4514
|
1 /* |
|
2 |
|
3 Copyright (C) 2003 John W. Eaton |
|
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_boolNDArray_h) |
|
24 #define octave_boolNDArray_h 1 |
|
25 |
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include "ArrayN.h" |
|
31 #include "CMatrix.h" |
|
32 |
|
33 #include "mx-defs.h" |
|
34 #include "mx-op-defs.h" |
|
35 |
|
36 #include "data-conv.h" |
|
37 #include "mach-info.h" |
|
38 |
|
39 class |
|
40 boolNDArray : public ArrayN<bool> |
|
41 { |
|
42 public: |
|
43 |
|
44 boolNDArray (void) : ArrayN<bool> () { } |
|
45 |
|
46 boolNDArray (dim_vector& dims) : ArrayN<bool> (dims) { } |
|
47 |
|
48 boolNDArray (dim_vector& dims, const bool& val) |
|
49 : ArrayN<bool> (dims, val) { } |
|
50 |
|
51 boolNDArray (const boolNDArray& a) : ArrayN<bool> (a) { } |
|
52 |
|
53 boolNDArray (const boolMatrix& a) : ArrayN<bool> (a) { } |
|
54 |
|
55 boolNDArray (const Array2<bool>& a) : ArrayN<bool> (a) { } |
|
56 |
|
57 boolNDArray (const ArrayN<bool>& a) : ArrayN<bool> (a) { } |
|
58 |
|
59 boolNDArray& operator = (const boolNDArray& a) |
|
60 { |
|
61 ArrayN<bool>::operator = (a); |
|
62 return *this; |
|
63 } |
|
64 |
|
65 // XXX FIXME XXX -- this is not quite the right thing. |
|
66 |
|
67 boolMatrix all (int dim = -1) const; |
|
68 boolMatrix any (int dim = -1) const; |
|
69 |
|
70 boolMatrix matrix_value (void) const; |
|
71 |
|
72 // i/o |
|
73 |
|
74 // friend std::ostream& operator << (std::ostream& os, const NDArray& a); |
|
75 // friend std::istream& operator >> (std::istream& is, NDArray& a); |
|
76 |
|
77 static bool resize_fill_value (void) { return false; } |
|
78 |
|
79 // bool all_elements_are_real (void) const; |
|
80 // bool all_integers (double& max_val, double& min_val) const; |
|
81 |
|
82 private: |
|
83 |
|
84 boolNDArray (bool *d, dim_vector& dims) : ArrayN<bool> (d, dims) { } |
|
85 }; |
|
86 |
|
87 #endif |
|
88 |
|
89 /* |
|
90 ;;; Local Variables: *** |
|
91 ;;; mode: C++ *** |
|
92 ;;; End: *** |
|
93 */ |