メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

CNDArray.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 2003 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 2, or (at your option) any
00010 later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 
00021 */
00022 
00023 #if !defined (octave_ComplexNDArray_h)
00024 #define octave_ComplexNDArray_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include "MArrayN.h"
00031 #include "CMatrix.h"
00032 
00033 #include "mx-defs.h"
00034 #include "mx-op-defs.h"
00035 
00036 class
00037 ComplexNDArray : public MArrayN<Complex>
00038 {
00039 public:
00040   
00041   ComplexNDArray (void) : MArrayN<Complex> () { }
00042 
00043   ComplexNDArray (const dim_vector& dv) : MArrayN<Complex> (dv) { }
00044 
00045   ComplexNDArray (const dim_vector& dv, const Complex& val)
00046     : MArrayN<Complex> (dv, val) { }
00047   
00048   ComplexNDArray (const ComplexNDArray& a) : MArrayN<Complex> (a) { }
00049 
00050   ComplexNDArray (const ComplexMatrix& a) : MArrayN<Complex> (a) { }
00051 
00052   ComplexNDArray (const MArrayN<Complex>& a) : MArrayN<Complex> (a) { }
00053 
00054   ComplexNDArray& operator = (const ComplexNDArray& a)
00055     {
00056       MArrayN<Complex>::operator = (a);
00057       return *this;
00058     }
00059 
00060   // unary operations
00061 
00062   boolNDArray operator ! (void) const;
00063 
00064   // XXX FIXME XXX -- this is not quite the right thing.
00065 
00066   bool any_element_is_inf_or_nan (void) const;
00067   bool all_elements_are_real (void) const;
00068   bool all_integers (double& max_val, double& min_val) const;
00069   bool too_large_for_float (void) const;
00070 
00071   boolNDArray all (int dim = -1) const;
00072   boolNDArray any (int dim = -1) const;
00073 
00074   ComplexNDArray cumprod (int dim = -1) const;
00075   ComplexNDArray cumsum (int dim = -1) const;
00076   ComplexNDArray prod (int dim = -1) const;
00077   ComplexNDArray sum (int dim = -1) const;
00078   ComplexNDArray sumsq (int dim = -1) const;
00079   ComplexNDArray concat (const ComplexNDArray& rb, const Array<int>& ra_idx);
00080   ComplexNDArray concat (const NDArray& rb, const Array<int>& ra_idx);
00081 
00082   ComplexNDArray max (int dim = 0) const;
00083   ComplexNDArray max (ArrayN<int>& index, int dim = 0) const;
00084   ComplexNDArray min (int dim = 0) const;
00085   ComplexNDArray min (ArrayN<int>& index, int dim = 0) const;
00086 
00087   ComplexNDArray& insert (const NDArray& a, int r, int c);
00088   ComplexNDArray& insert (const ComplexNDArray& a, int r, int c);
00089   ComplexNDArray& insert (const ComplexNDArray& a, const Array<int>& ra_idx);
00090   
00091   NDArray abs (void) const;
00092 
00093   ComplexNDArray fourier (int dim = 1) const;
00094   ComplexNDArray ifourier (int dim = 1) const;
00095 
00096   ComplexNDArray fourier2d (void) const;
00097   ComplexNDArray ifourier2d (void) const;
00098 
00099   ComplexNDArray fourierNd (void) const;
00100   ComplexNDArray ifourierNd (void) const;
00101 
00102   ComplexMatrix matrix_value (void) const;
00103 
00104   ComplexNDArray squeeze (void) const { return MArrayN<Complex>::squeeze (); }
00105 
00106   static void increment_index (Array<int>& ra_idx,
00107                                const dim_vector& dimensions,
00108                                int start_dimension = 0);
00109 
00110   static int compute_index (Array<int>& ra_idx,
00111                             const dim_vector& dimensions);
00112 
00113   // i/o
00114 
00115   friend std::ostream& operator << (std::ostream& os, const ComplexNDArray& a);
00116   friend std::istream& operator >> (std::istream& is, ComplexNDArray& a);
00117 
00118   static Complex resize_fill_value (void) { return Complex (0.0, 0.0); }
00119 
00120   //  bool all_elements_are_real (void) const;
00121   //  bool all_integers (double& max_val, double& min_val) const;
00122 
00123 private:
00124 
00125   ComplexNDArray (Complex *d, const dim_vector& dv)
00126     : MArrayN<Complex> (d, dv) { }
00127 };
00128 
00129 extern ComplexNDArray min (const Complex& c, const ComplexNDArray& m);
00130 extern ComplexNDArray min (const ComplexNDArray& m, const Complex& c);
00131 extern ComplexNDArray min (const ComplexNDArray& a, const ComplexNDArray& b);
00132 
00133 extern ComplexNDArray max (const Complex& c, const ComplexNDArray& m);
00134 extern ComplexNDArray max (const ComplexNDArray& m, const Complex& c);
00135 extern ComplexNDArray max (const ComplexNDArray& a, const ComplexNDArray& b);
00136 
00137 NDS_CMP_OP_DECLS (ComplexNDArray, Complex)
00138 NDS_BOOL_OP_DECLS (ComplexNDArray, Complex)
00139 
00140 SND_CMP_OP_DECLS (Complex, ComplexNDArray)
00141 SND_BOOL_OP_DECLS (Complex, ComplexNDArray)
00142 
00143 NDND_CMP_OP_DECLS (ComplexNDArray, ComplexNDArray)
00144 NDND_BOOL_OP_DECLS (ComplexNDArray, ComplexNDArray)
00145 
00146 MARRAY_FORWARD_DEFS (MArrayN, ComplexNDArray, Complex)
00147 
00148 #endif
00149 
00150 /*
00151 ;;; Local Variables: ***
00152 ;;; mode: C++ ***
00153 ;;; End: ***
00154 */

Wed Dec 29 11:51:04 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送