Isorropia: Partitioning, Load Balancing and more
Isorropia_EpetraProber.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_EpetraProber_hpp_
41 #define _Isorropia_EpetraProber_hpp_
42 
43 #include <Isorropia_ConfigDefs.hpp>
44 #include <Teuchos_ParameterList.hpp>
45 
46 #include <Isorropia_Colorer.hpp>
48 
49 #ifdef HAVE_EPETRA
50 #include <Epetra_CrsGraph.h>
51 #include <Teuchos_RCP.hpp>
52 class Epetra_MultiVector;
53 class Epetra_CrsMatrix;
54 class Epetra_Operator;
55 
56 namespace Isorropia {
57 
58 namespace Epetra {
59 
67 class Prober {
68 public:
69 
79  Prober(Teuchos::RCP<const Epetra_CrsGraph> input_graph,
80  const Teuchos::ParameterList& paramlist,
81  bool compute_now=true);
82 
83 
93  Prober(const Epetra_CrsGraph * input_graph,
94  const Teuchos::ParameterList& paramlist,
95  bool compute_now=true);
96 
106  Prober(Teuchos::RCP<const Epetra_CrsMatrix> input_matrix,
107  const Teuchos::ParameterList & paramlist,
108  bool compute_now=true);
109 
110 
120  Prober(const Epetra_CrsMatrix * input_matrix,
121  const Teuchos::ParameterList & paramlist,
122  bool compute_now=true);
123 
124 
125 
129  Prober();
130 
131 
133  ~Prober(){delete colorer_;}
134 
135 
137  void setList(const Teuchos::ParameterList& paramlist);
138 
140  void setGraph(Teuchos::RCP<const Epetra_CrsGraph> input_graph){input_graph_=input_graph; has_colored=false;}
141 
145  void color();
146 
153 
159  int probe(const Epetra_Operator & op, Epetra_CrsMatrix & out_matrix);
160 
166  Teuchos::RCP<Epetra_CrsMatrix> probe(const Epetra_Operator & op);
167 
168 private:
169  Teuchos::RCP<const Epetra_CrsGraph> input_graph_;
171  Teuchos::ParameterList List_;
173 };//class Prober
174 
175 }//namespace Epetra
176 }//namespace Isorropia
177 
178 #endif //HAVE_EPETRA
179 
180 #endif
181 
Teuchos::RCP< const Epetra_CrsGraph > input_graph_
Definition: Isorropia_EpetraProber.hpp:169
void color()
Compute the coloring.
Teuchos::ParameterList List_
Definition: Isorropia_EpetraProber.hpp:171
An implementation of the Prober interface that operates on Epetra matrices and linear systems...
Definition: Isorropia_EpetraProber.hpp:67
int getNumOrthogonalVectors()
Get the number of orthogonal vectors (or the number of colors from coloring)
void setGraph(Teuchos::RCP< const Epetra_CrsGraph > input_graph)
Sets the graph.
Definition: Isorropia_EpetraProber.hpp:140
int probe(const Epetra_Operator &op, Epetra_CrsMatrix &out_matrix)
Perform the actual probing.
Prober()
Default Constructor.
Colorer * colorer_
Definition: Isorropia_EpetraProber.hpp:170
bool has_colored
Definition: Isorropia_EpetraProber.hpp:172
~Prober()
Destructor.
Definition: Isorropia_EpetraProber.hpp:133
void setList(const Teuchos::ParameterList &paramlist)
Sets the parameter list.
An implementation of the Colorer interface that operates on Epetra matrices and linear systems...
Definition: Isorropia_EpetraColorer.hpp:76