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"
54 double AbsoluteThreshold,
55 double RelativeThreshold) :
57 AbsoluteThreshold_(AbsoluteThreshold),
58 RelativeThreshold_(RelativeThreshold)
72 for (
int MyRow = 0 ; MyRow <
NumMyRows() ; ++MyRow) {
77 &Values[0], &Indices[0]);
81 for (
int i = 0 ; i < NumEntries ; ++i) {
82 if (Indices[i] == MyRow) {
96 double* Values,
int* Indices)
const
102 if (
pos_[MyRow] != -1)
114 if (X.NumVectors() != Y.NumVectors())
119 for (
int v = 0 ; v < X.NumVectors() ; ++v)
121 Y[v][i] +=
val_[i] * X[v][i];
std::vector< int > pos_
Stores the position of the diagonal element, or -1 if not present.
const Epetra_Comm & Comm() const
Teuchos::RefCountPtr< Epetra_RowMatrix > A_
Pointer to the matrix to be filtered.
double ElapsedTime(void) const
double RelativeThreshold_
Multiplies A(i,i) by this value.
virtual int NumMyRows() const
virtual int MaxNumEntries() const
Returns the maximum number of entries.
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
virtual int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Ifpack_DiagonalFilter(const Teuchos::RefCountPtr< Epetra_RowMatrix > &Matrix, double AbsoluteThreshold, double RelativeThreshold)
Constructor.
double AbsoluteThreshold_
This value (times the sgn(A(i,i)) is added to the diagonal elements.
#define IFPACK_CHK_ERR(ifpack_err)
std::vector< double > val_
Stores as additional diagonal contribution due to the filter.