Xpetra  Version of the Day
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 
63 namespace 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_KOKKOS_REFACTOR
161 #ifdef HAVE_XPETRA_TPETRA
186  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
187  XPETRA_MONITOR("CrsMatrixFactory::Build");
188 
189  if (rowMap->lib() == UseTpetra)
191  colMap,
192  rowPointers,
193  columnIndices,
194  plist));
195 
197  }
198 
218  Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
219  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
221  const Teuchos::RCP<Teuchos::ParameterList>& params) {
222  XPETRA_MONITOR("CrsMatrixFactory::Build");
223 
224  if (rowMap->lib() == UseTpetra)
225  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
226  colMap,
227  lclGraph,
228  params));
229 
231  }
232 
259  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
260  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
261  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
262  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
263  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
264  XPETRA_MONITOR("CrsMatrixFactory::Build");
265 
266  if (rowMap->lib() == UseTpetra)
267  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
268  rowMap,
269  colMap,
270  domainMap,
271  rangeMap,
272  params));
273 
275  }
276 #endif
277 #endif
278 
301  const Teuchos::ArrayRCP<size_t>& rowPointers,
302  const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
303  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
304  XPETRA_MONITOR("CrsMatrixFactory::Build");
305 
306  if (rowMap->lib() == UseTpetra)
308  colMap,
309  rowPointers,
310  columnIndices,
311  plist));
312 
314  }
315 
316  };
317 
318 // we need the Epetra specialization only if Epetra is enabled
319 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES))
320 
321  template <>
322  class CrsGraphFactory<int, int, EpetraNode> {
323 
324  typedef int LocalOrdinal;
325  typedef int GlobalOrdinal;
326  typedef EpetraNode Node;
327 
328  private:
331 
332  public:
336  {
337  XPETRA_MONITOR("CrsMatrixFactory::Build");
338 #ifdef HAVE_XPETRA_TPETRA
339  if (rowMap->lib() == UseTpetra)
341 #endif
342 #ifdef HAVE_XPETRA_EPETRA
343  if(rowMap->lib() == UseEpetra)
344  return rcp( new EpetraCrsGraphT<int,Node>(rowMap));
345 #endif
347  }
348 
350  Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t maxNumEntriesPerRow) {
351  XPETRA_MONITOR("CrsGraphFactory::Build");
352 
353 #ifdef HAVE_XPETRA_TPETRA
354  if (map->lib() == UseTpetra)
355  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, maxNumEntriesPerRow) );
356 #endif
357 
358  if (map->lib() == UseEpetra)
359  return rcp( new EpetraCrsGraphT<int, Node>(map, maxNumEntriesPerRow) );
360 
363  }
364 
366  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) {
367  XPETRA_MONITOR("CrsGraphFactory::Build");
368 
369 #ifdef HAVE_XPETRA_TPETRA
370  if (rowMap->lib() == UseTpetra)
371  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
372 #endif
373 
374  if (rowMap->lib() == UseEpetra)
375  return rcp( new EpetraCrsGraphT<int, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
376 
379  }
380 
385  size_t maxNumEntriesPerRow,
386  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
387  XPETRA_MONITOR("CrsGraphFactory::Build");
388 
389 #ifdef HAVE_XPETRA_TPETRA
390  if (rowMap->lib() == UseTpetra)
391  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
392 #endif
393  if (rowMap->lib() == UseEpetra)
394  return rcp( new EpetraCrsGraphT<int,Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
395 
398  }
399 
400 
405  const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node >>& domainMap = Teuchos::null,
406  const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node > >& rangeMap = Teuchos::null,
407  const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
408 #ifdef HAVE_XPETRA_TPETRA
409  if (sourceGraph->getRowMap()->lib() == UseTpetra)
410  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
411 #endif
412  if (sourceGraph->getRowMap()->lib() == UseEpetra)
413  return rcp( new EpetraCrsGraphT<int, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
414 
417  }
418 
419 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
420 #ifdef HAVE_XPETRA_TPETRA
445  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
446  XPETRA_MONITOR("CrsMatrixFactory::Build");
447 
448  if (rowMap->lib() == UseTpetra)
450  colMap,
451  rowPointers,
452  columnIndices,
453  plist));
454 
456  }
457 
477  Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
478  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
480  const Teuchos::RCP<Teuchos::ParameterList>& params) {
481  XPETRA_MONITOR("CrsMatrixFactory::Build");
482 
483  if (rowMap->lib() == UseTpetra)
484  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
485  colMap,
486  lclGraph,
487  params));
488 
490  }
491 
518  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
519  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
520  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
521  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
522  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
523  XPETRA_MONITOR("CrsMatrixFactory::Build");
524 
525  if (rowMap->lib() == UseTpetra)
526  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
527  rowMap,
528  colMap,
529  domainMap,
530  rangeMap,
531  params));
532 
534  }
535 #endif
536 #endif
537 
560  const Teuchos::ArrayRCP<size_t>& rowPointers,
561  const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
562  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
563  XPETRA_MONITOR("CrsMatrixFactory::Build");
564 
565  if (rowMap->lib() == UseTpetra)
567  colMap,
568  rowPointers,
569  columnIndices,
570  plist));
571 
573  }
574 
575  };
576 #endif
577 
578 // we need the Epetra specialization only if Epetra is enabled
579 #if (defined(HAVE_XPETRA_EPETRA) && !defined(XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES))
580 
581  template <>
582  class CrsGraphFactory<int, long long, EpetraNode> {
583 
584  typedef int LocalOrdinal;
585  typedef long long GlobalOrdinal;
586  typedef EpetraNode Node;
587 
588  private:
591 
592  public:
596  {
597  XPETRA_MONITOR("CrsMatrixFactory::Build");
598 #ifdef HAVE_XPETRA_TPETRA
599  if (rowMap->lib() == UseTpetra)
601 #endif
602 #ifdef HAVE_XPETRA_EPETRA
603  if(rowMap->lib() == UseEpetra)
604  return rcp( new EpetraCrsGraphT<long long,Node>(rowMap));
605 #endif
607  }
608 
610  Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &map, size_t maxNumEntriesPerRow) {
611  XPETRA_MONITOR("CrsGraphFactory::Build");
612 
613 #ifdef HAVE_XPETRA_TPETRA
614  if (map->lib() == UseTpetra)
615  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node> (map, maxNumEntriesPerRow) );
616 #endif
617 
618  if (map->lib() == UseEpetra)
619  return rcp( new EpetraCrsGraphT<long long, Node>(map, maxNumEntriesPerRow) );
620 
623  }
624 
626  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) {
627  XPETRA_MONITOR("CrsGraphFactory::Build");
628 
629 #ifdef HAVE_XPETRA_TPETRA
630  if (rowMap->lib() == UseTpetra)
631  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
632 #endif
633 
634  if (rowMap->lib() == UseEpetra)
635  return rcp( new EpetraCrsGraphT<long long, Node>(rowMap, colMap, NumEntriesPerRowToAlloc, plist) );
636 
639  }
640 
645  size_t maxNumEntriesPerRow,
646  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
647  XPETRA_MONITOR("CrsGraphFactory::Build");
648 
649 #ifdef HAVE_XPETRA_TPETRA
650  if (rowMap->lib() == UseTpetra)
651  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
652 #endif
653  if (rowMap->lib() == UseEpetra)
654  return rcp( new EpetraCrsGraphT<long long,Node>(rowMap, colMap, maxNumEntriesPerRow, plist) );
655 
658  }
659 
664  const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node >>& domainMap = Teuchos::null,
665  const RCP<const Map< LocalOrdinal, GlobalOrdinal, Node > >& rangeMap = Teuchos::null,
666  const RCP<Teuchos::ParameterList>& params = Teuchos::null) {
667 #ifdef HAVE_XPETRA_TPETRA
668  if (sourceGraph->getRowMap()->lib() == UseTpetra)
669  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
670 #endif
671  if (sourceGraph->getRowMap()->lib() == UseTpetra)
672  return rcp( new EpetraCrsGraphT<long long,Node><LocalOrdinal, GlobalOrdinal, Node>(sourceGraph, importer, domainMap, rangeMap, params) );
673 
676  }
677 
678 
679 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
680 #ifdef HAVE_XPETRA_TPETRA
705  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
706  XPETRA_MONITOR("CrsMatrixFactory::Build");
707 
708  if (rowMap->lib() == UseTpetra)
710  colMap,
711  rowPointers,
712  columnIndices,
713  plist));
714 
716  }
717 
737  Build(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
738  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
740  const Teuchos::RCP<Teuchos::ParameterList>& params) {
741  XPETRA_MONITOR("CrsMatrixFactory::Build");
742 
743  if (rowMap->lib() == UseTpetra)
744  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(rowMap,
745  colMap,
746  lclGraph,
747  params));
748 
750  }
751 
778  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rowMap,
779  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& colMap,
780  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& domainMap = Teuchos::null,
781  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& rangeMap = Teuchos::null,
782  const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
783  XPETRA_MONITOR("CrsMatrixFactory::Build");
784 
785  if (rowMap->lib() == UseTpetra)
786  return rcp( new TpetraCrsGraph<LocalOrdinal, GlobalOrdinal, Node>(lclGraph,
787  rowMap,
788  colMap,
789  domainMap,
790  rangeMap,
791  params));
792 
794  }
795 #endif
796 #endif
797 
820  const Teuchos::ArrayRCP<size_t>& rowPointers,
821  const Teuchos::ArrayRCP<LocalOrdinal>& columnIndices,
822  const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null) {
823  XPETRA_MONITOR("CrsMatrixFactory::Build");
824 
825  if (rowMap->lib() == UseTpetra)
827  colMap,
828  rowPointers,
829  columnIndices,
830  plist));
831 
833  }
834 
835  };
836 #endif
837 }
838 
839 #define XPETRA_CRSGRAPHFACTORY_SHORT
840 #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.
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 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 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 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, 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 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 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 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)
CrsGraphFactory()
Private constructor. This is a static class.
CrsGraphFactory()
Private constructor. This is a static class.
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 > > &map, size_t maxNumEntriesPerRow)
Constructor specifying the number of non-zeros for all rows.
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, 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 ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying column Map and number of entries in each row.
#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