Tpetra Matrix/Vector Services Version of the Day
Tpetra_BlockCrsGraph_decl.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2008) 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 #ifndef TPETRA_BLOCKCRSGRAPH_DECL_HPP
00030 #define TPETRA_BLOCKCRSGRAPH_DECL_HPP
00031 
00032 #include "Tpetra_CrsGraph.hpp"
00033 #include "Tpetra_BlockMap.hpp"
00034 
00039 namespace Tpetra {
00040 
00051 template <class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
00052 class BlockCrsGraph : public Teuchos::Describable {
00053  public:
00054   typedef LocalOrdinal  local_ordinal_type;
00055   typedef GlobalOrdinal global_ordinal_type;
00056   typedef Node          node_type;
00057 
00059 
00060 
00063   BlockCrsGraph(const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> >& blkRowMap, size_t maxNumEntriesPerRow, ProfileType pftype = DynamicProfile);
00064 
00066   ~BlockCrsGraph(){}
00067 
00069 
00071 
00072 
00074   void insertGlobalIndices(GlobalOrdinal row, const Teuchos::ArrayView<const GlobalOrdinal> &indices);
00075 
00077 
00079   Teuchos::ArrayRCP<const size_t> getNodeRowOffsets() const;
00080 
00082 
00084   Teuchos::ArrayRCP<const LocalOrdinal> getNodePackedIndices() const;
00086 
00088 
00089 
00091   void globalAssemble();
00092 
00097   void fillComplete(const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > &blkDomainMap, const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > &blkRangeMap, OptimizeOption os = DoOptimizeStorage);
00098 
00104   void fillComplete(OptimizeOption os = DoOptimizeStorage);
00105 
00107   void optimizeStorage();
00108 
00110 
00112 
00113 
00115   bool isFillComplete() const;
00116 
00118   bool isLocallyIndexed() const;
00119 
00121   bool isUpperTriangular() const;
00122 
00124   bool isLowerTriangular() const;
00125 
00127   size_t getNodeNumBlockRows() const;
00128 
00130   size_t getGlobalNumBlockRows() const;
00131 
00133   size_t getNodeNumBlockDiags() const;
00134 
00136   size_t getNodeNumBlockEntries() const;
00137 
00139   size_t getGlobalBlockRowLength(GlobalOrdinal row) const;
00140 
00142   void getGlobalBlockRowView(GlobalOrdinal row,
00143                              Teuchos::ArrayView<const GlobalOrdinal>& blockCols) const;
00144 
00146   void getLocalBlockRowView(LocalOrdinal row,
00147                              Teuchos::ArrayView<const LocalOrdinal>& blockCols) const;
00148 
00150   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockRowMap() const;
00151 
00153   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockColMap() const;
00154 
00156   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockDomainMap() const;
00157 
00159   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockRangeMap() const;
00160 
00162 
00163  private:
00164   Teuchos::RCP<CrsGraph<LocalOrdinal,GlobalOrdinal,Node> > ptGraph_;
00165 
00166   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkRowMap_;
00167   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkColMap_;
00168   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkDomainMap_;
00169   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkRangeMap_;
00170 };//class BlockCrsGraph
00171 }//namespace Tpetra
00172 
00173 #endif
00174 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines