Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Tpetra_RowGraph_decl.hpp
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2008) Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 
00042 #ifndef TPETRA_ROWGRAPH_DECL_HPP
00043 #define TPETRA_ROWGRAPH_DECL_HPP
00044 
00045 #include <Teuchos_Describable.hpp>
00046 #include <Kokkos_DefaultNode.hpp>
00047 
00048 #include "Tpetra_ConfigDefs.hpp"
00049 #include "Tpetra_Map.hpp"
00050 #include "Tpetra_Import.hpp"
00051 #include "Tpetra_Export.hpp"
00052 #include "Tpetra_Packable.hpp"
00053 
00054 
00055 namespace Tpetra {
00056 
00069   template <class LocalOrdinal = Map<>::local_ordinal_type,
00070             class GlobalOrdinal = typename Map<LocalOrdinal>::global_ordinal_type,
00071             class Node = typename Map<LocalOrdinal, GlobalOrdinal>::node_type>
00072   class RowGraph :
00073     virtual public Teuchos::Describable,
00074     public Packable<GlobalOrdinal, LocalOrdinal> {
00075   public:
00077 
00078 
00079     typedef LocalOrdinal  local_ordinal_type;
00081     typedef GlobalOrdinal global_ordinal_type;
00083     typedef Node          node_type;
00085 
00087     virtual ~RowGraph() {};
00088 
00090 
00091 
00093     virtual Teuchos::RCP<const Teuchos::Comm<int> >
00094     getComm () const = 0;
00095 
00097     virtual Teuchos::RCP<Node> getNode () const = 0;
00098 
00100     virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
00101     getRowMap () const = 0;
00102 
00104     virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
00105     getColMap () const = 0;
00106 
00108     virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
00109     getDomainMap () const = 0;
00110 
00112     virtual Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >
00113     getRangeMap () const = 0;
00114 
00116     virtual Teuchos::RCP<const Import<LocalOrdinal,GlobalOrdinal,Node> >
00117     getImporter () const = 0;
00118 
00120     virtual Teuchos::RCP<const Export<LocalOrdinal,GlobalOrdinal,Node> >
00121     getExporter () const = 0;
00122 
00124     virtual global_size_t getGlobalNumRows() const = 0;
00125 
00127     virtual global_size_t getGlobalNumCols() const = 0;
00128 
00130     virtual size_t getNodeNumRows() const = 0;
00131 
00133     virtual size_t getNodeNumCols() const = 0;
00134 
00136     virtual GlobalOrdinal getIndexBase() const = 0;
00137 
00139     virtual global_size_t getGlobalNumEntries() const = 0;
00140 
00142     virtual size_t getNodeNumEntries() const = 0;
00143 
00145 
00146     virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
00147 
00149 
00150     virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
00151 
00153     virtual global_size_t getGlobalNumDiags() const = 0;
00154 
00156     virtual size_t getNodeNumDiags() const = 0;
00157 
00159     virtual size_t getGlobalMaxNumRowEntries() const = 0;
00160 
00162     virtual size_t getNodeMaxNumRowEntries() const = 0;
00163 
00165     virtual bool hasColMap() const = 0;
00166 
00168     virtual bool isLowerTriangular() const = 0;
00169 
00171     virtual bool isUpperTriangular() const = 0;
00172 
00174     virtual bool isLocallyIndexed() const = 0;
00175 
00177     virtual bool isGloballyIndexed() const = 0;
00178 
00180     virtual bool isFillComplete() const = 0;
00181 
00183 
00184 
00185 
00187 
00196     virtual void
00197     getGlobalRowCopy (GlobalOrdinal GlobalRow,
00198                       const Teuchos::ArrayView<GlobalOrdinal> &Indices,
00199                       size_t &NumIndices) const = 0;
00200 
00202 
00211     virtual void
00212     getLocalRowCopy (LocalOrdinal LocalRow,
00213                      const Teuchos::ArrayView<LocalOrdinal> &Indices,
00214                      size_t &NumIndices) const = 0;
00215 
00217 
00218 
00219 
00221     virtual void
00222     pack (const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
00223           Teuchos::Array<GlobalOrdinal>& exports,
00224           const Teuchos::ArrayView<size_t>& numPacketsPerLID,
00225           size_t& constantNumPackets,
00226           Distributor& distor) const;
00228   }; // class RowGraph
00229 } // namespace Tpetra
00230 
00231 #endif // TPETRA_ROWGRAPH_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines