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