Commit 048fc867 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

format

parent 43bda735
......@@ -37,7 +37,6 @@
#include "process_int.h"
#include "statistic.h"
#ifndef M_2_SQRTPI
#define M_2_SQRTPI 1.12837916709551257390 /* 2/std::sqrt(pi) */
#endif
......@@ -45,7 +44,6 @@
#define M_SQRT2 1.41421356237309504880 /* std::sqrt(2) */
#endif
constexpr double FNORM_PRECISION = 1e-12;
constexpr int MAX_JACOBI_ITER = 12;
......@@ -55,7 +53,6 @@ static int max_jacobi_iter;
static int n_finished;
namespace cdo
{
......@@ -1078,9 +1075,9 @@ annihilate_1side(double **M, long i, long j, long n)
#endif
for (long r = 0; r < n; r++)
{
alpha += Mj[r] * Mj[r];
alpha += Mj[r] * Mj[r];
beta += Mi[r] * Mi[r];
gamma += Mi[r] * Mj[r];
gamma += Mi[r] * Mj[r];
}
// 2011-08-15 Cedrick Ansorge: bug fix
......@@ -1097,11 +1094,11 @@ annihilate_1side(double **M, long i, long j, long n)
return;
}
const auto zeta = (beta - alpha) / (2. * gamma); // tan(2*theta)
const auto zeta = (beta - alpha) / (2. * gamma); // tan(2*theta)
auto tk = 1. / (std::fabs(zeta) + std::sqrt(1. + zeta * zeta));
tk = zeta > 0 ? tk : -tk; // = cot(2*theta)
const auto ck = 1. / std::sqrt(1. + tk * tk); // = cos(theta)
const auto sk = ck * tk; // = sin(theta)
tk = zeta > 0 ? tk : -tk; // = cot(2*theta)
const auto ck = 1. / std::sqrt(1. + tk * tk); // = cos(theta)
const auto sk = ck * tk; // = sin(theta)
// calculate a_i,j - tilde
for (long r = 0; r < n; r++)
......@@ -1273,4 +1270,4 @@ parallel_eigen_solution_of_symmetric_matrix(double **M, double *A, int n, const
return;
}
} // namespace cdo
} // namespace cdo
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment