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 
00046 template <class LocalOrdinal, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
00047 class BlockCrsGraph : public Teuchos::Describable {
00048  public:
00049   typedef LocalOrdinal  local_ordinal_type;
00050   typedef GlobalOrdinal global_ordinal_type;
00051   typedef Node          node_type;
00052 
00054 
00055 
00058   BlockCrsGraph(const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> >& blkRowMap, size_t maxNumEntriesPerRow, ProfileType pftype = DynamicProfile);
00059 
00061   ~BlockCrsGraph(){}
00062 
00064 
00066 
00067 
00069   void insertGlobalIndices(GlobalOrdinal row, const Teuchos::ArrayView<const GlobalOrdinal> &indices);
00070 
00072 
00074   Teuchos::ArrayRCP<const size_t> getNodeRowOffsets() const;
00075 
00077 
00079   Teuchos::ArrayRCP<const LocalOrdinal> getNodePackedIndices() const;
00081 
00083 
00084 
00086   void globalAssemble();
00087 
00092   void fillComplete(const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > &blkDomainMap, const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > &blkRangeMap, OptimizeOption os = DoOptimizeStorage);
00093 
00099   void fillComplete(OptimizeOption os = DoOptimizeStorage);
00100 
00102   void optimizeStorage();
00103 
00105 
00107 
00108 
00110   bool isFillComplete() const;
00111 
00113   bool isLocallyIndexed() const;
00114 
00116   bool isUpperTriangular() const;
00117 
00119   bool isLowerTriangular() const;
00120 
00122   size_t getNodeNumRows() const;
00123 
00125   size_t getNodeNumDiags() const;
00126 
00128   size_t getNodeNumEntries() const;
00129 
00131   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockRowMap() const;
00132 
00134   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockColMap() const;
00135 
00137   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockDomainMap() const;
00138 
00140   const Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > & getBlockRangeMap() const;
00141 
00143 
00144  private:
00145   Teuchos::RCP<CrsGraph<LocalOrdinal,GlobalOrdinal,Node> > ptGraph_;
00146 
00147   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkRowMap_;
00148   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkColMap_;
00149   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkDomainMap_;
00150   Teuchos::RCP<const BlockMap<LocalOrdinal,GlobalOrdinal,Node> > blkRangeMap_;
00151 };//class BlockCrsGraph
00152 }//namespace Tpetra
00153 
00154 #endif
00155 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines