00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_chMatrix_int_h)
00024 #define octave_chMatrix_int_h 1
00025
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029
00030 #include <string>
00031
00032 #include "MArray2.h"
00033
00034 #include "mx-defs.h"
00035 #include "str-vec.h"
00036
00037 class
00038 charMatrix : public MArray2<char>
00039 {
00040 friend class ComplexMatrix;
00041
00042 public:
00043
00044 charMatrix (void) : MArray2<char> () { }
00045 charMatrix (int r, int c) : MArray2<char> (r, c) { }
00046 charMatrix (int r, int c, char val) : MArray2<char> (r, c, val) { }
00047 charMatrix (const MArray2<char>& a) : MArray2<char> (a) { }
00048 charMatrix (const charMatrix& a) : MArray2<char> (a) { }
00049 charMatrix (char c);
00050 charMatrix (const char *s);
00051 charMatrix (const std::string& s);
00052 charMatrix (const string_vector& s);
00053
00054 charMatrix& operator = (const charMatrix& a)
00055 {
00056 MArray2<char>::operator = (a);
00057 return *this;
00058 }
00059
00060 bool operator == (const charMatrix& a) const;
00061 bool operator != (const charMatrix& a) const;
00062
00063 charMatrix transpose (void) const { return MArray2<char>::transpose (); }
00064
00065
00066
00067 charMatrix& insert (const char *s, int r, int c);
00068 charMatrix& insert (const charMatrix& a, int r, int c);
00069
00070 std::string row_as_string (int, bool strip_ws = false, bool raw = false) const;
00071
00072
00073
00074 charMatrix extract (int r1, int c1, int r2, int c2) const;
00075
00076 boolMatrix all (int dim = -1) const;
00077 boolMatrix any (int dim = -1) const;
00078
00079 #if 0
00080
00081
00082 friend std::ostream& operator << (std::ostream& os, const Matrix& a);
00083 friend std::istream& operator >> (std::istream& is, Matrix& a);
00084 #endif
00085
00086 static char resize_fill_value (void) { return '\0'; }
00087
00088 private:
00089
00090 charMatrix (char *ch, int r, int c) : MArray2<char> (ch, r, c) { }
00091 };
00092
00093 #endif
00094
00095
00096
00097
00098
00099