Ifpack_Graph_Epetra_CrsGraph.cpp

00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2002) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 //@HEADER
00028 */
00029 
00030 #include "Ifpack_ConfigDefs.h"
00031 #include "Ifpack_Graph.h"
00032 #include "Ifpack_Graph_Epetra_CrsGraph.h"
00033 #include "Epetra_Comm.h"
00034 #include "Epetra_CrsGraph.h"
00035 
00036 //==============================================================================
00037 Ifpack_Graph_Epetra_CrsGraph::
00038 Ifpack_Graph_Epetra_CrsGraph(const Teuchos::RefCountPtr<const Epetra_CrsGraph>& CrsGraph) :
00039 CrsGraph_(CrsGraph)
00040 {
00041   NumMyRows_ = CrsGraph_->NumMyRows();
00042   NumMyCols_ = CrsGraph_->NumMyCols();
00043   NumGlobalRows_ = CrsGraph_->NumGlobalRows();
00044   NumGlobalCols_ = CrsGraph_->NumGlobalCols();
00045   MaxNumIndices_ = CrsGraph_->MaxNumIndices();
00046 }
00047 
00048 //==============================================================================
00049 const Epetra_Comm& Ifpack_Graph_Epetra_CrsGraph::Comm() const
00050 {
00051   return(CrsGraph_->Comm());
00052 }
00053 
00054 //==============================================================================
00055 bool Ifpack_Graph_Epetra_CrsGraph::Filled() const
00056 {
00057   return(CrsGraph_->Filled());
00058 }
00059  
00060 //==============================================================================
00061 int Ifpack_Graph_Epetra_CrsGraph::GRID(int LRID_in) const
00062 {
00063   return(CrsGraph_->GRID(LRID_in));
00064 }
00065 
00066 //==============================================================================
00067 int Ifpack_Graph_Epetra_CrsGraph::GCID(int LCID_in) const
00068 {
00069   return(CrsGraph_->GCID(LCID_in));
00070 }
00071 
00072 //==============================================================================
00073 int Ifpack_Graph_Epetra_CrsGraph::LRID(int GRID_in) const
00074 {
00075   return(CrsGraph_->LRID(GRID_in));
00076 }
00077 
00078 //==============================================================================
00079 int Ifpack_Graph_Epetra_CrsGraph::LCID(int GCID_in) const
00080 {
00081   return(CrsGraph_->LCID(GCID_in));
00082 }
00083 
00084 //==============================================================================
00085 int Ifpack_Graph_Epetra_CrsGraph::
00086 ExtractMyRowCopy(int MyRow, int LenOfIndices, 
00087          int &NumIndices, int *Indices) const
00088 {
00089   return(CrsGraph_->ExtractMyRowCopy(MyRow, LenOfIndices,
00090                      NumIndices, Indices));
00091 }
00092 
00093 //==============================================================================
00094 int Ifpack_Graph_Epetra_CrsGraph::NumMyNonzeros() const
00095 {
00096   return(CrsGraph_->NumMyEntries());
00097 }
00098 
00099 // ======================================================================
00100 ostream& Ifpack_Graph_Epetra_CrsGraph::Print(std::ostream& os) const
00101 {
00102 
00103   if (Comm().MyPID())
00104     return(os);
00105 
00106   os << "================================================================================" << endl;
00107   os << "Ifpack_Graph_Epetra_CrsGraph" << endl;
00108   os << "Number of local rows  = " << NumMyRows_ << endl;
00109   os << "Number of global rows = " << NumGlobalRows_ << endl;
00110   os << "================================================================================" << endl;
00111 
00112   return(os);
00113 
00114 }
 All Classes Files Functions Variables Enumerations Friends
Generated on Wed Apr 13 10:05:23 2011 for IFPACK by  doxygen 1.6.3