GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
boolMatrix.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 John W. Eaton
4 Copyright (C) 2010 VZLU Prague
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_boolMatrix_h)
25 #define octave_boolMatrix_h 1
26 
27 #include "octave-config.h"
28 
29 #include "Array.h"
30 #include "boolNDArray.h"
31 
32 #include "mx-defs.h"
33 #include "mx-op-decl.h"
34 
35 class
36 OCTAVE_API
37 boolMatrix : public boolNDArray
38 {
39 public:
40 
41  boolMatrix (void) : boolNDArray () { }
42 
44  : boolNDArray (dim_vector (r, c)) { }
45 
47  : boolNDArray (dim_vector (r, c), val) { }
48 
49  boolMatrix (const dim_vector& dv) : boolNDArray (dv.redim (2)) { }
50 
51  boolMatrix (const dim_vector& dv, bool val)
52  : boolNDArray (dv.redim (2), val) { }
53 
54  boolMatrix (const Array<bool>& a) : boolNDArray (a.as_matrix ()) { }
55 
56  boolMatrix (const boolMatrix& a) : boolNDArray (a) { }
57 
58  bool operator == (const boolMatrix& a) const;
59  bool operator != (const boolMatrix& a) const;
60 
61  boolMatrix transpose (void) const { return Array<bool>::transpose (); }
62 
63  // destructive insert/delete/reorder operations
64 
65  boolMatrix& insert (const boolMatrix& a,
67 
68  // unary operations
69 
70  boolMatrix operator ! (void) const;
71 
72  // other operations
73 
74  boolMatrix diag (octave_idx_type k = 0) const;
75 
76 #if 0
77  // i/o
78 
79  friend std::ostream& operator << (std::ostream& os, const Matrix& a);
80  friend std::istream& operator >> (std::istream& is, Matrix& a);
81 #endif
82 
83  void resize (octave_idx_type nr, octave_idx_type nc, bool rfv = false)
84  {
85  Array<bool>::resize (dim_vector (nr, nc), rfv);
86  }
87 };
88 
90 MS_BOOL_OP_DECLS (boolMatrix, bool, OCTAVE_API)
91 SM_BOOL_OP_DECLS (bool, boolMatrix, OCTAVE_API)
92 MM_CMP_OP_DECLS (boolMatrix, boolMatrix, OCTAVE_API)
93 
94 #endif
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:567
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
boolMatrix(const dim_vector &dv, bool val)
Definition: boolMatrix.h:51
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
for large enough k
Definition: lu.cc:606
boolMatrix(const dim_vector &dv)
Definition: boolMatrix.h:49
boolMatrix(octave_idx_type r, octave_idx_type c)
Definition: boolMatrix.h:43
boolMatrix(void)
Definition: boolMatrix.h:41
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
boolMatrix transpose(void) const
Definition: boolMatrix.h:61
boolMatrix(octave_idx_type r, octave_idx_type c, bool val)
Definition: boolMatrix.h:46
#define SM_BOOL_OP_DECLS(S, M, API)
Definition: mx-op-decl.h:122
#define MM_CMP_OP_DECLS(M1, M2, API)
Definition: mx-op-decl.h:139
#define MM_BOOL_OP_DECLS(M1, M2, API)
Definition: mx-op-decl.h:147
Array< T > transpose(void) const
Definition: Array.cc:1616
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1028
Definition: dMatrix.h:37
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
Definition: lu.cc:138
bool operator==(const dim_vector &a, const dim_vector &b)
Definition: dim-vector.h:538
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
#define MS_BOOL_OP_DECLS(M, S, API)
Definition: mx-op-decl.h:97
boolMatrix(const Array< bool > &a)
Definition: boolMatrix.h:54
octave_value operator!(const octave_value &a)
Definition: ov.h:1484
void resize(octave_idx_type nr, octave_idx_type nc, bool rfv=false)
Definition: boolMatrix.h:83
write the output to stdout if nargout is
Definition: load-save.cc:1576
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
dim_vector dv
Definition: sub2ind.cc:263
boolMatrix(const boolMatrix &a)
Definition: boolMatrix.h:56