Debian Codegraph @

packages/trilinoscouplings/src/epetraext/EpetraExt_AmesosAMDGlobal_CrsGraph.h

raw
1 // @HEADER
2 // *****************************************************************************
3 // Trilinos: An Object-Oriented Solver Framework
4 //
5 // Copyright 2001-2024 NTESS and the Trilinos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef EpetraExt_AMESOS_AMD_CRSGRAPH_H
11 #define EpetraExt_AMESOS_AMD_CRSGRAPH_H
12
13 #include <EpetraExt_Transform.h>
14 #include <Teuchos_RCP.hpp>
15 #include <vector>
16
17 class Epetra_CrsGraph;
18 class Epetra_Map;
19
20 namespace EpetraExt {
21
22 ///
23 /** Block Triangular Factorization (Reordering) of Epetra_CrsGraph
24 *
25 * Uses Tim Davis' AMDGlobal algorithm to find a block lower or upper triangular
26 * ordering form a Epetra_CrsGraph.
27 */
28
29 class AmesosAMDGlobal_CrsGraph : public StructuralSameTypeTransform<Epetra_CrsGraph> {
30
31 public:
32
33 ///
34 /** Destructor
35 */
36 ~AmesosAMDGlobal_CrsGraph();
37
38 ///
39 /** Default Constructor
40 */
41 AmesosAMDGlobal_CrsGraph( bool verbose = false, bool debug = false )
42 : verbose_(verbose),
43 debug_(debug)
44 {}
45
46 ///
47 /** Construction of AMDGlobal ordered Epetra_CrsGraph from <tt>orig</tt> object.
48 *
49 * Preconditions:<ul>
50 * </ul>
51 *
52 * Invariants:<ul>
53 * </ul>
54 *
55 * Postconditions:<ul>
56 * </ul>
57 *
58 */
59 NewTypeRef operator()( OriginalTypeRef orig );
60
61 std::vector<int> RowPerm() { return rowPerm_; }
62 std::vector<int> ColPerm() { return colPerm_; }
63 std::vector<int> Perm() { return perm_; }
64 std::vector<int> BlockPtr() { return blkPtr_; }
65 int NumBlocks() { return numBlocks_; }
66
67 private:
68
69 Teuchos::RCP<Epetra_Map> NewRowMap_;
70 Teuchos::RCP<Epetra_Map> NewColMap_;
71
72 Teuchos::RCP<Epetra_CrsGraph> NewGraph_;
73
74 std::vector<int> perm_, rowPerm_, colPerm_, blkPtr_;
75
76 int numBlocks_;
77
78 const bool verbose_, debug_;
79 };
80
81 } //namespace EpetraExt
82
83 #endif //EpetraExt_AMESOS_AMD_CRSGRAPH_H