00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_FloatComplexNDArray_h)
00024 #define octave_FloatComplexNDArray_h 1
00025
00026 #include "MArrayN.h"
00027 #include "fCMatrix.h"
00028
00029 #include "mx-defs.h"
00030 #include "mx-op-decl.h"
00031
00032 class
00033 OCTAVE_API
00034 FloatComplexNDArray : public MArrayN<FloatComplex>
00035 {
00036 public:
00037
00038 typedef FloatComplexMatrix matrix_type;
00039
00040 FloatComplexNDArray (void) : MArrayN<FloatComplex> () { }
00041
00042 FloatComplexNDArray (const dim_vector& dv) : MArrayN<FloatComplex> (dv) { }
00043
00044 FloatComplexNDArray (const dim_vector& dv, const FloatComplex& val)
00045 : MArrayN<FloatComplex> (dv, val) { }
00046
00047 FloatComplexNDArray (const FloatComplexNDArray& a) : MArrayN<FloatComplex> (a) { }
00048
00049 FloatComplexNDArray (const FloatComplexMatrix& a) : MArrayN<FloatComplex> (a) { }
00050
00051 template <class U>
00052 FloatComplexNDArray (const MArrayN<U>& a) : MArrayN<FloatComplex> (a) { }
00053
00054 template <class U>
00055 FloatComplexNDArray (const Array<U>& a) : MArrayN<FloatComplex> (a) { }
00056
00057 FloatComplexNDArray (const charNDArray&);
00058
00059 FloatComplexNDArray& operator = (const FloatComplexNDArray& a)
00060 {
00061 MArrayN<FloatComplex>::operator = (a);
00062 return *this;
00063 }
00064
00065
00066
00067 boolNDArray operator ! (void) const;
00068
00069
00070
00071 bool any_element_is_nan (void) const;
00072 bool any_element_is_inf_or_nan (void) const;
00073 bool all_elements_are_real (void) const;
00074 bool all_integers (float& max_val, float& min_val) const;
00075 bool too_large_for_float (void) const;
00076
00077 boolNDArray all (int dim = -1) const;
00078 boolNDArray any (int dim = -1) const;
00079
00080 FloatComplexNDArray cumprod (int dim = -1) const;
00081 FloatComplexNDArray cumsum (int dim = -1) const;
00082 FloatComplexNDArray prod (int dim = -1) const;
00083 FloatComplexNDArray sum (int dim = -1) const;
00084 ComplexNDArray dsum (int dim = -1) const;
00085 FloatComplexNDArray sumsq (int dim = -1) const;
00086 FloatComplexNDArray concat (const FloatComplexNDArray& rb, const Array<octave_idx_type>& ra_idx);
00087 FloatComplexNDArray concat (const FloatNDArray& rb, const Array<octave_idx_type>& ra_idx);
00088
00089 FloatComplexNDArray max (int dim = 0) const;
00090 FloatComplexNDArray max (Array<octave_idx_type>& index, int dim = 0) const;
00091 FloatComplexNDArray min (int dim = 0) const;
00092 FloatComplexNDArray min (Array<octave_idx_type>& index, int dim = 0) const;
00093
00094 FloatComplexNDArray cummax (int dim = 0) const;
00095 FloatComplexNDArray cummax (Array<octave_idx_type>& index, int dim = 0) const;
00096 FloatComplexNDArray cummin (int dim = 0) const;
00097 FloatComplexNDArray cummin (Array<octave_idx_type>& index, int dim = 0) const;
00098
00099 FloatComplexNDArray diff (octave_idx_type order = 1, int dim = 0) const;
00100
00101 FloatComplexNDArray& insert (const NDArray& a, octave_idx_type r, octave_idx_type c);
00102 FloatComplexNDArray& insert (const FloatComplexNDArray& a, octave_idx_type r, octave_idx_type c);
00103 FloatComplexNDArray& insert (const FloatComplexNDArray& a, const Array<octave_idx_type>& ra_idx);
00104
00105 FloatNDArray abs (void) const;
00106 boolNDArray isnan (void) const;
00107 boolNDArray isinf (void) const;
00108 boolNDArray isfinite (void) const;
00109
00110 friend OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
00111
00112 FloatComplexNDArray fourier (int dim = 1) const;
00113 FloatComplexNDArray ifourier (int dim = 1) const;
00114
00115 FloatComplexNDArray fourier2d (void) const;
00116 FloatComplexNDArray ifourier2d (void) const;
00117
00118 FloatComplexNDArray fourierNd (void) const;
00119 FloatComplexNDArray ifourierNd (void) const;
00120
00121 FloatComplexMatrix matrix_value (void) const;
00122
00123 FloatComplexNDArray squeeze (void) const { return MArrayN<FloatComplex>::squeeze (); }
00124
00125 static void increment_index (Array<octave_idx_type>& ra_idx,
00126 const dim_vector& dimensions,
00127 int start_dimension = 0);
00128
00129 static octave_idx_type compute_index (Array<octave_idx_type>& ra_idx,
00130 const dim_vector& dimensions);
00131
00132
00133
00134 friend OCTAVE_API std::ostream& operator << (std::ostream& os, const FloatComplexNDArray& a);
00135 friend OCTAVE_API std::istream& operator >> (std::istream& is, FloatComplexNDArray& a);
00136
00137 static FloatComplex resize_fill_value (void) { return FloatComplex (0.0, 0.0); }
00138
00139
00140
00141
00142 FloatComplexNDArray diag (octave_idx_type k = 0) const;
00143
00144 FloatComplexNDArray& changesign (void)
00145 {
00146 MArrayN<FloatComplex>::changesign ();
00147 return *this;
00148 }
00149
00150 typedef float (*dmapper) (const FloatComplex&);
00151 typedef FloatComplex (*cmapper) (const FloatComplex&);
00152 typedef bool (*bmapper) (const FloatComplex&);
00153
00154 FloatNDArray map (dmapper fcn) const;
00155 FloatComplexNDArray map (cmapper fcn) const;
00156 boolNDArray map (bmapper fcn) const;
00157
00158 private:
00159
00160 FloatComplexNDArray (FloatComplex *d, const dim_vector& dv)
00161 : MArrayN<FloatComplex> (d, dv) { }
00162 };
00163
00164 extern OCTAVE_API FloatComplexNDArray conj (const FloatComplexNDArray& a);
00165
00166 extern OCTAVE_API FloatComplexNDArray min (const FloatComplex& c, const FloatComplexNDArray& m);
00167 extern OCTAVE_API FloatComplexNDArray min (const FloatComplexNDArray& m, const FloatComplex& c);
00168 extern OCTAVE_API FloatComplexNDArray min (const FloatComplexNDArray& a, const FloatComplexNDArray& b);
00169
00170 extern OCTAVE_API FloatComplexNDArray max (const FloatComplex& c, const FloatComplexNDArray& m);
00171 extern OCTAVE_API FloatComplexNDArray max (const FloatComplexNDArray& m, const FloatComplex& c);
00172 extern OCTAVE_API FloatComplexNDArray max (const FloatComplexNDArray& a, const FloatComplexNDArray& b);
00173
00174 NDS_CMP_OP_DECLS (FloatComplexNDArray, FloatComplex, OCTAVE_API)
00175 NDS_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplex, OCTAVE_API)
00176
00177 SND_CMP_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
00178 SND_BOOL_OP_DECLS (FloatComplex, FloatComplexNDArray, OCTAVE_API)
00179
00180 NDND_CMP_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
00181 NDND_BOOL_OP_DECLS (FloatComplexNDArray, FloatComplexNDArray, OCTAVE_API)
00182
00183 MARRAY_FORWARD_DEFS (MArrayN, FloatComplexNDArray, FloatComplex)
00184
00185 extern OCTAVE_API FloatComplexNDArray& operator *= (FloatComplexNDArray& a, float s);
00186 extern OCTAVE_API FloatComplexNDArray& operator /= (FloatComplexNDArray& a, float s);
00187
00188 #endif
00189
00190
00191
00192
00193
00194