QMCPACK
TestListenerFunction.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2022 QMCPACK developers.
6 //
7 // File developed by: Peter W. Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 //
9 // File created by: Peter W. Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef QMCPLUSPLUS_TESTLISTENERFUNCTION_H
13 #define QMCPLUSPLUS_TESTLISTENERFUNCTION_H
14 
15 namespace qmcplusplus
16 {
17 namespace testing
18 {
19 
20 template<typename T>
22 {
23  return [&local_pots](const int walker_index, const std::string& name, const Vector<T>& inputV) {
24  assert(local_pots.cols() >= inputV.size());
25  assert(walker_index < local_pots.rows());
26  std::copy_n(inputV.begin(), inputV.size(), local_pots[walker_index]);
27  };
28 }
29 
30 template<typename T>
31 auto getSummingListener(Matrix<T>& local_pots)
32 {
33  return [&local_pots](const int walker_index, const std::string& name, const Vector<T>& inputV) {
34  assert(local_pots.cols() >= inputV.size());
35  assert(walker_index < local_pots.rows());
36  std::transform(inputV.begin(), inputV.end(), local_pots[walker_index], local_pots[walker_index], std::plus<>{} );
37  };
38 }
39 
40 
41 } // namespace testing
42 } // namespace qmcplusplus
43 
44 #endif
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
size_type cols() const
Definition: OhmmsMatrix.h:78
auto getParticularListener(Matrix< T > &local_pots)
size_type rows() const
Definition: OhmmsMatrix.h:77
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
Definition: syclBLAS.cpp:548
auto getSummingListener(Matrix< T > &local_pots)