Mercurial > hg > octave-nkf
annotate liboctave/MatrixType.h @ 11897:ee24b6c413f6 release-3-0-x
contourf.m: Correct order of patch object handles.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 13 Dec 2008 17:30:38 +0100 |
parents | 9de3ccd2e7ac |
children |
rev | line source |
---|---|
5785 | 1 /* |
2 | |
7017 | 3 Copyright (C) 2006, 2007 David Bateman |
5785 | 4 Copyright (C) 2006 Andy Adler |
5 | |
7016 | 6 This file is part of Octave. |
7 | |
5785 | 8 Octave is free software; you can redistribute it and/or modify it |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
5785 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
5785 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_MatrixType_h) | |
25 #define octave_MatrixType_h | |
26 | |
11786
9de3ccd2e7ac
add missing include in MatrixType.h
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
27 #include "oct-types.h" |
9de3ccd2e7ac
add missing include in MatrixType.h
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
28 |
5785 | 29 class Matrix; |
30 class ComplexMatrix; | |
31 class SparseMatrix; | |
32 class SparseComplexMatrix; | |
33 | |
34 class | |
6108 | 35 OCTAVE_API |
5785 | 36 MatrixType |
37 { | |
38 public: | |
39 enum matrix_type { | |
40 Unknown = 0, | |
41 Full, | |
42 Diagonal, | |
43 Permuted_Diagonal, | |
44 Upper, | |
45 Lower, | |
46 Permuted_Upper, | |
47 Permuted_Lower, | |
48 Banded, | |
49 Hermitian, | |
50 Banded_Hermitian, | |
51 Tridiagonal, | |
52 Tridiagonal_Hermitian, | |
53 Rectangular | |
54 }; | |
55 | |
56 MatrixType (void); | |
6376 | 57 |
5785 | 58 MatrixType (const MatrixType &a); |
59 | |
60 MatrixType (const Matrix &a); | |
61 | |
62 MatrixType (const ComplexMatrix &a); | |
63 | |
64 MatrixType (const SparseMatrix &a); | |
65 | |
66 MatrixType (const SparseComplexMatrix &a); | |
67 | |
68 MatrixType (const matrix_type t, bool _full = false); | |
69 | |
70 MatrixType (const matrix_type t, const octave_idx_type np, | |
71 const octave_idx_type *p, bool _full = false); | |
72 | |
73 MatrixType (const matrix_type t, const octave_idx_type ku, | |
74 const octave_idx_type kl, bool _full = false); | |
75 | |
76 ~MatrixType (void); | |
77 | |
78 MatrixType& operator = (const MatrixType& a); | |
79 | |
80 int type (bool quiet = true); | |
81 | |
82 int type (const Matrix &a); | |
83 | |
84 int type (const ComplexMatrix &a); | |
85 | |
86 int type (const SparseMatrix &a); | |
87 | |
88 int type (const SparseComplexMatrix &a); | |
89 | |
90 double band_density (void) const { return bandden; } | |
91 | |
92 int nupper (void) const { return upper_band; } | |
93 | |
94 int nlower (void) const { return lower_band; } | |
95 | |
96 bool is_dense (void) const { return dense; } | |
97 | |
98 bool is_diagonal (void) const | |
99 { return (typ == Diagonal || typ == Permuted_Diagonal); } | |
100 | |
101 bool is_upper_triangular (void) const | |
102 { return (typ == Upper || typ == Permuted_Upper); } | |
103 | |
104 bool is_lower_triangular (void) const | |
105 { return (typ == Lower || typ == Permuted_Lower); } | |
106 | |
107 bool is_banded (void) | |
108 { return (typ == Banded || typ == Banded_Hermitian); } | |
109 | |
110 bool is_tridiagonal (void) const | |
111 { return (typ == Tridiagonal || typ == Tridiagonal_Hermitian); } | |
112 | |
113 bool is_hermitian (void) const | |
114 { return (typ == Banded_Hermitian || typ == Tridiagonal_Hermitian || | |
115 typ == Hermitian); } | |
116 | |
117 bool is_rectangular (void) const { return (typ == Rectangular); } | |
118 | |
119 bool is_known (void) const { return (typ != Unknown); } | |
120 | |
121 bool is_unknown (void) const { return (typ == Unknown); } | |
122 | |
123 void info (void) const; | |
124 | |
125 octave_idx_type * triangular_perm (void) const { return perm; } | |
126 | |
127 void invalidate_type (void) { typ = Unknown; } | |
128 | |
129 void mark_as_diagonal (void) { typ = Diagonal; } | |
130 | |
131 void mark_as_permuted_diagonal (void) { typ = Permuted_Diagonal; } | |
132 | |
133 void mark_as_upper_triangular (void) { typ = Upper; } | |
134 | |
135 void mark_as_lower_triangular (void) { typ = Lower; } | |
136 | |
137 void mark_as_tridiagonal (void) {typ = Tridiagonal; } | |
138 | |
139 void mark_as_banded (const octave_idx_type ku, const octave_idx_type kl) | |
140 { typ = Banded; upper_band = ku; lower_band = kl; } | |
141 | |
142 void mark_as_full (void) { typ = Full; } | |
143 | |
144 void mark_as_rectangular (void) { typ = Rectangular; } | |
145 | |
146 void mark_as_dense (void) { dense = true; } | |
147 | |
148 void mark_as_not_dense (void) { dense = false; } | |
149 | |
150 void mark_as_symmetric (void); | |
151 | |
152 void mark_as_unsymmetric (void); | |
153 | |
154 void mark_as_permuted (const octave_idx_type np, const octave_idx_type *p); | |
155 | |
156 void mark_as_unpermuted (void); | |
157 | |
158 MatrixType transpose (void) const; | |
159 | |
160 private: | |
161 void type (int new_typ) { typ = static_cast<matrix_type>(new_typ); } | |
162 | |
163 matrix_type typ; | |
164 double sp_bandden; | |
165 double bandden; | |
166 octave_idx_type upper_band; | |
167 octave_idx_type lower_band; | |
168 bool dense; | |
169 bool full; | |
170 octave_idx_type nperm; | |
171 octave_idx_type *perm; | |
172 }; | |
173 | |
174 #endif | |
175 | |
176 /* | |
177 ;;; Local Variables: *** | |
178 ;;; mode: C++ *** | |
179 ;;; End: *** | |
180 */ |