GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
boolNDArray.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2003-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_boolNDArray_h)
27#define octave_boolNDArray_h 1
28
29#include "octave-config.h"
30
31#include "Array.h"
32#include "bsxfun-decl.h"
33#include "mx-defs.h"
34#include "mx-op-decl.h"
35
36class OCTAVE_API boolNDArray : public Array<bool>
37{
38public:
39
41
42 boolNDArray () : Array<bool> () { }
43
44 boolNDArray (const dim_vector& dv) : Array<bool> (dv) { }
45
46 boolNDArray (const dim_vector& dv, const bool& val)
47 : Array<bool> (dv, val) { }
48
49 boolNDArray (const boolNDArray& a) : Array<bool> (a) { }
50
51 boolNDArray (const Array<bool>& a) : Array<bool> (a) { }
52
54 {
56 return *this;
57 }
58
59 ~boolNDArray () = default;
60
61 // unary operations
62
64
65 OCTAVE_API boolNDArray& invert ();
66
67 bool any_element_is_nan () const { return false; }
68
69 // FIXME: this is not quite the right thing.
70
71 OCTAVE_API boolNDArray all (int dim = -1) const;
72 OCTAVE_API boolNDArray any (int dim = -1) const;
73
76
81
83
84 static OCTAVE_API void
86 const dim_vector& dimensions, int start_dimension = 0);
87
90 const dim_vector& dimensions);
91
92 // i/o
93
94 // friend std::ostream& operator << (std::ostream& os, const NDArray& a);
95 // friend std::istream& operator >> (std::istream& is, NDArray& a);
96
97 // bool all_elements_are_real () const;
98 // bool all_integers (double& max_val, double& min_val) const;
99
101
103};
104
107
110
113
118
121
122#endif
void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension)
Definition Array-util.cc:60
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition CNDArray.cc:418
boolNDArray & mx_el_and_assign(boolNDArray &m, const boolNDArray &a)
boolNDArray & mx_el_or_assign(boolNDArray &m, const boolNDArray &a)
#define BSXFUN_OP_DECL(OP, ARRAY, API)
Definition bsxfun-decl.h:29
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Array< T, Alloc > & operator=(const Array< T, Alloc > &a)
Definition Array.h:365
Array< T, Alloc > & insert(const Array< T, Alloc > &a, const Array< octave_idx_type > &idx)
Insert an array into another at a specified position.
Array< T, Alloc > squeeze() const
Chop off leading singleton dimensions.
Array< T, Alloc > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
octave_idx_type compute_index(octave_idx_type i, octave_idx_type j) const
Size of the specified dimension.
boolNDArray(const boolNDArray &a)
Definition boolNDArray.h:49
bool any_element_is_nan() const
Definition boolNDArray.h:67
~boolNDArray()=default
boolNDArray squeeze() const
Definition boolNDArray.h:82
boolNDArray(const dim_vector &dv)
Definition boolNDArray.h:44
boolNDArray(const dim_vector &dv, const bool &val)
Definition boolNDArray.h:46
boolNDArray(const Array< bool > &a)
Definition boolNDArray.h:51
boolMatrix matrix_type
Definition boolNDArray.h:40
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
#define OCTAVE_API
Definition main.in.cc:55
#define NDND_BOOL_OP_DECLS(ND1, ND2, API)
Definition mx-op-decl.h:226
#define NDND_CMP_OP_DECLS(ND1, ND2, API)
Definition mx-op-decl.h:218
#define NDS_BOOL_OP_DECLS(ND, S, API)
Definition mx-op-decl.h:172
#define SND_CMP_OP_DECLS(S, ND, API)
Definition mx-op-decl.h:191
#define NDS_CMP_OP_DECLS(ND, S, API)
Definition mx-op-decl.h:164
#define SND_BOOL_OP_DECLS(S, ND, API)
Definition mx-op-decl.h:199
const octave_base_value const Array< octave_idx_type > & ra_idx
octave_value operator!(const octave_value &a)
Definition ov.h:1648