QMCPACK
test_complex_helper.cpp
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) 2023 QMCPACK developers
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 #include "catch.hpp"
14 
15 namespace qmcplusplus
16 {
17 template<typename P>
19 {
20  using Cmplx = std::complex<P>;
24 
25 public:
26  void run()
27  {
28  Cmplx aa;
29  CmplxRebuild bb;
30  aa = bb;
31 
32  Real cc;
33  RealRebuild dd(0);
34  cc = dd;
35  }
36 };
37 
38 TEST_CASE("complex_helper", "[type_traits]")
39 {
40  TestComplexHelper<float> float_test;
41  float_test.run();
42  TestComplexHelper<double> double_test;
43  double_test.run();
44 }
45 
46 } // namespace qmcplusplus
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
TEST_CASE("complex_helper", "[type_traits]")
ValueAlias< P, Cmplx > CmplxRebuild
typename RealAlias_impl< T >::value_type RealAlias
If you have a function templated on a value that can be real or complex and you need to get the base ...
typename ValueAlias_impl< TREAL, TREF >::value_type ValueAlias
If you need to make a value type of a given precision based on a reference value type set the desired...