54 const std::ptrdiff_t
inc = (start < end) ? 1 : -1;
57 const std::size_t NN =
N*
N;
62 std::exception_ptr
error;
69 error = std::current_exception();
81 std::fill_n(y2.
data(),
N, dcomplex(1.));
82 for (std::size_t i = 0; i <
N; i++) {
84 if (
real(y1[i]) < -
SMALL) { y1[i] = -y1[i]; y2[i] = -y2[i]; }
85 if (
imag(y1[i]) >
SMALL) { y1[i] = -y1[i]; y2[i] = -y2[i]; }
88 std::fill_n(
Y.
data(), NN, dcomplex(0.));
89 for (std::size_t i = 0; i <
N; i++)
Y(i,i) = - y2[i] / y1[i];
97 for (std::size_t i = 0; i <
N; i++)
Y(i,i) = y2[i] * y2[i] / (y1[i] -
Y(i,i)) - y1[i];
102 if (start == end)
return;
107 for (std::ptrdiff_t
n = start+
inc;
n != end;
n +=
inc)
123 for (std::size_t j = 0; j <
N; j++)
124 for (std::size_t i = 0; i <
N; i++)
Y(i,j) = y1[i]*
temp(i,j) -
work(i,j);
126 for (std::size_t i = 0; i < NN; i++)
work[i] = 0.;
127 for (std::size_t j = 0, i = 0; j <
N; j++, i +=
N+1)
work[i] = y2[j];
132 for (std::size_t j = 0; j <
N; j++)
133 for (std::size_t i = 0; i <
N; i++)
Y(i,j) *= y2[i];
135 for (std::size_t j = 0, i = 0; j <
N; j++, i +=
N+1)
Y[i] -= y1[j];