1573
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1573
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
1687
|
23 #if !defined (octave_chMatrix_int_h) |
|
24 #define octave_chMatrix_int_h 1 |
1573
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
1728
|
30 #include <string> |
|
31 |
1989
|
32 #include "MArray2.h" |
1573
|
33 |
|
34 #include "mx-defs.h" |
2349
|
35 #include "str-vec.h" |
1573
|
36 |
1728
|
37 class |
|
38 charMatrix : public MArray2<char> |
1573
|
39 { |
|
40 friend class ComplexMatrix; |
|
41 |
|
42 public: |
|
43 |
|
44 charMatrix (void) : MArray2<char> () { } |
|
45 charMatrix (int r, int c) : MArray2<char> (r, c) { } |
|
46 charMatrix (int r, int c, char val) : MArray2<char> (r, c, val) { } |
|
47 charMatrix (const MArray2<char>& a) : MArray2<char> (a) { } |
|
48 charMatrix (const charMatrix& a) : MArray2<char> (a) { } |
|
49 charMatrix (const char *s); |
1731
|
50 charMatrix (const string& s); |
2349
|
51 charMatrix (const string_vector& s); |
1573
|
52 |
|
53 charMatrix& operator = (const charMatrix& a) |
|
54 { |
|
55 MArray2<char>::operator = (a); |
|
56 return *this; |
|
57 } |
|
58 |
2384
|
59 bool operator == (const charMatrix& a) const; |
|
60 bool operator != (const charMatrix& a) const; |
1573
|
61 |
|
62 // destructive insert/delete/reorder operations |
|
63 |
|
64 charMatrix& insert (const char *s, int r, int c); |
|
65 charMatrix& insert (const charMatrix& a, int r, int c); |
|
66 |
2493
|
67 string row_as_string (int r, bool strip_trailing_whitespace = false) const; |
1573
|
68 |
2255
|
69 charMatrix transpose (void) const; |
1573
|
70 |
3136
|
71 Matrix all (void) const; |
|
72 Matrix any (void) const; |
|
73 |
2255
|
74 #if 0 |
1573
|
75 // i/o |
|
76 |
|
77 friend ostream& operator << (ostream& os, const Matrix& a); |
|
78 friend istream& operator >> (istream& is, Matrix& a); |
|
79 #endif |
|
80 |
|
81 private: |
|
82 |
|
83 charMatrix (char *ch, int r, int c) : MArray2<char> (ch, r, c) { } |
|
84 }; |
|
85 |
|
86 #endif |
|
87 |
|
88 /* |
|
89 ;;; Local Variables: *** |
|
90 ;;; mode: C++ *** |
|
91 ;;; End: *** |
|
92 */ |