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