80 |
|
|
81 |
|
/** |
82 |
|
* Retunrs the inversion of this matrix. |
83 |
< |
* @todo |
83 |
> |
* @todo need implementation |
84 |
|
*/ |
85 |
|
SquareMatrix<Real, Dim> inverse() { |
86 |
|
SquareMatrix<Real, Dim> result; |
90 |
|
|
91 |
|
/** |
92 |
|
* Returns the determinant of this matrix. |
93 |
< |
* @todo |
93 |
> |
* @todo need implementation |
94 |
|
*/ |
95 |
< |
double determinant() const { |
96 |
< |
double det; |
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]; |
148 |
|
return true; |
149 |
|
} |
150 |
|
|
151 |
< |
/** @todo need implement */ |
151 |
> |
/** @todo need implementation */ |
152 |
|
void diagonalize() { |
153 |
|
//jacobi(m, eigenValues, ortMat); |
154 |
|
} |
165 |
|
SquareMatrix<Real, Dim> ortMat; |
166 |
|
|
167 |
|
if ( !isSymmetric()){ |
168 |
< |
throw(); |
168 |
> |
//throw(); |
169 |
|
} |
170 |
|
|
171 |
|
SquareMatrix<Real, Dim> m(*this); |
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 |
|
|
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 |