44 #include "Teuchos_ParameterList.hpp" 45 #include "Teuchos_RefCountPtr.hpp" 46 #include "Epetra_MultiVector.h" 48 #include "Epetra_RowMatrix.h" 53 #include <amesos_amd.h> 67 NumMyRows_(
RHS.NumMyRows()),
68 IsComputed_(
RHS.IsComputed())
139 int NumNz =
Graph.NumMyNonzeros();
146 std::vector<int> ja(NumNz);
150 int * tmpP = &ja[ia[i]];
151 Graph.ExtractMyRowCopy( i, NumNz-ia[i], cnt, tmpP );
152 ia[i+1] = ia[i] + cnt;
157 std::vector<int> jat(NumNz);
162 for(
int j = ia[i]; j < ia[i+1]; ++j )
174 std::vector<double> info(AMD_INFO);
178 if( info[AMD_STATUS] == AMD_INVALID )
179 cout <<
"AMD ORDERING: Invalid!!!!" << endl;
226 Epetra_MultiVector& X)
const 233 X[j][np] = Xorig[j][i];
242 Epetra_MultiVector& X)
const 249 X[j][i] = Xorig[j][np];
261 os <<
"*** Ifpack_AMDReordering" << endl << endl;
263 os <<
"*** Reordering not yet computed." << endl;
265 os <<
"*** Number of local rows = " <<
NumMyRows_ << endl;
267 os <<
"Local Row\tReorder[i]\tInvReorder[i]" << endl;
int NumMyRows_
Number of local rows in the graph.
std::vector< int > Reorder_
Contains the reordering.
std::ostream & Print(std::ostream &os) const
Prints basic information on iostream. This function is used by operator<<.
int InvReorder(const int i) const
Returns the inverse reordered index of row i.
Ifpack_AMDReordering()
Constructor for Ifpack_Graph's.
int SetParameters(Teuchos::ParameterList &List)
Sets all parameters.
Ifpack_AMDReordering: approximate minimum degree reordering.
int Pinv(const Epetra_MultiVector &Xorig, Epetra_MultiVector &Xinvreord) const
Applies inverse reordering to multivector X, whose local length equals the number of local rows...
Ifpack_AMDReordering & operator=(const Ifpack_AMDReordering &RHS)
Assignment operator.
int NumMyRows() const
Returns the number of local rows.
int Compute(const Ifpack_Graph &Graph)
Computes all it is necessary to initialize the reordering object.
int SetParameter(const std::string Name, const int Value)
Sets integer parameters ‘Name’.
bool IsComputed() const
Returns true is the reordering object has been successfully initialized, false otherwise.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
std::vector< int > InvReorder_
Contains the inverse reordering.
adjacency_list< vecS, vecS, undirectedS, no_property, property< edge_weight_t, double > > Graph
Ifpack_Graph_Epetra_RowMatrix: a class to define Ifpack_Graph as a light-weight conversion of Epetra_...
int Reorder(const int i) const
Returns the reordered index of row i.
Ifpack_Graph: a pure virtual class that defines graphs for IFPACK.
int P(const Epetra_MultiVector &Xorig, Epetra_MultiVector &Xreord) const
Applies reordering to multivector X, whose local length equals the number of local rows...
#define IFPACK_CHK_ERR(ifpack_err)
bool IsComputed_
If true, the reordering has been successfully computed.