00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_boolSparse_h)
00025 #define octave_boolSparse_h 1
00026
00027 #include "Sparse.h"
00028 #include "MSparse-defs.h"
00029 #include "Sparse-op-defs.h"
00030
00031 class
00032 OCTAVE_API
00033 SparseBoolMatrix : public Sparse<bool>
00034 {
00035 public:
00036
00037 SparseBoolMatrix (void) : Sparse<bool> () { }
00038
00039 SparseBoolMatrix (octave_idx_type r, octave_idx_type c) : Sparse<bool> (r, c) { }
00040
00041 explicit SparseBoolMatrix (octave_idx_type r, octave_idx_type c, bool val)
00042 : Sparse<bool> (r, c, val) { }
00043
00044 SparseBoolMatrix (const dim_vector& dv, octave_idx_type nz = 0) :
00045 Sparse<bool> (dv, nz) { }
00046
00047 SparseBoolMatrix (const Sparse<bool>& a) : Sparse<bool> (a) { }
00048
00049 SparseBoolMatrix (const SparseBoolMatrix& a) : Sparse<bool> (a) { }
00050
00051 SparseBoolMatrix (const SparseBoolMatrix& a, const dim_vector& dv)
00052 : Sparse<bool> (a, dv) { }
00053
00054 explicit SparseBoolMatrix (const boolMatrix& a) : Sparse<bool> (a) { }
00055
00056 explicit SparseBoolMatrix (const boolNDArray& a) : Sparse<bool> (a) { }
00057
00058 explicit SparseBoolMatrix (const Array<bool> a, const Array<octave_idx_type>& r,
00059 const Array<octave_idx_type>& c, octave_idx_type nr = -1,
00060 octave_idx_type nc = -1, bool sum_terms = true)
00061 : Sparse<bool> (a, r, c, nr, nc, sum_terms) { }
00062
00063 explicit SparseBoolMatrix (const Array<bool> a, const Array<double>& r,
00064 const Array<double>& c, octave_idx_type nr = -1,
00065 octave_idx_type nc = -1, bool sum_terms = true)
00066 : Sparse<bool> (a, r, c, nr, nc, sum_terms) { }
00067
00068 SparseBoolMatrix (octave_idx_type r, octave_idx_type c, octave_idx_type num_nz) : Sparse<bool> (r, c, num_nz) { }
00069
00070 SparseBoolMatrix& operator = (const SparseBoolMatrix& a)
00071 {
00072 Sparse<bool>::operator = (a);
00073 return *this;
00074 }
00075
00076 bool operator == (const SparseBoolMatrix& a) const;
00077 bool operator != (const SparseBoolMatrix& a) const;
00078
00079 SparseBoolMatrix transpose (void) const
00080 { return Sparse<bool>::transpose (); }
00081
00082
00083
00084 SparseBoolMatrix& insert (const SparseBoolMatrix& a, octave_idx_type r, octave_idx_type c);
00085
00086 SparseBoolMatrix& insert (const SparseBoolMatrix& a, const Array<octave_idx_type>& indx);
00087
00088 SparseBoolMatrix concat (const SparseBoolMatrix& rb,
00089 const Array<octave_idx_type>& ra_idx);
00090
00091 SparseBoolMatrix diag (octave_idx_type k = 0) const;
00092
00093 boolMatrix matrix_value (void) const;
00094
00095 SparseBoolMatrix squeeze (void) const;
00096
00097 SparseBoolMatrix index (idx_vector& i, int resize_ok) const;
00098
00099 SparseBoolMatrix index (idx_vector& i, idx_vector& j, int resize_ok) const;
00100
00101 SparseBoolMatrix index (Array<idx_vector>& ra_idx, int resize_ok) const;
00102
00103 SparseBoolMatrix reshape (const dim_vector& new_dims) const;
00104
00105 SparseBoolMatrix permute (const Array<octave_idx_type>& vec, bool inv = false) const;
00106
00107 SparseBoolMatrix ipermute (const Array<octave_idx_type>& vec) const;
00108
00109
00110
00111 SparseBoolMatrix operator ! (void) const;
00112
00113
00114
00115 SparseBoolMatrix all (int dim = -1) const;
00116 SparseBoolMatrix any (int dim = -1) const;
00117
00118
00119
00120 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const SparseBoolMatrix& a);
00121 friend OCTAVE_API std::istream& operator >> (std::istream& is, SparseBoolMatrix& a);
00122 };
00123
00124 SPARSE_SMS_EQNE_OP_DECLS (SparseBoolMatrix, bool, OCTAVE_API)
00125 SPARSE_SMS_BOOL_OP_DECLS (SparseBoolMatrix, bool, OCTAVE_API)
00126
00127 SPARSE_SSM_EQNE_OP_DECLS (bool, SparseBoolMatrix, OCTAVE_API)
00128 SPARSE_SSM_BOOL_OP_DECLS (bool, SparseBoolMatrix, OCTAVE_API)
00129
00130 SPARSE_SMSM_EQNE_OP_DECLS (SparseBoolMatrix, SparseBoolMatrix, OCTAVE_API)
00131 SPARSE_SMSM_BOOL_OP_DECLS (SparseBoolMatrix, SparseBoolMatrix, OCTAVE_API)
00132
00133 #endif
00134
00135
00136
00137
00138
00139