12 template<
typename DataT>
15 if constexpr (std::is_same_v<DataT, float> or std::is_same_v<DataT, double>) {
20 for (
size_t i = 0; i < DataT::size() - 1; i++)
22 msg <<
v[DataT::size() - 1] <<
"]";
32 for (
size_t i = 1; i < fvec::size(); i++) {
33 ok = ok && (
v[i] ==
v[0]);
36 std::stringstream msg;
37 msg << name <<
" SIMD vector is inconsistent, not all of the words are equal each other: ";
39 throw std::logic_error(msg.str());
122 double eta = 1.0E-09;
143 if (nn < (n * (n + 1)) / 2) {
154 for (icol = 1; icol <= n; icol++) {
156 x = eta * eta * a[ii - 1];
162 for (irow = 1; irow <= icol; irow++) {
168 for (i = 1; i < irow; i++) {
170 w = w - u[l - 1] * u[m - 1];
180 if (u[l - 1] != 0.0) {
181 u[k - 1] = w / u[l - 1];
186 if (
fabs(
x * a[k - 1]) < w * w) {
195 if (
fabs(w) <=
fabs(eta * a[k - 1])) {
197 *nullty = *nullty + 1;
212 void SymInv(
const double a[],
const int n,
double c[],
double w[],
int* nullty,
int* ifault)
291 nn = (n * (n + 1)) / 2;
310 if (c[ndiag - 1] == 0.0) {
312 for (j = irow; j <= nrow; j++) {
319 for (i = irow; i <= nrow; i++) {
332 x = 1.0 / w[irow - 1];
341 x =
x - w[k - 1] * c[l - 1];
350 c[l - 1] =
x / w[irow - 1];
355 mdiag = mdiag - icol;
361 ndiag = ndiag - irow;
friend fvec sqrt(const fvec &a)
void SymInv(const double a[], const int n, double c[], double w[], int *nullty, int *ifault)
void CholeskyFactorization(const double a[], const int n, int nn, double u[], int *nullty, int *ifault)
void PrintSIMDmsg(std::stringstream &msg, DataT &v)
Stingstream output operation for simd data.
void CheckSimdVectorEquality(fvec v, const char *name)
Checks, if a SIMD vector horizontally equal TODO: Find this method in the VC!