# | Line 78 | Line 78 | namespace oopse { | |
---|---|---|
78 | return m; | |
79 | } | |
80 | ||
81 | < | /** Retunrs the inversion of this matrix. */ |
81 | > | /** |
82 | > | * Retunrs the inversion of this matrix. |
83 | > | * @todo need implementation |
84 | > | */ |
85 | SquareMatrix<Real, Dim> inverse() { | |
86 | SquareMatrix<Real, Dim> result; | |
87 | ||
88 | return result; | |
89 | } | |
90 | ||
91 | < | /** Returns the determinant of this matrix. */ |
92 | < | double determinant() const { |
93 | < | double det; |
91 | > | /** |
92 | > | * Returns the determinant of this matrix. |
93 | > | * @todo need implementation |
94 | > | */ |
95 | > | Real determinant() const { |
96 | > | Real det; |
97 | return det; | |
98 | } | |
99 | ||
100 | /** Returns the trace of this matrix. */ | |
101 | < | double trace() const { |
102 | < | double tmp = 0; |
101 | > | Real trace() const { |
102 | > | Real tmp = 0; |
103 | ||
104 | for (unsigned int i = 0; i < Dim ; i++) | |
105 | tmp += data_[i][i]; | |
# | Line 142 | Line 148 | namespace oopse { | |
148 | return true; | |
149 | } | |
150 | ||
151 | + | /** @todo need implementation */ |
152 | void diagonalize() { | |
153 | < | jacobi(m, eigenValues, ortMat); |
153 | > | //jacobi(m, eigenValues, ortMat); |
154 | } | |
155 | ||
156 | /** | |
# | Line 158 | Line 165 | namespace oopse { | |
165 | SquareMatrix<Real, Dim> ortMat; | |
166 | ||
167 | if ( !isSymmetric()){ | |
168 | < | throw(); |
168 | > | //throw(); |
169 | } | |
170 | ||
171 | SquareMatrix<Real, Dim> m(*this); | |
# | Line 175 | Line 182 | namespace oopse { | |
182 | * @param w output eigenvalues | |
183 | * @param v output eigenvectors | |
184 | */ | |
185 | < | bool jacobi(const SquareMatrix<Real, Dim>& a, Vector<Real, Dim>& w, |
185 | > | bool jacobi(SquareMatrix<Real, Dim>& a, Vector<Real, Dim>& w, |
186 | SquareMatrix<Real, Dim>& v); | |
187 | };//end SquareMatrix | |
188 | ||
# | Line 184 | Line 191 | template<typename Real, int Dim> | |
191 | #define MAX_ROTATIONS 60 | |
192 | ||
193 | template<typename Real, int Dim> | |
194 | < | bool SquareMatrix<Real, Dim>::jacobi(const SquareMatrix<Real, Dim>& a, Vector<Real, Dim>& w, |
194 | > | bool SquareMatrix<Real, Dim>::jacobi(SquareMatrix<Real, Dim>& a, Vector<Real, Dim>& w, |
195 | SquareMatrix<Real, Dim>& v) { | |
196 | const int N = Dim; | |
197 | int i, j, k, iq, ip; | |
198 | < | double tresh, theta, tau, t, sm, s, h, g, c; |
199 | < | double tmp; |
198 | > | Real tresh, theta, tau, t, sm, s, h, g, c; |
199 | > | Real tmp; |
200 | Vector<Real, Dim> b, z; | |
201 | ||
202 | // initialize | |
# | Line 256 | Line 263 | bool SquareMatrix<Real, Dim>::jacobi(const SquareMatri | |
263 | ||
264 | for (j=iq+1; j<N; j++) | |
265 | ROT(a,ip,j,iq,j); | |
266 | + | |
267 | for (j=0; j<N; j++) | |
268 | ROT(v,j,ip,j,iq); | |
269 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |