1 /*
2   This file is part of MADNESS.
3 
4   Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2 of the License, or
9   (at your option) any later version.
10 
11   This program is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   GNU General Public License for more details.
15 
16   You should have received a copy of the GNU General Public License
17   along with this program; if not, write to the Free Software
18   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20   For more information please contact:
21 
22   Robert J. Harrison
23   Oak Ridge National Laboratory
24   One Bethel Valley Road
25   P.O. Box 2008, MS-6367
26 
27   email: harrisonrj@ornl.gov
28   tel:   865-241-3937
29   fax:   865-572-0680
30 */
31 
32 #include <madness/mra/mra.h>
33 #define MPRAIMPLX
34 #include <madness/mra/mraimpl.h>
35 #include <madness/world/world_object.h>
36 #include <madness/world/worldmutex.h>
37 #include <madness/world/worlddc.h>
38 #include <list>
39 
40 namespace madness {
41 
42     template <>
43     ConcurrentHashMap< hashT, std::shared_ptr< GaussianConvolution1D<double> > >
44     GaussianConvolution1DCache<double>::map = ConcurrentHashMap< hashT, std::shared_ptr< GaussianConvolution1D<double> > >();
45 
46     template <>
47     ConcurrentHashMap< hashT, std::shared_ptr< GaussianConvolution1D<double_complex> > >
48     GaussianConvolution1DCache<double_complex>::map = ConcurrentHashMap< hashT, std::shared_ptr< GaussianConvolution1D<double_complex> > >();
49 
50 #ifdef FUNCTION_INSTANTIATE_1
51 
52     template void fcube<double,1>(const Key<1>&, const FunctionFunctorInterface<double,1>&, const Tensor<double>&, Tensor<double>&);
53     template Tensor<double> fcube<double, 1>(Key<1> const&, double (*)(Vector<double, 1> const&), Tensor<double> const&);
54     template void fcube<std::complex<double>,1>(const Key<1>&, const FunctionFunctorInterface<std::complex<double>,1>&, const Tensor<double>&, Tensor<std::complex<double> >&);
55     template Tensor<std::complex<double> > fcube<std::complex<double>, 1>(Key<1> const&, std::complex<double> (*)(Vector<double, 1> const&), Tensor<double> const&);
56 
57     template <> volatile std::list<detail::PendingMsg> WorldObject<FunctionImpl<double,1> >::pending = std::list<detail::PendingMsg>();
58     template <> Spinlock WorldObject<FunctionImpl<double,1> >::pending_mutex(0);
59     template <> volatile std::list<detail::PendingMsg> WorldObject<madness::FunctionImpl<std::complex<double>, 1> >::pending = std::list<detail::PendingMsg>();
60     template <> Spinlock WorldObject<FunctionImpl<std::complex<double>, 1> >::pending_mutex(0);
61 
62     template <> volatile std::list<detail::PendingMsg> WorldObject<WorldContainerImpl<Key<1>, FunctionNode<double, 1>, Hash<Key<1> > > >::pending = std::list<detail::PendingMsg>();
63     template <> Spinlock WorldObject<WorldContainerImpl<Key<1>, FunctionNode<double, 1>, Hash<Key<1> > > >::pending_mutex(0);
64     template <> volatile std::list<detail::PendingMsg> WorldObject<WorldContainerImpl<Key<1>, FunctionNode<std::complex<double>, 1>, Hash<Key<1> > > >::pending = std::list<detail::PendingMsg>();
65     template <> Spinlock WorldObject<WorldContainerImpl<Key<1>, FunctionNode<std::complex<double>, 1>, Hash<Key<1> > > >::pending_mutex(0);
66 
67     template <> volatile std::list<detail::PendingMsg> WorldObject<DerivativeBase<double,1> >::pending = std::list<detail::PendingMsg>();
68     template <> Spinlock WorldObject<DerivativeBase<double,1> >::pending_mutex(0);
69     template <> volatile std::list<detail::PendingMsg> WorldObject<DerivativeBase<std::complex<double>,1> >::pending = std::list<detail::PendingMsg>();
70     template <> Spinlock WorldObject<DerivativeBase<std::complex<double>,1> >::pending_mutex(0);
71 
72     template <> volatile std::list<detail::PendingMsg> WorldObject<SeparatedConvolution<double,1> >::pending = std::list<detail::PendingMsg>();
73     template <> Spinlock WorldObject<SeparatedConvolution<double,1> >::pending_mutex(0);
74     template <> volatile std::list<detail::PendingMsg> WorldObject<SeparatedConvolution<std::complex<double>,1> >::pending = std::list<detail::PendingMsg>();
75     template <> Spinlock WorldObject<SeparatedConvolution<std::complex<double>,1> >::pending_mutex(0);
76 
77     template <> volatile std::list<detail::PendingMsg> WorldObject<WorldContainerImpl<Key<1>, LBNodeDeux<1>, Hash<Key<1> > > >::pending = std::list<detail::PendingMsg>();
78     template <>  Spinlock WorldObject<WorldContainerImpl<Key<1>, LBNodeDeux<1>, Hash<Key<1> > > >::pending_mutex(0);
79 
80     template void plotdx<double,1>(const Function<double,1>&, const char*, const Tensor<double>&,
81                                    const std::vector<long>&, bool binary);
82     template void plotdx<double_complex,1>(const Function<double_complex,1>&, const char*, const Tensor<double>&,
83                                            const std::vector<long>&, bool binary);
84 
85     // These implicit instantiations must be below the explicit ones above in order not to offend LLVM
86     template class WorldObject<FunctionImpl<double,1> >;
87     template class WorldObject<FunctionImpl<std::complex<double>,1> >;
88     template class FunctionDefaults<1>;
89     template class Function<double, 1>;
90     template class Function<std::complex<double>, 1>;
91     template class FunctionImpl<double, 1>;
92     template class FunctionImpl<std::complex<double>, 1>;
93     template class FunctionCommonData<double, 1>;
94     template class FunctionCommonData<double_complex, 1>;
95     template class Displacements<1>;
96     template class DerivativeBase<double,1>;
97     template class DerivativeBase<double_complex,1>;
98 #endif
99 
100 }
101 
102 /// Quietly used as a global lock when looking for bugs with multiple threads
103 madness::Mutex THELOCK;
104 
105