Tpetra_RowMatrix.hpp

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_ROWMATRIX_HPP
00030 #define TPETRA_ROWMATRIX_HPP
00031 
00032 #include <Teuchos_Describable.hpp>
00033 #include <Kokkos_DefaultNode.hpp>
00034 
00035 #include "Tpetra_ConfigDefs.hpp"
00036 #include "Tpetra_MapDecl.hpp"
00037 #include "Tpetra_Operator.hpp"
00038 #include "Tpetra_RowGraph.hpp"
00039 #include "Tpetra_Vector.hpp"
00040 
00041 namespace Tpetra {
00042 
00044 
00050   template <class Scalar, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Kokkos::DefaultNode::DefaultNodeType>
00051   class RowMatrix : virtual public Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> {
00052     public:
00054 
00055 
00057       virtual ~RowMatrix();
00058 
00060 
00062 
00063 
00065       virtual const Teuchos::RCP<const Teuchos::Comm<int> > & getComm() const = 0;
00066 
00068       virtual Teuchos::RCP<Node> getNode() const = 0;
00069 
00071       virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getRowMap() const = 0;
00072 
00074       virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getColMap() const = 0;
00075 
00077       virtual Teuchos::RCP<const RowGraph<LocalOrdinal,GlobalOrdinal,Node> > getGraph() const = 0;
00078 
00080       virtual global_size_t getGlobalNumRows() const = 0;
00081 
00083       virtual global_size_t getGlobalNumCols() const = 0;
00084 
00086       virtual size_t getNodeNumRows() const = 0;
00087 
00089       virtual size_t getNodeNumCols() const = 0;
00090 
00092       virtual GlobalOrdinal getIndexBase() const = 0;
00093 
00095       virtual global_size_t getGlobalNumEntries() const = 0;
00096 
00098       virtual size_t getNodeNumEntries() const = 0;
00099 
00101 
00102       virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
00103 
00105 
00106       virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
00107 
00109       virtual global_size_t getGlobalNumDiags() const = 0;
00110 
00112       virtual size_t getNodeNumDiags() const = 0;
00113 
00115       virtual size_t getGlobalMaxNumRowEntries() const = 0;
00116 
00118       virtual size_t getNodeMaxNumRowEntries() const = 0;
00119 
00121       virtual bool hasColMap() const = 0;
00122 
00124       virtual bool isLowerTriangular() const = 0;
00125 
00127       virtual bool isUpperTriangular() const = 0;
00128 
00130       virtual bool isLocallyIndexed() const = 0;
00131 
00133       virtual bool isGloballyIndexed() const = 0;
00134 
00136       virtual bool isFillComplete() const = 0;
00137 
00139 
00141 
00142 
00144 
00154       virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow,
00155                                     const Teuchos::ArrayView<GlobalOrdinal> &Indices,
00156                                     const Teuchos::ArrayView<Scalar> &Values,
00157                                     size_t &NumEntries) const = 0;
00158 
00160 
00170       virtual void getLocalRowCopy(LocalOrdinal LocalRow, 
00171                                    const Teuchos::ArrayView<LocalOrdinal> &Indices, 
00172                                    const Teuchos::ArrayView<Scalar> &Values,
00173                                    size_t &NumEntries) const  = 0;
00174 
00176 
00185       virtual void getGlobalRowView(GlobalOrdinal GlobalRow, 
00186                                     Teuchos::ArrayRCP<const GlobalOrdinal> &indices,
00187                                     Teuchos::ArrayRCP<const Scalar>        &values) const = 0;
00188 
00190 
00199       virtual void getLocalRowView(LocalOrdinal LocalRow,
00200                                    Teuchos::ArrayRCP<const LocalOrdinal> &indices,
00201                                    Teuchos::ArrayRCP<const Scalar>       &values) const = 0;
00202 
00204 
00206       virtual void getLocalDiagCopy(Vector<Scalar,LocalOrdinal,GlobalOrdinal> &diag) const = 0;
00207 
00209 
00210   }; // class RowMatrix
00211 
00212   template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
00213   RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::~RowMatrix() {
00214   }
00215 
00216 } // namespace Tpetra
00217 
00218 #endif

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