21int mneigen(
double *
a,
unsigned int ndima,
unsigned int n,
unsigned int mits,
double *work,
double precis)
26 unsigned int a_dim1, a_offset, i__1, i__2, i__3;
30 double b, c__,
f, h__;
31 unsigned int i__, j, k,
l,
m = 0;
33 unsigned int i0, i1, j1, m1, n1;
34 double hh, gl, pr,
pt;
39 a_offset = 1 + a_dim1 * 1;
48 for (i1 = 2; i1 <= i__1; ++i1) {
50 f =
a[i__ + (i__ - 1) * a_dim1];
58 for (k = 1; k <= i__2; ++k) {
60 r__1 =
a[i__ + k * a_dim1];
66 h__ = gl + r__1 * r__1;
68 if (gl > (
double)1
e-35) {
80 if (
f >= (
double)0.) {
86 a[i__ + (i__ - 1) * a_dim1] =
f - gl;
89 for (j = 1; j <= i__2; ++j) {
90 a[j + i__ * a_dim1] =
a[i__ + j * a_dim1] / h__;
93 for (k = 1; k <= i__3; ++k) {
94 gl +=
a[j + k * a_dim1] *
a[i__ + k * a_dim1];
103 for (k = j1; k <= i__3; ++k) {
104 gl +=
a[k + j * a_dim1] *
a[i__ + k * a_dim1];
107 work[
n + j] = gl / h__;
108 f += gl *
a[j + i__ * a_dim1];
110 hh =
f / (h__ + h__);
112 for (j = 1; j <= i__2; ++j) {
113 f =
a[i__ + j * a_dim1];
114 gl = work[
n + j] - hh *
f;
117 for (k = 1; k <= i__3; ++k) {
118 a[j + k * a_dim1] =
a[j + k * a_dim1] -
f * work[
n + k] - gl *
a[i__ + k * a_dim1];
128 for (i__ = 1; i__ <= i__1; ++i__) {
131 if (work[i__] == (
double)0. ||
l == 0) {
136 for (j = 1; j <= i__3; ++j) {
139 for (k = 1; k <= i__2; ++k) {
140 gl +=
a[i__ + k * a_dim1] *
a[k + j * a_dim1];
143 for (k = 1; k <= i__2; ++k) {
144 a[k + j * a_dim1] -= gl *
a[k + i__ * a_dim1];
148 work[i__] =
a[i__ + i__ * a_dim1];
149 a[i__ + i__ * a_dim1] = (
double)1.;
156 for (j = 1; j <= i__2; ++j) {
157 a[i__ + j * a_dim1] = (
double)0.;
158 a[j + i__ * a_dim1] = (
double)0.;
165 for (i__ = 2; i__ <= i__1; ++i__) {
167 work[i0] = work[i0 + 1];
173 for (
l = 1;
l <= i__1; ++
l) {
175 h__ = precis * ((r__1 = work[
l], std::fabs(r__1)) + (r__2 = work[
n +
l], std::fabs(r__2)));
182 for (m1 =
l; m1 <= i__2; ++m1) {
185 if ((r__1 = work[
n +
m], std::fabs(r__1)) <=
b) {
201 pt = (work[
l + 1] - work[
l]) / (work[
n +
l] * (
double)2.);
202 r__ = std::sqrt(
pt *
pt + (
double)1.);
205 if (
pt < (
double)0.) {
209 h__ = work[
l] - work[
n +
l] / pr;
211 for (i__ =
l; i__ <= i__2; ++i__) {
221 for (i1 =
l; i1 <= i__2; ++i1) {
224 gl = c__ * work[
n + i__];
227 if (std::fabs(
pt) >= (r__1 = work[
n + i__], std::fabs(r__1))) {
231 c__ =
pt / work[
n + i__];
232 r__ = std::sqrt(c__ * c__ + (
double)1.);
233 work[
n + j] = s * work[
n + i__] * r__;
238 c__ = work[
n + i__] /
pt;
239 r__ = std::sqrt(c__ * c__ + (
double)1.);
240 work[
n + j] = s *
pt * r__;
244 pt = c__ * work[i__] - s * gl;
245 work[j] = h__ + s * (c__ * gl + s * work[i__]);
247 for (k = 1; k <= i__3; ++k) {
248 h__ =
a[k + j * a_dim1];
249 a[k + j * a_dim1] = s *
a[k + i__ * a_dim1] + c__ * h__;
250 a[k + i__ * a_dim1] = c__ *
a[k + i__ * a_dim1] - s * h__;
253 work[
n +
l] = s *
pt;
256 if ((r__1 = work[
n +
l], std::fabs(r__1)) >
b) {
264 for (i__ = 1; i__ <= i__1; ++i__) {
269 for (j = i1; j <= i__3; ++j) {
287 for (j = 1; j <= i__3; ++j) {
288 pt =
a[j + i__ * a_dim1];
289 a[j + i__ * a_dim1] =
a[j + k * a_dim1];
290 a[j + k * a_dim1] =
pt;
int mneigen(double *, unsigned int, unsigned int, unsigned int, double *, double)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...