Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_ShyLUBasker_TypeMap.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Amesos2: Templated Direct Sparse Solver Package
4 //
5 // Copyright 2011 NTESS and the Amesos2 contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
21 #ifndef AMESOS2_SHYLUBASKER_TYPEMAP_HPP
22 #define AMESOS2_SHYLUBASKER_TYPEMAP_HPP
23 
24 #include <functional>
25 #ifdef HAVE_TEUCHOS_COMPLEX
26 #include <complex>
27 #endif
28 
29 #include <Teuchos_as.hpp>
30 #ifdef HAVE_TEUCHOS_COMPLEX
31 #include <Teuchos_SerializationTraits.hpp>
32 #endif
33 
34 #include "Amesos2_TypeMap.hpp"
35 
36 namespace Amesos2 {
37 
38 template <class, class> class ShyLUBasker;
39 
40 /* Specialize the Amesos2::TypeMap struct for ShyLUBasker types
41  * TODO: Mostly dummy assignments as ShyLUBasker is templated. Remove if possible.
42  *
43  * \cond ShyLUBasker_type_specializations
44  */
45 
46 template <>
47 struct TypeMap<ShyLUBasker,float>
48 {
49  typedef float dtype;
50  typedef float type;
51 };
52 
53 template <>
54 struct TypeMap<ShyLUBasker,double>
55 {
56  typedef double dtype;
57  typedef double type;
58 };
59 
60 
61 #ifdef HAVE_TEUCHOS_COMPLEX
62 
63 template <>
64 struct TypeMap<ShyLUBasker,std::complex<float> >
65 {
66  typedef std::complex<float> dtype;
67  typedef Kokkos::complex<float> type;
68 };
69 
70 template <>
71 struct TypeMap<ShyLUBasker,std::complex<double> >
72 {
73  typedef std::complex<double> dtype;
74  typedef Kokkos::complex<double> type;
75 };
76 
77 template <>
78 struct TypeMap<ShyLUBasker,Kokkos::complex<float> >
79 {
80  typedef std::complex<float> dtype;
81  typedef Kokkos::complex<float> type;
82 };
83 
84 template <>
85 struct TypeMap<ShyLUBasker,Kokkos::complex<double> >
86 {
87  typedef std::complex<double> dtype;
88  typedef Kokkos::complex<double> type;
89 };
90 
91 #endif // HAVE_TEUCHOS_COMPLEX
92 
93 /* \endcond ShyLUBasker_type_specializations */
94 
95 
96 } // end namespace Amesos2
97 
98 #endif // AMESOS2_SHYLUBASKER_TYPEMAP_HPP