36 #ifndef FUNCTIONCOMMONDATA_H_
37 #define FUNCTIONCOMMONDATA_H_
51 template<
typename T, std::
size_t NDIM>
64 for (
int i = 0; i < 4; ++i)
65 s[i] =
Slice(i * k, (i + 1) * k - 1);
66 s0 = std::vector<Slice>(
NDIM);
67 sh = std::vector<Slice>(
NDIM);
68 vk = std::vector<long>(
NDIM);
69 vq = std::vector<long>(
NDIM);
71 for (std::size_t i = 0; i <
NDIM; ++i) {
73 sh[i] =
Slice(0, (k - 1) / 2);
91 std::vector<Slice>
s0;
92 std::vector<Slice>
sh;
94 std::vector<long>
v2k;
112 MADNESS_ASSERT(k > 0 && k <= MAXK);
122 double>& quad_w, Tensor<double>& quad_phi,
123 Tensor<double>& quad_phiw, Tensor<double>& quad_phit);
133 static const int itotal=-10;
144 map& map2=
const_cast<map&
>(data);
145 bool found=map2.
find(acc, -10);
149 map2.
insert(std::pair<int,double>(-10,time));
154 if (time<0.1) ilog=-1;
155 else if (time<1.0) ilog=0;
156 else if (time<10.0) ilog=1;
157 else if (time<100.0) ilog=2;
160 found=map2.
find(acc, ilog);
164 map2.
insert(std::pair<int,long>(ilog,1));
169 map& map2=
const_cast<map&
>(data);
179 for (
int ilog=-10; ilog<4; ++ilog) {
180 const bool found=data.
find(acc, ilog);
181 if (found)
madness::print(
" time spent in log(10) ", acc->first, acc->second);
Tensor< double > g1T
The separate blocks of twoscale coefficients.
Definition: function_common_data.h:106
Tensor< double > h1
Definition: function_common_data.h:105
Tensor< double > hgT
The full twoscale coeff (2k,2k) and transpose.
Definition: function_common_data.h:107
static void _init_quadrature(int k, int npt, Tensor< double > &quad_x, Tensor< double > &quad_w, Tensor< double > &quad_phi, Tensor< double > &quad_phiw, Tensor< double > &quad_phit)
Initialize the quadrature information.
Definition: mraimpl.h:83
Tensor< double > g0
Definition: function_common_data.h:105
const int NDIM
Definition: tdse1.cc:44
std::vector< long > v2k
(2k,...) used to initialize Tensors
Definition: function_common_data.h:94
void clear()
Definition: worldhashmap.h:556
::std::string string
Definition: gtest-port.h:872
std::vector< long > vq
(npt,...) used to initialize Tensors
Definition: function_common_data.h:95
Tensor< double > g0T
Definition: function_common_data.h:106
Tensor< T > tensorT
Type of tensor used to hold coeff.
Definition: function_common_data.h:86
Provides FunctionDefaults and utilities for coordinate transformation.
Tensor< double > h1T
Definition: function_common_data.h:106
void print(std::string line="") const
print timer
Definition: function_common_data.h:174
int k
order of the wavelet
Definition: function_common_data.h:88
std::vector< long > vk
(k,...) used to initialize Tensors
Definition: function_common_data.h:93
Tensor< double > h0T
Definition: function_common_data.h:106
Tensor< double > quad_x
quadrature points
Definition: function_common_data.h:99
std::vector< Slice > s0
s[0] in each dimension to get scaling coeff
Definition: function_common_data.h:91
Definition: function_common_data.h:127
void accumulate(const double time) const
accumulate timer
Definition: function_common_data.h:141
std::pair< iterator, bool > insert(const datumT &datum)
Definition: worldhashmap.h:469
std::vector< Slice > sh
Slice(0,(k-1)/2) in each dimension for autorefine test.
Definition: function_common_data.h:92
Tensor< double > hgsonly
hg[0:k,:]
Definition: function_common_data.h:108
Tensor< double > g1
The separate blocks of twoscale coefficients.
Definition: function_common_data.h:105
Tensor< double > quad_w
quadrature weights
Definition: function_common_data.h:100
Tensor< double > hg
Definition: function_common_data.h:107
void reset() const
Definition: function_common_data.h:168
Slice s[4]
s[0]=Slice(0,k-1), s[1]=Slice(k,2*k-1), etc.
Definition: function_common_data.h:90
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
FunctionCommonData holds all Function data common for given k.
Definition: function_common_data.h:52
int npt
no. of quadrature points
Definition: function_common_data.h:89
A slice defines a sub-range or patch of a dimension.
Definition: slice.h:103
iterator find(const keyT &key)
Definition: worldhashmap.h:524
Timer()
start timer
Definition: function_common_data.h:137
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
Key< NDIM > key0
Key for root node.
Definition: function_common_data.h:97
Tensor< double > quad_phi
quad_phi(i,j) = at x[i] value of phi[j]
Definition: function_common_data.h:101
Tensor< double > quad_phit
transpose of quad_phi
Definition: function_common_data.h:102
Tensor< double > quad_phiw
quad_phiw(i,j) = at x[i] value of w[i]*phi[j]
Definition: function_common_data.h:103
Key is the index for a node of the 2^NDIM-tree.
Definition: key.h:69
Tensor< double > h0
Definition: function_common_data.h:105