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 /*=
67  typename CrsMatrix<Scalar>::local_ordinal_type*/,
68  class GlobalOrdinal /*=
69  typename CrsMatrix<Scalar, LocalOrdinal>::global_ordinal_type*/,
70  class Node /*=
71  typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal>::node_type*/>
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 // we need the Epetra specialization only if Epetra is enabled
203 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
204 
205  // Specializtion for SC=double, LO=int, GO=int and Node=EpetraNode
206  // Used both for Epetra and Tpetra
207  template <>
208  class CrsMatrixFactory<double, int, int, EpetraNode> {
209  typedef double Scalar;
210  typedef int LocalOrdinal;
211  typedef int GlobalOrdinal;
212  typedef EpetraNode Node;
213 
214  private:
217 
218  public:
219 
221  XPETRA_MONITOR("CrsMatrixFactory::Build");
222 
223 #ifdef HAVE_XPETRA_TPETRA
224  if (rowMap->lib() == UseTpetra)
225  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
226 #endif
227 
228  if (rowMap->lib() == UseEpetra)
229  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
230 
232  }
233 
235  XPETRA_MONITOR("CrsMatrixFactory::Build");
236 
237 #ifdef HAVE_XPETRA_TPETRA
238  if (rowMap->lib() == UseTpetra)
239  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
240 #endif
241 
242  if (rowMap->lib() == UseEpetra)
243  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
244 
246  }
247 
250  XPETRA_MONITOR("CrsMatrixFactory::Build");
251 
252 #ifdef HAVE_XPETRA_TPETRA
253  if (rowMap->lib() == UseTpetra)
254  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
255 #endif
256 
257  if (rowMap->lib() == UseEpetra)
258  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
259 
261  }
262 
265  XPETRA_MONITOR("CrsMatrixFactory::Build");
266 
267 #ifdef HAVE_XPETRA_TPETRA
268  if (rowMap->lib() == UseTpetra)
269  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
270 #endif
271 
272  if (rowMap->lib() == UseEpetra)
273  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
274 
276  }
277 
280  XPETRA_MONITOR("CrsMatrixFactory::Build");
281 
282 #ifdef HAVE_XPETRA_TPETRA
283  if (graph->getRowMap()->lib() == UseTpetra)
285 #endif
286 
287  if (graph->getRowMap()->lib() == UseEpetra)
288  return rcp( new EpetraCrsMatrixT<int,Node>(graph, plist) );
289 
291  }
292 
293 
296  XPETRA_MONITOR("CrsMatrixFactory::Build");
297 
298 #ifdef HAVE_XPETRA_TPETRA
299  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
300  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
301 #endif
302 
303  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
304  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
305 
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,exporter,domainMap,rangeMap,params) );
316 #endif
317 
318  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
319  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
320 
322  }
323 
324 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
329  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
330  XPETRA_MONITOR("CrsMatrixFactory::Build");
331 
332 #ifdef HAVE_XPETRA_TPETRA
333  if (rowMap->lib() == UseTpetra)
334  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
335 #endif
336 
337  if (rowMap->lib() == UseEpetra)
338  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, lclMatrix, params) );
339 
341  }
342 #endif
343 
344  };
345 #endif
346 
347 // we need the Epetra specialization only if Epetra is enabled
348 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
349 
350  template <>
351  class CrsMatrixFactory<double, int, long long, EpetraNode> {
352  typedef double Scalar;
353  typedef int LocalOrdinal;
354  typedef long long GlobalOrdinal;
355  typedef EpetraNode Node;
356 
357  private:
360 
361  public:
362 
364  XPETRA_MONITOR("CrsMatrixFactory::Build");
365 
366 #ifdef HAVE_XPETRA_TPETRA
367  if (rowMap->lib() == UseTpetra)
368  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
369 #endif
370 
371  if (rowMap->lib() == UseEpetra)
372  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
373 
375  }
376 
378  XPETRA_MONITOR("CrsMatrixFactory::Build");
379 
380 #ifdef HAVE_XPETRA_TPETRA
381  if (rowMap->lib() == UseTpetra)
382  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
383 #endif
384 
385  if (rowMap->lib() == UseEpetra)
386  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
387 
389  }
390 
393  XPETRA_MONITOR("CrsMatrixFactory::Build");
394 
395 #ifdef HAVE_XPETRA_TPETRA
396  if (rowMap->lib() == UseTpetra)
397  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
398 #endif
399 
400  if (rowMap->lib() == UseEpetra)
401  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
402 
404  }
405 
408  XPETRA_MONITOR("CrsMatrixFactory::Build");
409 
410 #ifdef HAVE_XPETRA_TPETRA
411  if (rowMap->lib() == UseTpetra)
412  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
413 #endif
414 
415  if (rowMap->lib() == UseEpetra)
416  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
417 
419  }
420 
423  XPETRA_MONITOR("CrsMatrixFactory::Build");
424 
425 #ifdef HAVE_XPETRA_TPETRA
426  if (graph->getRowMap()->lib() == UseTpetra)
428 #endif
429 
430  if (graph->getRowMap()->lib() == UseEpetra)
431  return rcp( new EpetraCrsMatrixT<long long, Node>(graph, plist) );
432 
434  }
435 
436 
439  XPETRA_MONITOR("CrsMatrixFactory::Build");
440 
441 #ifdef HAVE_XPETRA_TPETRA
442  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
443  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
444 #endif
445 
446  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
447  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
448 
450  }
451 
454  XPETRA_MONITOR("CrsMatrixFactory::Build");
455 
456 #ifdef HAVE_XPETRA_TPETRA
457  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
458  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
459 #endif
460 
461  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
462  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
463 
465  }
466 
467 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
472  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
473  XPETRA_MONITOR("CrsMatrixFactory::Build");
474 
475 #ifdef HAVE_XPETRA_TPETRA
476  if (rowMap->lib() == UseTpetra)
477  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
478 #endif
479 
480  if (rowMap->lib() == UseEpetra)
481  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, lclMatrix, params) );
483  }
484 #endif
485 
486  };
487 #endif
488 
489 }
490 
491 #define XPETRA_CRSMATRIXFACTORY_SHORT
492 #endif
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, 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.
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 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.
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)
#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, ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
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.
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, ProfileType pftype=DynamicProfile, 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.
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 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)
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_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 > &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 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.
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 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, 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.