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:
79  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
80  Build (const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap,
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 
97  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
98  Build (const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > >& rowMap,
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 
113  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
114  Build (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
115  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
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 
132  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) {
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 
145  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) {
146  XPETRA_MONITOR("CrsMatrixFactory::Build");
147 
148 #ifdef HAVE_XPETRA_TPETRA
149  if (graph->getRowMap()->lib() == UseTpetra)
150  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
151 #endif
152 
153  XPETRA_FACTORY_ERROR_IF_EPETRA(graph->getRowMap()->lib());
155  }
156 
157 
158  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
159  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
161  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
162  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
163  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
164  XPETRA_MONITOR("CrsMatrixFactory::Build");
165 
166 #ifdef HAVE_XPETRA_TPETRA
167  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
168  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params));
169 #endif
170 
171  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
173  }
174 
175  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
176  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
178  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & domainMap = Teuchos::null,
179  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & rangeMap = Teuchos::null,
180  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
181  XPETRA_MONITOR("CrsMatrixFactory::Build");
182 
183 #ifdef HAVE_XPETRA_TPETRA
184  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
185  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params));
186 #endif
187 
188  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
190  }
191 
192  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
193  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
194  const Import<LocalOrdinal,GlobalOrdinal,Node> &RowImporter,
195  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
196  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
197  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
198  const Teuchos::RCP<Teuchos::ParameterList>& params) {
199  XPETRA_MONITOR("CrsMatrixFactory::Build");
200 
201 #ifdef HAVE_XPETRA_TPETRA
202  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
203  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params));
204 #endif
205 
206  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
208  }
209 
210  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
211  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
212  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
213  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
214  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & domainMap,
215  const RCP<Map<LocalOrdinal,GlobalOrdinal,Scalar> > & rangeMap,
216  const Teuchos::RCP<Teuchos::ParameterList>& params) {
217  XPETRA_MONITOR("CrsMatrixFactory::Build");
218 
219 #ifdef HAVE_XPETRA_TPETRA
220  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
221  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params));
222 #endif
223 
224  XPETRA_FACTORY_ERROR_IF_EPETRA(sourceMatrix->getRowMap()->lib());
226  }
227 
228 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
229  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
230  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
231  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
233  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
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, colMap, lclMatrix, params));
239 #endif
240 
241  XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
243  }
244 #endif
245 
246  };
247 
248 // we need the Epetra specialization only if Epetra is enabled
249 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
250 
251  // Specializtion for SC=double, LO=int, GO=int and Node=EpetraNode
252  // Used both for Epetra and Tpetra
253  template <>
254  class CrsMatrixFactory<double, int, int, EpetraNode> {
255  typedef double Scalar;
256  typedef int LocalOrdinal;
257  typedef int GlobalOrdinal;
258  typedef EpetraNode Node;
259 
260  private:
263 
264  public:
265 
266  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) {
267  XPETRA_MONITOR("CrsMatrixFactory::Build");
268 
269 #ifdef HAVE_XPETRA_TPETRA
270  if (rowMap->lib() == UseTpetra)
271  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
272 #endif
273 
274  if (rowMap->lib() == UseEpetra)
275  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
276 
278  }
279 
280  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) {
281  XPETRA_MONITOR("CrsMatrixFactory::Build");
282 
283 #ifdef HAVE_XPETRA_TPETRA
284  if (rowMap->lib() == UseTpetra)
285  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
286 #endif
287 
288  if (rowMap->lib() == UseEpetra)
289  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
290 
292  }
293 
295  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) {
296  XPETRA_MONITOR("CrsMatrixFactory::Build");
297 
298 #ifdef HAVE_XPETRA_TPETRA
299  if (rowMap->lib() == UseTpetra)
300  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
301 #endif
302 
303  if (rowMap->lib() == UseEpetra)
304  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
305 
307  }
308 
310  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) {
311  XPETRA_MONITOR("CrsMatrixFactory::Build");
312 
313 #ifdef HAVE_XPETRA_TPETRA
314  if (rowMap->lib() == UseTpetra)
315  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
316 #endif
317 
318  if (rowMap->lib() == UseEpetra)
319  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
320 
322  }
323 
325  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) {
326  XPETRA_MONITOR("CrsMatrixFactory::Build");
327 
328 #ifdef HAVE_XPETRA_TPETRA
329  if (graph->getRowMap()->lib() == UseTpetra)
330  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
331 #endif
332 
333  if (graph->getRowMap()->lib() == UseEpetra)
334  return rcp( new EpetraCrsMatrixT<int,Node>(graph, plist) );
335 
337  }
338 
339 
341  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
342  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
344  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
345  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
346  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
347  XPETRA_MONITOR("CrsMatrixFactory::Build");
348 
349 #ifdef HAVE_XPETRA_TPETRA
350  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
351  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
352 #endif
353 
354  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
355  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
356 
358  }
359 
361  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
362  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
364  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
365  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
366  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
367  XPETRA_MONITOR("CrsMatrixFactory::Build");
368 
369 #ifdef HAVE_XPETRA_TPETRA
370  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
371  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
372 #endif
373 
374  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
375  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
376 
378  }
379 
381  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
382  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
383  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
384  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
385  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
386  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
387  const Teuchos::RCP<Teuchos::ParameterList>& params) {
388  XPETRA_MONITOR("CrsMatrixFactory::Build");
389 
390 #ifdef HAVE_XPETRA_TPETRA
391  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
392  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
393 #endif
394 
395  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
396  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
397 
399  }
400 
402  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
403  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
404  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
405  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
406  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
407  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
408  const Teuchos::RCP<Teuchos::ParameterList>& params) {
409  XPETRA_MONITOR("CrsMatrixFactory::Build");
410 
411 #ifdef HAVE_XPETRA_TPETRA
412  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
413  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
414 #endif
415 
416  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
417  return rcp( new EpetraCrsMatrixT<int,Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
418 
420  }
421 
422 
423 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
424  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
425  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
426  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
428  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
429  XPETRA_MONITOR("CrsMatrixFactory::Build");
430 
431 #ifdef HAVE_XPETRA_TPETRA
432  if (rowMap->lib() == UseTpetra)
433  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
434 #endif
435 
436  if (rowMap->lib() == UseEpetra)
437  return rcp( new EpetraCrsMatrixT<int,Node>(rowMap, colMap, lclMatrix, params) );
438 
440  }
441 #endif
442 
443  };
444 #endif
445 
446 // we need the Epetra specialization only if Epetra is enabled
447 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
448 
449  template <>
450  class CrsMatrixFactory<double, int, long long, EpetraNode> {
451  typedef double Scalar;
452  typedef int LocalOrdinal;
453  typedef long long GlobalOrdinal;
454  typedef EpetraNode Node;
455 
456  private:
459 
460  public:
461 
462  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) {
463  XPETRA_MONITOR("CrsMatrixFactory::Build");
464 
465 #ifdef HAVE_XPETRA_TPETRA
466  if (rowMap->lib() == UseTpetra)
467  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
468 #endif
469 
470  if (rowMap->lib() == UseEpetra)
471  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, maxNumEntriesPerRow, pftype, plist) );
472 
474  }
475 
476  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) {
477  XPETRA_MONITOR("CrsMatrixFactory::Build");
478 
479 #ifdef HAVE_XPETRA_TPETRA
480  if (rowMap->lib() == UseTpetra)
481  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
482 #endif
483 
484  if (rowMap->lib() == UseEpetra)
485  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, NumEntriesPerRowToAlloc, pftype, plist) );
486 
488  }
489 
491  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) {
492  XPETRA_MONITOR("CrsMatrixFactory::Build");
493 
494 #ifdef HAVE_XPETRA_TPETRA
495  if (rowMap->lib() == UseTpetra)
496  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
497 #endif
498 
499  if (rowMap->lib() == UseEpetra)
500  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, maxNumEntriesPerRow, pftype, plist) );
501 
503  }
504 
506  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) {
507  XPETRA_MONITOR("CrsMatrixFactory::Build");
508 
509 #ifdef HAVE_XPETRA_TPETRA
510  if (rowMap->lib() == UseTpetra)
511  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
512 #endif
513 
514  if (rowMap->lib() == UseEpetra)
515  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, pftype, plist) );
516 
518  }
519 
521  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) {
522  XPETRA_MONITOR("CrsMatrixFactory::Build");
523 
524 #ifdef HAVE_XPETRA_TPETRA
525  if (graph->getRowMap()->lib() == UseTpetra)
526  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(graph, plist) );
527 #endif
528 
529  if (graph->getRowMap()->lib() == UseEpetra)
530  return rcp( new EpetraCrsMatrixT<long long, Node>(graph, plist) );
531 
533  }
534 
535 
537  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
538  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
540  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
541  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
542  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
543  XPETRA_MONITOR("CrsMatrixFactory::Build");
544 
545 #ifdef HAVE_XPETRA_TPETRA
546  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
547  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
548 #endif
549 
550  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
551  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,importer,domainMap,rangeMap,params) );
552 
554  }
555 
557  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
558  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
560  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap = Teuchos::null,
561  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap = Teuchos::null,
562  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
563  XPETRA_MONITOR("CrsMatrixFactory::Build");
564 
565 #ifdef HAVE_XPETRA_TPETRA
566  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
567  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
568 #endif
569 
570  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
571  return rcp( new EpetraCrsMatrixT<long long, Node>(sourceMatrix,exporter,domainMap,rangeMap,params) );
572 
574  }
575 
577  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
578  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
579  const Import<LocalOrdinal,GlobalOrdinal,Node> & RowImporter,
580  const RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> > DomainImporter,
581  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
582  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
583  const Teuchos::RCP<Teuchos::ParameterList>& params) {
584  XPETRA_MONITOR("CrsMatrixFactory::Build");
585 
586 #ifdef HAVE_XPETRA_TPETRA
587  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
588  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
589 #endif
590 
591  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
592  return rcp( new EpetraCrsMatrixT<long long,Node>(sourceMatrix,RowImporter,DomainImporter,domainMap,rangeMap,params) );
593 
595  }
596 
598  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build(
599  const Teuchos::RCP< const CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix,
600  const Export<LocalOrdinal,GlobalOrdinal,Node> &RowExporter,
601  const RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> > DomainExporter,
602  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & domainMap,
603  const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & rangeMap,
604  const Teuchos::RCP<Teuchos::ParameterList>& params) {
605  XPETRA_MONITOR("CrsMatrixFactory::Build");
606 
607 #ifdef HAVE_XPETRA_TPETRA
608  if (sourceMatrix->getRowMap()->lib() == UseTpetra)
609  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
610 #endif
611 
612  if (sourceMatrix->getRowMap()->lib() == UseEpetra)
613  return rcp( new EpetraCrsMatrixT<long long,Node>(sourceMatrix,RowExporter,DomainExporter,domainMap,rangeMap,params) );
614 
616  }
617 
618 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
619  static RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Build (
620  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& rowMap,
621  const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& colMap,
623  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
624  XPETRA_MONITOR("CrsMatrixFactory::Build");
625 
626 #ifdef HAVE_XPETRA_TPETRA
627  if (rowMap->lib() == UseTpetra)
628  return rcp( new TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, lclMatrix, params));
629 #endif
630 
631  if (rowMap->lib() == UseEpetra)
632  return rcp( new EpetraCrsMatrixT<long long, Node>(rowMap, colMap, lclMatrix, params) );
634  }
635 #endif
636 
637  };
638 #endif
639 
640 }
641 
642 #define XPETRA_CRSMATRIXFACTORY_SHORT
643 #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)
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, 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.
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 > &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 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 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.
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, 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.