Tpetra_MapDecl.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2004) 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_MAP_DECL_HPP
00030 #define TPETRA_MAP_DECL_HPP
00031 
00032 #include <Teuchos_RCP.hpp>
00033 #include <Teuchos_Object.hpp>
00034 #include "Tpetra_Platform.hpp"
00035 
00036 namespace Tpetra {
00037 
00038   template<typename Ordinal> class MapData;
00039 
00041 
00042   template<typename Ordinal>
00043   class Map : public Teuchos::Object {
00044 
00045   public:
00046 
00048 
00049 
00055     Map(Ordinal numGlobalEntries, Ordinal indexBase, const Platform<Ordinal> &platform, bool local=false);
00056 
00066     Map(Ordinal numGlobalEntries, Ordinal numMyEntries, Ordinal indexBase, 
00067         const Platform<Ordinal> &platform);
00068 
00070     Map(Ordinal numGlobalEntries, const Teuchos::ArrayView<const Ordinal> &entryList, 
00071         Ordinal indexBase, const Platform<Ordinal> &platform);
00072 
00074     Map(const Map<Ordinal> &Map);
00075 
00077     ~Map();
00078 
00080 
00081 
00083 
00084 
00086     Ordinal getNumGlobalEntries() const;
00087 
00089     Ordinal getNumMyEntries() const;
00090 
00092     Ordinal getIndexBase() const;
00093 
00095     Ordinal getMinLocalIndex() const;
00096 
00098     Ordinal getMaxLocalIndex() const;
00099 
00101     Ordinal getMinGlobalIndex() const;
00102 
00104     Ordinal getMaxGlobalIndex() const;
00105 
00107     Ordinal getMinAllGlobalIndex() const;
00108 
00110     Ordinal getMaxAllGlobalIndex() const;
00111 
00113     Ordinal getLocalIndex(Ordinal globalIndex) const;
00114 
00116     Ordinal getGlobalIndex(Ordinal localIndex) const;
00117 
00119 
00122     bool getRemoteIndexList(const Teuchos::ArrayView<const Ordinal> & GIDList, 
00123                             const Teuchos::ArrayView<Ordinal> & imageIDList, 
00124                             const Teuchos::ArrayView<Ordinal> & LIDList) const;
00125 
00127 
00130     bool getRemoteIndexList(const Teuchos::ArrayView<const Ordinal> & GIDList, 
00131                             const Teuchos::ArrayView<Ordinal> & imageIDList) const;
00132 
00134     Teuchos::ArrayView<const Ordinal> getMyGlobalEntries() const;
00135 
00137     bool isMyLocalIndex(Ordinal localIndex) const;
00138 
00140     bool isMyGlobalIndex(Ordinal globalIndex) const;
00141 
00143     bool isContiguous() const;
00144 
00146     bool isDistributed() const;
00147 
00149 
00151 
00152 
00154     bool isCompatible (const Map< Ordinal> &map) const;
00155 
00157     bool isSameAs (const Map<Ordinal> &map) const;
00158 
00160     bool operator== (const Map< Ordinal > &map) const;
00161 
00163     bool operator!= (const Map< Ordinal > &map) const;
00164 
00166 
00168 
00170     Map<Ordinal>& operator = (const Map<Ordinal> & Source);
00171 
00173     Teuchos::RCP< const Platform<Ordinal> > getPlatform() const;
00174 
00176     Teuchos::RCP<const Teuchos::Comm<Ordinal> > getComm() const;
00177 
00179 
00181 
00183 
00184     void print(std::ostream& os) const;
00185 
00187 
00188 
00189   private:
00190 
00191     Teuchos::RCP< MapData<Ordinal> > MapData_;
00192 
00193     // setup the directory
00194     void directorySetup();
00195 
00196   }; // Map class
00197 
00198 } // Tpetra namespace
00199 
00200 #endif // TPETRA_MAP_DECL_HPP
00201 

Generated on Wed May 12 21:59:41 2010 for Tpetra Matrix/Vector Services by  doxygen 1.4.7