45 #include "Epetra_MultiVector.h"
46 #include "Epetra_Vector.h"
47 #include "Epetra_RowMatrix.h"
48 #include "Epetra_Map.h"
49 #include "Epetra_BlockMap.h"
60 sprintf(
Label_,
"%s",
"Ifpack_LocalFilter");
71 #if !defined(EPETRA_NO_32BIT_GLOBAL_INDICES) || !defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
103 int ActualMaxNumEntries = 0;
105 for (
int i = 0 ; i <
NumRows_ ; ++i) {
111 for (
int j = 0 ; j < Nnz ; ++j) {
112 if (
Indices_[j] < NumRows_ ) ++NewNnz;
118 if (NewNnz > ActualMaxNumEntries)
119 ActualMaxNumEntries = NewNnz;
132 double *Values,
int * Indices)
const
134 if ((MyRow < 0) || (MyRow >=
NumRows_)) {
153 for (
int j = 0 ; j < Nnz ; ++j) {
157 Values[NumEntries] =
Values_[j];
187 X.ExtractView(&X_ptr);
188 Y.ExtractView(&Y_ptr);
190 for (
int i = 0 ; i <
NumRows_ ; ++i) {
197 for (
int j = 0 ; j < Nnz ; ++j) {
virtual int ExtractDiagonalCopy(Epetra_Vector &Diagonal) const
Returns a copy of the main diagonal in a user-provided vector.
Teuchos::RefCountPtr< Epetra_Map > Map_
Map based on SerialComm_, containing the local rows only.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
char Label_[80]
Label for this object.
bool SameAs(const Epetra_BlockMap &Map) const
Ifpack_LocalFilter(const Teuchos::RefCountPtr< const Epetra_RowMatrix > &Matrix)
Constructor.
const Epetra_BlockMap & Map() const
#define IFPACK_CHK_ERRV(ifpack_err)
Teuchos::RefCountPtr< Epetra_SerialComm > SerialComm_
Communicator containing this process only.
std::vector< int > NumEntries_
NumEntries_[i] contains the nonzero entries in row `i'.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual const Epetra_BlockMap & Map() const =0
std::vector< int > Indices_
Used in ExtractMyRowCopy, to avoid allocation each time.
int MaxNumEntriesA_
Maximum number of nonzero entries in a row for Matrix_.
Teuchos::RefCountPtr< const Epetra_RowMatrix > Matrix_
Pointer to the matrix to be preconditioned.
int NumRows_
Number of rows in the local matrix.
int NumNonzeros_
Number of nonzeros in the local matrix.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
#define IFPACK_CHK_ERR(ifpack_err)
Teuchos::RefCountPtr< Epetra_Vector > Diagonal_
int MaxNumEntries_
Maximum number of nonzero entries in a row for the filtered matrix.
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified local row in user-provided arrays.
std::vector< double > Values_
Used in ExtractMyRowCopy, to avoid allocation each time.