1#ifndef MADNESS_JACOBI_H
2#define MADNESS_JACOBI_H
21 int i, j,
k, iter,
nrot;
22 double tolmin = std::sqrt(n) * 5.0e-16, tol = 0.05;
27 A(i,j) =
A(j,i) = 0.5*(
A(i,j) +
A(j,i));
35 double daii = std::fabs(
A(i,i));
41 double * __restrict__ ai = &A(i,0); \
42 double * __restrict__ aj = &A(j,0); \
43 for (k=0; k<n; k++) { \
53 double * __restrict__ ai = &A(0,i); \
54 double * __restrict__ aj = &A(0,j); \
55 for (k=0; k<n*n; k+=n) { \
63 for (iter=0; iter<5000; iter++) {
67 for (j=i+1; j<n; j++) {
68 if (set[i] != set[j]) {
78 double ds = std::fabs(s);
83 c = s = 1.0/std::sqrt(2.);
87 double u = 0.25/std::sqrt(0.25+t*t);
116 A(j,i) =
A(i,j) = 0.0;
129 tol = std::max(tol,
tolmin);
132 printf(
"Jacobi iteration did not converge in 5000 passes\n");
Definition test_ar.cc:118
A tensor is a multidimensional array.
Definition tensor.h:317
static double u(double r, double c)
Definition he.cc:20
Defines madness::MadnessException for exception handling.
#define MADNESS_CHECK(condition)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition madness_exception.h:182
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
void jacobi(Tensor< double > &A, Tensor< double > &V, const std::vector< int > &set)
Definition jacobi.h:13
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:284
Defines simple templates for printing to std::cout "a la Python".
static const double c
Definition relops.cc:10
static const long k
Definition rk.cc:44
static double V(const coordT &r)
Definition tdse.cc:288
Defines and implements most of Tensor.
void e()
Definition test_sig.cc:75