Go to the documentation of this file.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 #include "Array.h"
00027
00028 #include "mx-defs.h"
00029 #include "mx-op-decl.h"
00030 #include "bsxfun-decl.h"
00031
00032 #include "boolMatrix.h"
00033
00034
00035 class
00036 OCTAVE_API
00037 boolNDArray : public Array<bool>
00038 {
00039 public:
00040
00041 typedef boolMatrix matrix_type;
00042
00043 boolNDArray (void) : Array<bool> () { }
00044
00045 boolNDArray (const dim_vector& dv) : Array<bool> (dv) { }
00046
00047 boolNDArray (const dim_vector& dv, const bool& val)
00048 : Array<bool> (dv, val) { }
00049
00050 boolNDArray (const boolNDArray& a) : Array<bool> (a) { }
00051
00052 boolNDArray (const boolMatrix& a) : Array<bool> (a) { }
00053
00054 boolNDArray (const Array<bool>& a) : Array<bool> (a) { }
00055
00056 boolNDArray& operator = (const boolNDArray& a)
00057 {
00058 Array<bool>::operator = (a);
00059 return *this;
00060 }
00061
00062
00063
00064 boolNDArray operator ! (void) const;
00065
00066 boolNDArray& invert (void);
00067
00068 bool any_element_is_nan (void) const { return false; }
00069
00070
00071
00072 boolNDArray all (int dim = -1) const;
00073 boolNDArray any (int dim = -1) const;
00074
00075 NDArray sum (int dim = -1) const;
00076 NDArray cumsum (int dim = -1) const;
00077
00078 boolNDArray concat (const boolNDArray& rb, const Array<octave_idx_type>& ra_idx);
00079
00080 boolNDArray& insert (const boolNDArray& a, octave_idx_type r, octave_idx_type c);
00081 boolNDArray& insert (const boolNDArray& a, const Array<octave_idx_type>& ra_idx);
00082
00083 boolMatrix matrix_value (void) const;
00084
00085 boolNDArray squeeze (void) const { return Array<bool>::squeeze (); }
00086
00087 static void increment_index (Array<octave_idx_type>& ra_idx,
00088 const dim_vector& dimensions,
00089 int start_dimension = 0);
00090
00091 static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx,
00092 const dim_vector& dimensions);
00093
00094
00095
00096
00097
00098
00099 static bool resize_fill_value (void) { return false; }
00100
00101
00102
00103
00104 boolNDArray diag (octave_idx_type k = 0) const;
00105
00106 };
00107
00108 NDND_BOOL_OP_DECLS (boolNDArray, boolNDArray, OCTAVE_API)
00109 NDND_CMP_OP_DECLS (boolNDArray, boolNDArray, OCTAVE_API)
00110
00111 NDS_BOOL_OP_DECLS (boolNDArray, bool, OCTAVE_API)
00112 NDS_CMP_OP_DECLS (boolNDArray, bool, OCTAVE_API)
00113
00114 SND_BOOL_OP_DECLS (bool, boolNDArray, OCTAVE_API)
00115 SND_CMP_OP_DECLS (bool, boolNDArray, OCTAVE_API)
00116
00117 extern OCTAVE_API boolNDArray&
00118 mx_el_and_assign (boolNDArray& m, const boolNDArray& a);
00119 extern OCTAVE_API boolNDArray&
00120 mx_el_or_assign (boolNDArray& m, const boolNDArray& a);
00121
00122 BSXFUN_OP_DECL (and, boolNDArray, OCTAVE_API);
00123 BSXFUN_OP_DECL (or, boolNDArray, OCTAVE_API);
00124
00125 #endif