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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
457
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_GEPBALANCE_h) |
|
25 #define octave_GEPBALANCE_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
457
|
31 class ostream; |
|
32 |
|
33 #include "dMatrix.h" |
|
34 |
|
35 class GEPBALANCE |
|
36 { |
|
37 friend class Matrix; |
|
38 |
|
39 public: |
|
40 |
|
41 GEPBALANCE (void) {} |
|
42 |
|
43 GEPBALANCE (const Matrix& a, const Matrix &, const char *balance_job); |
|
44 |
|
45 GEPBALANCE (const GEPBALANCE& a); |
|
46 |
|
47 GEPBALANCE& operator = (const GEPBALANCE& a); |
|
48 Matrix balanced_a_matrix (void) const; |
|
49 Matrix balanced_b_matrix (void) const; |
|
50 Matrix left_balancing_matrix (void) const; |
|
51 Matrix right_balancing_matrix (void) const; |
|
52 friend ostream& operator << (ostream& os, const GEPBALANCE& a); |
|
53 |
|
54 private: |
|
55 |
|
56 int init (const Matrix& a, const Matrix& b, const char * balance_job); |
|
57 |
|
58 Matrix balanced_a_mat; |
|
59 Matrix balanced_b_mat; |
|
60 Matrix left_balancing_mat; |
|
61 Matrix right_balancing_mat; |
|
62 }; |
|
63 |
|
64 inline GEPBALANCE::GEPBALANCE (const Matrix& a, const Matrix& b, |
|
65 const char * balance_job) |
|
66 { |
|
67 init (a, b, balance_job); |
|
68 } |
|
69 |
|
70 inline GEPBALANCE::GEPBALANCE (const GEPBALANCE& a) |
|
71 { |
|
72 balanced_a_mat = a.balanced_a_mat; |
|
73 balanced_b_mat = a.balanced_b_mat; |
|
74 left_balancing_mat = a.left_balancing_mat; |
|
75 right_balancing_mat = a.right_balancing_mat; |
|
76 } |
|
77 |
|
78 inline GEPBALANCE& |
|
79 GEPBALANCE::operator = (const GEPBALANCE& a) |
|
80 { |
|
81 balanced_a_mat = a.balanced_a_mat; |
|
82 balanced_b_mat = a.balanced_b_mat; |
|
83 left_balancing_mat = a.left_balancing_mat; |
|
84 right_balancing_mat = a.right_balancing_mat; |
|
85 |
|
86 return *this; |
|
87 } |
|
88 |
|
89 inline Matrix GEPBALANCE::balanced_a_matrix (void) const |
|
90 { |
|
91 return balanced_a_mat; |
|
92 } |
|
93 |
|
94 inline Matrix GEPBALANCE::balanced_b_matrix (void) const |
|
95 { |
|
96 return balanced_b_mat; |
|
97 } |
|
98 |
|
99 inline Matrix GEPBALANCE::left_balancing_matrix (void) const |
|
100 { |
|
101 return left_balancing_mat; |
|
102 } |
|
103 |
|
104 inline Matrix GEPBALANCE::right_balancing_matrix (void) const |
|
105 { |
|
106 return right_balancing_mat; |
|
107 } |
|
108 |
|
109 #endif |
|
110 |
|
111 /* |
|
112 ;;; Local Variables: *** |
|
113 ;;; mode: C++ *** |
|
114 ;;; page-delimiter: "^/\\*" *** |
|
115 ;;; End: *** |
|
116 */ |