| 92 |
|
* Returns the determinant of this matrix. |
| 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]; |
| 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 |