GNU Octave  3.8.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-2013 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 #include "fCMatrix.h"
28 
29 #include "mx-defs.h"
30 #include "mx-op-decl.h"
31 #include "bsxfun-decl.h"
32 
33 class
34 OCTAVE_API
36 {
37 public:
38 
40 
42 
44 
46  : MArray<FloatComplex> (dv, val) { }
47 
49  : MArray<FloatComplex> (a) { }
50 
52  : MArray<FloatComplex> (a) { }
53 
54  template <class U>
56 
57  template <class U>
59 
61 
63  {
65  return *this;
66  }
67 
68  // unary operations
69 
70  boolNDArray operator ! (void) const;
71 
72  // FIXME: this is not quite the right thing.
73 
74  bool any_element_is_nan (void) const;
75  bool any_element_is_inf_or_nan (void) const;
76  bool all_elements_are_real (void) const;
77  bool all_integers (float& max_val, float& min_val) const;
78  bool too_large_for_float (void) const;
79 
80  boolNDArray all (int dim = -1) const;
81  boolNDArray any (int dim = -1) const;
82 
83  FloatComplexNDArray cumprod (int dim = -1) const;
84  FloatComplexNDArray cumsum (int dim = -1) const;
85  FloatComplexNDArray prod (int dim = -1) const;
86  FloatComplexNDArray sum (int dim = -1) const;
87  ComplexNDArray dsum (int dim = -1) const;
88  FloatComplexNDArray sumsq (int dim = -1) const;
90  const Array<octave_idx_type>& ra_idx);
92  const Array<octave_idx_type>& ra_idx);
93 
94  FloatComplexNDArray max (int dim = -1) const;
95  FloatComplexNDArray max (Array<octave_idx_type>& index, int dim = -1) const;
96  FloatComplexNDArray min (int dim = -1) const;
97  FloatComplexNDArray min (Array<octave_idx_type>& index, int dim = -1) const;
98 
99  FloatComplexNDArray cummax (int dim = -1) const;
101  int dim = -1) const;
102  FloatComplexNDArray cummin (int dim = -1) const;
104  int dim = -1) const;
105 
106  FloatComplexNDArray diff (octave_idx_type order = 1, int dim = -1) const;
107 
113  const Array<octave_idx_type>& ra_idx);
114 
115  FloatNDArray abs (void) const;
116  boolNDArray isnan (void) const;
117  boolNDArray isinf (void) const;
118  boolNDArray isfinite (void) const;
119 
120  friend OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
121 
122  FloatComplexNDArray fourier (int dim = 1) const;
123  FloatComplexNDArray ifourier (int dim = 1) const;
124 
125  FloatComplexNDArray fourier2d (void) const;
126  FloatComplexNDArray ifourier2d (void) const;
127 
128  FloatComplexNDArray fourierNd (void) const;
129  FloatComplexNDArray ifourierNd (void) const;
130 
131  FloatComplexMatrix matrix_value (void) const;
132 
134  { return MArray<FloatComplex>::squeeze (); }
135 
136  static void increment_index (Array<octave_idx_type>& ra_idx,
137  const dim_vector& dimensions,
138  int start_dimension = 0);
139 
141  const dim_vector& dimensions);
142 
143  // i/o
144 
145  friend OCTAVE_API std::ostream& operator << (std::ostream& os,
146  const FloatComplexNDArray& a);
147  friend OCTAVE_API std::istream& operator >> (std::istream& is,
149 
150  // bool all_elements_are_real (void) const;
151  // bool all_integers (float& max_val, float& min_val) const;
152 
154 
156 
158  {
160  return *this;
161  }
162 
163 };
164 
165 extern OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
166 
168 
170 NDS_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplex, OCTAVE_API)
171 
172 SND_CMP_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
173 SND_BOOL_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
174 
175 NDND_CMP_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
176 NDND_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
177 
178 MARRAY_FORWARD_DEFS (MArray, FloatComplexNDArray, FloatComplex)
179 
180 extern OCTAVE_API FloatComplexNDArray& operator *= (FloatComplexNDArray& a,
181  float s);
182 extern OCTAVE_API FloatComplexNDArray& operator /= (FloatComplexNDArray& a,
183  float s);
184 
185 BSXFUN_STDOP_DECLS (FloatComplexNDArray, OCTAVE_API)
186 BSXFUN_STDREL_DECLS (FloatComplexNDArray, OCTAVE_API)
187 
188 BSXFUN_OP_DECL (pow, FloatComplexNDArray, OCTAVE_API)
189 
190 #endif