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

intNDArray.h

解説を見る。
00001 /*
00002 
00003 Copyright (C) 2004 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_intNDArray_h)
00024 #define octave_intNDArray_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include "MArrayN.h"
00031 #include "boolNDArray.h"
00032 
00033 template <class T>
00034 class
00035 intNDArray : public MArrayN<T>
00036 {
00037 public:
00038   
00039   intNDArray (void) : MArrayN<T> () { }
00040 
00041   intNDArray (T val) : MArrayN<T> (dim_vector (1, 1), val) { }
00042 
00043   intNDArray (const dim_vector& dv) : MArrayN<T> (dv) { }
00044   
00045   intNDArray (const dim_vector& dv, T val)
00046     : MArrayN<T> (dv, val) { }
00047   
00048   template <class U>
00049   explicit intNDArray (const Array<U>& a) : MArrayN<T> (a) { }
00050 
00051   template <class U>
00052   explicit intNDArray (const ArrayN<U>& a) : MArrayN<T> (a) { }
00053 
00054   template <class U>
00055   intNDArray (const MArrayN<U>& a) : MArrayN<T> (a) { }
00056 
00057   template <class U>
00058   intNDArray (const intNDArray<U>& a) : MArrayN<T> (a) { }
00059 
00060   intNDArray& operator = (const intNDArray<T>& a)
00061     {
00062       MArrayN<T>::operator = (a);
00063       return *this;
00064     }
00065 
00066   boolNDArray operator ! (void) const;
00067 
00068   // XXX FIXME XXX -- this is not quite the right thing.
00069 
00070   boolNDArray all (int dim = -1) const;
00071   boolNDArray any (int dim = -1) const;
00072 
00073   intNDArray squeeze (void) const
00074     { return intNDArray<T> (MArrayN<T>::squeeze ()); }
00075 
00076   intNDArray transpose (void) const
00077     { return intNDArray<T> (MArrayN<T>::transpose ()); }
00078 
00079   intNDArray concat (const intNDArray<T>& rb, const Array<int>& ra_idx);
00080 
00081   intNDArray& insert (const intNDArray<T>& a, int r, int c);
00082   intNDArray& insert (const intNDArray<T>& a, const Array<int>& ra_idx);
00083 
00084   static void increment_index (Array<int>& ra_idx,
00085                                const dim_vector& dimensions,
00086                                int start_dimension = 0);
00087 
00088   static int compute_index (Array<int>& ra_idx,
00089                             const dim_vector& dimensions);
00090 
00091   static T resize_fill_value (void) { return 0; }
00092 
00093 protected:
00094 
00095   intNDArray (T *d, dim_vector& dv) : MArrayN<T> (d, dv) { }
00096 };
00097 
00098 // i/o
00099 
00100 template <class T>
00101 std::ostream& operator << (std::ostream& os, const intNDArray<T>& a);
00102 
00103 template <class T>
00104 std::istream& operator >> (std::istream& is, intNDArray<T>& a);
00105 
00106 #endif
00107 
00108 /*
00109 ;;; Local Variables: ***
00110 ;;; mode: C++ ***
00111 ;;; End: ***
00112 */

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