33 #ifndef MADNESS_MRA_VMRA_H__INCLUDED
34 #define MADNESS_MRA_VMRA_H__INCLUDED
132 template <
typename T, std::
size_t NDIM>
155 template <
typename T, std::
size_t NDIM>
164 template <
typename T, std::
size_t NDIM>
170 template <
typename T, std::
size_t NDIM>
188 template <
typename T, std::
size_t NDIM>
207 template <
typename T, std::
size_t NDIM>
210 for (
const auto&
f : vf)
f.refine(
false);
217 template <
typename T, std::
size_t NDIM>
223 std::vector<FunctionImpl<T,NDIM>*> v_ptr;
226 for (
unsigned int i=0; i<vf.size(); ++i) {
227 if (vf[i].is_initialized()) v_ptr.push_back(vf[i].
get_impl().get());
231 std::sort(v_ptr.begin(),v_ptr.end());
232 typename std::vector<FunctionImpl<T, NDIM>*>::iterator it;
233 it = std::unique(v_ptr.begin(), v_ptr.end());
236 std::vector< Tensor<T> >
c(v_ptr.size());
237 v_ptr[0]->refine_to_common_level(v_ptr,
c, key0);
238 if (fence) v_ptr[0]->world.gop.fence();
240 for (
unsigned int i=0; i<vf.size(); i++) vf[i].
verify_tree();
244 template <
typename T, std::
size_t NDIM>
259 template <
typename T, std::
size_t NDIM>
276 template <
typename T, std::
size_t NDIM>
279 const bool fence=
true) {
280 if (
v.size()==0)
return v;
283 for (
const auto&
f :
v)
284 if (
f.is_initialized()) {
293 auto change_initial_to_intermediate =[](
const std::vector<Function<T,NDIM>>&
v,
298 if (
f.is_initialized() and
f.get_impl()->get_tree_state()==initialstate) {
299 f.change_tree_state(intermediatestate,
false);
334 template <
typename T, std::
size_t NDIM>
345 for (
unsigned int i=0; i<
v.size(); ++i) {
346 v[i].truncate(tol,
false);
355 template <
typename T, std::
size_t NDIM>
357 double tol=0.0,
bool fence=
true) {
358 if (
v.size()>0)
truncate(
v[0].world(),
v,tol,fence);
365 template <
typename T, std::
size_t NDIM>
367 double thresh=0.0,
bool fence=
true) {
368 if (
v.size()==0)
return v;
369 for (
auto& vv :
v) vv.reduce_rank(
thresh,
false);
370 if (fence)
v[0].world().gop.fence();
376 template <
typename T, std::
size_t NDIM>
377 std::vector< Function<T,NDIM> >
384 std::vector< Function<T,NDIM> > df(
v.size());
385 for (
unsigned int i=0; i<
v.size(); ++i) {
386 df[i] =
D(
v[i],
false);
393 template <
typename T, std::
size_t NDIM>
394 std::vector< Function<T,NDIM> >
397 std::vector< Function<T,NDIM> > r(n);
398 for (
int i=0; i<n; ++i)
407 template <
typename T, std::
size_t NDIM>
408 std::vector< Function<T,NDIM> >
411 std::vector< Function<T,NDIM> > r(n);
412 for (
int i=0; i<n; ++i)
420 template<
typename T, std::
size_t NDIM>
422 if (vf_in.size()==0)
return std::vector<Function<T,NDIM>>();
423 World& world=vf_in.front().world();
424 auto vf=
copy(world,vf_in);
426 if (vf.size()==1)
return copy(world,vf_in);
431 for (
int i=0; i<s.dim(0); ++i)
Q(i,i) += 1.5;
438 for (
int i=0; i<
Q.dim(0); ++i)
439 for (
int j=0; j<i; ++j)
455 template <
typename T, std::
size_t NDIM>
459 if(
v.empty())
return v;
466 for(
size_t i=0;i<
v.size();++i) s(i)=1.0/(sqrt(s(i)));
470 for(
size_t i=0;i<
v.size();++i){
471 for(
size_t j=0;j<
v.size();++j){
478 World& world=
v.front().world();
485 template <
typename T, std::
size_t NDIM>
487 if(
v.empty())
return v;
490 World& world=
v.front().world();
500 template <
typename T, std::
size_t NDIM>
506 if(
v.empty())
return v;
511 lindep*=s(s.size()-1);
516 for(
size_t i=0;i<
v.size();++i) {
518 sqrts(i)=1.0/(sqrt(s(i)));
527 for(
size_t i=0;i<
v.size();++i){
528 for(
size_t j=0;j<
v.size();++j){
529 U(i,j)=U(i,j)*(sqrts(j));
534 World& world=
v.front().world();
542 template <
typename T, std::
size_t NDIM>
544 const double lindep){
545 if(
v.empty())
return v;
547 World& world=
v.front().world();
556 template <
typename T, std::
size_t NDIM>
561 if (
v.empty())
return v;
569 World& world=
v.front().world();
577 template <
typename T, std::
size_t NDIM>
579 if(
v.empty())
return v;
581 World& world=
v.front().world();
593 template <
typename T, std::
size_t NDIM>
608 std::vector<Function<T,NDIM> > pv(rank);
618 World& world=
v.front().world();
626 template <
typename T, std::
size_t NDIM>
636 template <
typename T, std::
size_t NDIM>
642 World& world=
v.front().world();
648 template <
typename T, std::
size_t NDIM>
650 std::vector<Function<T,NDIM> >
v=lhs;
651 for (std::size_t i = 0; i < rhs.size(); ++i)
v.push_back(rhs[i]);
655 template <
typename T, std::
size_t NDIM>
657 std::vector<Function<T,NDIM> >result;
658 for(
const auto& x:vv) result=
append(result,x);
662 template<
typename T, std::
size_t NDIM>
664 std::vector<std::shared_ptr<FunctionImpl<T,NDIM>>> result;
665 for (
auto&
f :
v) result.push_back(
f.get_impl());
669 template<
typename T, std::
size_t NDIM>
672 for (std::size_t i=0; i<vimpl.size(); ++i)
v[i].
set_impl(vimpl[i]);
675 template<
typename T, std::
size_t NDIM>
677 std::vector<Function<T,NDIM>>
v(vimpl.size());
678 for (std::size_t i=0; i<vimpl.size(); ++i)
v[i].
set_impl(vimpl[i]);
687 template <
typename T,
typename R, std::
size_t NDIM>
700 std::vector< Function<resultT,NDIM> > vc = zero_functions_compressed<resultT,NDIM>(world,
m);
703 for (
int i=0; i<
m; ++i) {
704 for (
int j=0; j<n; ++j) {
705 if (
c(j,i) !=
R(0.0)) vc[i].gaxpy(resultT(1.0),
v[j],resultT(
c(j,i)),
false);
716 template <
typename T,
typename R, std::
size_t NDIM>
732 vv.get_impl()->get_tree_state()==
reconstructed,
"trees have to be reconstructed in transform_reconstructed");
734 std::vector< Function<resultT,NDIM> > result = zero_functions<resultT,NDIM>(world,
m);
736 for (
int i=0; i<
m; ++i) {
738 for (
int j=0; j<n; ++j) {
739 if (
c(j,i) !=
R(0.0))
v[j].get_impl()->accumulate_trees(*(result[i].
get_impl()),resultT(
c(j,i)),
true);
747 for (
auto& r : result) r.get_impl()->finalize_sum();
755 template <
typename L,
typename R, std::
size_t NDIM>
763 = zero_functions_compressed<TENSOR_RESULT_TYPE(L,R),NDIM>(world,
c.dim(1));
766 vresult[0].vtransform(
v,
c, vresult, tol, fence);
770 template <
typename T,
typename R, std::
size_t NDIM>
786 c.copy_to_replicated(tmp);
789 std::vector< Function<resultT,NDIM> > vc = zero_functions_compressed<resultT,NDIM>(world,
m);
792 for (
int i=0; i<
m; ++i) {
793 for (
int j=0; j<n; ++j) {
794 if (tmp(j,i) !=
R(0.0)) vc[i].gaxpy(1.0,
v[j],tmp(j,i),
false);
804 template <
typename T,
typename Q, std::
size_t NDIM>
807 const std::vector<Q>& factors,
810 for (
unsigned int i=0; i<
v.size(); ++i)
v[i].
scale(factors[i],
false);
815 template <
typename T,
typename Q, std::
size_t NDIM>
821 for (
unsigned int i=0; i<
v.size(); ++i)
v[i].
scale(factor,
false);
826 template <
typename T, std::
size_t NDIM>
830 std::vector<double> norms(
v.size());
831 for (
unsigned int i=0; i<
v.size(); ++i) norms[i] =
v[i].norm2sq_local();
832 world.
gop.
sum(&norms[0], norms.size());
833 for (
unsigned int i=0; i<
v.size(); ++i) norms[i] = sqrt(norms[i]);
838 template <
typename T, std::
size_t NDIM>
842 for (
unsigned int i = 0; i <
v.size(); ++i) norms[i] =
v[i].norm2sq_local();
844 for (
unsigned int i = 0; i <
v.size(); ++i) norms[i] = sqrt(norms[i]);
850 template <
typename T, std::
size_t NDIM>
853 if (
v.size()==0)
return 0.0;
854 std::vector<double> norms(
v.size());
855 for (
unsigned int i=0; i<
v.size(); ++i) norms[i] =
v[i].norm2sq_local();
856 world.
gop.
sum(&norms[0], norms.size());
857 for (
unsigned int i=1; i<
v.size(); ++i) norms[0] += norms[i];
859 return sqrt(norms[0]);
905 template <
typename T, std::
size_t NDIM>
913 const int64_t n =
A.coldim();
914 const int64_t
m =
A.rowdim();
918 const int ichunk = 1000;
919 const int jchunk = 1000;
920 for (int64_t ilo=0; ilo<n; ilo+=ichunk) {
921 int64_t ihi = std::min(ilo + ichunk, n);
922 std::vector< Function<T,NDIM> > ivec(
f.begin()+ilo,
f.begin()+ihi);
923 for (int64_t jlo=0; jlo<
m; jlo+=jchunk) {
924 int64_t jhi = std::min(jlo + jchunk,
m);
925 std::vector< Function<T,NDIM> > jvec(
g.begin()+jlo,
g.begin()+jhi);
928 A.copy_from_replicated_patch(ilo, ihi-1, jlo, jhi-1,
P);
939 template <
typename T,
typename R, std::
size_t NDIM>
951 std::vector<const FunctionImpl<T,NDIM>*> left(
f.size());
952 std::vector<const FunctionImpl<R,NDIM>*> right(
g.size());
953 for (
unsigned int i=0; i<
f.size(); i++) left[i] =
f[i].
get_impl().get();
954 for (
unsigned int i=0; i<
g.size(); i++) right[i]=
g[i].
get_impl().get();
969 template <
typename T,
typename R, std::
size_t NDIM>
975 long n=
f.size(),
m=
g.size();
981 if ((
void*)(&
f) != (
void*)(&
g))
compress(world,
g);
983 for (
long i=0; i<n; ++i) {
986 for (
long j=0; j<jtop; ++j) {
987 r(i,j) =
f[i].inner_local(
g[j]);
988 if (sym) r(j,i) =
conj(r(i,j));
1011 template <
typename T,
typename R, std::
size_t NDIM>
1016 long n=
f.size(),
m=
g.size();
1023 for (
long i=0; i<n; ++i) {
1024 r(i) =
f[i].inner_local(
g[i]);
1035 template <
typename T,
typename R, std::
size_t NDIM>
1046 for (
long i=0; i<n; ++i) {
1047 r(i) =
f.inner_local(
g[i]);
1058 template <
typename T,
typename R, std::
size_t NDIM>
1062 if(
f.empty())
return 0.0;
1063 else return inner(
f[0].world(),
f,
g).sum();
1068 template <
typename T,
typename R, std::
size_t NDIM>
1075 a.reconstruct(
false);
1082 template <
typename T,
typename R, std::
size_t NDIM>
1090 a.reconstruct(
false);
1093 for (
unsigned int i=0; i<
v.size(); ++i) {
1094 v[i].norm_tree(
false);
1113 template <
typename T,
typename R, std::
size_t NDIM>
1120 bool symm =
false) {
1122 bool same=(&
f == &
g);
1126 for (
auto& ff :
f) ff.norm_tree(
false);
1127 if (not same)
for (
auto& gg :
g) gg.norm_tree(
false);
1130 std::vector<std::vector<Function<R,NDIM> > >result(
f.size());
1131 std::vector<Function<R,NDIM>> g_i;
1132 for (int64_t i=
f.size()-1; i>=0; --i) {
1134 result[i]=
vmulXX(
f[i],
g, tol,
false);
1136 if (g_i.empty()) g_i =
g;
1138 result[i]=
vmulXX(
f[i], g_i, tol,
false);
1146 template <
typename T, std::
size_t NDIM>
1152 for (
unsigned int i=0; i<
v.size(); ++i) {
1153 v[i].norm_tree(
false);
1159 template <
typename T,
typename R, std::
size_t NDIM>
1171 for (
unsigned int i=0; i<
a.size(); ++i) {
1172 q[i] =
mul(
a[i],
b[i],
false);
1185 template<
typename T, std::
size_t NDIM, std::
size_t LDIM>
1190 std::vector<Function<T,NDIM> > result(
g.size());
1191 for (
auto& r : result) r.set_impl(
f,
false);
1199 for (std::size_t i=0; i<result.size(); ++i) {
1201 result[i].get_impl()->multiply(fimpl,gimpl,
particle);
1206 for (
auto& ig :
g) ig.get_impl()->undo_redundant(
false);
1211 template<
typename T, std::
size_t NDIM, std::
size_t LDIM>
1213 const std::tuple<int,int,int>
v) {
1214 return partial_mul<T,NDIM,LDIM>(
f,
g,std::array<int,3>({std::get<0>(
v),std::get<1>(
v),std::get<2>(
v)}));
1219 template <
typename T, std::
size_t NDIM>
1220 std::vector< Function<T,NDIM> >
1224 return mul<T,T,NDIM>(world,
v,
v, fence);
1235 template <
typename T, std::
size_t NDIM>
1236 std::vector< Function<typename Tensor<T>::scalar_type,
NDIM> >
1242 std::vector<Function<scalartype,NDIM> > result(
v.size());
1243 for (
size_t i=0; i<
v.size(); ++i) result[i]=
abs_square(
v[i],
false);
1250 template <
typename T, std::
size_t NDIM>
1252 for (
unsigned int j=0; j<
v.size(); ++j) {
1253 v[j].set_thresh(
thresh,
false);
1259 template <
typename T, std::
size_t NDIM>
1260 std::vector< Function<T,NDIM> >
1265 std::vector< Function<T,NDIM> > r =
copy(world,
v);
1266 for (
unsigned int i=0; i<
v.size(); ++i) {
1274 template <
typename T,
typename R, std::
size_t NDIM>
1278 std::vector< Function<R,NDIM> > r(
v.size());
1279 for (
unsigned int i=0; i<
v.size(); ++i) {
1280 r[i] = convert<T,R,NDIM>(
v[i],
false);
1288 template <
typename T, std::
size_t NDIM>
1289 std::vector< Function<T,NDIM> >
1294 std::vector< Function<T,NDIM> > r(
v.size());
1295 for (
unsigned int i=0; i<
v.size(); ++i) {
1296 r[i] =
copy(
v[i],
false);
1304 template <
typename T, std::
size_t NDIM>
1305 std::vector< Function<T,NDIM> >
1308 std::vector< Function<T,NDIM> > r(
v.size());
1309 if (
v.size()>0) r=
copy(
v.front().world(),
v,fence);
1314 template <
typename T, std::
size_t NDIM>
1315 std::vector< Function<T,NDIM> >
1318 const unsigned int n,
1321 std::vector< Function<T,NDIM> > r(n);
1322 for (
unsigned int i=0; i<n; ++i) {
1323 r[i] =
copy(
v,
false);
1338 template <
typename T, std::
size_t NDIM>
1342 bool fence =
true) {
1344 std::vector<Function<T, NDIM>> r(
v.size());
1345 for (
unsigned int i = 0; i <
v.size(); ++i) {
1346 r[i] =
copy(
v[i], pmap,
false);
1353 template <
typename T,
typename R, std::
size_t NDIM>
1365 for (
unsigned int i=0; i<
a.size(); ++i) {
1366 r[i] =
add(
a[i],
b[i],
false);
1373 template <
typename T,
typename R, std::
size_t NDIM>
1384 for (
unsigned int i=0; i<
b.size(); ++i) {
1385 r[i] =
add(
a,
b[i],
false);
1390 template <
typename T,
typename R, std::
size_t NDIM>
1396 return add(world,
a,
b, fence);
1400 template <
typename T,
typename R, std::
size_t NDIM>
1412 for (
unsigned int i=0; i<
a.size(); ++i) {
1413 r[i] =
sub(
a[i],
b[i],
false);
1420 template <
typename T, std::
size_t NDIM>
1427 for (
unsigned int i=0; i<
f.size(); ++i) r.
gaxpy(1.0,
f[i],1.0,
false);
1434 template <
typename T,
typename R, std::
size_t NDIM>
1441 return sum(world,
mul(world,
a,
b,
true),fence);
1446 template <
typename T,
typename Q,
typename R, std::
size_t NDIM>
1456 if (
a.size()==0)
return std::vector<Function<resultT,NDIM> >();
1458 World& world=
a[0].world();
1461 std::vector<Function<resultT,NDIM> > result(
a.size());
1462 for (
unsigned int i=0; i<
a.size(); ++i) {
1465 if (fence) world.gop.fence();
1471 template <
typename T,
typename Q,
typename R, std::
size_t NDIM>
1480 if (
a.size()==0)
return std::vector<Function<resultT,NDIM> >();
1482 World& world=
a[0].world();
1485 std::vector<Function<resultT,NDIM> > result(
a.size());
1486 for (
unsigned int i=0; i<
a.size(); ++i) {
1489 if (fence) world.gop.fence();
1495 template <
typename T,
typename Q,
typename R, std::
size_t NDIM>
1497 if (
a.size() == 0)
return;
1498 World& world=
a.front().world();
1503 template <
typename T,
typename Q,
typename R, std::
size_t NDIM>
1517 for (
const auto& bb :
b)
MADNESS_CHECK_THROW(bb.is_compressed(),
"vector-gaxpy requires compressed functions");
1519 for (
unsigned int i=0; i<
a.size(); ++i) {
1527 template <
typename opT,
typename R, std::
size_t NDIM>
1530 const std::vector< std::shared_ptr<opT> >&
op,
1536 std::vector< Function<R,NDIM> >&
ncf = *
const_cast< std::vector< Function<R,NDIM>
>* >(&
f);
1542 for (
unsigned int i=0; i<
f.size(); ++i) {
1558 template <
typename T,
typename R, std::
size_t NDIM, std::
size_t KDIM>
1567 template <
typename T,
typename R, std::
size_t NDIM, std::
size_t KDIM>
1574 std::vector< Function<R,NDIM> >&
ncf = *
const_cast< std::vector< Function<R,NDIM>
>* >(&
f);
1581 if (
print_timings) printf(
"timer: %20.20s %8.2fs\n",
"make_nonstandard", wall1-wall0);
1584 for (
unsigned int i=0; i<
f.size(); ++i) {
1591 if (
op.destructive()) {
1592 for (
auto& ff :
ncf) ff.clear(
false);
1600 for (
auto& r : result) r.get_impl()->finalize_apply();
1604 for (
auto& r : result) r.get_impl()->print_timer();
1613 template <
typename T, std::
size_t NDIM>
1616 std::vector<double> nn =
norm2s(world,
v);
1617 for (
unsigned int i=0; i<
v.size(); ++i)
v[i].
scale(1.0/nn[i],
false);
1621 template <
typename T, std::
size_t NDIM>
1624 if(world.
rank()==0) std::cout <<
"print_size: " << msg <<
" is empty" << std::endl;
1625 }
else if(
v.size()==1){
1626 v.front().print_size(msg);
1635 template <
typename T, std::
size_t NDIM>
1638 if (
v.empty())
return 0.0;
1640 const double d=
sizeof(
T);
1641 const double fac=1024*1024*1024;
1644 for(
unsigned int i=0;i<
v.size();i++){
1645 if (
v[i].is_initialized()) size+=
v[i].size();
1653 template <
typename T, std::
size_t NDIM>
1655 const double d=
sizeof(
T);
1656 const double fac=1024*1024*1024;
1657 double size=
f.size();
1666 template <
typename T,
typename opT, std::
size_t NDIM>
1669 const bool fence=
true) {
1672 World& world=vin[0].world();
1675 std::vector<Function<T,NDIM> > vout=zero_functions<T,NDIM>(world,
op.get_result_size());
1676 for (
auto& out : vout) out.set_impl(vin[0],
false);
1687 template <
typename T, std::
size_t NDIM>
1695 template <
typename T, std::
size_t NDIM>
1703 template <
typename T, std::
size_t NDIM>
1711 template <
typename T, std::
size_t NDIM>
1719 template <
typename T, std::
size_t NDIM>
1727 template <
typename T, std::
size_t NDIM>
1735 template <
typename T,
typename R, std::
size_t NDIM>
1739 std::vector<Function<T,NDIM> > tmp=
copy(rhs[0].world(),rhs);
1746 template <
typename T,
typename R, std::
size_t NDIM>
1758 template <
typename T,
typename R, std::
size_t NDIM>
1761 if (
v.size()>0)
return mul(
v[0].world(),
a,
v,
true);
1767 template <
typename T,
typename R, std::
size_t NDIM>
1770 if (
v.size()>0)
return mul(
v[0].world(),
a,
v,
true);
1775 template <
typename T, std::
size_t NDIM>
1778 if (lhs.size() > 0)
gaxpy(lhs.front().world(), 1.0, lhs, 1.0, rhs);
1782 template <
typename T, std::
size_t NDIM>
1786 if (lhs.size() > 0)
gaxpy(lhs.front().world(), 1.0, lhs, -1.0, rhs);
1791 template <
typename T, std::
size_t NDIM>
1792 std::vector<Function<typename Tensor<T>::scalar_type,
NDIM> >
1794 std::vector<Function<typename Tensor<T>::scalar_type,
NDIM> > result(
v.size());
1795 for (std::size_t i=0; i<
v.size(); ++i) result[i]=
real(
v[i],
false);
1796 if (fence and result.size()>0) result[0].world().gop.fence();
1801 template <
typename T, std::
size_t NDIM>
1802 std::vector<Function<typename Tensor<T>::scalar_type,
NDIM> >
1804 std::vector<Function<typename Tensor<T>::scalar_type,
NDIM> > result(
v.size());
1805 for (std::size_t i=0; i<
v.size(); ++i) result[i]=
imag(
v[i],
false);
1806 if (fence and result.size()>0) result[0].world().gop.fence();
1817 template <
typename T, std::
size_t NDIM>
1819 bool refine=
false,
bool fence=
true) {
1825 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1826 gradient_operator<T,NDIM>(world);
1828 std::vector<Function<T,NDIM> > result(
NDIM);
1829 for (
size_t i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1835 template <
typename T, std::
size_t NDIM>
1837 bool refine=
false,
bool fence=
true) {
1843 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1844 gradient_operator<T,NDIM>(world);
1847 for (
unsigned int i=0; i<
NDIM; ++i) (*
grad[i]).set_ble1();
1849 std::vector<Function<T,NDIM> > result(
NDIM);
1850 for (
unsigned int i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1856 template <
typename T, std::
size_t NDIM>
1858 bool refine=
false,
bool fence=
true) {
1864 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1865 gradient_operator<T,NDIM>(world);
1868 for (
unsigned int i=0; i<
NDIM; ++i) (*
grad[i]).set_ble2();
1870 std::vector<Function<T,NDIM> > result(
NDIM);
1871 for (
unsigned int i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1877 template <
typename T, std::
size_t NDIM>
1879 bool refine=
false,
bool fence=
true) {
1885 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1886 gradient_operator<T,NDIM>(world);
1889 for (
unsigned int i=0; i<
NDIM; ++i) (*
grad[i]).set_bspline1();
1891 std::vector<Function<T,NDIM> > result(
NDIM);
1892 for (
unsigned int i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1898 template <
typename T, std::
size_t NDIM>
1900 bool refine=
false,
bool fence=
true) {
1906 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1907 gradient_operator<T,NDIM>(world);
1910 for (
unsigned int i=0; i<
NDIM; ++i) (*
grad[i]).set_bspline2();
1912 std::vector<Function<T,NDIM> > result(
NDIM);
1913 for (
unsigned int i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1919 template <
typename T, std::
size_t NDIM>
1921 bool refine=
false,
bool fence=
true) {
1927 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1928 gradient_operator<T,NDIM>(world);
1931 for (
unsigned int i=0; i<
NDIM; ++i) (*
grad[i]).set_bspline3();
1933 std::vector<Function<T,NDIM> > result(
NDIM);
1934 for (
unsigned int i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
f,
false);
1949 template <
typename T, std::
size_t NDIM>
1951 bool do_refine=
false,
bool fence=
true) {
1954 World& world=
v[0].world();
1956 if (do_refine)
refine(world,
v);
1958 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1959 gradient_operator<T,NDIM>(world);
1961 std::vector<Function<T,NDIM> > result(
NDIM);
1962 for (
size_t i=0; i<
NDIM; ++i) result[i]=
apply(*(
grad[i]),
v[i],
false);
1964 return sum(world,result,fence);
1975 template <
typename T, std::
size_t NDIM>
1977 bool do_refine=
false,
bool fence=
true) {
1980 World& world=
v[0].world();
1982 if (do_refine)
refine(world,
v);
1984 std::vector< std::shared_ptr< Derivative<T,NDIM> > >
grad=
1985 gradient_operator<T,NDIM>(world);
1987 std::vector<Function<T,NDIM> >
d(
NDIM),dd(
NDIM);
1996 d[0].gaxpy(1.0,dd[0],-1.0,
false);
1997 d[1].gaxpy(1.0,dd[1],-1.0,
false);
1998 d[2].gaxpy(1.0,dd[2],-1.0,
false);
2012 template <
typename T,
typename R, std::
size_t NDIM>
2015 bool do_refine=
false,
bool fence=
true) {
2019 World& world=
f[0].world();
2025 d[0]=
mul(
f[1],
g[2],
false);
2026 d[1]=
mul(
f[2],
g[0],
false);
2027 d[2]=
mul(
f[0],
g[1],
false);
2029 dd[0]=
mul(
f[2],
g[1],
false);
2030 dd[1]=
mul(
f[0],
g[2],
false);
2031 dd[2]=
mul(
f[1],
g[0],
false);
2037 d[0].gaxpy(1.0,dd[0],-1.0,
false);
2038 d[1].gaxpy(1.0,dd[1],-1.0,
false);
2039 d[2].gaxpy(1.0,dd[2],-1.0,
false);
2047 template<
typename T,
size_t NDIM>
2049 const std::string
name) {
2050 if (world.
rank()==0)
print(
"loading vector of functions",
name);
2052 std::size_t fsize=0;
2055 for (std::size_t i=0; i<fsize; ++i) ar &
f[i];
2059 template<
typename T,
size_t NDIM>
2062 World& world=
f.front().world();
2063 if (world.
rank()==0)
print(
"saving vector of functions",
name);
2065 std::size_t fsize=
f.size();
2067 for (std::size_t i=0; i<fsize; ++i) ar &
f[i];
double q(double t)
Definition: DKops.h:18
real_convolution_3d A(World &world)
Definition: DKops.h:230
Definition: test_ar.cc:118
long size() const
Returns the number of elements in the tensor.
Definition: basetensor.h:138
Implements derivatives operators with variety of boundary conditions on simulation domain.
Definition: derivative.h:266
Definition: distributed_matrix.h:68
Manages data associated with a row/column/block distributed array.
Definition: distributed_matrix.h:388
FunctionFactory implements the named-parameter idiom for Function.
Definition: function_factory.h:86
FunctionFactory & compressed(bool value=true)
Definition: function_factory.h:168
FunctionImpl holds all Function state to facilitate shallow copy semantics.
Definition: funcimpl.h:941
void undo_redundant(const bool fence)
convert this from redundant to standard reconstructed form
Definition: mraimpl.h:1560
static Tensor< TENSOR_RESULT_TYPE(T, R) > inner_local(const std::vector< const FunctionImpl< T, NDIM > * > &left, const std::vector< const FunctionImpl< R, NDIM > * > &right, bool sym)
Definition: funcimpl.h:5722
void change_tree_state(const TreeState finalstate, bool fence=true)
change the tree state of this function, might or might not respect fence!
Definition: mraimpl.h:1386
A multiresolution adaptive numerical function.
Definition: mra.h:122
World & world() const
Returns the world.
Definition: mra.h:648
void set_impl(const std::shared_ptr< FunctionImpl< T, NDIM > > &impl)
Replace current FunctionImpl with provided new one.
Definition: mra.h:621
void multi_to_multi_op_values(const opT &op, const std::vector< Function< T, NDIM > > &vin, std::vector< Function< T, NDIM > > &vout, const bool fence=true)
apply op on the input vector yielding an output vector of functions
Definition: mra.h:1521
bool is_initialized() const
Returns true if the function is initialized.
Definition: mra.h:147
Function< T, NDIM > & gaxpy(const T &alpha, const Function< Q, NDIM > &other, const R &beta, bool fence=true)
Inplace, general bi-linear operation in wavelet basis. No communication except for optional fence.
Definition: mra.h:981
Key is the index for a node of the 2^NDIM-tree.
Definition: key.h:66
Convolutions in separated form (including Gaussian)
Definition: operator.h:136
A slice defines a sub-range or patch of a dimension.
Definition: slice.h:103
A tensor is a multidimension array.
Definition: tensor.h:317
T * ptr()
Returns a pointer to the internal data.
Definition: tensor.h:1824
TensorTypeData< T >::scalar_type scalar_type
C++ typename of the real type associated with a complex type.
Definition: tensor.h:409
Interface to be provided by any process map.
Definition: worlddc.h:82
void fence(bool debug=false)
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition: worldgop.cc:161
void sum(T *buf, size_t nelem)
Inplace global sum while still processing AM & tasks.
Definition: worldgop.h:870
void fence()
Returns after all local tasks have completed.
Definition: world_task_queue.h:1384
A parallel world class.
Definition: world.h:132
WorldTaskQueue & taskq
Task queue.
Definition: world.h:204
ProcessID rank() const
Returns the process rank in this World (same as MPI_Comm_rank()).
Definition: world.h:318
WorldGopInterface & gop
Global operations.
Definition: world.h:205
An archive for storing local or parallel data wrapping a BinaryFstreamOutputArchive.
Definition: parallel_archive.h:321
int integer
Definition: crayio.c:25
static const double R
Definition: csqrt.cc:46
Declaration and initialization of tree traversal functions and generic derivative.
static double lo
Definition: dirac-hatom.cc:23
const double m
Definition: gfit.cc:199
auto T(World &world, response_space &f) -> response_space
Definition: global_functions.cc:34
const double beta
Definition: gygi_soltion.cc:62
static const double v
Definition: hatom_sf_dirac.cc:20
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
#define max(a, b)
Definition: lda.h:51
#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:190
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition: madness_exception.h:134
#define MADNESS_CHECK_THROW(condition, msg)
Check a condition — even in a release build the condition is always evaluated so it can have side eff...
Definition: madness_exception.h:210
Main include file for MADNESS and defines Function interface.
static const bool VERIFY_TREE
Definition: mra.h:57
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
void save_function(const std::vector< Function< T, NDIM > > &f, const std::string name)
save a vector of functions
Definition: vmra.h:2060
std::vector< Function< T, NDIM > > grad_bpsline_two(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
Definition: vmra.h:1899
Function< TENSOR_RESULT_TYPE(L, R), NDIM > sub(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator- but with optional fence and no automatic compression.
Definition: mra.h:1971
std::vector< CCPairFunction< T, NDIM > > operator+(const std::vector< CCPairFunction< T, NDIM >> c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition: ccpairfunction.h:1047
void rr_cholesky(Tensor< T > &A, typename Tensor< T >::scalar_type tol, Tensor< integer > &piv, int &rank)
Compute the rank-revealing Cholesky factorization.
Definition: lapack.cc:1203
void make_redundant(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
change tree_state of a vector of functions to redundant
Definition: vmra.h:189
Function< TENSOR_RESULT_TYPE(T, R), NDIM > dot(World &world, const std::vector< Function< T, NDIM > > &a, const std::vector< Function< R, NDIM > > &b, bool fence=true)
Multiplies and sums two vectors of functions r = \sum_i a[i] * b[i].
Definition: vmra.h:1436
std::vector< Function< T, NDIM > > orthonormalize_canonical(const std::vector< Function< T, NDIM > > &v, const Tensor< T > &ovlp, double lindep)
Definition: vmra.h:501
std::vector< Function< T, NDIM > > append(const std::vector< Function< T, NDIM > > &lhs, const std::vector< Function< T, NDIM > > &rhs)
combine two vectors
Definition: vmra.h:649
std::vector< Function< T, NDIM > > orthonormalize_rrcd(const std::vector< Function< T, NDIM > > &v, Tensor< T > &ovlp, const double tol, Tensor< integer > &piv, int &rank)
Definition: vmra.h:594
Function< TENSOR_RESULT_TYPE(L, R), NDIM > add(const Function< L, NDIM > &left, const Function< R, NDIM > &right, bool fence=true)
Same as operator+ but with optional fence and no automatic compression.
Definition: mra.h:1927
Function< TENSOR_RESULT_TYPE(Q, T), NDIM > mul(const Q alpha, const Function< T, NDIM > &f, bool fence=true)
Returns new function equal to alpha*f(x) with optional fence.
Definition: mra.h:1701
Function< T, NDIM > div(const std::vector< Function< T, NDIM > > &v, bool do_refine=false, bool fence=true)
shorthand div operator
Definition: vmra.h:1950
void set_impl(std::vector< Function< T, NDIM >> &v, const std::vector< std::shared_ptr< FunctionImpl< T, NDIM >>> vimpl)
Definition: vmra.h:670
response_space scale(response_space a, double b)
std::vector< CCPairFunction< T, NDIM > > operator-(const std::vector< CCPairFunction< T, NDIM >> c1, const std::vector< CCPairFunction< T, NDIM > > &c2)
Definition: ccpairfunction.h:1055
Function< T, NDIM > conj(const Function< T, NDIM > &f, bool fence=true)
Return the complex conjugate of the input function with the same distribution and optional fence.
Definition: mra.h:2046
response_space apply(World &world, std::vector< std::vector< std::shared_ptr< real_convolution_3d >>> &op, response_space &f)
Definition: basic_operators.cc:39
Function< double, NDIM > abssq(const Function< double_complex, NDIM > &z, bool fence=true)
Returns a new function that is the square of the absolute value of the input.
Definition: mra.h:2713
Function< typename TensorTypeData< Q >::scalar_type, NDIM > abs_square(const Function< Q, NDIM > &func)
Definition: complexfun.h:121
std::vector< Function< T, NDIM > > grad_bspline_three(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
Definition: vmra.h:1920
std::vector< Function< T, NDIM > > orthonormalize_symmetric(const std::vector< Function< T, NDIM > > &v, const Tensor< T > &ovlp)
symmetric orthonormalization (see e.g. Szabo/Ostlund)
Definition: vmra.h:456
std::vector< Function< T, NDIM > > orthonormalize(const std::vector< Function< T, NDIM > > &vf_in)
orthonormalize the vectors
Definition: vmra.h:421
std::vector< Function< T, NDIM > > grad_ble_two(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
Definition: vmra.h:1857
void truncate(World &world, response_space &v, double tol, bool fence)
Definition: basic_operators.cc:30
Function< T, NDIM > multiply(const Function< T, NDIM > f, const Function< T, LDIM > g, const int particle, const bool fence=true)
multiply a high-dimensional function with a low-dimensional function
Definition: mra.h:2372
void norm_tree(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
Makes the norm tree for all functions in a vector.
Definition: vmra.h:1147
tensorT Q2(const tensorT &s)
Given overlap matrix, return rotation with 2nd order error to orthonormalize the vectors.
Definition: SCF.cc:135
const std::vector< Function< T, NDIM > > & change_tree_state(const std::vector< Function< T, NDIM >> &v, const TreeState finalstate, const bool fence=true)
change tree state of the functions
Definition: vmra.h:277
TreeState
Definition: funcdefaults.h:58
@ nonstandard_after_apply
s and d coeffs, state after operator application
Definition: funcdefaults.h:63
@ redundant_after_merge
s coeffs everywhere, must be summed up to yield the result
Definition: funcdefaults.h:65
@ reconstructed
s coeffs at the leaves only
Definition: funcdefaults.h:59
@ nonstandard
s and d coeffs in internal nodes
Definition: funcdefaults.h:61
@ compressed
d coeffs in internal nodes, s and d coeffs at the root
Definition: funcdefaults.h:60
@ redundant
s coeffs everywhere
Definition: funcdefaults.h:64
@ nonstandard_with_leaves
like nonstandard, with s coeffs at the leaves
Definition: funcdefaults.h:62
void cholesky(Tensor< T > &A)
Compute the Cholesky factorization.
Definition: lapack.cc:1174
std::vector< Function< T, NDIM > > zero_functions(World &world, int n, bool fence=true)
Generates a vector of zero functions (reconstructed)
Definition: vmra.h:395
void standard(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Generates standard form of a vector of functions.
Definition: vmra.h:260
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence.
Definition: mra.h:2002
void compress(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
Compress a vector of functions.
Definition: vmra.h:133
Function< Q, NDIM > convert(const Function< T, NDIM > &f, bool fence=true)
Type conversion implies a deep copy. No communication except for optional fence.
Definition: mra.h:2032
response_space transpose(response_space &f)
Definition: basic_operators.cc:10
Function< T, NDIM > square(const Function< T, NDIM > &f, bool fence=true)
Create a new function that is the square of f - global comm only if not reconstructed.
Definition: mra.h:2681
std::vector< std::shared_ptr< FunctionImpl< T, NDIM > > > get_impl(const std::vector< Function< T, NDIM >> &v)
Definition: vmra.h:663
void set_thresh(World &world, std::vector< Function< T, NDIM > > &v, double thresh, bool fence=true)
Sets the threshold in a vector of functions.
Definition: vmra.h:1251
double norm2(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norm of a vector of functions.
Definition: vmra.h:851
static void verify_tree(World &world, const std::vector< Function< T, NDIM > > &v)
Definition: SCF.cc:72
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform_reconstructed(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition: vmra.h:718
std::vector< Function< T, NDIM > > zero_functions_compressed(World &world, int n, bool fence=true)
Generates a vector of zero functions (compressed)
Definition: vmra.h:409
static const Slice _(0,-1, 1)
std::vector< Function< T, NDIM > > flatten(const std::vector< std::vector< Function< T, NDIM > > > &vv)
Definition: vmra.h:656
std::vector< Function< T, NDIM > > grad_ble_one(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
Definition: vmra.h:1836
std::vector< Function< TENSOR_RESULT_TYPE(L, R), D > > vmulXX(const Function< L, D > &left, const std::vector< Function< R, D > > &vright, double tol, bool fence=true)
Use the vmra/mul(...) interface instead.
Definition: mra.h:1807
Function< TENSOR_RESULT_TYPE(L, R), NDIM > gaxpy_oop(TENSOR_RESULT_TYPE(L, R) alpha, const Function< L, NDIM > &left, TENSOR_RESULT_TYPE(L, R) beta, const Function< R, NDIM > &right, bool fence=true)
Returns new function alpha*left + beta*right optional fence and no automatic compression.
Definition: mra.h:1917
std::vector< Function< T, NDIM > > rot(const std::vector< Function< T, NDIM > > &v, bool do_refine=false, bool fence=true)
shorthand rot operator
Definition: vmra.h:1976
TENSOR_RESULT_TYPE(T, R) inner(const Function< T
Computes the scalar/inner product between two functions.
Definition: vmra.h:1059
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition: print.h:225
std::vector< Function< T, NDIM > > orthonormalize_cd(const std::vector< Function< T, NDIM > > &v, Tensor< T > &ovlp)
Definition: vmra.h:557
@ TT_2D
Definition: gentensor.h:120
void refine(World &world, const std::vector< Function< T, NDIM > > &vf, bool fence=true)
refine the functions according to the autorefine criteria
Definition: vmra.h:208
void print_size(World &world, const std::vector< Function< T, NDIM > > &v, const std::string &msg="vectorfunction")
Definition: vmra.h:1622
std::vector< CCPairFunction< T, NDIM > > & operator+=(std::vector< CCPairFunction< T, NDIM > > &lhs, const CCPairFunction< T, NDIM > &rhs)
Definition: ccpairfunction.h:1063
Function< T, NDIM > sum(World &world, const std::vector< Function< T, NDIM > > &f, bool fence=true)
Returns new function — q = sum_i f[i].
Definition: vmra.h:1421
NDIM & f
Definition: mra.h:2416
std::vector< CCPairFunction< T, NDIM > > & operator-=(std::vector< CCPairFunction< T, NDIM > > &rhs, const std::vector< CCPairFunction< T, NDIM > > &lhs)
Definition: ccpairfunction.h:1077
Function< TENSOR_RESULT_TYPE(L, R), NDIM > mul_sparse(const Function< L, NDIM > &left, const Function< R, NDIM > &right, double tol, bool fence=true)
Sparse multiplication — left and right must be reconstructed and if tol!=0 have tree of norms already...
Definition: mra.h:1742
std::vector< Function< T, NDIM > > partial_mul(const Function< T, NDIM > f, const std::vector< Function< T, LDIM > > g, const int particle)
multiply a high-dimensional function with a low-dimensional function
Definition: vmra.h:1186
std::vector< std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > > matrix_mul_sparse(World &world, const std::vector< Function< R, NDIM > > &f, const std::vector< Function< R, NDIM > > &g, double tol, bool fence=true, bool symm=false)
Outer product of a vector of functions with a vector of functions using sparsity.
Definition: vmra.h:1115
NDIM const Function< R, NDIM > & g
Definition: mra.h:2416
std::vector< CCPairFunction< T, NDIM > > operator*(const double fac, const std::vector< CCPairFunction< T, NDIM > > &arg)
Definition: ccpairfunction.h:1084
double wall_time()
Returns the wall time in seconds relative to an arbitrary origin.
Definition: timers.cc:48
std::vector< Function< T, NDIM > > grad(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
shorthand gradient operator
Definition: vmra.h:1818
Tensor< T > inverse(const Tensor< T > &a_in)
invert general square matrix A
Definition: lapack.cc:832
std::vector< Function< T, NDIM > > grad_bspline_one(const Function< T, NDIM > &f, bool refine=false, bool fence=true)
Definition: vmra.h:1878
std::vector< Function< T, NDIM > > reduce_rank(std::vector< Function< T, NDIM > > v, double thresh=0.0, bool fence=true)
reduces the tensor rank of the coefficient tensor (if applicable)
Definition: vmra.h:366
Tensor< TENSOR_RESULT_TYPE(T, R) > matrix_inner_old(World &world, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< R, NDIM > > &g, bool sym=false)
Computes the matrix inner product of two function vectors - q(i,j) = inner(f[i],g[j])
Definition: vmra.h:970
double inner(response_space &a, response_space &b)
Definition: response_functions.h:442
double imag(double x)
Definition: complexfun.h:56
std::vector< Function< T, NDIM > > impl2function(const std::vector< std::shared_ptr< FunctionImpl< T, NDIM >>> vimpl)
Definition: vmra.h:676
void load_function(World &world, std::vector< Function< T, NDIM > > &f, const std::string name)
load a vector of functions
Definition: vmra.h:2048
void refine_to_common_level(World &world, std::vector< Function< T, NDIM > > &vf, bool fence=true)
refine all functions to a common (finest) level
Definition: vmra.h:218
static bool print_timings
Definition: SCF.cc:104
void normalize(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Normalizes a vector of functions — v[i] = v[i].scale(1.0/v[i].norm2())
Definition: vmra.h:1614
Tensor< double > norm2s_T(World &world, const std::vector< Function< T, NDIM >> &v)
Computes the 2-norms of a vector of functions.
Definition: vmra.h:839
double real(double x)
Definition: complexfun.h:52
std::vector< Function< T, NDIM > > multi_to_multi_op_values(const opT &op, const std::vector< Function< T, NDIM > > &vin, const bool fence=true)
apply op on the input vector yielding an output vector of functions
Definition: vmra.h:1667
Function< TENSOR_RESULT_TYPE(typename opT::opT, R), NDIM > apply_only(const opT &op, const Function< R, NDIM > &f, bool fence=true)
Apply operator ONLY in non-standard form - required other steps missing !!
Definition: mra.h:2120
std::string name(const FuncType &type, const int ex=-1)
Definition: ccpairfunction.h:28
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const Tensor< R > &c, bool fence=true)
Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
Definition: vmra.h:689
void matrix_inner(DistributedMatrix< T > &A, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< T, NDIM > > &g, bool sym=false)
Definition: distpm.cc:46
double get_size(World &world, const std::vector< Function< T, NDIM > > &v)
Definition: vmra.h:1636
std::vector< double > norm2s(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norms of a vector of functions.
Definition: vmra.h:827
void syev(const Tensor< T > &A, Tensor< T > &V, Tensor< typename Tensor< T >::scalar_type > &e)
Real-symmetric or complex-Hermitian eigenproblem.
Definition: lapack.cc:969
void make_nonstandard(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Generates non-standard form of a vector of functions.
Definition: vmra.h:245
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > cross(const std::vector< Function< T, NDIM > > &f, const std::vector< Function< R, NDIM > > &g, bool do_refine=false, bool fence=true)
shorthand cross operator
Definition: vmra.h:2013
void gaxpy(const double a, ScalarResult< T > &left, const double b, const T &right, const bool fence=true)
the result type of a macrotask must implement gaxpy
Definition: macrotaskq.h:140
const std::vector< Function< T, NDIM > > & reconstruct(const std::vector< Function< T, NDIM > > &v)
reconstruct a vector of functions
Definition: vmra.h:156
int distance(const madness::Hash_private::HashIterator< hashT > &it, const madness::Hash_private::HashIterator< hashT > &jt)
Definition: worldhashmap.h:616
static long abs(long a)
Definition: tensor.h:218
static const double b
Definition: nonlinschro.cc:119
static const double a
Definition: nonlinschro.cc:118
double Q(double a)
Definition: relops.cc:20
static const double c
Definition: relops.cc:10
static const double L
Definition: rk.cc:46
static const double thresh
Definition: rk.cc:45
Definition: test_ar.cc:204
Definition: lowrankfunction.h:332
Definition: dirac-hatom.cc:108
int P
Definition: test_binsorter.cc:9
const double alpha
Definition: test_coulomb.cc:54
void d()
Definition: test_sig.cc:79
double aa
Definition: testbsh.cc:68
static const std::size_t NDIM
Definition: testpdiff.cc:42
#define PROFILE_FUNC
Definition: worldprofile.h:209
#define PROFILE_BLOCK(name)
Definition: worldprofile.h:208