Ifpack_DiagonalFilter.cpp

Go to the documentation of this file.
00001 #include "Ifpack_ConfigDefs.h"
00002 #include "Ifpack_DiagonalFilter.h"
00003 #include "Epetra_ConfigDefs.h"
00004 #include "Epetra_RowMatrix.h"
00005 #include "Epetra_Comm.h"
00006 #include "Epetra_Map.h"
00007 #include "Epetra_MultiVector.h"
00008 #include "Epetra_Vector.h"
00009 
00010 //==============================================================================
00011 int Ifpack_DiagonalFilter::
00012 ExtractMyRowCopy(int MyRow, int Length, int& NumEntries, 
00013      double* Values, int* Indices) const
00014 {
00015 
00016   IFPACK_CHK_ERR(A_.ExtractMyRowCopy(MyRow, Length, NumEntries,
00017              Values,Indices));
00018 
00019   if (pos_[MyRow] != -1)
00020     Values[pos_[MyRow]] += val_[MyRow];
00021 
00022   return(0);
00023 }
00024 
00025 //==============================================================================
00026 int Ifpack_DiagonalFilter::
00027 Multiply(bool TransA, const Epetra_MultiVector& X, 
00028    Epetra_MultiVector& Y) const
00029 {
00030 
00031   if (X.NumVectors() != Y.NumVectors())
00032     IFPACK_CHK_ERR(-2);
00033 
00034   IFPACK_CHK_ERR(A_.Multiply(TransA, X, Y));
00035 
00036   for (int v = 0 ; v < X.NumVectors() ; ++v)
00037     for (int i = 0 ; i < NumMyRows() ; ++i)
00038       Y[v][i] += val_[i] * X[v][i];
00039       
00040 
00041   return(0);
00042 }

Generated on Thu Sep 18 12:37:21 2008 for Ifpack Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1