GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
boolMatrix.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1996-2025 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_boolMatrix_h)
27#define octave_boolMatrix_h 1
28
29#include "octave-config.h"
30
31#include "Array.h"
32#include "boolNDArray.h"
33#include "mx-defs.h"
34#include "mx-op-decl.h"
35
37{
38public:
39
40 boolMatrix () = default;
41
42 boolMatrix (const boolMatrix& a) = default;
43
44 boolMatrix& operator = (const boolMatrix& a) = default;
45
46 ~boolMatrix () = default;
47
50
52 : boolNDArray (dim_vector (r, c), val) { }
53
54 boolMatrix (const dim_vector& dv) : boolNDArray (dv.redim (2)) { }
55
56 boolMatrix (const dim_vector& dv, bool val)
57 : boolNDArray (dv.redim (2), val) { }
58
59 boolMatrix (const Array<bool>& a) : boolNDArray (a.as_matrix ()) { }
60
61 OCTAVE_API bool operator == (const boolMatrix& a) const;
62 OCTAVE_API bool operator != (const boolMatrix& a) const;
63
65
66 // destructive insert/delete/reorder operations
67
70
71 // unary operations
72
74
75 // other operations
76
78
79 void resize (octave_idx_type nr, octave_idx_type nc, bool rfv = false)
80 {
81 Array<bool>::resize (dim_vector (nr, nc), rfv);
82 }
83};
84
89
90#endif
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Array< T, Alloc > transpose() const
Size of the specified dimension.
void resize(const dim_vector &dv, const T &rfv)
Size of the specified dimension.
boolMatrix(const dim_vector &dv)
Definition boolMatrix.h:54
~boolMatrix()=default
boolMatrix(octave_idx_type r, octave_idx_type c)
Definition boolMatrix.h:48
boolMatrix(const Array< bool > &a)
Definition boolMatrix.h:59
boolMatrix(octave_idx_type r, octave_idx_type c, bool val)
Definition boolMatrix.h:51
boolMatrix transpose() const
Definition boolMatrix.h:64
void resize(octave_idx_type nr, octave_idx_type nc, bool rfv=false)
Definition boolMatrix.h:79
boolMatrix(const dim_vector &dv, bool val)
Definition boolMatrix.h:56
boolMatrix(const boolMatrix &a)=default
boolMatrix()=default
boolNDArray diag(octave_idx_type k=0) const
boolNDArray & operator=(const boolNDArray &a)
Definition boolNDArray.h:53
boolNDArray & insert(const boolNDArray &a, octave_idx_type r, octave_idx_type c)
boolNDArray operator!() const
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
bool operator!=(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:532
bool operator==(const dim_vector &a, const dim_vector &b)
Definition dim-vector.h:516
#define OCTAVE_API
Definition main.in.cc:55
#define SM_BOOL_OP_DECLS(S, M, API)
Definition mx-op-decl.h:122
#define MS_BOOL_OP_DECLS(M, S, API)
Definition mx-op-decl.h:97
#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