Mercurial > hg > octave-lyh
annotate liboctave/MatrixType.h @ 14819:67b6b47a22f6
doc: Clarify docstrings for canonicalize_file_name, make_absolute_filename
* syscalls.cc (canonicalize_file_name): Clarify docstring.
* utils.cc (make_absolute_filename): Clarify docstring.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 29 Jun 2012 13:38:28 -0700 |
parents | 72c96de7a403 |
children |
rev | line source |
---|---|
5785 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
3 Copyright (C) 2006-2012 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 | |
27 class Matrix; | |
28 class ComplexMatrix; | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
29 class FloatMatrix; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
30 class FloatComplexMatrix; |
5785 | 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 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
64 MatrixType (const FloatMatrix &a); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
65 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
66 MatrixType (const FloatComplexMatrix &a); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
67 |
5785 | 68 MatrixType (const SparseMatrix &a); |
69 | |
70 MatrixType (const SparseComplexMatrix &a); | |
71 | |
72 MatrixType (const matrix_type t, bool _full = false); | |
73 | |
74 MatrixType (const matrix_type t, const octave_idx_type np, | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
75 const octave_idx_type *p, bool _full = false); |
5785 | 76 |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
77 MatrixType (const matrix_type t, const octave_idx_type ku, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
78 const octave_idx_type kl, bool _full = false); |
5785 | 79 |
80 ~MatrixType (void); | |
81 | |
82 MatrixType& operator = (const MatrixType& a); | |
83 | |
84 int type (bool quiet = true); | |
85 | |
86 int type (const Matrix &a); | |
87 | |
88 int type (const ComplexMatrix &a); | |
89 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
90 int type (const FloatMatrix &a); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
91 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
92 int type (const FloatComplexMatrix &a); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
93 |
5785 | 94 int type (const SparseMatrix &a); |
95 | |
96 int type (const SparseComplexMatrix &a); | |
97 | |
98 double band_density (void) const { return bandden; } | |
99 | |
100 int nupper (void) const { return upper_band; } | |
101 | |
102 int nlower (void) const { return lower_band; } | |
103 | |
104 bool is_dense (void) const { return dense; } | |
105 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
106 bool is_diagonal (void) const |
5785 | 107 { return (typ == Diagonal || typ == Permuted_Diagonal); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
108 |
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
109 bool is_upper_triangular (void) const |
5785 | 110 { return (typ == Upper || typ == Permuted_Upper); } |
111 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
112 bool is_lower_triangular (void) const |
5785 | 113 { return (typ == Lower || typ == Permuted_Lower); } |
114 | |
115 bool is_banded (void) | |
116 { return (typ == Banded || typ == Banded_Hermitian); } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
117 |
5785 | 118 bool is_tridiagonal (void) const |
119 { return (typ == Tridiagonal || typ == Tridiagonal_Hermitian); } | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
120 |
5785 | 121 bool is_hermitian (void) const |
122 { return (typ == Banded_Hermitian || typ == Tridiagonal_Hermitian || | |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10158
diff
changeset
|
123 typ == Hermitian); } |
5785 | 124 |
125 bool is_rectangular (void) const { return (typ == Rectangular); } | |
126 | |
127 bool is_known (void) const { return (typ != Unknown); } | |
128 | |
129 bool is_unknown (void) const { return (typ == Unknown); } | |
130 | |
131 void info (void) const; | |
132 | |
133 octave_idx_type * triangular_perm (void) const { return perm; } | |
134 | |
135 void invalidate_type (void) { typ = Unknown; } | |
136 | |
137 void mark_as_diagonal (void) { typ = Diagonal; } | |
138 | |
139 void mark_as_permuted_diagonal (void) { typ = Permuted_Diagonal; } | |
140 | |
141 void mark_as_upper_triangular (void) { typ = Upper; } | |
142 | |
143 void mark_as_lower_triangular (void) { typ = Lower; } | |
144 | |
145 void mark_as_tridiagonal (void) {typ = Tridiagonal; } | |
146 | |
147 void mark_as_banded (const octave_idx_type ku, const octave_idx_type kl) | |
148 { typ = Banded; upper_band = ku; lower_band = kl; } | |
149 | |
150 void mark_as_full (void) { typ = Full; } | |
151 | |
152 void mark_as_rectangular (void) { typ = Rectangular; } | |
153 | |
154 void mark_as_dense (void) { dense = true; } | |
155 | |
156 void mark_as_not_dense (void) { dense = false; } | |
157 | |
158 void mark_as_symmetric (void); | |
159 | |
160 void mark_as_unsymmetric (void); | |
161 | |
162 void mark_as_permuted (const octave_idx_type np, const octave_idx_type *p); | |
163 | |
164 void mark_as_unpermuted (void); | |
165 | |
166 MatrixType transpose (void) const; | |
167 | |
168 private: | |
169 void type (int new_typ) { typ = static_cast<matrix_type>(new_typ); } | |
170 | |
171 matrix_type typ; | |
172 double sp_bandden; | |
173 double bandden; | |
174 octave_idx_type upper_band; | |
175 octave_idx_type lower_band; | |
176 bool dense; | |
177 bool full; | |
178 octave_idx_type nperm; | |
179 octave_idx_type *perm; | |
180 }; | |
181 | |
182 #endif |