Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_CrsMatrixFactory.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef XPETRA_CRSMATRIXFACTORY_HPP
47 #define XPETRA_CRSMATRIXFACTORY_HPP
48 
49 #include "Xpetra_ConfigDefs.hpp"
50 
51 #include "Xpetra_CrsMatrix.hpp"
52 
53 #ifdef HAVE_XPETRA_TPETRA
54 #include "Xpetra_TpetraCrsMatrix.hpp"
55 #endif
56 
57 #ifdef HAVE_XPETRA_EPETRA
59 #endif
60 
61 #include "Xpetra_Exceptions.hpp"
62 
63 namespace Xpetra {
64 
65  template <class Scalar,
66  class LocalOrdinal,
67  class GlobalOrdinal,
70  private:
73 
74  public:
76  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
77  Build (const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap)
78  {
79  TEUCHOS_TEST_FOR_EXCEPTION(rowMap->lib() == UseEpetra, std::logic_error,
80  "Can't create Xpetra::EpetraCrsMatrix with these scalar/LO/GO types");
81 #ifdef HAVE_XPETRA_TPETRA
82  if (rowMap->lib() == UseTpetra)
84 #endif
85 
87  }
88 
90  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
91  Build (const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
92  size_t maxNumEntriesPerRow,
93  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
94  {
95  XPETRA_MONITOR("CrsMatrixFactory::Build");
96 
97 #ifdef HAVE_XPETRA_TPETRA
98  if (rowMap->lib() == UseTpetra)
99  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, plist) );
100 #endif
101 
102  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
104  }
105 
107  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
108  Build (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >& rowMap,
109  const ArrayRCP<const size_t>& NumEntriesPerRowToAlloc,
110  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
111  {
112 #ifdef HAVE_XPETRA_TPETRA
113  if (rowMap->lib() == UseTpetra)
114  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, plist) );
115 #endif
116 
117  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
119  }
120 
122  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
123  Build (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
124  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
125  size_t maxNumEntriesPerRow,
126  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
127  {
128  XPETRA_MONITOR("CrsMatrixFactory::Build");
129 
130 #ifdef HAVE_XPETRA_TPETRA
131  if (rowMap->lib() == UseTpetra)
132  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
133 #endif
134 
135  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
137  }
138 
140  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
141  XPETRA_MONITOR("CrsMatrixFactory::Build");
142 
143 #ifdef HAVE_XPETRA_TPETRA
144  if (rowMap->lib() == UseTpetra)
145  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
146 #endif
147 
148  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
150  }
151 
153  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
154  XPETRA_MONITOR("CrsMatrixFactory::Build");
155 
156 #ifdef HAVE_XPETRA_TPETRA
157  if (graph->getRowMap()->lib() == UseTpetra)
158  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
159 #endif
160 
161  XPETRA_FACTORY_ERROR_IF_EPETRA(graph->getRowMap()->lib());
163  }
164 
165 
166  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
167  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
169  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
170  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
171  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
172  XPETRA_MONITOR("CrsMatrixFactory::Build");
173 
174 #ifdef HAVE_XPETRA_TPETRA
175  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
176  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params));
177 #endif
178 
179  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
181  }
182 
183  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
184  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
186  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & domainMap = Teuchos::null,
187  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & rangeMap = Teuchos::null,
188  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
189  XPETRA_MONITOR("CrsMatrixFactory::Build");
190 
191 #ifdef HAVE_XPETRA_TPETRA
192  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
193  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params));
194 #endif
195 
196  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
198  }
199 
200  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
201  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
202  const Import<LocalOrdinal,GlobalOrdinal,Node> &RowImporter,
203  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
204  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
205  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
206  const Teuchos::RCP<Teuchos::ParameterList>& params) {
207  XPETRA_MONITOR("CrsMatrixFactory::Build");
208 
209 #ifdef HAVE_XPETRA_TPETRA
210  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
211  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params));
212 #endif
213 
214  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
216  }
217 
218  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
219  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
220  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
221  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
222  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & domainMap,
223  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & rangeMap,
224  const Teuchos::RCP<Teuchos::ParameterList>& params) {
225  XPETRA_MONITOR("CrsMatrixFactory::Build");
226 
227 #ifdef HAVE_XPETRA_TPETRA
228  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
229  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params));
230 #endif
231 
232  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
234  }
235 
236 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
237  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
238  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
239  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
241  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
242  XPETRA_MONITOR("CrsMatrixFactory::Build");
243 
244 #ifdef HAVE_XPETRA_TPETRA
245  if (rowMap->lib() == UseTpetra)
246  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
247 #endif
248 
249  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
251  }
252  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
254  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
255  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
256  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
257  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
258  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
259  XPETRA_MONITOR("CrsMatrixFactory::Build");
260 
261 #ifdef HAVE_XPETRA_TPETRA
262  if (rowMap->lib() == UseTpetra)
263  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(lclMatrix, rowMap, colMap, domainMap, rangeMap, params));
264 #endif
265 
266  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
268  }
269 #endif
270 
271  };
272 
273 // we need the Epetra specialization only if Epetra is enabled
274 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
275 
276  // Specializtion for SC=double, LO=int, GO=int and Node=EpetraNode
277  // Used both for Epetra and Tpetra
278  template <>
279  class CrsMatrixFactory<double, int, int, EpetraNode> {
280  typedef double Scalar;
281  typedef int LocalOrdinal;
282  typedef int GlobalOrdinal;
283  typedef EpetraNode Node;
284 
285  private:
288 
289  public:
291  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
292  Build (const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap)
293  {
294  XPETRA_MONITOR("CrsMatrixFactory::Build");
295 #ifdef HAVE_XPETRA_TPETRA
296  if (rowMap->lib() == UseTpetra)
298 #endif
299 #ifdef HAVE_XPETRA_EPETRA
300  if(rowMap->lib() == UseEpetra)
301  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap));
302 #endif
304  }
305 
306  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
307  XPETRA_MONITOR("CrsMatrixFactory::Build");
308 
309 #ifdef HAVE_XPETRA_TPETRA
310  if (rowMap->lib() == UseTpetra)
311  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, plist) );
312 #endif
313 
314  if (rowMap->lib() == UseEpetra)
315  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, maxNumEntriesPerRow, plist) );
316 
318  }
319 
320  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
321  XPETRA_MONITOR("CrsMatrixFactory::Build");
322 
323 #ifdef HAVE_XPETRA_TPETRA
324  if (rowMap->lib() == UseTpetra)
325  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, plist) );
326 #endif
327 
328  if (rowMap->lib() == UseEpetra)
329  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, NumEntriesPerRowToAlloc, plist) );
330 
332  }
333 
335  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
336  XPETRA_MONITOR("CrsMatrixFactory::Build");
337 
338 #ifdef HAVE_XPETRA_TPETRA
339  if (rowMap->lib() == UseTpetra)
340  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
341 #endif
342 
343  if (rowMap->lib() == UseEpetra)
344  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
345 
347  }
348 
350  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
351  XPETRA_MONITOR("CrsMatrixFactory::Build");
352 
353 #ifdef HAVE_XPETRA_TPETRA
354  if (rowMap->lib() == UseTpetra)
355  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
356 #endif
357 
358  if (rowMap->lib() == UseEpetra)
359  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
360 
362  }
363 
365  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
366  XPETRA_MONITOR("CrsMatrixFactory::Build");
367 
368 #ifdef HAVE_XPETRA_TPETRA
369  if (graph->getRowMap()->lib() == UseTpetra)
370  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
371 #endif
372 
373  if (graph->getRowMap()->lib() == UseEpetra)
374  return rcp( new EpetraCrsMatrixT<int,Node>(graph, plist) );
375 
377  }
378 
379 
381  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
382  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
384  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
385  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
386  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
387  XPETRA_MONITOR("CrsMatrixFactory::Build");
388 
389 #ifdef HAVE_XPETRA_TPETRA
390  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
391  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
392 #endif
393 
394  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
395  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
396 
398  }
399 
401  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
402  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
404  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
405  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
406  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
407  XPETRA_MONITOR("CrsMatrixFactory::Build");
408 
409 #ifdef HAVE_XPETRA_TPETRA
410  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
411  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
412 #endif
413 
414  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
415  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
416 
418  }
419 
421  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
422  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
423  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
424  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
425  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
426  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
427  const Teuchos::RCP<Teuchos::ParameterList>& params) {
428  XPETRA_MONITOR("CrsMatrixFactory::Build");
429 
430 #ifdef HAVE_XPETRA_TPETRA
431  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
432  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
433 #endif
434 
435  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
436  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
437 
439  }
440 
442  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
443  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
444  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
445  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
446  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
447  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
448  const Teuchos::RCP<Teuchos::ParameterList>& params) {
449  XPETRA_MONITOR("CrsMatrixFactory::Build");
450 
451 #ifdef HAVE_XPETRA_TPETRA
452  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
453  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
454 #endif
455 
456  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
457  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
458 
460  }
461 
462 
463 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
464  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
465  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
466  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
468  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
469  XPETRA_MONITOR("CrsMatrixFactory::Build");
470 
471 #ifdef HAVE_XPETRA_TPETRA
472  if (rowMap->lib() == UseTpetra)
473  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
474 #endif
475 
476  if (rowMap->lib() == UseEpetra)
477  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, lclMatrix, params) );
478 
480  }
481  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
483  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
484  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
485  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
486  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
487  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
488  XPETRA_MONITOR("CrsMatrixFactory::Build");
489 
490 #ifdef HAVE_XPETRA_TPETRA
491  if (rowMap->lib() == UseTpetra)
492  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(lclMatrix, rowMap, colMap, domainMap, rangeMap, params));
493 #endif
494 
495  if (rowMap->lib() == UseEpetra)
496  return rcp( new EpetraCrsMatrixT<int,Node>(lclMatrix, rowMap, colMap, domainMap, rangeMap, params) );
497 
499  }
500 #endif
501 
502  };
503 #endif
504 
505 // we need the Epetra specialization only if Epetra is enabled
506 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
507 
508  template <>
509  class CrsMatrixFactory<double, int, long long, EpetraNode> {
510  typedef double Scalar;
511  typedef int LocalOrdinal;
512  typedef long long GlobalOrdinal;
513  typedef EpetraNode Node;
514 
515  private:
518 
519  public:
521  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
522  Build (const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap)
523  {
524  XPETRA_MONITOR("CrsMatrixFactory::Build");
525 #ifdef HAVE_XPETRA_TPETRA
526  if (rowMap->lib() == UseTpetra)
528 #endif
529 #ifdef HAVE_XPETRA_EPETRA
530  if(rowMap->lib() == UseEpetra)
531  return rcp( new EpetraCrsMatrixT<long long,Node>(rowMap));
532 #endif
534  }
535 
536  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
537  XPETRA_MONITOR("CrsMatrixFactory::Build");
538 
539 #ifdef HAVE_XPETRA_TPETRA
540  if (rowMap->lib() == UseTpetra)
541  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, plist) );
542 #endif
543 
544  if (rowMap->lib() == UseEpetra)
545  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, maxNumEntriesPerRow, plist) );
546 
548  }
549 
550  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
551  XPETRA_MONITOR("CrsMatrixFactory::Build");
552 
553 #ifdef HAVE_XPETRA_TPETRA
554  if (rowMap->lib() == UseTpetra)
555  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, plist) );
556 #endif
557 
558  if (rowMap->lib() == UseEpetra)
559  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, NumEntriesPerRowToAlloc, plist) );
560 
562  }
563 
565  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
566  XPETRA_MONITOR("CrsMatrixFactory::Build");
567 
568 #ifdef HAVE_XPETRA_TPETRA
569  if (rowMap->lib() == UseTpetra)
570  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
571 #endif
572 
573  if (rowMap->lib() == UseEpetra)
574  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
575 
577  }
578 
580  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
581  XPETRA_MONITOR("CrsMatrixFactory::Build");
582 
583 #ifdef HAVE_XPETRA_TPETRA
584  if (rowMap->lib() == UseTpetra)
585  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
586 #endif
587 
588  if (rowMap->lib() == UseEpetra)
589  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
590 
592  }
593 
595  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
596  XPETRA_MONITOR("CrsMatrixFactory::Build");
597 
598 #ifdef HAVE_XPETRA_TPETRA
599  if (graph->getRowMap()->lib() == UseTpetra)
600  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
601 #endif
602 
603  if (graph->getRowMap()->lib() == UseEpetra)
604  return rcp( new EpetraCrsMatrixT<long long, Node>(graph, plist) );
605 
607  }
608 
609 
611  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
612  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
614  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
615  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
616  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
617  XPETRA_MONITOR("CrsMatrixFactory::Build");
618 
619 #ifdef HAVE_XPETRA_TPETRA
620  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
621  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
622 #endif
623 
624  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
625  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
626 
628  }
629 
631  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
632  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
634  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
635  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
636  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
637  XPETRA_MONITOR("CrsMatrixFactory::Build");
638 
639 #ifdef HAVE_XPETRA_TPETRA
640  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
641  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
642 #endif
643 
644  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
645  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
646 
648  }
649 
651  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
652  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
653  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
654  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
655  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
656  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
657  const Teuchos::RCP<Teuchos::ParameterList>& params) {
658  XPETRA_MONITOR("CrsMatrixFactory::Build");
659 
660 #ifdef HAVE_XPETRA_TPETRA
661  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
662  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
663 #endif
664 
665  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
666  return rcp( new EpetraCrsMatrixT<long long,Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
667 
669  }
670 
672  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
673  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
674  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
675  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
676  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
677  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
678  const Teuchos::RCP<Teuchos::ParameterList>& params) {
679  XPETRA_MONITOR("CrsMatrixFactory::Build");
680 
681 #ifdef HAVE_XPETRA_TPETRA
682  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
683  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
684 #endif
685 
686  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
687  return rcp( new EpetraCrsMatrixT<long long,Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
688 
690  }
691 
692 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
693  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
694  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
695  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
697  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
698  XPETRA_MONITOR("CrsMatrixFactory::Build");
699 
700 #ifdef HAVE_XPETRA_TPETRA
701  if (rowMap->lib() == UseTpetra)
702  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
703 #endif
704 
705  if (rowMap->lib() == UseEpetra)
706  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, lclMatrix, params) );
707 
709  }
710  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
712  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
713  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
714  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& domainMap = Teuchos::null,
715  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rangeMap = Teuchos::null,
716  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
717  XPETRA_MONITOR("CrsMatrixFactory::Build");
718 
719 #ifdef HAVE_XPETRA_TPETRA
720  if (rowMap->lib() == UseTpetra)
721  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(lclMatrix, rowMap, colMap, domainMap, rangeMap, params));
722 #endif
723 
724  if (rowMap->lib() == UseEpetra)
725  return rcp( new EpetraCrsMatrixT<long long, Node>(lclMatrix, rowMap, colMap, domainMap, rangeMap, params) );
726 
728  }
729 #endif
730 
731  };
732 #endif
733 
734 }
735 
736 #define XPETRA_CRSMATRIXFACTORY_SHORT
737 #endif
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty matrix (intended use is an import/export target - can&#39;t insert entries directly...
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using FusedExport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty matrix (intended use is an import/export target - can&#39;t insert entries directly...
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using FusedImport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor using FusedImport.
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
CrsMatrixFactory()
Private constructor. This is a static class.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
CrsMatrixFactory()
Private constructor. This is a static class.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
CrsMatrixFactory()
Private constructor. This is a static class.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &domainMap=Teuchos::null, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
#define XPETRA_FACTORY_END
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor using FusedExport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using FusedImport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor using FusedImport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying a previously constructed graph.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor using FusedExport.
#define XPETRA_MONITOR(funcName)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using FusedExport.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &domainMap, const RCP< Map< LocalOrdinal, GlobalOrdinal, Scalar > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty matrix (intended use is an import/export target - can&#39;t insert entries directly...