Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_CrsGraphFactory.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_CRSGRAPHFACTORY_HPP
47#define XPETRA_CRSGRAPHFACTORY_HPP
48
49#include "Xpetra_ConfigDefs.hpp"
50
51#include "Xpetra_CrsGraph.hpp"
52
53#ifdef HAVE_XPETRA_TPETRA
54#include "Xpetra_TpetraCrsGraph.hpp"
55#endif
56
57#ifdef HAVE_XPETRA_EPETRA
59#endif
60
61#include "Xpetra_Exceptions.hpp"
62
63namespace Xpetra {
64
65 template <class LocalOrdinal,
66 class GlobalOrdinal,
69 private:
72
73 public:
77 {
78 TEUCHOS_TEST_FOR_EXCEPTION(rowMap->lib() == UseEpetra, std::logic_error,
79 "Can't create Xpetra::EpetraCrsMatrix with these scalar/LO/GO types");
80#ifdef HAVE_XPETRA_TPETRA
81 if (rowMap->lib() == UseTpetra)
83#endif
84
86 }
87
90 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t maxNumEntriesPerRow) {
91 XPETRA_MONITOR("CrsGraphFactory::Build");
92
93#ifdef HAVE_XPETRA_TPETRA
94 if (map->lib() == UseTpetra)
95 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, maxNumEntriesPerRow) );
96#endif
97
101 }
102
107 size_t maxNumEntriesPerRow,
108 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
109 XPETRA_MONITOR("CrsGraphFactory::Build");
110
111#ifdef HAVE_XPETRA_TPETRA
112 if (rowMap->lib() == UseTpetra)
113 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
114#endif
115
116 XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
119 }
120
121
126 const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc,
127 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
128 XPETRA_MONITOR("CrsGraphFactory::Build");
129
130#ifdef HAVE_XPETRA_TPETRA
131 if (rowMap->lib() == UseTpetra)
132 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
133#endif
134
135 XPETRA_FACTORY_ERROR_IF_EPETRA(rowMap->lib());
138 }
139
140
145 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node >>& domainMap = Teuchos::null,
146 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node > >& rangeMap = Teuchos::null,
147 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
148#ifdef HAVE_XPETRA_TPETRA
149 if (sourceGraph->getRowMap()->lib() == UseTpetra)
150 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
151#endif
152
153 XPETRA_FACTORY_ERROR_IF_EPETRA(sourceGraph()->getRowMap()->lib());
156 }
157
158
159
160#ifdef HAVE_XPETRA_TPETRA
185 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
186 XPETRA_MONITOR("CrsMatrixFactory::Build");
187
188 if (rowMap->lib() == UseTpetra)
190 colMap,
191 rowPointers,
192 columnIndices,
193 plist));
194
196 }
197
221 XPETRA_MONITOR("CrsMatrixFactory::Build");
222
223 if (rowMap->lib() == UseTpetra)
225 colMap,
226 lclGraph,
227 params));
228
230 }
231
260 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
261 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
262 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
263 XPETRA_MONITOR("CrsMatrixFactory::Build");
264
265 if (rowMap->lib() == UseTpetra)
267 rowMap,
268 colMap,
269 domainMap,
270 rangeMap,
271 params));
272
274 }
275#endif
276
299 const Teuchos::ArrayRCP<size_t>& rowPointers,
300 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
301 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
302 XPETRA_MONITOR("CrsMatrixFactory::Build");
303
304 if (rowMap->lib() == UseTpetra)
306 colMap,
307 rowPointers,
308 columnIndices,
309 plist));
310
312 }
313
314 };
315
316// we need the Epetra specialization only if Epetra is enabled
317#if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
318
319 template <>
320 class CrsGraphFactory<int, int, EpetraNode> {
321
322 typedef int LocalOrdinal;
323 typedef int GlobalOrdinal;
325
326 private:
329
330 public:
334 {
335 XPETRA_MONITOR("CrsMatrixFactory::Build");
336#ifdef HAVE_XPETRA_TPETRA
337 if (rowMap->lib() == UseTpetra)
339#endif
340#ifdef HAVE_XPETRA_EPETRA
341 if(rowMap->lib() == UseEpetra)
342 return rcp( new EpetraCrsGraphT<int,Node>(rowMap));
343#endif
345 }
346
348 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t maxNumEntriesPerRow) {
349 XPETRA_MONITOR("CrsGraphFactory::Build");
350
351#ifdef HAVE_XPETRA_TPETRA
352 if (map->lib() == UseTpetra)
353 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, maxNumEntriesPerRow) );
354#endif
355
356 if (map->lib() == UseEpetra)
357 return rcp( new EpetraCrsGraphT<int, Node>(map, maxNumEntriesPerRow) );
358
361 }
362
364 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) {
365 XPETRA_MONITOR("CrsGraphFactory::Build");
366
367#ifdef HAVE_XPETRA_TPETRA
368 if (rowMap->lib() == UseTpetra)
369 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
370#endif
371
372 if (rowMap->lib() == UseEpetra)
373 return rcp( new EpetraCrsGraphT<int, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
374
377 }
378
383 size_t maxNumEntriesPerRow,
384 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
385 XPETRA_MONITOR("CrsGraphFactory::Build");
386
387#ifdef HAVE_XPETRA_TPETRA
388 if (rowMap->lib() == UseTpetra)
389 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
390#endif
391 if (rowMap->lib() == UseEpetra)
392 return rcp( new EpetraCrsGraphT<int,Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
393
396 }
397
398
403 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node >>& domainMap = Teuchos::null,
404 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node > >& rangeMap = Teuchos::null,
405 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
406#ifdef HAVE_XPETRA_TPETRA
407 if (sourceGraph->getRowMap()->lib() == UseTpetra)
408 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
409#endif
410 if (sourceGraph->getRowMap()->lib() == UseEpetra)
411 return rcp( new EpetraCrsGraphT<int, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
412
415 }
416
417#ifdef HAVE_XPETRA_TPETRA
442 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
443 XPETRA_MONITOR("CrsMatrixFactory::Build");
444
445 if (rowMap->lib() == UseTpetra)
447 colMap,
448 rowPointers,
449 columnIndices,
450 plist));
451
453 }
454
478 XPETRA_MONITOR("CrsMatrixFactory::Build");
479
480 if (rowMap->lib() == UseTpetra)
482 colMap,
483 lclGraph,
484 params));
485
487 }
488
517 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
518 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
519 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
520 XPETRA_MONITOR("CrsMatrixFactory::Build");
521
522 if (rowMap->lib() == UseTpetra)
524 rowMap,
525 colMap,
526 domainMap,
527 rangeMap,
528 params));
529
531 }
532#endif
533
556 const Teuchos::ArrayRCP<size_t>& rowPointers,
557 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
558 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
559 XPETRA_MONITOR("CrsMatrixFactory::Build");
560
561 if (rowMap->lib() == UseTpetra)
563 colMap,
564 rowPointers,
565 columnIndices,
566 plist));
567
569 }
570
571 };
572#endif
573
574// we need the Epetra specialization only if Epetra is enabled
575#if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
576
577 template <>
578 class CrsGraphFactory<int, long long, EpetraNode> {
579
580 typedef int LocalOrdinal;
581 typedef long long GlobalOrdinal;
583
584 private:
587
588 public:
592 {
593 XPETRA_MONITOR("CrsMatrixFactory::Build");
594#ifdef HAVE_XPETRA_TPETRA
595 if (rowMap->lib() == UseTpetra)
597#endif
598#ifdef HAVE_XPETRA_EPETRA
599 if(rowMap->lib() == UseEpetra)
600 return rcp( new EpetraCrsGraphT<long long,Node>(rowMap));
601#endif
603 }
604
606 Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t maxNumEntriesPerRow) {
607 XPETRA_MONITOR("CrsGraphFactory::Build");
608
609#ifdef HAVE_XPETRA_TPETRA
610 if (map->lib() == UseTpetra)
611 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, maxNumEntriesPerRow) );
612#endif
613
614 if (map->lib() == UseEpetra)
615 return rcp( new EpetraCrsGraphT<long long, Node>(map, maxNumEntriesPerRow) );
616
619 }
620
622 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) {
623 XPETRA_MONITOR("CrsGraphFactory::Build");
624
625#ifdef HAVE_XPETRA_TPETRA
626 if (rowMap->lib() == UseTpetra)
627 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
628#endif
629
630 if (rowMap->lib() == UseEpetra)
631 return rcp( new EpetraCrsGraphT<long long, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
632
635 }
636
641 size_t maxNumEntriesPerRow,
642 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
643 XPETRA_MONITOR("CrsGraphFactory::Build");
644
645#ifdef HAVE_XPETRA_TPETRA
646 if (rowMap->lib() == UseTpetra)
647 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
648#endif
649 if (rowMap->lib() == UseEpetra)
650 return rcp( new EpetraCrsGraphT<long long,Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
651
654 }
655
660 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node >>& domainMap = Teuchos::null,
661 const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node > >& rangeMap = Teuchos::null,
662 const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
663#ifdef HAVE_XPETRA_TPETRA
664 if (sourceGraph->getRowMap()->lib() == UseTpetra)
665 return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
666#endif
667 if (sourceGraph->getRowMap()->lib() == UseTpetra)
668 return rcp( new EpetraCrsGraphT<long long,Node><LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
669
672 }
673
674
675#ifdef HAVE_XPETRA_TPETRA
700 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
701 XPETRA_MONITOR("CrsMatrixFactory::Build");
702
703 if (rowMap->lib() == UseTpetra)
705 colMap,
706 rowPointers,
707 columnIndices,
708 plist));
709
711 }
712
736 XPETRA_MONITOR("CrsMatrixFactory::Build");
737
738 if (rowMap->lib() == UseTpetra)
740 colMap,
741 lclGraph,
742 params));
743
745 }
746
775 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
776 const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
777 const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
778 XPETRA_MONITOR("CrsMatrixFactory::Build");
779
780 if (rowMap->lib() == UseTpetra)
782 rowMap,
783 colMap,
784 domainMap,
785 rangeMap,
786 params));
787
789 }
790#endif
791
814 const Teuchos::ArrayRCP<size_t>& rowPointers,
815 const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
816 const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
817 XPETRA_MONITOR("CrsMatrixFactory::Build");
818
819 if (rowMap->lib() == UseTpetra)
821 colMap,
822 rowPointers,
823 columnIndices,
824 plist));
825
827 }
828
829 };
830#endif
831}
832
833#define XPETRA_CRSGRAPHFACTORY_SHORT
834#endif
#define XPETRA_MONITOR(funcName)
#define XPETRA_FACTORY_ERROR_IF_EPETRA(lib)
#define XPETRA_FACTORY_END
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
CrsGraphFactory()
Private constructor. This is a static class.
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &sourceGraph, 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 RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using fused import.
static Teuchos::RCP< CrsGraph< 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 number of entries per row.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
static Teuchos::RCP< CrsGraph< 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)
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &sourceGraph, 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 RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using fused import.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow)
static RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)
static Teuchos::RCP< CrsGraph< 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)
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static Teuchos::RCP< CrsGraph< 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 number of entries per row.
CrsGraphFactory()
Private constructor. This is a static class.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor specifying column Map and a local (sorted) graph, which the resulting CrsGraph views.
CrsGraphFactory()
Private constructor. This is a static class.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t maxNumEntriesPerRow)
Constructor specifying the number of non-zeros for all rows.
static Teuchos::RCP< CrsGraph< 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 number of entries per row.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::ArrayRCP< size_t > &rowPointers, const Teuchos::ArrayRCP< LocalOrdinal > &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::row_map_type &rowPointers, const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type::entries_type::non_const_type &columnIndices, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and arrays containing the graph in sorted, local ids.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const typename Xpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node >::local_graph_type &lclGraph, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column, domain and range maps, and a local (sorted) graph, which the resulting...
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &sourceGraph, 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 RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor using fused import.
static Teuchos::RCP< CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap)
Constructor for empty graph (intended use is an import/export target - can't insert entries directly)
static Teuchos::RCP< CrsGraph< 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.
Kokkos::StaticCrsGraph< LocalOrdinal, Kokkos::LayoutLeft, device_type, void, size_t > local_graph_type
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Xpetra namespace