All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Xpetra_CrsGraph.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 //
00003 // ***********************************************************************
00004 //
00005 //             Xpetra: A linear algebra interface package
00006 //                  Copyright 2012 Sandia Corporation
00007 //
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact
00039 //                    Jonathan Hu       (jhu@sandia.gov)
00040 //                    Andrey Prokopenko (aprokop@sandia.gov)
00041 //                    Ray Tuminaro      (rstumin@sandia.gov)
00042 //
00043 // ***********************************************************************
00044 //
00045 // @HEADER
00046 #ifndef XPETRA_CRSGRAPH_HPP
00047 #define XPETRA_CRSGRAPH_HPP
00048 
00049 /* this file is automatically generated - do not edit (see script/interfaces.py) */
00050 
00051 #include <Teuchos_ParameterList.hpp>
00052 
00053 #include <Teuchos_Describable.hpp>
00054 #include <Kokkos_DefaultNode.hpp>
00055 #include "Xpetra_ConfigDefs.hpp"
00056 #include "Xpetra_DistObject.hpp"
00057 #include "Xpetra_Exceptions.hpp"
00058 
00059 #include "Xpetra_Map.hpp"
00060 
00061 using Teuchos::ParameterList;
00062 
00063 namespace Xpetra {
00064 
00065   struct RowInfo {
00066     size_t localRow;
00067     size_t allocSize;
00068     size_t numEntries;
00069     size_t offset1D;
00070   };
00071 
00072   enum ELocalGlobal {
00073     LocalIndices,
00074     GlobalIndices
00075   };
00076 
00077   template <class LocalOrdinal = Map<>::local_ordinal_type,
00078             class GlobalOrdinal = typename Map<LocalOrdinal>::global_ordinal_type,
00079             class Node = typename Map<LocalOrdinal, GlobalOrdinal>::node_type>
00080   class CrsGraph
00081     : /*public RowGraph<>,*/ public DistObject<GlobalOrdinal,LocalOrdinal,GlobalOrdinal,Node>
00082   {
00083   public:
00084     typedef LocalOrdinal local_ordinal_type;
00085     typedef GlobalOrdinal global_ordinal_type;
00086     typedef Node node_type;
00087 
00089 
00090 
00092     virtual ~CrsGraph() { }
00093 
00095 
00097 
00098 
00100     virtual void insertGlobalIndices(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &indices)= 0;
00101 
00103     virtual void insertLocalIndices(const LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &indices)= 0;
00104 
00106     virtual void removeLocalIndices(LocalOrdinal localRow)= 0;
00107 
00109 
00111 
00112 
00114     virtual void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)= 0;
00115 
00117     virtual void fillComplete(const RCP< ParameterList > &params=null)= 0;
00118 
00120 
00122 
00123 
00125     virtual RCP< const Comm< int > > getComm() const = 0;
00126 
00128     virtual RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const = 0;
00129 
00131     virtual RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const = 0;
00132 
00134     virtual RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const = 0;
00135 
00137     virtual RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const = 0;
00138 
00140     virtual RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > getImporter() const = 0;
00141 
00143     virtual RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > getExporter() const = 0;
00144 
00146     virtual global_size_t getGlobalNumRows() const = 0;
00147 
00149     virtual global_size_t getGlobalNumCols() const = 0;
00150 
00152     virtual size_t getNodeNumRows() const = 0;
00153 
00155     virtual size_t getNodeNumCols() const = 0;
00156 
00158     virtual GlobalOrdinal getIndexBase() const = 0;
00159 
00161     virtual global_size_t getGlobalNumEntries() const = 0;
00162 
00164     virtual size_t getNodeNumEntries() const = 0;
00165 
00167     virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
00168 
00170     virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
00171 
00173     virtual size_t getNumAllocatedEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
00174 
00176     virtual size_t getNumAllocatedEntriesInLocalRow(LocalOrdinal localRow) const = 0;
00177 
00179     virtual global_size_t getGlobalNumDiags() const = 0;
00180 
00182     virtual size_t getNodeNumDiags() const = 0;
00183 
00185     virtual size_t getGlobalMaxNumRowEntries() const = 0;
00186 
00188     virtual size_t getNodeMaxNumRowEntries() const = 0;
00189 
00191     virtual bool hasColMap() const = 0;
00192 
00194     virtual bool isLowerTriangular() const = 0;
00195 
00197     virtual bool isUpperTriangular() const = 0;
00198 
00200     virtual bool isLocallyIndexed() const = 0;
00201 
00203     virtual bool isGloballyIndexed() const = 0;
00204 
00206     virtual bool isFillComplete() const = 0;
00207 
00209     virtual bool isStorageOptimized() const = 0;
00210 
00212     virtual void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &Indices) const = 0;
00213 
00215     virtual void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices) const = 0;
00216 
00218 
00220 
00221 
00223     virtual std::string description() const = 0;
00224 
00226     virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const = 0;
00227 
00229 
00230   }; // CrsGraph class
00231 
00232 } // Xpetra namespace
00233 
00234 #define XPETRA_CRSGRAPH_SHORT
00235 #endif // XPETRA_CRSGRAPH_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines