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