00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "Ifpack_ConfigDefs.h"
00031 #include "Ifpack_Graph.h"
00032 #include "Ifpack_Graph_Epetra_RowMatrix.h"
00033 #include "Epetra_Comm.h"
00034 #include "Epetra_Map.h"
00035 #include "Epetra_RowMatrix.h"
00036
00037
00038 Ifpack_Graph_Epetra_RowMatrix::Ifpack_Graph_Epetra_RowMatrix(const Teuchos::RefCountPtr<const Epetra_RowMatrix>& RowMatrix) :
00039 RowMatrix_(RowMatrix)
00040 {
00041 NumMyRows_ = RowMatrix_->NumMyRows();
00042 NumMyCols_ = RowMatrix_->NumMyCols();
00043 NumGlobalRows_ = RowMatrix_->NumGlobalRows();
00044 NumGlobalCols_ = RowMatrix_->NumGlobalCols();
00045 MaxNumIndices_ = RowMatrix_->MaxNumEntries();
00046
00047 Values_.resize(MaxNumIndices_);
00048 }
00049
00050
00051 const Epetra_Comm& Ifpack_Graph_Epetra_RowMatrix::Comm() const
00052 {
00053 return(RowMatrix_->Comm());
00054 }
00055
00056
00057 bool Ifpack_Graph_Epetra_RowMatrix::Filled() const
00058 {
00059 return(RowMatrix_->Filled());
00060 }
00061
00062
00063 int Ifpack_Graph_Epetra_RowMatrix::GRID(int LRID_in) const
00064 {
00065 return(RowMatrix_->RowMatrixRowMap().GID(LRID_in));
00066 }
00067
00068
00069 int Ifpack_Graph_Epetra_RowMatrix::GCID(int LCID_in) const
00070 {
00071 return(RowMatrix_->RowMatrixColMap().GID(LCID_in));
00072 }
00073
00074
00075 int Ifpack_Graph_Epetra_RowMatrix::LRID(int GRID_in) const
00076 {
00077 return(RowMatrix_->RowMatrixRowMap().LID(GRID_in));
00078 }
00079
00080
00081 int Ifpack_Graph_Epetra_RowMatrix::LCID(int GCID_in) const
00082 {
00083 return(RowMatrix_->RowMatrixColMap().LID(GCID_in));
00084 }
00085
00086
00087 int Ifpack_Graph_Epetra_RowMatrix::
00088 ExtractMyRowCopy(int MyRow, int LenOfIndices,
00089 int &NumIndices, int *Indices) const
00090 {
00091 return(RowMatrix_->ExtractMyRowCopy(MyRow, LenOfIndices,
00092 NumIndices, &Values_[0],
00093 Indices));
00094 }
00095
00096
00097 int Ifpack_Graph_Epetra_RowMatrix::NumMyNonzeros() const
00098 {
00099 return(RowMatrix_->NumMyNonzeros());
00100 }
00101
00102
00103 ostream& Ifpack_Graph_Epetra_RowMatrix::Print(std::ostream& os) const
00104 {
00105
00106 if (Comm().MyPID())
00107 return(os);
00108
00109 os << "================================================================================" << endl;
00110 os << "Ifpack_Graph_Epetra_RowMatrix" << endl;
00111 os << "Number of local rows = " << NumMyRows_ << endl;
00112 os << "Number of global rows = " << NumGlobalRows_ << endl;
00113 os << "================================================================================" << endl;
00114
00115 return(os);
00116
00117 }
00118