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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1573
|
21 |
|
22 */ |
|
23 |
1687
|
24 #if !defined (octave_chMatrix_int_h) |
|
25 #define octave_chMatrix_int_h 1 |
1573
|
26 |
1728
|
27 #include <string> |
|
28 |
1989
|
29 #include "MArray2.h" |
1573
|
30 |
|
31 #include "mx-defs.h" |
2349
|
32 #include "str-vec.h" |
1573
|
33 |
1728
|
34 class |
|
35 charMatrix : public MArray2<char> |
1573
|
36 { |
|
37 friend class ComplexMatrix; |
|
38 |
|
39 public: |
|
40 |
|
41 charMatrix (void) : MArray2<char> () { } |
5275
|
42 charMatrix (octave_idx_type r, octave_idx_type c) : MArray2<char> (r, c) { } |
|
43 charMatrix (octave_idx_type r, octave_idx_type c, char val) : MArray2<char> (r, c, val) { } |
1573
|
44 charMatrix (const MArray2<char>& a) : MArray2<char> (a) { } |
|
45 charMatrix (const charMatrix& a) : MArray2<char> (a) { } |
3189
|
46 charMatrix (char c); |
1573
|
47 charMatrix (const char *s); |
3504
|
48 charMatrix (const std::string& s); |
2349
|
49 charMatrix (const string_vector& s); |
1573
|
50 |
|
51 charMatrix& operator = (const charMatrix& a) |
|
52 { |
|
53 MArray2<char>::operator = (a); |
|
54 return *this; |
|
55 } |
|
56 |
2384
|
57 bool operator == (const charMatrix& a) const; |
|
58 bool operator != (const charMatrix& a) const; |
1573
|
59 |
4902
|
60 charMatrix transpose (void) const { return MArray2<char>::transpose (); } |
|
61 |
1573
|
62 // destructive insert/delete/reorder operations |
|
63 |
5275
|
64 charMatrix& insert (const char *s, octave_idx_type r, octave_idx_type c); |
|
65 charMatrix& insert (const charMatrix& a, octave_idx_type r, octave_idx_type c); |
1573
|
66 |
5275
|
67 std::string row_as_string (octave_idx_type, bool strip_ws = false, bool raw = false) const; |
1573
|
68 |
3189
|
69 // resize is the destructive equivalent for this one |
|
70 |
5275
|
71 charMatrix extract (octave_idx_type r1, octave_idx_type c1, octave_idx_type r2, octave_idx_type c2) const; |
3189
|
72 |
4017
|
73 boolMatrix all (int dim = -1) const; |
|
74 boolMatrix any (int dim = -1) const; |
3136
|
75 |
2255
|
76 #if 0 |
1573
|
77 // i/o |
|
78 |
3504
|
79 friend std::ostream& operator << (std::ostream& os, const Matrix& a); |
|
80 friend std::istream& operator >> (std::istream& is, Matrix& a); |
1573
|
81 #endif |
|
82 |
3933
|
83 static char resize_fill_value (void) { return '\0'; } |
|
84 |
1573
|
85 private: |
|
86 |
5275
|
87 charMatrix (char *ch, octave_idx_type r, octave_idx_type c) : MArray2<char> (ch, r, c) { } |
1573
|
88 }; |
|
89 |
|
90 #endif |
|
91 |
|
92 /* |
|
93 ;;; Local Variables: *** |
|
94 ;;; mode: C++ *** |
|
95 ;;; End: *** |
|
96 */ |