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
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 = CrsMatrix<>::scalar_type,
66  class LocalOrdinal =
68  class GlobalOrdinal =
70  class Node =
73  private:
76 
77  public:
81  size_t maxNumEntriesPerRow,
83  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
84  {
85  XPETRA_MONITOR("CrsMatrixFactory::Build");
86 
87 #ifdef HAVE_XPETRA_TPETRA
88  if (rowMap->lib() == UseTpetra)
89  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
90 #endif
91 
92  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
94  }
95 
99  const ArrayRCP<const size_t>& NumEntriesPerRowToAlloc,
101  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
102  {
103 #ifdef HAVE_XPETRA_TPETRA
104  if (rowMap->lib() == UseTpetra)
105  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
106 #endif
107 
108  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
110  }
111 
116  size_t maxNumEntriesPerRow,
117  ProfileType pftype = DynamicProfile,
118  const Teuchos::RCP<Teuchos::ParameterList>& plist = Teuchos::null)
119  {
120  XPETRA_MONITOR("CrsMatrixFactory::Build");
121 
122 #ifdef HAVE_XPETRA_TPETRA
123  if (rowMap->lib() == UseTpetra)
124  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
125 #endif
126 
127  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
129  }
130 
133  XPETRA_MONITOR("CrsMatrixFactory::Build");
134 
135 #ifdef HAVE_XPETRA_TPETRA
136  if (rowMap->lib() == UseTpetra)
137  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
138 #endif
139 
140  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
142  }
143 
146  XPETRA_MONITOR("CrsMatrixFactory::Build");
147 
148 #ifdef HAVE_XPETRA_TPETRA
149  if (graph->getRowMap()->lib() == UseTpetra)
151 #endif
152 
153  XPETRA_FACTORY_ERROR_IF_EPETRA(graph->getRowMap()->lib());
155  }
156 
157 
159  XPETRA_MONITOR("CrsMatrixFactory::Build");
160 
161 #ifdef HAVE_XPETRA_TPETRA
162  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
163  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params));
164 #endif
165 
166  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
168  }
169 
171  XPETRA_MONITOR("CrsMatrixFactory::Build");
172 
173 #ifdef HAVE_XPETRA_TPETRA
174  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
175  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params));
176 #endif
177 
178  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
180  }
181 
182 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
187  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
188  XPETRA_MONITOR("CrsMatrixFactory::Build");
189 
190 #ifdef HAVE_XPETRA_TPETRA
191  if (rowMap->lib() == UseTpetra)
192  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
193 #endif
194 
195  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
197  }
198 #endif
199 
200  };
201 
202  template <>
203  class CrsMatrixFactory<double, int, int> {
204  typedef double Scalar;
205  typedef int LocalOrdinal;
206  typedef int GlobalOrdinal;
208 
209  private:
212 
213  public:
214 
216  XPETRA_MONITOR("CrsMatrixFactory::Build");
217 
218 #ifdef HAVE_XPETRA_TPETRA
219  if (rowMap->lib() == UseTpetra)
220  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
221 #endif
222 
223 #ifdef HAVE_XPETRA_EPETRA
224 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
225  if (rowMap->lib() == UseEpetra)
226  return rcp( new EpetraCrsMatrixT<int>(rowMap, maxNumEntriesPerRow, pftype, plist) );
227 #endif
228 #endif
229 
231  }
232 
234  XPETRA_MONITOR("CrsMatrixFactory::Build");
235 
236 #ifdef HAVE_XPETRA_TPETRA
237  if (rowMap->lib() == UseTpetra)
238  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
239 #endif
240 
241 #ifdef HAVE_XPETRA_EPETRA
242 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
243  if (rowMap->lib() == UseEpetra)
244  return rcp( new EpetraCrsMatrixT<int>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
245 #endif
246 #endif
247 
249  }
250 
253  XPETRA_MONITOR("CrsMatrixFactory::Build");
254 
255 #ifdef HAVE_XPETRA_TPETRA
256  if (rowMap->lib() == UseTpetra)
257  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
258 #endif
259 
260 #ifdef HAVE_XPETRA_EPETRA
261 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
262  if (rowMap->lib() == UseEpetra)
263  return rcp( new EpetraCrsMatrixT<int>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
264 #endif
265 #endif
266 
268  }
269 
272  XPETRA_MONITOR("CrsMatrixFactory::Build");
273 
274 #ifdef HAVE_XPETRA_TPETRA
275  if (rowMap->lib() == UseTpetra)
276  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
277 #endif
278 
279 #ifdef HAVE_XPETRA_EPETRA
280 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
281  if (rowMap->lib() == UseEpetra)
282  return rcp( new EpetraCrsMatrixT<int>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
283 #endif
284 #endif
285 
287  }
288 
291  XPETRA_MONITOR("CrsMatrixFactory::Build");
292 
293 #ifdef HAVE_XPETRA_TPETRA
294  if (graph->getRowMap()->lib() == UseTpetra)
296 #endif
297 
298 #ifdef HAVE_XPETRA_EPETRA
299 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
300  if (graph->getRowMap()->lib() == UseEpetra)
301  return rcp( new EpetraCrsMatrixT<int>(graph, plist) );
302 #endif
303 #endif
304 
306  }
307 
308 
311  XPETRA_MONITOR("CrsMatrixFactory::Build");
312 
313 #ifdef HAVE_XPETRA_TPETRA
314  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
315  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
316 
317 #endif
318 
319 #ifdef HAVE_XPETRA_EPETRA
320 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
321  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
322  return rcp( new EpetraCrsMatrixT<int>(sourceMatrix,importer,domainMap,rangeMap,params) );
323 #endif
324 #endif
325 
327  }
328 
331  XPETRA_MONITOR("CrsMatrixFactory::Build");
332 
333 #ifdef HAVE_XPETRA_TPETRA
334  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
335  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
336 
337 #endif
338 
339 #ifdef HAVE_XPETRA_EPETRA
340 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
341  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
342  return rcp( new EpetraCrsMatrixT<int>(sourceMatrix,exporter,domainMap,rangeMap,params) );
343 #endif
344 #endif
345 
347  }
348 
349 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
354  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
355  XPETRA_MONITOR("CrsMatrixFactory::Build");
356 
357 #ifdef HAVE_XPETRA_TPETRA
358  if (rowMap->lib() == UseTpetra)
359  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
360 #endif
361 
362 #ifdef HAVE_XPETRA_EPETRA
363 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
364  if (rowMap->lib() == UseEpetra)
365  return rcp( new EpetraCrsMatrixT<int>(rowMap, colMap, lclMatrix, params) );
366 #endif
367 #endif
369  }
370 #endif
371 
372  };
373 
374 #ifdef HAVE_XPETRA_INT_LONG_LONG
375  template <>
376  class CrsMatrixFactory<double, int, long long> {
377  typedef double Scalar;
378  typedef int LocalOrdinal;
379  typedef long long GlobalOrdinal;
381 
382  private:
384  CrsMatrixFactory() {}
385 
386  public:
387 
389  XPETRA_MONITOR("CrsMatrixFactory::Build");
390 
391 #ifdef HAVE_XPETRA_TPETRA
392  if (rowMap->lib() == UseTpetra)
393  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
394 #endif
395 
396 #ifdef HAVE_XPETRA_EPETRA
397 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
398  if (rowMap->lib() == UseEpetra)
399  return rcp( new EpetraCrsMatrixT<long long>(rowMap, maxNumEntriesPerRow, pftype, plist) );
400 #endif
401 #endif
402 
404  }
405 
407  XPETRA_MONITOR("CrsMatrixFactory::Build");
408 
409 #ifdef HAVE_XPETRA_TPETRA
410  if (rowMap->lib() == UseTpetra)
411  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
412 #endif
413 
414 #ifdef HAVE_XPETRA_EPETRA
415 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
416  if (rowMap->lib() == UseEpetra)
417  return rcp( new EpetraCrsMatrixT<long long>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
418 #endif
419 #endif
420 
422  }
423 
426  XPETRA_MONITOR("CrsMatrixFactory::Build");
427 
428 #ifdef HAVE_XPETRA_TPETRA
429  if (rowMap->lib() == UseTpetra)
430  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
431 #endif
432 
433 #ifdef HAVE_XPETRA_EPETRA
434 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
435  if (rowMap->lib() == UseEpetra)
436  return rcp( new EpetraCrsMatrixT<long long>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
437 #endif
438 #endif
439 
441  }
442 
445  XPETRA_MONITOR("CrsMatrixFactory::Build");
446 
447 #ifdef HAVE_XPETRA_TPETRA
448  if (rowMap->lib() == UseTpetra)
449  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
450 #endif
451 
452 #ifdef HAVE_XPETRA_EPETRA
453 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
454  if (rowMap->lib() == UseEpetra)
455  return rcp( new EpetraCrsMatrixT<long long>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
456 #endif
457 #endif
458 
460  }
461 
464  XPETRA_MONITOR("CrsMatrixFactory::Build");
465 
466 #ifdef HAVE_XPETRA_TPETRA
467  if (graph->getRowMap()->lib() == UseTpetra)
469 #endif
470 
471 #ifdef HAVE_XPETRA_EPETRA
472 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
473  if (graph->getRowMap()->lib() == UseEpetra)
474  return rcp( new EpetraCrsMatrixT<long long>(graph, plist) );
475 #endif
476 #endif
477 
479  }
480 
481 
483  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) {
484  XPETRA_MONITOR("CrsMatrixFactory::Build");
485 
486 #ifdef HAVE_XPETRA_TPETRA
487  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
488  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
489 
490 #endif
491 
492 #ifdef HAVE_XPETRA_EPETRA
493 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
494  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
495  return rcp( new EpetraCrsMatrixT<long long>(sourceMatrix,importer,domainMap,rangeMap,params) );
496 #endif
497 #endif
498 
500  }
501 
503  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) {
504  XPETRA_MONITOR("CrsMatrixFactory::Build");
505 
506 #ifdef HAVE_XPETRA_TPETRA
507  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
508  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
509 
510 #endif
511 
512 #ifdef HAVE_XPETRA_EPETRA
513 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
514  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
515  return rcp( new EpetraCrsMatrixT<long long>(sourceMatrix,exporter,domainMap,rangeMap,params) );
516 #endif
517 #endif
518 
520  }
521 
522 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
527  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
528  XPETRA_MONITOR("CrsMatrixFactory::Build");
529 
530 #ifdef HAVE_XPETRA_TPETRA
531  if (rowMap->lib() == UseTpetra)
532  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
533 #endif
534 
535 #ifdef HAVE_XPETRA_EPETRA
536 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
537  if (rowMap->lib() == UseEpetra)
538  return rcp( new EpetraCrsMatrixT<long long>(rowMap, colMap, lclMatrix, params) );
539 #endif
540 #endif
542  }
543 #endif
544 
545  };
546 #endif // HAVE_XPETRA_INT_LONG_LONG
547 
548 }
549 
550 #define XPETRA_CRSMATRIXFACTORY_SHORT
551 #endif
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 Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
GlobalOrdinal global_ordinal_type
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)
CrsMatrixFactory()
Private constructor. This is a static class.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
Xpetra namespace
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
LocalOrdinal local_ordinal_type
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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, ProfileType pftype=DynamicProfile, 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 > &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)
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.
#define XPETRA_FACTORY_END
CrsMatrix< double, int, GlobalOrdinal >::node_type Node
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, 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 Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
#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 Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, ProfileType pftype=DynamicProfile, 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 Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row.