GNU Octave  4.0.0
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-2015 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 "MArray.h"
27 
28 #include "mx-defs.h"
29 #include "mx-op-decl.h"
30 #include "bsxfun-decl.h"
31 
32 class
33 OCTAVE_API
35 {
36 public:
37 
39 
41 
43  : MArray<FloatComplex> (dv, val) { }
44 
46  : MArray<FloatComplex> (a) { }
47 
48  template <class U>
50 
51  template <class U>
53 
55 
57  {
59  return *this;
60  }
61 
62  // unary operations
63 
64  boolNDArray operator ! (void) const;
65 
66  // FIXME: this is not quite the right thing.
67 
68  bool any_element_is_nan (void) const;
69  bool any_element_is_inf_or_nan (void) const;
70  bool all_elements_are_real (void) const;
71  bool all_integers (float& max_val, float& min_val) const;
72  bool too_large_for_float (void) const;
73 
74  boolNDArray all (int dim = -1) const;
75  boolNDArray any (int dim = -1) const;
76 
77  FloatComplexNDArray cumprod (int dim = -1) const;
78  FloatComplexNDArray cumsum (int dim = -1) const;
79  FloatComplexNDArray prod (int dim = -1) const;
80  ComplexNDArray dprod (int dim = -1) const;
81  FloatComplexNDArray sum (int dim = -1) const;
82  ComplexNDArray dsum (int dim = -1) const;
83  FloatComplexNDArray sumsq (int dim = -1) const;
88 
89  FloatComplexNDArray max (int dim = -1) const;
90  FloatComplexNDArray max (Array<octave_idx_type>& index, int dim = -1) const;
91  FloatComplexNDArray min (int dim = -1) const;
92  FloatComplexNDArray min (Array<octave_idx_type>& index, int dim = -1) const;
93 
94  FloatComplexNDArray cummax (int dim = -1) const;
96  int dim = -1) const;
97  FloatComplexNDArray cummin (int dim = -1) const;
99  int dim = -1) const;
100 
101  FloatComplexNDArray diff (octave_idx_type order = 1, int dim = -1) const;
102 
109 
110  FloatNDArray abs (void) const;
111  boolNDArray isnan (void) const;
112  boolNDArray isinf (void) const;
113  boolNDArray isfinite (void) const;
114 
115  friend OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
116 
117  FloatComplexNDArray fourier (int dim = 1) const;
118  FloatComplexNDArray ifourier (int dim = 1) const;
119 
120  FloatComplexNDArray fourier2d (void) const;
121  FloatComplexNDArray ifourier2d (void) const;
122 
123  FloatComplexNDArray fourierNd (void) const;
124  FloatComplexNDArray ifourierNd (void) const;
125 
127  { return MArray<FloatComplex>::squeeze (); }
128 
130  const dim_vector& dimensions,
131  int start_dimension = 0);
132 
134  const dim_vector& dimensions);
135 
136  // i/o
137 
138  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
139  const FloatComplexNDArray& a);
140  friend OCTAVE_API std::istream& operator >> (std::istream& is,
142 
143  // bool all_elements_are_real (void) const;
144  // bool all_integers (float& max_val, float& min_val) const;
145 
147 
149 
151  {
153  return *this;
154  }
155 
156 };
157 
158 extern OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
159 
161 
163 NDS_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplex, OCTAVE_API)
164 
165 SND_CMP_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
166 SND_BOOL_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
167 
168 NDND_CMP_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
169 NDND_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
170 
171 MARRAY_FORWARD_DEFS (MArray, FloatComplexNDArray, FloatComplex)
172 
173 extern OCTAVE_API FloatComplexNDArray& operator *= (FloatComplexNDArray& a,
174  float s);
175 extern OCTAVE_API FloatComplexNDArray& operator /= (FloatComplexNDArray& a,
176  float s);
177 
178 BSXFUN_STDOP_DECLS (FloatComplexNDArray, OCTAVE_API)
179 BSXFUN_STDREL_DECLS (FloatComplexNDArray, OCTAVE_API)
180 
181 BSXFUN_OP_DECL (pow, FloatComplexNDArray, OCTAVE_API)
182 
183 #endif
dim_vector dimensions
Definition: Array.h:127
octave_idx_type compute_index(octave_idx_type n, const dim_vector &dims)
Definition: Array-util.cc:178
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:63
MArray squeeze(void) const
Definition: MArray.h:81
FloatComplexNDArray(const Array< U > &a)
Definition: fCNDArray.h:52
#define BSXFUN_STDREL_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:51
#define NDND_CMP_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:216
#define SND_BOOL_OP_DECLS(S, ND, API)
Definition: mx-op-decl.h:197
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:664
#define NDND_BOOL_OP_DECLS(ND1, ND2, API)
Definition: mx-op-decl.h:224
Array< FloatComplex > diag(octave_idx_type k=0) const
Get the kth super or subdiagonal.
FloatComplexNDArray(const MArray< U > &a)
Definition: fCNDArray.h:49
#define NDS_BOOL_OP_DECLS(ND, S, API)
Definition: mx-op-decl.h:170
void changesign(void)
Definition: MArray.cc:208
#define NDS_CMP_OP_DECLS(ND, S, API)
Definition: mx-op-decl.h:162
#define SND_CMP_OP_DECLS(S, ND, API)
Definition: mx-op-decl.h:189
OCTAVE_API FloatComplexNDArray min(FloatComplex d, const FloatComplexNDArray &m)
Definition: fCNDArray.cc:894
void increment_index(Array< octave_idx_type > &ra_idx, const dim_vector &dimensions, int start_dimension)
Definition: Array-util.cc:59
FloatComplexNDArray(void)
Definition: fCNDArray.h:38
FloatComplexNDArray & changesign(void)
Definition: fCNDArray.h:150
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
#define MARRAY_FORWARD_DEFS(B, R, T)
Definition: MArray-decl.h:236
FloatComplexNDArray squeeze(void) const
Definition: fCNDArray.h:126
FloatComplexNDArray(const FloatComplexNDArray &a)
Definition: fCNDArray.h:45
Handles the reference counting for all the derived classes.
Definition: Array.h:45
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
OCTAVE_API FloatComplexNDArray max(FloatComplex d, const FloatComplexNDArray &m)
Definition: fCNDArray.cc:894
std::complex< float > FloatComplex
Definition: oct-cmplx.h:30
#define BSXFUN_STDOP_DECLS(ARRAY, API)
Definition: bsxfun-decl.h:36
octave_value operator!(const octave_value &a)
Definition: ov.h:1293
FloatComplexRowVector & insert(const FloatRowVector &a, octave_idx_type c)
Definition: fCRowVector.cc:77
FloatComplexNDArray(const dim_vector &dv, const FloatComplex &val)
Definition: fCNDArray.h:42
#define MINMAX_DECLS(T, S, API)
Definition: mx-op-decl.h:286
T abs(T x)
Definition: pr-output.cc:3062
FloatComplexNDArray(const dim_vector &dv)
Definition: fCNDArray.h:40
MArray< T > & operator=(const MArray< T > &a)
Definition: MArray.h:65
#define BSXFUN_OP_DECL(OP, ARRAY, API)
Definition: bsxfun-decl.h:27
OCTAVE_API FloatComplexNDArray conj(const FloatComplexNDArray &a)
Definition: fCNDArray.cc:757
Array< FloatComplex > index(const idx_vector &i) const
Indexing without resizing.