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

chNDArray.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_charNDArray_h)
00024 #define octave_charNDArray_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include "MArrayN.h"
00031 #include "chMatrix.h"
00032 
00033 #include "mx-defs.h"
00034 #include "mx-op-defs.h"
00035 
00036 class
00037 charNDArray : public MArrayN<char>
00038 {
00039 public:
00040   
00041   charNDArray (void) : MArrayN<char> () { }
00042 
00043   charNDArray (dim_vector& dv) : MArrayN<char> (dv) { }
00044 
00045   charNDArray (dim_vector& dv, char val) : MArrayN<char> (dv, val) { }
00046   
00047   charNDArray (const charNDArray& a) : MArrayN<char> (a) { }
00048 
00049   charNDArray (const charMatrix& a) : MArrayN<char> (a) { }
00050 
00051   charNDArray (char c) : MArrayN<char> (charMatrix (c)) { }
00052 
00053   charNDArray (const char *s) : MArrayN<char> (charMatrix (s)) { }
00054 
00055   charNDArray (const std::string& s) : MArrayN<char> (charMatrix (s)) { }
00056 
00057   charNDArray (const string_vector& s) : MArrayN<char> (charMatrix (s)) { }
00058 
00059   charNDArray (const ArrayN<char>& a) : MArrayN<char> (a) { }
00060 
00061   charNDArray& operator = (const charNDArray& a)
00062     {
00063       MArrayN<char>::operator = (a);
00064       return *this;
00065     }
00066 
00067   // XXX FIXME XXX -- this is not quite the right thing.
00068 
00069   boolNDArray all (int dim = -1) const;
00070   boolNDArray any (int dim = -1) const;
00071   charNDArray concat (const charNDArray& rb, const Array<int>& ra_idx);
00072   charNDArray concat (const NDArray& rb, const Array<int>& ra_idx);
00073 
00074   charNDArray& insert (const charNDArray& a, int r, int c);
00075   charNDArray& insert (const charNDArray& a, const Array<int>& ra_idx);
00076   
00077   charMatrix matrix_value (void) const;
00078 
00079   charNDArray squeeze (void) const { return ArrayN<char>::squeeze (); }
00080 
00081   static void increment_index (Array<int>& ra_idx,
00082                                const dim_vector& dimensions,
00083                                int start_dimension = 0);
00084 
00085   static int compute_index (Array<int>& ra_idx,
00086                             const dim_vector& dimensions);
00087 
00088   // i/o
00089 
00090   // friend std::ostream& operator << (std::ostream& os, const charNDArray& a);
00091   // friend std::istream& operator >> (std::istream& is, charNDArray& a);
00092 
00093   static char resize_fill_value (void) { return '\0'; }
00094 
00095 private:
00096 
00097   charNDArray (char *d, dim_vector& dv) : MArrayN<char> (d, dv) { }
00098 };
00099 
00100 MARRAY_FORWARD_DEFS (MArrayN, charNDArray, char)
00101 
00102 #endif
00103 
00104 /*
00105 ;;; Local Variables: ***
00106 ;;; mode: C++ ***
00107 ;;; End: ***
00108 */

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