Isorropia: Partitioning, Load Balancing and more
Isorropia_EpetraColorer.hpp
Go to the documentation of this file.
1 //@HEADER
2 //************************************************************************
3 //
4 // Isorropia: Partitioning and Load Balancing Package
5 // Copyright (2006) Sandia Corporation
6 //
7 //Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 //license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 //************************************************************************
38 //@HEADER
39 
40 #ifndef _Isorropia_EpetraColorer_hpp_
41 #define _Isorropia_EpetraColorer_hpp_
42 
43 #include <Isorropia_ConfigDefs.hpp>
44 #include <Teuchos_RCP.hpp>
45 #include <Teuchos_ParameterList.hpp>
46 
49 #include <Isorropia_Colorer.hpp>
50 
51 #ifdef HAVE_EPETRAEXT
52 #include <Epetra_MapColoring.h>
53 #endif /* HAVE_EPETRAEXT */
54 
55 #ifdef HAVE_EPETRA
56 class Epetra_Map;
57 class Epetra_BlockMap;
58 class Epetra_Import;
59 class Epetra_Vector;
60 class Epetra_MultiVector;
61 class Epetra_CrsGraph;
62 class Epetra_CrsMatrix;
63 class Epetra_RowMatrix;
64 class Epetra_LinearProblem;
65 
66 namespace Isorropia {
67 
68 namespace Epetra {
69 
77 public:
78 
88  Colorer(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
89  const Teuchos::ParameterList& paramlist=Teuchos::ParameterList("EmptyParameterList"),
90  bool compute_now=true);
91 
101  Colorer(const Epetra_CrsGraph * input_graph,
102  const Teuchos::ParameterList& paramlist=Teuchos::ParameterList("EmptyParameterList"),
103  bool compute_now=true);
104 
114  Colorer(Teuchos::RCP<const Epetra_RowMatrix> input_matrix,
115  const Teuchos::ParameterList& paramlist=Teuchos::ParameterList("EmptyParameterList"),
116  bool compute_now=true);
117 
118 
128  Colorer(const Epetra_RowMatrix * input_matrix,
129  const Teuchos::ParameterList& paramlist=Teuchos::ParameterList("EmptyParameterList"),
130  bool compute_now=true);
131 
132 
134  ~Colorer() {} ;
135 
144  void color(bool force_coloring=false);
145 
154  void compute(bool force_compute=false) {
155  color(force_compute);
156  }
157 
158 #ifdef HAVE_EPETRAEXT
159 
166  __deprecated Teuchos::RCP<Epetra_MapColoring> generateMapColoring() {
167  return generateRowMapColoring();
168  }
169 
170 
178  Teuchos::RCP<Epetra_MapColoring> generateRowMapColoring() ;
179 
187  Teuchos::RCP<Epetra_MapColoring> generateColMapColoring() ;
188 
189 private:
190  Teuchos::RCP<const Epetra_BlockMap> colmap_;
191 
192 #endif /* HAVE_EPETRAEXT */
193 
194 };//class Colorer
195 
196 }//namespace Epetra
197 }//namespace Isorropia
198 
199 #endif //HAVE_EPETRA
200 
201 #endif
202 
An implementation of the Partitioner interface that operates on Epetra matrices and linear systems...
Definition: Isorropia_EpetraOperator.hpp:72
Teuchos::RCP< Epetra_MapColoring > generateRowMapColoring()
Generate an Epetra_MapColoring object corresponding of rows color.
void compute(bool force_compute=false)
Compute the coloring if it has not already been computed, same effect as Isorropia::Epetra::Colorer::...
Definition: Isorropia_EpetraColorer.hpp:154
Colorer(Teuchos::RCP< const Epetra_CrsGraph > input_graph, const Teuchos::ParameterList &paramlist=Teuchos::ParameterList("EmptyParameterList"), bool compute_now=true)
Constructor.
Teuchos::RCP< const Epetra_BlockMap > colmap_
Definition: Isorropia_EpetraColorer.hpp:190
~Colorer()
Destructor.
Definition: Isorropia_EpetraColorer.hpp:134
Interface (abstract base class) for computing a new coloring and describing the result.
Definition: Isorropia_Colorer.hpp:55
__deprecated Teuchos::RCP< Epetra_MapColoring > generateMapColoring()
Generate an Epetra_MapColoring object.
Definition: Isorropia_EpetraColorer.hpp:166
Teuchos::RCP< Epetra_MapColoring > generateColMapColoring()
Generate an Epetra_MapColoring object corresponding of columns color.
#define __deprecated
Definition: Isorropia_ConfigDefs.hpp:94
void color(bool force_coloring=false)
Compute the coloring if it has not already been computed, same effect as Isorropia::Epetra::Colorer::...
An implementation of the Colorer interface that operates on Epetra matrices and linear systems...
Definition: Isorropia_EpetraColorer.hpp:76