00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
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 Index first_ele_offset,
00137 const Index sub_dim,
00138 const Index global_offset
00139 ) const;
00140
00142
00143 private:
00144
00145
00146
00147
00148 Teuchos::RCP<const DefaultClusteredSpmdProductVectorSpace<Scalar> > productSpace_;
00149 std::vector<Teuchos::RCP<VectorBase<Scalar> > > vecs_;
00150
00151 };
00152
00153 }
00154
00155 #endif // THYRA_DEFAULT_CLUSTERED_SPMD_PRODUCT_VECTOR_DECL_HPP