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
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include "Ifpack_ConfigDefs.h"
00044 #include "Ifpack_Graph.h"
00045 #include "Ifpack_Graph_Epetra_RowMatrix.h"
00046 #include "Epetra_Comm.h"
00047 #include "Epetra_Map.h"
00048 #include "Epetra_RowMatrix.h"
00049
00050
00051 Ifpack_Graph_Epetra_RowMatrix::Ifpack_Graph_Epetra_RowMatrix(const Teuchos::RefCountPtr<const Epetra_RowMatrix>& RowMatrix) :
00052 RowMatrix_(RowMatrix)
00053 {
00054 NumMyRows_ = RowMatrix_->NumMyRows();
00055 NumMyCols_ = RowMatrix_->NumMyCols();
00056 NumGlobalRows_ = RowMatrix_->NumGlobalRows64();
00057 NumGlobalCols_ = RowMatrix_->NumGlobalCols64();
00058 MaxNumIndices_ = RowMatrix_->MaxNumEntries();
00059
00060 Values_.resize(MaxNumIndices_);
00061 }
00062
00063
00064 const Epetra_Comm& Ifpack_Graph_Epetra_RowMatrix::Comm() const
00065 {
00066 return(RowMatrix_->Comm());
00067 }
00068
00069
00070 bool Ifpack_Graph_Epetra_RowMatrix::Filled() const
00071 {
00072 return(RowMatrix_->Filled());
00073 }
00074
00075
00076 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00077 int Ifpack_Graph_Epetra_RowMatrix::GRID(int LRID_in) const
00078 {
00079 return(RowMatrix_->RowMatrixRowMap().GID(LRID_in));
00080 }
00081
00082
00083 int Ifpack_Graph_Epetra_RowMatrix::GCID(int LCID_in) const
00084 {
00085 return(RowMatrix_->RowMatrixColMap().GID(LCID_in));
00086 }
00087 #endif
00088
00089 long long Ifpack_Graph_Epetra_RowMatrix::GRID64(int LRID_in) const
00090 {
00091 return(RowMatrix_->RowMatrixRowMap().GID64(LRID_in));
00092 }
00093
00094
00095 long long Ifpack_Graph_Epetra_RowMatrix::GCID64(int LCID_in) const
00096 {
00097 return(RowMatrix_->RowMatrixColMap().GID64(LCID_in));
00098 }
00099
00100
00101 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
00102 int Ifpack_Graph_Epetra_RowMatrix::LRID(int GRID_in) const
00103 {
00104 return(RowMatrix_->RowMatrixRowMap().LID(GRID_in));
00105 }
00106
00107
00108 int Ifpack_Graph_Epetra_RowMatrix::LCID(int GCID_in) const
00109 {
00110 return(RowMatrix_->RowMatrixColMap().LID(GCID_in));
00111 }
00112 #endif
00113
00114 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
00115 int Ifpack_Graph_Epetra_RowMatrix::LRID(long long GRID_in) const
00116 {
00117 return(RowMatrix_->RowMatrixRowMap().LID(GRID_in));
00118 }
00119
00120
00121 int Ifpack_Graph_Epetra_RowMatrix::LCID(long long GCID_in) const
00122 {
00123 return(RowMatrix_->RowMatrixColMap().LID(GCID_in));
00124 }
00125 #endif
00126
00127 int Ifpack_Graph_Epetra_RowMatrix::
00128 ExtractMyRowCopy(int MyRow, int LenOfIndices,
00129 int &NumIndices, int *Indices) const
00130 {
00131 return(RowMatrix_->ExtractMyRowCopy(MyRow, LenOfIndices,
00132 NumIndices, &Values_[0],
00133 Indices));
00134 }
00135
00136
00137 int Ifpack_Graph_Epetra_RowMatrix::NumMyNonzeros() const
00138 {
00139 return(RowMatrix_->NumMyNonzeros());
00140 }
00141
00142
00143 ostream& Ifpack_Graph_Epetra_RowMatrix::Print(std::ostream& os) const
00144 {
00145
00146 if (Comm().MyPID())
00147 return(os);
00148
00149 os << "================================================================================" << endl;
00150 os << "Ifpack_Graph_Epetra_RowMatrix" << endl;
00151 os << "Number of local rows = " << NumMyRows_ << endl;
00152 os << "Number of global rows = " << NumGlobalRows_ << endl;
00153 os << "================================================================================" << endl;
00154
00155 return(os);
00156
00157 }
00158