Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef XPETRA_CRSGRAPHFACTORY_HPP
00047 #define XPETRA_CRSGRAPHFACTORY_HPP
00048
00049 #include "Xpetra_ConfigDefs.hpp"
00050
00051 #include "Xpetra_CrsGraph.hpp"
00052
00053 #ifdef HAVE_XPETRA_TPETRA
00054 #include "Xpetra_TpetraCrsGraph.hpp"
00055 #endif
00056
00057 #ifdef HAVE_XPETRA_EPETRA
00058 #include "Xpetra_EpetraCrsGraph.hpp"
00059 #endif
00060
00061 #include "Xpetra_Exceptions.hpp"
00062
00063 namespace Xpetra {
00064
00065 template <class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType, class LocalMatOps = typename Kokkos::DefaultKernels<void,LocalOrdinal,Node>::SparseOps>
00066 class CrsGraphFactory {
00067
00068 private:
00070 CrsGraphFactory() {}
00071
00072 public:
00073
00075 static Teuchos::RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
00076 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t NumVectors, ProfileType pftype=DynamicProfile) {
00077 XPETRA_MONITOR("CrsGraphFactory::Build");
00078
00079 #ifdef HAVE_XPETRA_TPETRA
00080 if (map->lib() == UseTpetra)
00081 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, NumVectors, pftype) );
00082 #endif
00083
00084 XPETRA_FACTORY_ERROR_IF_EPETRA(map->lib());
00085 XPETRA_FACTORY_END;
00086 return null;
00087 }
00088
00089 };
00090
00091 template <>
00092 class CrsGraphFactory<int, int> {
00093
00094 typedef int LocalOrdinal;
00095 typedef int GlobalOrdinal;
00096 typedef Kokkos::DefaultNode::DefaultNodeType Node;
00097
00098 private:
00100 CrsGraphFactory() {}
00101
00102 public:
00103
00104 static RCP<CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
00105 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t NumVectors, ProfileType pftype=DynamicProfile) {
00106 XPETRA_MONITOR("CrsGraphFactory::Build");
00107
00108 #ifdef HAVE_XPETRA_TPETRA
00109 if (map->lib() == UseTpetra)
00110 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, NumVectors, pftype) );
00111 #endif
00112
00113 #ifdef HAVE_XPETRA_EPETRA
00114 if (map->lib() == UseEpetra)
00115 return rcp( new EpetraCrsGraph(map, NumVectors, pftype) );
00116 #endif
00117
00118 XPETRA_FACTORY_END;
00119 return null;
00120 }
00121
00122 };
00123
00124 }
00125
00126 #define XPETRA_CRSGRAPHFACTORY_SHORT
00127 #endif