GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
chNDArray.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_chNDArray_h)
27#define octave_chNDArray_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#include "str-vec.h"
36
37class OCTAVE_API charNDArray : public Array<char>
38{
39public:
40
42
43 charNDArray () : Array<char> () { }
44
45 charNDArray (const dim_vector& dv) : Array<char> (dv) { }
46
47 charNDArray (const dim_vector& dv, char val) : Array<char> (dv, val) { }
48
49 charNDArray (const charNDArray& a) : Array<char> (a) { }
50
51 charNDArray (const Array<char>& a) : Array<char> (a) { }
52
53 OCTAVE_API charNDArray (char c);
54
55 OCTAVE_API charNDArray (const char *s);
56
57 OCTAVE_API charNDArray (const std::string& s);
58
59 OCTAVE_API charNDArray (const string_vector& s, char fill_value = '\0');
60
61 charNDArray& operator = (const charNDArray& a)
62 {
64 return *this;
65 }
66
67 ~charNDArray () = default;
68
69 bool any_element_is_nan () const { return false; }
70
71 // FIXME: this is not quite the right thing.
72
73 OCTAVE_API boolNDArray all (int dim = -1) const;
74 OCTAVE_API boolNDArray any (int dim = -1) const;
78 concat (const NDArray& rb, const Array<octave_idx_type>& ra_idx);
79
80 OCTAVE_API charNDArray max (int dim = -1) const;
82 max (Array<octave_idx_type>& index, int dim = -1) const;
83 OCTAVE_API charNDArray min (int dim = -1) const;
85 min (Array<octave_idx_type>& index, int dim = -1) const;
86
88 insert (const charNDArray& a, octave_idx_type r, octave_idx_type c);
90 insert (const charNDArray& a, const Array<octave_idx_type>& ra_idx);
91
93
94 static OCTAVE_API void
96 const dim_vector& dimensions, int start_dimension = 0);
97
100
101 // i/o
102
103 // friend OCTAVE_API std::ostream&
104 // operator << (std::ostream& os, const charNDArray& a);
105 // friend OCTAVE_API std::istream&
106 // operator >> (std::istream& is, charNDArray& a);
107
108 OCTAVE_API charNDArray diag (octave_idx_type k = 0) const;
109
111};
112
113extern OCTAVE_API charNDArray min (char d, const charNDArray& m);
114extern OCTAVE_API charNDArray min (const charNDArray& m, char d);
115extern OCTAVE_API charNDArray min (const charNDArray& a, const charNDArray& b);
116extern OCTAVE_API charNDArray max (char d, const charNDArray& m);
117extern OCTAVE_API charNDArray max (const charNDArray& m, char d);
118extern OCTAVE_API charNDArray max (const charNDArray& a, const charNDArray& b);
119
122
125
128
130
131#endif
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
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
#define BSXFUN_STDREL_DECLS(ARRAY, API)
Definition bsxfun-decl.h:53
charNDArray max(char d, const charNDArray &m)
Definition chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition chNDArray.cc:207
charNDArray max(char d, const charNDArray &m)
Definition chNDArray.cc:230
charNDArray min(char d, const charNDArray &m)
Definition chNDArray.cc:207
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 > squeeze() const
Chop off leading singleton dimensions.
charNDArray(const dim_vector &dv)
Definition chNDArray.h:45
~charNDArray()=default
bool any_element_is_nan() const
Definition chNDArray.h:69
charMatrix matrix_type
Definition chNDArray.h:41
charNDArray(const charNDArray &a)
Definition chNDArray.h:49
charNDArray(const dim_vector &dv, char val)
Definition chNDArray.h:47
charNDArray(const Array< char > &a)
Definition chNDArray.h:51
charNDArray squeeze() const
Definition chNDArray.h:92
Vector representing the dimensions (size) of an Array.
Definition dim-vector.h:90
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
#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