Mercurial > hg > octave-lyh
comparison liboctave/CmplxSCHUR.h @ 1881:950825cea083
[project @ 1996-02-05 18:07:21 by jwe]
author | jwe |
---|---|
date | Mon, 05 Feb 1996 18:07:21 +0000 |
parents | 1af643fa00e3 |
children | 908f5b6676d7 |
comparison
equal
deleted
inserted
replaced
1880:cbdbec67ad60 | 1881:950825cea083 |
---|---|
1 // -*- C++ -*- | 1 // -*- C++ -*- |
2 /* | 2 /* |
3 | 3 |
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton | 4 Copyright (C) 1996 John W. Eaton |
5 | 5 |
6 This file is part of Octave. | 6 This file is part of Octave. |
7 | 7 |
8 Octave is free software; you can redistribute it and/or modify it | 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 | 9 under the terms of the GNU General Public License as published by the |
32 | 32 |
33 #include <string> | 33 #include <string> |
34 | 34 |
35 #include "CMatrix.h" | 35 #include "CMatrix.h" |
36 | 36 |
37 class ComplexSCHUR | 37 class |
38 ComplexSCHUR | |
38 { | 39 { |
39 friend class ComplexMatrix; | |
40 | |
41 public: | 40 public: |
42 | 41 |
43 ComplexSCHUR (void) { } | 42 ComplexSCHUR (void) : schur_mat (), unitary_mat () { } |
44 | 43 |
45 ComplexSCHUR (const ComplexMatrix& a, const string& ord) | 44 ComplexSCHUR (const ComplexMatrix& a, const string& ord) |
46 { | 45 { |
47 init (a,ord); | 46 init (a,ord); |
48 } | 47 } |
51 { | 50 { |
52 info = init (a,ord); | 51 info = init (a,ord); |
53 } | 52 } |
54 | 53 |
55 ComplexSCHUR (const ComplexSCHUR& a) | 54 ComplexSCHUR (const ComplexSCHUR& a) |
56 { | 55 : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat) { } |
57 schur_mat = a.schur_mat; | |
58 unitary_mat = a.unitary_mat; | |
59 } | |
60 | 56 |
61 ComplexSCHUR& operator = (const ComplexSCHUR& a) | 57 ComplexSCHUR& operator = (const ComplexSCHUR& a) |
62 { | 58 { |
63 schur_mat = a.schur_mat; | 59 if (this != &a) |
64 unitary_mat = a.unitary_mat; | 60 { |
65 | 61 schur_mat = a.schur_mat; |
62 unitary_mat = a.unitary_mat; | |
63 } | |
66 return *this; | 64 return *this; |
67 } | 65 } |
68 | 66 |
69 ComplexMatrix schur_matrix (void) const | 67 ComplexMatrix schur_matrix (void) const { return schur_mat; } |
70 { | |
71 return schur_mat; | |
72 } | |
73 | 68 |
74 ComplexMatrix unitary_matrix (void) const | 69 ComplexMatrix unitary_matrix (void) const { return unitary_mat; } |
75 { | |
76 return unitary_mat; | |
77 } | |
78 | 70 |
79 friend ostream& operator << (ostream& os, const ComplexSCHUR& a); | 71 friend ostream& operator << (ostream& os, const ComplexSCHUR& a); |
80 | 72 |
81 private: | 73 private: |
82 | 74 |
83 int init (const ComplexMatrix& a, const string& ord); | |
84 | |
85 ComplexMatrix schur_mat; | 75 ComplexMatrix schur_mat; |
86 ComplexMatrix unitary_mat; | 76 ComplexMatrix unitary_mat; |
77 | |
78 int init (const ComplexMatrix& a, const string& ord); | |
87 }; | 79 }; |
88 | 80 |
89 #endif | 81 #endif |
90 | 82 |
91 /* | 83 /* |