Tpetra Matrix/Vector Services Version of the Day
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_Map.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:
00053       typedef Scalar        scalar_type;
00054       typedef LocalOrdinal  local_ordinal_type;
00055       typedef GlobalOrdinal global_ordinal_type;
00056       typedef Node          node_type;
00057 
00059 
00060 
00062       virtual ~RowMatrix();
00063 
00065 
00067 
00068 
00070       virtual const Teuchos::RCP<const Teuchos::Comm<int> > & getComm() const = 0;
00071 
00073       virtual Teuchos::RCP<Node> getNode() const = 0;
00074 
00076       virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getRowMap() const = 0;
00077 
00079       virtual const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > & getColMap() const = 0;
00080 
00082       virtual Teuchos::RCP<const RowGraph<LocalOrdinal,GlobalOrdinal,Node> > getGraph() const = 0;
00083 
00085       virtual global_size_t getGlobalNumRows() const = 0;
00086 
00088       virtual global_size_t getGlobalNumCols() const = 0;
00089 
00091       virtual size_t getNodeNumRows() const = 0;
00092 
00094       virtual size_t getNodeNumCols() const = 0;
00095 
00097       virtual GlobalOrdinal getIndexBase() const = 0;
00098 
00100       virtual global_size_t getGlobalNumEntries() const = 0;
00101 
00103       virtual size_t getNodeNumEntries() const = 0;
00104 
00106 
00107       virtual size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const = 0;
00108 
00110 
00111       virtual size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const = 0;
00112 
00114       virtual global_size_t getGlobalNumDiags() const = 0;
00115 
00117       virtual size_t getNodeNumDiags() const = 0;
00118 
00120       virtual size_t getGlobalMaxNumRowEntries() const = 0;
00121 
00123       virtual size_t getNodeMaxNumRowEntries() const = 0;
00124 
00126       virtual bool hasColMap() const = 0;
00127 
00129       virtual bool isLowerTriangular() const = 0;
00130 
00132       virtual bool isUpperTriangular() const = 0;
00133 
00135       virtual bool isLocallyIndexed() const = 0;
00136 
00138       virtual bool isGloballyIndexed() const = 0;
00139 
00141       virtual bool isFillComplete() const = 0;
00142 
00143 
00145 
00147 
00148 
00150 
00160       virtual void getGlobalRowCopy(GlobalOrdinal GlobalRow,
00161                                     const Teuchos::ArrayView<GlobalOrdinal> &Indices,
00162                                     const Teuchos::ArrayView<Scalar> &Values,
00163                                     size_t &NumEntries) const = 0;
00164 
00166 
00176       virtual void getLocalRowCopy(LocalOrdinal LocalRow, 
00177                                    const Teuchos::ArrayView<LocalOrdinal> &Indices, 
00178                                    const Teuchos::ArrayView<Scalar> &Values,
00179                                    size_t &NumEntries) const  = 0;
00180 
00182 
00191       virtual void getGlobalRowView(GlobalOrdinal GlobalRow, 
00192                                     ArrayView<const GlobalOrdinal> &indices, 
00193                                     ArrayView<const Scalar> &values) const = 0;
00194 
00196 
00205       virtual void getLocalRowView(LocalOrdinal LocalRow, 
00206                                    ArrayView<const LocalOrdinal> &indices, 
00207                                    ArrayView<const Scalar> &values) const = 0;
00208 
00210 
00212       virtual void getLocalDiagCopy(Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &diag) const = 0;
00213 
00215       
00217 
00218 
00228       virtual void leftScale(const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& x) =0;
00229 
00239       virtual void rightScale(const Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& x) =0;
00240 
00242 
00245       virtual typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const = 0;
00246 
00248 
00250 
00251 
00253 
00262       TPETRA_DEPRECATED virtual void getGlobalRowView(GlobalOrdinal GlobalRow, 
00263                                                       Teuchos::ArrayRCP<const GlobalOrdinal> &indices,
00264                                                       Teuchos::ArrayRCP<const Scalar>        &values) const = 0;
00265 
00267 
00276       TPETRA_DEPRECATED virtual void getLocalRowView(LocalOrdinal LocalRow,
00277                                                     Teuchos::ArrayRCP<const LocalOrdinal> &indices,
00278                                                     Teuchos::ArrayRCP<const Scalar>       &values) const = 0;
00279 
00281 
00282   }; // class RowMatrix
00283 
00284   template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
00285   RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::~RowMatrix() {
00286   }
00287 
00288 } // namespace Tpetra
00289 
00290 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines