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) { } |
3189
|
49 charMatrix (char c); |
1573
|
50 charMatrix (const char *s); |
3504
|
51 charMatrix (const std::string& s); |
2349
|
52 charMatrix (const string_vector& s); |
1573
|
53 |
|
54 charMatrix& operator = (const charMatrix& a) |
|
55 { |
|
56 MArray2<char>::operator = (a); |
|
57 return *this; |
|
58 } |
|
59 |
2384
|
60 bool operator == (const charMatrix& a) const; |
|
61 bool operator != (const charMatrix& a) const; |
1573
|
62 |
|
63 // destructive insert/delete/reorder operations |
|
64 |
|
65 charMatrix& insert (const char *s, int r, int c); |
|
66 charMatrix& insert (const charMatrix& a, int r, int c); |
|
67 |
3836
|
68 std::string row_as_string (int, bool strip_ws = false, bool raw = false) const; |
1573
|
69 |
3189
|
70 // resize is the destructive equivalent for this one |
|
71 |
|
72 charMatrix extract (int r1, int c1, int r2, int c2) const; |
|
73 |
3136
|
74 Matrix all (void) const; |
|
75 Matrix any (void) const; |
|
76 |
2255
|
77 #if 0 |
1573
|
78 // i/o |
|
79 |
3504
|
80 friend std::ostream& operator << (std::ostream& os, const Matrix& a); |
|
81 friend std::istream& operator >> (std::istream& is, Matrix& a); |
1573
|
82 #endif |
|
83 |
|
84 private: |
|
85 |
|
86 charMatrix (char *ch, int r, int c) : MArray2<char> (ch, r, c) { } |
|
87 }; |
|
88 |
|
89 #endif |
|
90 |
|
91 /* |
|
92 ;;; Local Variables: *** |
|
93 ;;; mode: C++ *** |
|
94 ;;; End: *** |
|
95 */ |