45 #include "Epetra_ConfigDefs.h"
46 #include "Epetra_RowMatrix.h"
47 #include "Epetra_Comm.h"
48 #include "Epetra_Map.h"
49 #include "Epetra_MultiVector.h"
50 #include "Epetra_Vector.h"
65 if (
A_->Comm().NumProc() != 1) {
66 cerr <<
"Ifpack_DropFilter can be used with Comm().NumProc() == 1" << endl;
67 cerr <<
"only. This class is a tool for Ifpack_AdditiveSchwarz," << endl;
68 cerr <<
"and it is not meant to be used otherwise." << endl;
72 if ((
A_->NumMyRows() !=
A_->NumGlobalRows64()) ||
73 (
A_->NumMyRows() !=
A_->NumMyCols()))
86 for (
int i = 0 ; i <
NumRows_ ; ++i) {
103 double *Values,
int * Indices)
const
117 for (
int i = 0 ; i < Nnz ; ++i) {
151 if (NumVectors != Y.NumVectors())
159 for (
int i = 0 ; i <
NumRows_ ; ++i) {
163 &Values[0], &Indices[0]);
167 for (
int k = 0 ; k < Nnz ; ++k) {
168 Y[j][i] += Values[k] * X[j][Indices[k]];
175 for (
int k = 0 ; k < Nnz ; ++k) {
176 Y[j][Indices[k]] += Values[k] * X[j][i];
virtual int InvColSums(Epetra_Vector &x) const
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
double DropTol_
Drop tolerance.
Teuchos::RefCountPtr< Epetra_RowMatrix > A_
Pointer to the matrix to be preconditioned.
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
virtual int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
#define IFPACK_CHK_ERRV(ifpack_err)
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int InvRowSums(Epetra_Vector &x) const
int NumNonzeros_
Number of nonzeros for the dropped matrix.
int MaxNumEntries_
Maximum entries in each row.
#define IFPACK_RETURN(ifpack_err)
std::vector< double > Values_
Used in ExtractMyRowCopy, to avoid allocation each time.
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
#define IFPACK_CHK_ERR(ifpack_err)
std::vector< int > NumEntries_
Ifpack_DropFilter(const Teuchos::RefCountPtr< Epetra_RowMatrix > &Matrix, double DropTol)
Constructor.
std::vector< int > Indices_
Used in ExtractMyRowCopy, to avoid allocation each time.
bool UseTranspose() const