00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_boolNDArray_h)
00024 #define octave_boolNDArray_h 1
00025
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029
00030 #include "ArrayN.h"
00031 #include "CMatrix.h"
00032
00033 #include "mx-defs.h"
00034 #include "mx-op-defs.h"
00035
00036 #include "boolMatrix.h"
00037
00038 class
00039 boolNDArray : public ArrayN<bool>
00040 {
00041 public:
00042
00043 boolNDArray (void) : ArrayN<bool> () { }
00044
00045 boolNDArray (const dim_vector& dv) : ArrayN<bool> (dv) { }
00046
00047 boolNDArray (const dim_vector& dv, const bool& val)
00048 : ArrayN<bool> (dv, val) { }
00049
00050 boolNDArray (const boolNDArray& a) : ArrayN<bool> (a) { }
00051
00052 boolNDArray (const boolMatrix& a) : ArrayN<bool> (a) { }
00053
00054 boolNDArray (const Array2<bool>& a) : ArrayN<bool> (a) { }
00055
00056 boolNDArray (const ArrayN<bool>& a) : ArrayN<bool> (a) { }
00057
00058 boolNDArray& operator = (const boolNDArray& a)
00059 {
00060 ArrayN<bool>::operator = (a);
00061 return *this;
00062 }
00063
00064
00065
00066 boolNDArray operator ! (void) const;
00067
00068
00069
00070 boolNDArray all (int dim = -1) const;
00071 boolNDArray any (int dim = -1) const;
00072
00073 boolNDArray concat (const boolNDArray& rb, const Array<int>& ra_idx);
00074
00075 boolNDArray& insert (const boolNDArray& a, int r, int c);
00076 boolNDArray& insert (const boolNDArray& a, const Array<int>& ra_idx);
00077
00078 boolMatrix matrix_value (void) const;
00079
00080 boolNDArray squeeze (void) const { return ArrayN<bool>::squeeze (); }
00081
00082 static void increment_index (Array<int>& ra_idx,
00083 const dim_vector& dimensions,
00084 int start_dimension = 0);
00085
00086 static int compute_index (Array<int>& ra_idx,
00087 const dim_vector& dimensions);
00088
00089
00090
00091
00092
00093
00094 static bool resize_fill_value (void) { return false; }
00095
00096
00097
00098
00099 private:
00100
00101 boolNDArray (bool *d, dim_vector& dv) : ArrayN<bool> (d, dv) { }
00102 };
00103
00104 NDND_BOOL_OP_DECLS (boolNDArray, boolNDArray)
00105 NDND_CMP_OP_DECLS (boolNDArray, boolNDArray)
00106
00107 NDS_BOOL_OP_DECLS (boolNDArray, bool)
00108 NDS_CMP_OP_DECLS (boolNDArray, bool)
00109
00110 SND_BOOL_OP_DECLS (bool, boolNDArray)
00111 SND_CMP_OP_DECLS (bool, boolNDArray)
00112
00113 #endif
00114
00115
00116
00117
00118
00119