Thyra Package Browser (Single Doxygen Collection) Version of the Day
Thyra_DefaultClusteredSpmdProductVector_decl.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
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 THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP
00030 #define THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP
00031 
00032 #include "Thyra_ProductVectorBase.hpp"
00033 #include "Thyra_VectorDefaultBase.hpp"
00034 
00035 namespace Thyra {
00036 
00038 template <class Scalar> class DefaultClusteredSpmdProductVectorSpace;
00039 
00049 template<class Scalar>
00050 class DefaultClusteredSpmdProductVector
00051   : virtual public ProductVectorBase<Scalar>
00052   , virtual protected VectorDefaultBase<Scalar>
00053 {
00054 public:
00055 
00056 #ifndef _MSC_VER
00057 
00058   using ProductVectorBase<Scalar>::applyOp;
00059 #endif
00060   
00063 
00065   DefaultClusteredSpmdProductVector();
00066 
00068   DefaultClusteredSpmdProductVector(
00069     const Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  &productSpace
00070     ,const Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]
00071     );
00072 
00077   void initialize(
00078     const Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  &productSpace
00079     ,const Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]
00080     );
00081 
00086   void uninitialize(
00087     Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >  *productSpace = NULL
00088     ,Teuchos::RCP<VectorBase<Scalar> >                                   vecs[]        = NULL
00089     );
00090 
00092 
00095 
00097   Teuchos::RCP<VectorBase<Scalar> > getNonconstVectorBlock(const int k); 
00099   Teuchos::RCP<const VectorBase<Scalar> > getVectorBlock(const int k) const;
00100 
00102 
00105 
00107   Teuchos::RCP<const ProductVectorSpaceBase<Scalar> > productSpace() const;
00109   bool blockIsConst(const int k) const; 
00111   Teuchos::RCP<MultiVectorBase<Scalar> > getNonconstMultiVectorBlock(const int k); 
00113   Teuchos::RCP<const MultiVectorBase<Scalar> > getMultiVectorBlock(const int k) const;
00114 
00116 
00119 
00121   Teuchos::RCP< const VectorSpaceBase<Scalar> > space() const;
00122 
00124 
00125 protected:
00126 
00129 
00131   void applyOpImpl(
00132     const RTOpPack::RTOpT<Scalar> &op,
00133     const ArrayView<const Ptr<const VectorBase<Scalar> > > &vecs,
00134     const ArrayView<const Ptr<VectorBase<Scalar> > > &targ_vecs,
00135     const Ptr<RTOpPack::ReductTarget> &reduct_obj,
00136     const Ordinal global_offset
00137     ) const;
00138 
00140 
00141 private:
00142 
00143   // //////////////////////////////
00144   // Private data members
00145 
00146   Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> >   productSpace_;
00147   std::vector<Teuchos::RCP<VectorBase<Scalar> > >                       vecs_;
00148 
00149 };
00150 
00151 } // namespace Thyra
00152 
00153 #endif // THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines