457
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
457
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_LU_h) |
|
25 #define octave_LU_h 1 |
|
26 |
|
27 class ostream; |
|
28 |
|
29 #include "dMatrix.h" |
|
30 |
|
31 extern "C++" { |
|
32 |
|
33 class LU |
|
34 { |
|
35 friend class Matrix; |
|
36 |
|
37 public: |
|
38 |
|
39 LU (void) {} |
|
40 |
|
41 LU (const Matrix& a); |
|
42 |
|
43 LU (const LU& a); |
|
44 |
|
45 LU& operator = (const LU& a); |
|
46 |
|
47 Matrix L (void) const; |
|
48 Matrix U (void) const; |
|
49 Matrix P (void) const; |
|
50 |
|
51 friend ostream& operator << (ostream& os, const LU& a); |
|
52 |
|
53 private: |
|
54 |
|
55 Matrix l; |
|
56 Matrix u; |
|
57 Matrix p; |
|
58 }; |
|
59 |
|
60 inline LU::LU (const LU& a) |
|
61 { |
|
62 l = a.l; |
|
63 u = a.u; |
|
64 p = a.p; |
|
65 } |
|
66 |
|
67 inline LU& LU::operator = (const LU& a) |
|
68 { |
|
69 l = a.l; |
|
70 u = a.u; |
|
71 p = a.p; |
|
72 return *this; |
|
73 } |
|
74 |
|
75 inline Matrix LU::L (void) const |
|
76 { |
|
77 return l; |
|
78 } |
|
79 |
|
80 inline Matrix LU::U (void) const |
|
81 { |
|
82 return u; |
|
83 } |
|
84 |
|
85 inline Matrix LU::P (void) const |
|
86 { |
|
87 return p; |
|
88 } |
|
89 |
|
90 } // extern "C++" |
|
91 |
|
92 #endif |
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; page-delimiter: "^/\\*" *** |
|
98 ;;; End: *** |
|
99 */ |