| 314 |
|
int JacobiN(double **a, int n, double *w, double **v) { |
| 315 |
|
|
| 316 |
|
int i, j, k, iq, ip, numPos; |
| 317 |
+ |
int ceil_half_n; |
| 318 |
|
double tresh, theta, tau, t, sm, s, h, g, c, tmp; |
| 319 |
|
double bspace[4], zspace[4]; |
| 320 |
|
double *b = bspace; |
| 321 |
|
double *z = zspace; |
| 322 |
+ |
|
| 323 |
|
|
| 324 |
|
// only allocate memory if the matrix is large |
| 325 |
|
if (n > 4) |
| 476 |
|
// are negative of one another (.707,.707,0) and (-.707,-.707,0). This can |
| 477 |
|
// reek havoc in hyperstreamline/other stuff. We will select the most |
| 478 |
|
// positive eigenvector. |
| 479 |
< |
int ceil_half_n = (n >> 1) + (n & 1); |
| 479 |
> |
ceil_half_n = (n >> 1) + (n & 1); |
| 480 |
|
for (j=0; j<n; j++) |
| 481 |
|
{ |
| 482 |
|
for (numPos=0, i=0; i<n; i++) |