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

boolNDArray.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_boolNDArray_h)
00024 #define octave_boolNDArray_h 1
00025 
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029 
00030 #include "ArrayN.h"
00031 #include "CMatrix.h"
00032 
00033 #include "mx-defs.h"
00034 #include "mx-op-defs.h"
00035 
00036 #include "boolMatrix.h"
00037 
00038 class
00039 boolNDArray : public ArrayN<bool>
00040 {
00041 public:
00042   
00043   boolNDArray (void) : ArrayN<bool> () { }
00044 
00045   boolNDArray (const dim_vector& dv) : ArrayN<bool> (dv) { }
00046 
00047   boolNDArray (const dim_vector& dv, const bool& val)
00048     : ArrayN<bool> (dv, val) { }
00049   
00050   boolNDArray (const boolNDArray& a) : ArrayN<bool> (a) { }
00051 
00052   boolNDArray (const boolMatrix& a) : ArrayN<bool> (a) { }
00053 
00054   boolNDArray (const Array2<bool>& a) : ArrayN<bool> (a) { }
00055 
00056   boolNDArray (const ArrayN<bool>& a) : ArrayN<bool> (a) { }
00057 
00058   boolNDArray& operator = (const boolNDArray& a)
00059     {
00060       ArrayN<bool>::operator = (a);
00061       return *this;
00062     }
00063 
00064   // unary operations
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   boolNDArray concat (const boolNDArray& rb, const Array<int>& ra_idx);
00074 
00075   boolNDArray& insert (const boolNDArray& a, int r, int c);
00076   boolNDArray& insert (const boolNDArray& a, const Array<int>& ra_idx);
00077 
00078   boolMatrix matrix_value (void) const;
00079 
00080   boolNDArray squeeze (void) const { return ArrayN<bool>::squeeze (); }
00081 
00082   static void increment_index (Array<int>& ra_idx,
00083                                const dim_vector& dimensions,
00084                                int start_dimension = 0);
00085 
00086   static int compute_index (Array<int>& ra_idx,
00087                             const dim_vector& dimensions);
00088 
00089   // i/o
00090 
00091   // friend std::ostream& operator << (std::ostream& os, const NDArray& a);
00092   // friend std::istream& operator >> (std::istream& is, NDArray& a);
00093 
00094   static bool resize_fill_value (void) { return false; }
00095 
00096   //  bool all_elements_are_real (void) const;
00097   //  bool all_integers (double& max_val, double& min_val) const;
00098 
00099 private:
00100 
00101   boolNDArray (bool *d, dim_vector& dv) : ArrayN<bool> (d, dv) { }
00102 };
00103 
00104 NDND_BOOL_OP_DECLS (boolNDArray, boolNDArray)
00105 NDND_CMP_OP_DECLS (boolNDArray, boolNDArray)
00106 
00107 NDS_BOOL_OP_DECLS (boolNDArray, bool)
00108 NDS_CMP_OP_DECLS (boolNDArray, bool)
00109 
00110 SND_BOOL_OP_DECLS (bool, boolNDArray)
00111 SND_CMP_OP_DECLS (bool, boolNDArray)
00112 
00113 #endif
00114 
00115 /*
00116 ;;; Local Variables: ***
00117 ;;; mode: C++ ***
00118 ;;; End: ***
00119 */

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