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
fCNDArray.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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 
30 #include "mx-defs.h"
31 #include "mx-op-decl.h"
32 #include "bsxfun-decl.h"
33 
34 class
35 OCTAVE_API
37 {
38 public:
39 
41 
43 
45  : MArray<FloatComplex> (dv, val) { }
46 
48  : MArray<FloatComplex> (a) { }
49 
50  template <typename U>
52 
53  template <typename U>
55 
57 
59  {
61  return *this;
62  }
63 
64  // unary operations
65 
66  boolNDArray operator ! (void) const;
67 
68  // FIXME: this is not quite the right thing.
69 
70  bool any_element_is_nan (void) const;
71  bool any_element_is_inf_or_nan (void) const;
72  bool all_elements_are_real (void) const;
73  bool all_integers (float& max_val, float& min_val) const;
74  bool too_large_for_float (void) const;
75 
76  boolNDArray all (int dim = -1) const;
77  boolNDArray any (int dim = -1) const;
78 
79  FloatComplexNDArray cumprod (int dim = -1) const;
80  FloatComplexNDArray cumsum (int dim = -1) const;
81  FloatComplexNDArray prod (int dim = -1) const;
82  ComplexNDArray dprod (int dim = -1) const;
83  FloatComplexNDArray sum (int dim = -1) const;
84  ComplexNDArray dsum (int dim = -1) const;
85  FloatComplexNDArray sumsq (int dim = -1) const;
90 
91  FloatComplexNDArray max (int dim = -1) const;
92  FloatComplexNDArray max (Array<octave_idx_type>& index, int dim = -1) const;
93  FloatComplexNDArray min (int dim = -1) const;
94  FloatComplexNDArray min (Array<octave_idx_type>& index, int dim = -1) const;
95 
96  FloatComplexNDArray cummax (int dim = -1) const;
98  int dim = -1) const;
99  FloatComplexNDArray cummin (int dim = -1) const;
101  int dim = -1) const;
102 
103  FloatComplexNDArray diff (octave_idx_type order = 1, int dim = -1) const;
104 
111 
112  FloatNDArray abs (void) const;
113  boolNDArray isnan (void) const;
114  boolNDArray isinf (void) const;
115  boolNDArray isfinite (void) const;
116 
117  friend OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
118 
119  FloatComplexNDArray fourier (int dim = 1) const;
120  FloatComplexNDArray ifourier (int dim = 1) const;
121 
122  FloatComplexNDArray fourier2d (void) const;
123  FloatComplexNDArray ifourier2d (void) const;
124 
125  FloatComplexNDArray fourierNd (void) const;
126  FloatComplexNDArray ifourierNd (void) const;
127 
129  { return MArray<FloatComplex>::squeeze (); }
130 
132  const dim_vector& dimensions,
133  int start_dimension = 0);
134 
136  const dim_vector& dimensions);
137 
138  // i/o
139 
140  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
141  const FloatComplexNDArray& a);
142  friend OCTAVE_API std::istream& operator >> (std::istream& is,
144 
145  // bool all_elements_are_real (void) const;
146  // bool all_integers (float& max_val, float& min_val) const;
147 
149 
151 
153  {
155  return *this;
156  }
157 
158 };
159 
160 extern OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
161 
163 
165 NDS_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplex, OCTAVE_API)
166 
167 SND_CMP_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
168 SND_BOOL_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
169 
170 NDND_CMP_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
171 NDND_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
172 
173 MARRAY_FORWARD_DEFS (MArray, FloatComplexNDArray, FloatComplex)
174 
175 extern OCTAVE_API FloatComplexNDArray& operator *= (FloatComplexNDArray& a,
176  float s);
177 extern OCTAVE_API FloatComplexNDArray& operator /= (FloatComplexNDArray& a,
178  float s);
179 
180 BSXFUN_STDOP_DECLS (FloatComplexNDArray, OCTAVE_API)
181 BSXFUN_STDREL_DECLS (FloatComplexNDArray, OCTAVE_API)
182 
183 BSXFUN_OP_DECL (pow, FloatComplexNDArray, OCTAVE_API)
184 
185 #endif
dim_vector dimensions
Definition: Array.h:214
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
Definition: Array-util.cc:176
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:65
MArray squeeze(void) const
Definition: MArray.h:101
FloatComplexNDArray(const Array< U > &a)
Definition: fCNDArray.h:54
#define BSXFUN_STDREL_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:53
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
#define NDND_CMP_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:218
bool isnan(double x)
Definition: lo-mappers.cc:347
for large enough k
Definition: lu.cc:606
#define SND_BOOL_OP_DECLS(S, ND, API)
Definition: mx-op-decl.h:199
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:655
#define NDND_BOOL_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:226
Array< FloatComplex > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
FloatComplexNDArray(const MArray< U > &a)
Definition: fCNDArray.h:51
s
Definition: file-io.cc:2682
#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
void changesign(void)
Definition: MArray.cc:204
#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:398
#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:877
void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension)
Definition: Array-util.cc:59
nd deftypefn *octave_map m
Definition: ov-struct.cc:2058
FloatComplexNDArray(void)
Definition: fCNDArray.h:40
FloatComplexNDArray & changesign(void)
Definition: fCNDArray.h:152
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
FloatComplexNDArray squeeze(void) const
Definition: fCNDArray.h:128
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 isinf(double x)
Definition: lo-mappers.cc:387
FloatComplexNDArray(const FloatComplexNDArray &a)
Definition: fCNDArray.h:47
N Dimensional Array with copy-on-write semantics.
Definition: Array.h:126
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
OCTAVE_API FloatComplexNDArray max(FloatComplex d, const FloatComplexNDArray &m)
Definition: fCNDArray.cc:877
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
#define BSXFUN_STDOP_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:38
octave_value operator!(const octave_value &a)
Definition: ov.h:1484
FloatComplexRowVector & insert(const FloatRowVector &a, octave_idx_type c)
Definition: fCRowVector.cc:58
FloatComplexNDArray(const dim_vector &dv, const FloatComplex &val)
Definition: fCNDArray.h:44
write the output to stdout if nargout is
Definition: load-save.cc:1576
#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
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:1491
FloatComplexNDArray(const dim_vector &dv)
Definition: fCNDArray.h:42
dim_vector dv
Definition: sub2ind.cc:263
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:85
#define BSXFUN_OP_DECL(OP, ARRAY, API)
Definition: bsxfun-decl.h:29
OCTAVE_API FloatComplexNDArray conj(const FloatComplexNDArray &a)
Definition: fCNDArray.cc:745
Array< FloatComplex > index(const idx_vector &i) const
Indexing without resizing.