Tpetra_VectorDecl.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_VECTOR_DECL_HPP
00030 #define TPETRA_VECTOR_DECL_HPP
00031 
00032 #include "Tpetra_MultiVectorDecl.hpp"
00033 
00034 namespace Tpetra {
00035 
00037 
00042   template<class Scalar, class LocalOrdinal=int, class GlobalOrdinal=LocalOrdinal, class Node=Kokkos::DefaultNode::DefaultNodeType>
00043   class Vector : public MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> {
00044 
00045     // need this so that MultiVector::operator() can call Vector's private constructor
00046     friend class MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>;
00047 
00048   public:
00049 
00051 
00052 
00054     explicit Vector(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &map, bool zeroOut=true);
00055 
00057     Vector(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &source);
00058 
00060     Vector(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &map, const Teuchos::ArrayView<const Scalar> &A);
00061 
00063     virtual ~Vector();
00064 
00066 
00068 
00069 
00071     void replaceGlobalValue(GlobalOrdinal globalRow, const Scalar &value);
00072 
00074     void sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar &value);
00075 
00077     void replaceLocalValue(LocalOrdinal myRow, const Scalar &value);
00078 
00080     void sumIntoLocalValue(LocalOrdinal myRow, const Scalar &value);
00081 
00083 
00085 
00086 
00087     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::get1dCopy; // overloading, not hiding
00089     void get1dCopy(Teuchos::ArrayView<Scalar> A) const;
00090 
00092 
00094 
00095 
00096     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::dot; // overloading, not hiding
00098     Scalar dot(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &a) const;
00099 
00100     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm1; // overloading, not hiding
00102     typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm1() const;
00103 
00104     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::norm2; // overloading, not hiding
00106     typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm2() const;
00107 
00108     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normInf; // overloading, not hiding
00110     typename Teuchos::ScalarTraits<Scalar>::magnitudeType normInf() const;
00111 
00112     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::normWeighted; // overloading, not hiding
00114     typename Teuchos::ScalarTraits<Scalar>::magnitudeType normWeighted(const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &weights) const;
00115 
00116     using MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::meanValue; // overloading, not hiding
00118     Scalar meanValue() const;
00119 
00121 
00123 
00124 
00126     std::string description() const;
00127 
00129     void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const;
00130 
00132 
00133     protected:
00134 
00135     typedef Kokkos::MultiVector<Scalar,Node> KMV;
00136     typedef Kokkos::DefaultArithmetic<KMV>   MVT;
00137 
00139     Vector(const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &map, Teuchos::ArrayRCP<Scalar> data);
00140 
00141   }; // class Vector
00142 
00143 } // namespace Tpetra
00144 
00145 #endif // TPETRA_VECTOR_DECL_HPP

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