GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fCNDArray.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_fCNDArray_h)
24 #define octave_fCNDArray_h 1
25 
26 #include "octave-config.h"
27 
28 #include "MArray.h"
29 #include "bsxfun-decl.h"
30 #include "mx-defs.h"
31 #include "mx-op-decl.h"
32 
33 class
34 OCTAVE_API
36 {
37 public:
38 
40 
42 
44  : MArray<FloatComplex> (dv, val) { }
45 
47  : MArray<FloatComplex> (a) { }
48 
49  template <typename U>
51 
52  template <typename U>
54 
56 
58  {
60  return *this;
61  }
62 
63  // unary operations
64 
65  boolNDArray operator ! (void) const;
66 
67  // FIXME: this is not quite the right thing.
68 
69  bool any_element_is_nan (void) const;
70  bool any_element_is_inf_or_nan (void) const;
71  bool all_elements_are_real (void) const;
72  bool all_integers (float& max_val, float& min_val) const;
73  bool too_large_for_float (void) const;
74 
75  boolNDArray all (int dim = -1) const;
76  boolNDArray any (int dim = -1) const;
77 
78  FloatComplexNDArray cumprod (int dim = -1) const;
79  FloatComplexNDArray cumsum (int dim = -1) const;
80  FloatComplexNDArray prod (int dim = -1) const;
81  ComplexNDArray dprod (int dim = -1) const;
82  FloatComplexNDArray sum (int dim = -1) const;
83  ComplexNDArray dsum (int dim = -1) const;
84  FloatComplexNDArray sumsq (int dim = -1) const;
89 
90  FloatComplexNDArray max (int dim = -1) const;
91  FloatComplexNDArray max (Array<octave_idx_type>& index, int dim = -1) const;
92  FloatComplexNDArray min (int dim = -1) const;
93  FloatComplexNDArray min (Array<octave_idx_type>& index, int dim = -1) const;
94 
95  FloatComplexNDArray cummax (int dim = -1) const;
97  int dim = -1) const;
98  FloatComplexNDArray cummin (int dim = -1) const;
100  int dim = -1) const;
101 
102  FloatComplexNDArray diff (octave_idx_type order = 1, int dim = -1) const;
103 
110 
111  FloatNDArray abs (void) const;
112  boolNDArray isnan (void) const;
113  boolNDArray isinf (void) const;
114  boolNDArray isfinite (void) const;
115 
116  friend OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
117 
118  FloatComplexNDArray fourier (int dim = 1) const;
119  FloatComplexNDArray ifourier (int dim = 1) const;
120 
121  FloatComplexNDArray fourier2d (void) const;
122  FloatComplexNDArray ifourier2d (void) const;
123 
124  FloatComplexNDArray fourierNd (void) const;
125  FloatComplexNDArray ifourierNd (void) const;
126 
128  { return MArray<FloatComplex>::squeeze (); }
129 
131  const dim_vector& dimensions,
132  int start_dimension = 0);
133 
135  const dim_vector& dimensions);
136 
137  // i/o
138 
139  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
140  const FloatComplexNDArray& a);
141  friend OCTAVE_API std::istream& operator >> (std::istream& is,
143 
144  // bool all_elements_are_real (void) const;
145  // bool all_integers (float& max_val, float& min_val) const;
146 
148 
150 
152  {
154  return *this;
155  }
156 
157 };
158 
159 extern OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
160 
162 
165 
168 
171 
173 
174 extern OCTAVE_API FloatComplexNDArray& operator *= (FloatComplexNDArray& a,
175  float s);
176 extern OCTAVE_API FloatComplexNDArray& operator /= (FloatComplexNDArray& a,
177  float s);
178 
181 
183 
184 #endif
dim_vector dimensions
Definition: Array.h:216
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
Definition: Array-util.cc:175
const octave_base_value const Array< octave_idx_type > & ra_idx
std::istream & operator>>(std::istream &is, SparseBoolMatrix &a)
Definition: boolSparse.cc:279
FloatComplexRowVector & operator=(const FloatComplexRowVector &a)
Definition: fCRowVector.h:64
FloatComplexNDArray(const Array< U > &a)
Definition: fCNDArray.h:53
#define BSXFUN_STDREL_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:51
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
#define NDND_CMP_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:218
void changesign(void)
Definition: MArray.cc:204
for large enough k
Definition: lu.cc:617
#define SND_BOOL_OP_DECLS(S, ND, API)
Definition: mx-op-decl.h:199
bool isnan(bool)
Definition: lo-mappers.h:187
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:653
#define NDND_BOOL_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:226
bool isinf(double x)
Definition: lo-mappers.h:225
static T abs(T x)
Definition: pr-output.cc:1696
FloatComplexNDArray(const MArray< U > &a)
Definition: fCNDArray.h:50
the second is matched to the second specifier and placed in the second column and so forth If there are more words than specifiers then the process is repeated until all words have been processed or the limit imposed by any(non-whitespace) text in the format that is not one of these specifiers is considered a literal. If there is a literal between two format specifiers then that same literal must appear in the input stream between the matching words. The following specifiers are valid
Definition: file-io.cc:1499
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
s
Definition: file-io.cc:2729
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray.h:126
#define NDS_BOOL_OP_DECLS(ND, S, API)
Definition: mx-op-decl.h:172
#define NDS_CMP_OP_DECLS(ND, S, API)
Definition: mx-op-decl.h:164
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:400
#define SND_CMP_OP_DECLS(S, ND, API)
Definition: mx-op-decl.h:191
OCTAVE_API FloatComplexNDArray min(FloatComplex d, const FloatComplexNDArray &m)
Definition: fCNDArray.cc:875
Array< FloatComplex > index(const idx_vector &i) const
Indexing without resizing.
Definition: Array.cc:697
void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension)
Definition: Array-util.cc:58
FloatComplexNDArray(void)
Definition: fCNDArray.h:39
FloatComplexNDArray & changesign(void)
Definition: fCNDArray.h:151
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
FloatComplexNDArray(const FloatComplexNDArray &a)
Definition: fCNDArray.h:46
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:85
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:125
Array< FloatComplex > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
Definition: Array.cc:2530
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
bool isfinite(double x)
Definition: lo-mappers.h:201
MArray squeeze(void) const
Definition: MArray.h:101
OCTAVE_API FloatComplexNDArray max(FloatComplex d, const FloatComplexNDArray &m)
Definition: fCNDArray.cc:875
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
#define BSXFUN_STDOP_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:36
octave_value operator!(const octave_value &a)
Definition: ov.h:1573
FloatComplexRowVector & insert(const FloatRowVector &a, octave_idx_type c)
Definition: fCRowVector.cc:57
FloatComplexNDArray squeeze(void) const
Definition: fCNDArray.h:127
FloatComplexNDArray(const dim_vector &dv, const FloatComplex &val)
Definition: fCNDArray.h:43
write the output to stdout if nargout is
Definition: load-save.cc:1612
#define MINMAX_DECLS(T, S, API)
Definition: mx-op-decl.h:288
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
FloatComplexNDArray(const dim_vector &dv)
Definition: fCNDArray.h:41
dim_vector dv
Definition: sub2ind.cc:263
octave::stream os
Definition: file-io.cc:627
#define BSXFUN_OP_DECL(OP, ARRAY, API)
Definition: bsxfun-decl.h:27
OCTAVE_API FloatComplexNDArray conj(const FloatComplexNDArray &a)
Definition: fCNDArray.cc:743