34 #ifndef MADNESS_MRA_VMRA_H__INCLUDED
35 #define MADNESS_MRA_VMRA_H__INCLUDED
130 template <
typename T, std::
size_t NDIM>
137 bool must_fence =
false;
138 unsigned int vvsize = v.size();
139 for (
unsigned int i=0; i<vvsize; i+= blk) {
140 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
141 if (!v[j].is_compressed()) {
142 v[j].compress(
false);
146 if ( blk!=1 && must_fence && fence) world.
gop.
fence();
149 if (fence && must_fence) world.
gop.
fence();
154 template <
typename T, std::
size_t NDIM>
160 bool must_fence =
false;
161 unsigned int vvsize = v.size();
162 for (
unsigned int i=0; i<vvsize; i+= blk) {
163 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
164 if (v[j].is_compressed()) {
165 v[j].reconstruct(
false);
169 if ( blk!=1 && must_fence && fence) world.
gop.
fence();
172 if (fence && must_fence) world.
gop.
fence();
176 template <
typename T, std::
size_t NDIM>
182 unsigned int vvsize = v.size();
184 for (
unsigned int i=0; i<vvsize; i+= blk) {
185 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
186 v[j].nonstandard(
false,
false);
188 if ( blk!=1 && fence) world.
gop.
fence();
196 template <
typename T, std::
size_t NDIM>
202 unsigned int vvsize = v.size();
203 for (
unsigned int i=0; i<vvsize; i+= blk) {
204 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
205 v[j].standard(
false);
207 if ( blk!=1 && fence) world.
gop.
fence();
214 template <
typename T, std::
size_t NDIM>
224 unsigned int vvsize = v.size();
225 for (
unsigned int i=0; i<vvsize; i+= blk) {
226 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
227 v[j].truncate(tol,
false);
229 if ( blk!=1 && fence) world.
gop.
fence();
236 template <
typename T, std::
size_t NDIM>
237 std::vector< Function<T,NDIM> >
241 const unsigned int blk=1,
242 const bool fence=
true)
245 std::vector< Function<T,NDIM> > df(v.size());
247 unsigned int vvsize = v.size();
249 for (
unsigned int i=0; i<vvsize; i+= blk) {
250 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
251 df[j] = D(v[j],
false);
253 if (blk!= 1 && fence) world.
gop.
fence();
262 template <
typename T, std::
size_t NDIM>
263 std::vector< Function<T,NDIM> >
266 std::vector< Function<T,NDIM> > r(n);
267 for (
int i=0; i<n; ++i)
268 r[i] = Function<T,NDIM>(FunctionFactory<T,NDIM>(world));
279 template <
typename T,
typename R, std::
size_t NDIM>
280 std::vector< Function<TENSOR_RESULT_TYPE(T,R),NDIM> >
286 const bool fence=
true){
292 unsigned int blk =
min(blki, blkj);
293 unsigned int n = v.size();
294 unsigned int m = c.dim(1);
295 MADNESS_ASSERT(n==c.dim(0));
297 std::vector< Function<resultT,NDIM> > vc = zero_functions<resultT,NDIM>(world,
m);
301 for (
unsigned int i=0; i<
m; i+= blki) {
302 for (
unsigned int ii=i; ii<
std::min(m,(i+1)*blki); ii++) {
303 for (
unsigned int j=0; j<n; j+= blkj) {
304 for (
unsigned int jj=j; jj<
std::min(n, (j+1)*blkj); jj++)
305 if (
c(jj,ii) !=
R(0.0)) vc[ii].
gaxpy(1.0,v[jj],
c(jj,ii),
false);
306 if (fence && (blkj!=1)) world.gop.fence();
309 if (fence && (blki!=1)) world.gop.fence();
319 if (fence) world.gop.fence();
324 template <
typename L,
typename R, std::
size_t NDIM>
325 std::vector< Function<TENSOR_RESULT_TYPE(L,R),NDIM> >
330 const unsigned int blki=1,
334 MADNESS_ASSERT(v.size() == (
unsigned int)(c.dim(0)));
336 std::vector< Function<TENSOR_RESULT_TYPE(L,R),NDIM> > vresult(c.dim(1));
337 unsigned int m=c.dim(1);
339 for (
unsigned int i=0; i<
m; i+= blki) {
340 for (
unsigned int ii=i; ii<
std::min(m,(i+1)*blki); ii++) {
343 if (fence && (blki!=1)) world.
gop.
fence();
351 compress(world, vresult, blki,
false);
353 vresult[0].vtransform(v, c, vresult, tol, fence);
359 template <
typename T,
typename Q, std::
size_t NDIM>
362 const std::vector<Q>& factors,
363 const unsigned int blk=1,
364 const bool fence=
true)
368 unsigned int vvsize = v.size();
369 for (
unsigned int i=0; i<vvsize; i+= blk) {
370 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
371 v[j].scale(factors[j],
false);
373 if (fence && blk!=1 ) world.
gop.
fence();
380 template <
typename T,
typename Q, std::
size_t NDIM>
384 const unsigned int blk=1,
385 const bool fence=
true){
389 unsigned int vvsize = v.size();
390 for (
unsigned int i=0; i<vvsize; i+= blk) {
391 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
392 v[j].scale(factor,
false);
394 if (fence && blk!=1 ) world.
gop.
fence();
400 template <
typename T, std::
size_t NDIM>
403 const unsigned int blk=1,
404 const bool fence=
true){
407 unsigned int vvsize = v.size();
408 std::vector<double> norms(vvsize);
410 for (
unsigned int i=0; i<vvsize; i+= blk) {
411 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j) {
412 norms[j] = v[j].norm2sq_local();
414 if (fence && (blk!=1)) world.
gop.
fence();
418 world.
gop.
sum(&norms[0], norms.size());
420 for (
unsigned int i=0; i<vvsize; i+= blk) {
421 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
422 norms[j] =
sqrt(norms[j]);
423 if (fence && (blk!=1)) world.
gop.
fence();
433 template <
typename T, std::
size_t NDIM>
434 double norm2(World& world,
435 const std::vector< Function<T,NDIM> >& v)
440 std::vector<double> norms(v.size());
442 for (
unsigned int i=0; i<v.size(); ++i)
443 norms[i] = v[i].norm2sq_local();
445 world.gop.sum(&norms[0], norms.size());
447 for (
unsigned int i=1; i<v.size(); ++i)
448 norms[0] += norms[i];
451 return sqrt(norms[0]);
454 inline double conj(
double x) {
458 inline double conj(
float x) {
463 template <
typename T,
typename R, std::
size_t NDIM>
467 const std::vector< Function<R,NDIM> >&
g;
474 : result(result), f(f), g(g), jtop(jtop) {}
477 for (
long j=0; j<
jtop; ++j) {
478 result(j) = f.inner_local(g[j]);
486 virtual void get_id(std::pair<void*,unsigned short>&
id)
const {
497 template <
typename T,
typename R, std::
size_t NDIM>
498 Tensor< TENSOR_RESULT_TYPE(T,R) >
matrix_inner(World& world,
499 const std::vector< Function<T,NDIM> >& f,
500 const std::vector< Function<R,NDIM> >& g,
503 unsigned int n=f.
size(),
m=g.size();
504 Tensor< TENSOR_RESULT_TYPE(T,R) > r(n,
m);
505 if (sym) MADNESS_ASSERT(n==
m);
520 for (
unsigned int i=n-1; i>=0; --i) {
521 unsigned int jtop =
m;
523 world.taskq.add(
new MatrixInnerTask<T,R,NDIM>(r(i,_), f[i], g, jtop));
526 world.gop.sum(r.ptr(),n*
m);
529 for (
unsigned int i=0; i<n; ++i) {
530 for (
unsigned int j=0; j<i; ++j) {
531 r(j,i) =
conj(r(i,j));
540 template <
typename T,
typename R, std::
size_t NDIM>
541 Tensor< TENSOR_RESULT_TYPE(T,R) >
inner(World& world,
542 const std::vector< Function<T,NDIM> >& f,
543 const std::vector< Function<R,NDIM> >& g) {
545 long n=f.
size(),
m=g.size();
546 MADNESS_ASSERT(n==
m);
547 Tensor< TENSOR_RESULT_TYPE(T,R) > r(n);
552 for (
long i=0; i<n; ++i) {
553 r(i) = f[i].inner_local(g[i]);
557 world.gop.sum(r.ptr(),n);
565 template <
typename T,
typename R, std::
size_t NDIM>
566 Tensor< TENSOR_RESULT_TYPE(T,R) >
inner(World& world,
567 const Function<T,NDIM>& f,
568 const std::vector< Function<R,NDIM> >& g) {
571 Tensor< TENSOR_RESULT_TYPE(T,R) > r(n);
576 for (
long i=0; i<n; ++i) {
577 r(i) = f.inner_local(g[i]);
581 world.gop.sum(r.ptr(),n);
589 template <
typename T,
typename R, std::
size_t NDIM>
590 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
594 const unsigned int blk=1,
595 const bool fence=
true) {
601 return vmulXX(a, v, 0.0, fence);
605 template <
typename T,
typename R, std::
size_t NDIM>
606 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
611 const bool fence=
true,
612 const unsigned int blk=1)
619 unsigned int vvsize = v.size();
620 for (
unsigned int i=0; i<vvsize; i+= blk) {
621 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
623 if ( fence && (blk == 1)) world.
gop.
fence();
626 return vmulXX(a, v, tol, fence);
630 template <
typename T, std::
size_t NDIM>
637 unsigned int vvsize = v.size();
638 for (
unsigned int i=0; i<vvsize; i+= blk) {
639 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
641 if (fence && blk!=1 ) world.
gop.
fence();
648 template <
typename T,
typename R, std::
size_t NDIM>
649 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
660 std::vector< Function<TENSOR_RESULT_TYPE(T,R),NDIM> > q(
a.size());
662 unsigned int vvsize =
a.size();
663 for (
unsigned int i=0; i<vvsize; i+= blk) {
664 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
665 q[j] =
mul(
a[j],
b[j],
false);
666 if (fence && (blk !=1 )) world.
gop.
fence();
675 template <
typename T, std::
size_t NDIM>
676 std::vector< Function<T,NDIM> >
678 const std::vector< Function<T,NDIM> >& v,
680 return mul<T,T,NDIM>(world, v, v, fence);
691 template <
typename T, std::
size_t NDIM>
693 std::vector< Function<T,NDIM> >& v,
696 for (
unsigned int j=0; j<v.size(); ++j) {
697 v[j].set_thresh(thresh,
false);
699 if (fence) world.gop.fence();
704 template <
typename T, std::
size_t NDIM>
705 std::vector< Function<T,NDIM> >
707 const std::vector< Function<T,NDIM> >& v,
710 std::vector< Function<T,NDIM> > r =
copy(world, v);
711 for (
unsigned int i=0; i<v.size(); ++i) {
714 if (fence) world.gop.fence();
721 template <
typename T, std::
size_t NDIM>
722 std::vector< Function<T,NDIM> >
724 const std::vector< Function<T,NDIM> >& v,
727 std::vector< Function<T,NDIM> > r(v.size());
728 for (
unsigned int i=0; i<v.size(); ++i) {
729 r[i] =
copy(v[i],
false);
731 if (fence) world.gop.fence();
737 template <
typename T, std::
size_t NDIM>
738 std::vector< Function<T,NDIM> >
740 const Function<T,NDIM>& v,
741 const unsigned int n,
744 std::vector< Function<T,NDIM> > r(n);
745 for (
unsigned int i=0; i<n; ++i) {
746 r[i] =
copy(v,
false);
748 if (fence) world.gop.fence();
754 template <
typename T,
typename R, std::
size_t NDIM>
755 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
760 unsigned int blk=1) {
762 MADNESS_ASSERT(
a.size() ==
b.size());
766 std::vector< Function<TENSOR_RESULT_TYPE(T,R),NDIM> > r(
a.size());
768 unsigned int vvsize =
a.size();
769 for (
unsigned int i=0; i<vvsize; i+= blk) {
770 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
771 r[j] =
add(
a[j],
b[j],
false);
772 if (fence && (blk !=1 )) world.
gop.
fence();
781 template <
typename T,
typename R, std::
size_t NDIM>
782 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
787 unsigned int blk=1) {
793 std::vector< Function<TENSOR_RESULT_TYPE(T,R),NDIM> > r(
b.size());
795 unsigned int vvsize =
b.size();
796 for (
unsigned int i=0; i<vvsize; i+= blk) {
797 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
798 r[j] =
add(a,
b[j],
false);
799 if (fence && (blk !=1 )) world.
gop.
fence();
806 template <
typename T,
typename R, std::
size_t NDIM>
807 inline std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
812 unsigned int blk=1) {
813 return add(world, a,
b, fence, blk);
818 template <
typename T,
typename R, std::
size_t NDIM>
819 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
824 unsigned int blk=1) {
826 MADNESS_ASSERT(
a.size() ==
b.size());
830 std::vector< Function<TENSOR_RESULT_TYPE(T,R),NDIM> > r(
a.size());
832 unsigned int vvsize =
a.size();
833 for (
unsigned int i=0; i<vvsize; i+= blk) {
834 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
835 r[j] =
sub(
a[j],
b[j],
false);
836 if (fence && (blk !=1 )) world.
gop.
fence();
845 template <
typename T,
typename Q,
typename R, std::
size_t NDIM>
854 MADNESS_ASSERT(
a.size() ==
b.size());
858 unsigned int vvsize =
a.size();
860 for (
unsigned int i=0; i<vvsize; i+= blk) {
861 for (
unsigned int j=i; j<
std::min(vvsize,(i+1)*blk); ++j)
862 a[j].
gaxpy(alpha,
b[j], beta,
false);
864 if (fence && (blk !=1 )) world.
gop.
fence();
876 template <
typename opT,
typename R, std::
size_t NDIM>
877 std::vector< Function<TENSOR_RESULT_TYPE(typename opT::opT,R), NDIM> >
881 const unsigned int blk=1){
884 MADNESS_ASSERT(f.size()==
op.size());
886 std::vector< Function<R,NDIM> >& ncf = *
const_cast< std::vector< Function<R,NDIM>
>* >(&
f);
891 std::vector< Function<TENSOR_RESULT_TYPE(typename opT::opT,R), NDIM> > result(f.size());
892 unsigned int ff = f.size();
894 for (
unsigned int i=0; i<ff; ++blk) {
895 for (
unsigned int j=i; j<
std::min(ff,(i+1)*blk); ++j)
913 template <
typename T,
typename R, std::
size_t NDIM>
914 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> >
918 const unsigned int blk=1) {
921 std::vector< Function<R,NDIM> >& ncf = *
const_cast< std::vector< Function<R,NDIM>
>* >(&
f);
926 std::vector< Function<TENSOR_RESULT_TYPE(T,R), NDIM> > result(f.size());
928 unsigned int ff = f.size();
929 for (
unsigned int i=0; i<ff; ++blk) {
930 for (
unsigned int j=i; j<
std::min(ff,(i+1)*blk); ++j)
946 template <
typename T, std::
size_t NDIM>
948 std::vector< Function<T,NDIM> >& v,
952 std::vector<double> nn =
norm2s(world, v);
954 for (
unsigned int i=0; i<v.size(); ++i)
955 v[i].
scale(1.0/nn[i],
false);
957 if (fence) world.gop.fence();
961 #endif // MADNESS_MRA_VMRA_H__INCLUDED
void matrix_inner(DistributedMatrix< T > &A, const std::vector< Function< T, NDIM > > &f, const std::vector< Function< T, NDIM > > &g, bool sym=false)
Definition: chem/distpm.cc:38
WorldGopInterface & gop
Global operations.
Definition: worldfwd.h:462
long jtop
Definition: vmra1.h:468
Definition: shared_ptr_bits.h:38
void reconstruct(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
Reconstruct a vector of functions.
Definition: vmra.h:149
const double R
Definition: dielectric.cc:191
Main include file for MADNESS and defines Function interface.
void gaxpy(World &world, Q alpha, std::vector< Function< T, NDIM > > &a, Q beta, const std::vector< Function< R, NDIM > > &b, bool fence=true)
Generalized A*X+Y for vectors of functions -— a[i] = alpha*a[i] + beta*b[i].
Definition: vmra.h:680
void run(World &world)
Runs a single-threaded task ... derived classes must implement this.
Definition: vmra1.h:476
const Function< T, NDIM > & compress(bool fence=true) const
Compresses the function, transforming into wavelet basis. Possible non-blocking comm.
Definition: mra.h:683
Implements derivatives operators with variety of boundary conditions on simulation domain...
Definition: derivative.h:272
void truncate(World &world, std::vector< Function< T, NDIM > > &v, double tol=0.0, bool fence=true)
Truncates a vector of functions.
Definition: vmra.h:194
void nonstandard(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Generates non-standard form of a vector of functions.
Definition: vmra.h:167
NDIM & f
Definition: mra.h:2179
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:1942
Declaration and initialization of tree traversal functions and generic derivative.
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:1734
TENSOR_RESULT_TYPE(T, R) inner(const Function<T
Computes the scalar/inner product between two functions.
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:506
const double beta
Definition: gygi_soltion.cc:63
T inner(const vecfunc< T, NDIM > &a, const vecfunc< T, NDIM > &b)
the non-linear solver requires an inner product
Definition: nemo.h:112
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:312
#define PROFILE_BLOCK(name)
Definition: worldprofile.h:197
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
void scale(World &world, std::vector< Function< T, NDIM > > &v, const std::vector< Q > &factors, bool fence=true)
Scales inplace a vector of functions by distinct values.
Definition: vmra.h:290
void reconstruct(bool fence=true) const
Reconstructs the function, transforming into scaling function basis. Possible non-blocking comm...
Definition: mra.h:737
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:1835
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
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:1778
FLOAT a(int j, FLOAT z)
Definition: y1.cc:86
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:1634
MatrixInnerTask(const Tensor< TENSOR_RESULT_TYPE(T, R)> &result, const Function< T, NDIM > &f, const std::vector< Function< R, NDIM > > &g, long jtop)
Definition: vmra1.h:470
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:556
void sum(T *buf, size_t nelem)
Inplace global sum while still processing AM & tasks.
Definition: worldgop.h:767
void standard(World &world, std::vector< Function< T, NDIM > > &v, bool fence=true)
Generates standard form of a vector of functions.
Definition: vmra.h:181
tensorT sqrt(const tensorT &s, double tol=1e-8)
Computes matrix square root (not used any more?)
Definition: DFcode/moldft.cc:446
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:1806
A parallel world with full functionality wrapping an MPI communicator.
Definition: worldfwd.h:416
void fence()
Synchronizes all processes in communicator AND globally ensures no pending AM or tasks.
Definition: worldgop.cc:52
double norm2(World &world, const std::vector< Function< T, NDIM > > &v)
Computes the 2-norm of a vector of functions.
Definition: vmra.h:325
A multiresolution adaptive numerical function.
Definition: derivative.h:61
const std::vector< Function< R, NDIM > > & g
Definition: vmra1.h:467
const double m
Definition: gfit.cc:199
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 alread...
Definition: mra.h:1569
static enable_if_c< detail::function_traits< fnT >::value||detail::memfunc_traits< fnT >::value >::type make_id(std::pair< void *, unsigned short > &id, fnT fn)
Definition: worldthread.h:680
std::size_t size() const
Returns the number of coefficients in the function ... collective global sum.
Definition: mra.h:515
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
const Function< T, NDIM > & f
Definition: vmra1.h:466
void norm_tree(bool fence=true) const
Initializes information about the function norm at all length scales.
Definition: mra.h:663
All world tasks must be derived from this public interface.
Definition: taskfn.h:68
FunctionFactory implements the named-parameter idiom for Function.
Definition: funcimpl.h:70
Tensor< TENSOR_RESULT_TYPE(T, R)> result
Definition: vmra1.h:465
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
Function< T, NDIM > apply(const Derivative< T, NDIM > &D, const Function< T, NDIM > &f, bool fence=true)
Applies derivative operator to function (for syntactic equivalence to integral operator apply) ...
Definition: derivative.h:613
const double c
Definition: gfit.cc:200
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > transform(World &world, const std::vector< Function< T, NDIM > > &v, const DistributedMatrix< R > &c, bool fence=true)
Definition: chem/SCF.cc:86
FLOAT b(int j, FLOAT z)
Definition: y1.cc:79
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:765
std::vector< Function< T, NDIM > > zero_functions(World &world, int n)
Generates a vector of zero functions.
Definition: vmra.h:229
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:1528
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:1879
void compress(World &world, const std::vector< Function< T, NDIM > > &v, bool fence=true)
Compress a vector of functions.
Definition: vmra.h:130