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

Array3.h

解説を見る。
00001 // Template array classes
00002 /*
00003 
00004 Copyright (C) 1996, 1997 John W. Eaton
00005 
00006 This file is part of Octave.
00007 
00008 Octave is free software; you can redistribute it and/or modify it
00009 under the terms of the GNU General Public License as published by the
00010 Free Software Foundation; either version 2, or (at your option) any
00011 later version.
00012 
00013 Octave is distributed in the hope that it will be useful, but WITHOUT
00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00015 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00016 for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with Octave; see the file COPYING.  If not, write to the Free
00020 Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021 
00022 */
00023 
00024 #if !defined (octave_Array3_h)
00025 #define octave_Array3_h 1
00026 
00027 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00028 #pragma interface
00029 #endif
00030 
00031 #include <cassert>
00032 #include <cstdlib>
00033 
00034 #include "Array.h"
00035 #include "lo-error.h"
00036 
00037 class idx_vector;
00038 
00039 // Three dimensional array class.
00040 
00041 template <class T>
00042 class
00043 Array3 : public Array<T>
00044 {
00045 protected:
00046 
00047   static int get_size (int r, int c, int p)
00048     { return Array<T>::get_size (r, c, p); }
00049 
00050   Array3 (T *d, int r, int c, int p) : Array<T> (d, dim_vector (r, c, p)) { }
00051 
00052 public:
00053 
00054   Array3 (void) : Array<T> (dim_vector (0, 0, 0)) { }
00055 
00056   Array3 (int r, int c, int p) : Array<T> (dim_vector (r, c, p)) { }
00057 
00058   Array3 (int r, int c, int p, const T& val)
00059     : Array<T> (dim_vector (r, c, p), val) { }
00060 
00061   Array3 (const Array3<T>& a)
00062     : Array<T> (a, a.dims ()) { }
00063 
00064   Array3 (const Array<T>& a, int r, int c, int p)
00065     : Array<T> (a, dim_vector (r, c, p)) { }
00066 
00067   ~Array3 (void) { }
00068 
00069   Array3<T>& operator = (const Array3<T>& a)
00070     {
00071       if (this != &a)
00072         Array<T>::operator = (a);
00073 
00074       return *this;
00075     }
00076 
00077   void resize (int r, int c, int p) { this->resize_no_fill (r, c, p); }
00078 
00079   void resize (int r, int c, int p, const T& val)
00080     { this->resize_and_fill (r, c, p, val); }
00081 };
00082 
00083 #endif
00084 
00085 /*
00086 ;;; Local Variables: ***
00087 ;;; mode: C++ ***
00088 ;;; End: ***
00089 */

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