Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_SpmdMultiVectorDefaultBase_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_SPMD_MULTI_VECTOR_DEFAULT_BASE_DECL_HPP
43 #define THYRA_SPMD_MULTI_VECTOR_DEFAULT_BASE_DECL_HPP
44 
45 #include "Thyra_SpmdMultiVectorBase.hpp"
46 #include "Thyra_MultiVectorAdapterBase_decl.hpp"
47 #include "Teuchos_BLAS.hpp"
48 
49 
50 namespace Thyra {
51 
52 
97 template<class Scalar>
99  : virtual public SpmdMultiVectorBase<Scalar>,
100  virtual public MultiVectorAdapterBase<Scalar>
101 {
102 public:
103 
106 
109 
111 
114 
117 
119 
120 protected:
121 
124 
127 
130 
132 
137  const RTOpPack::RTOpT<Scalar> &primary_op,
138  const ArrayView<const Ptr<const MultiVectorBase<Scalar> > > &multi_vecs,
139  const ArrayView<const Ptr<MultiVectorBase<Scalar> > > &targ_multi_vecs,
140  const ArrayView<const Ptr<RTOpPack::ReductTarget> > &reduct_objs,
141  const Ordinal primary_global_offset
142  ) const;
145  const Range1D &rowRng,
146  const Range1D &colRng
148  ) const;
152  ) const;
155  const Range1D &rowRng,
156  const Range1D &colRng,
158  );
162  );
164 
167 
173  void euclideanApply(
174  const EOpTransp M_trans,
175  const MultiVectorBase<Scalar> &X,
176  const Ptr<MultiVectorBase<Scalar> > &Y,
177  const Scalar alpha,
178  const Scalar beta
179  ) const;
180 
182 
185 
194  virtual void updateSpmdSpace();
195 
200  Range1D validateRowRange( const Range1D& rowRng ) const;
201 
206  Range1D validateColRange( const Range1D& rowCol ) const;
207 
209 
210 private:
211 
212  // ///////////////////////////////////////
213  // Private data members
214 
215  mutable bool in_applyOp_;
216 
217  mutable Teuchos::BLAS<int,Scalar> blas_;
218 
219  // cached
220  Ordinal globalDim_;
221  Ordinal localOffset_;
222  Ordinal localSubDim_;
223  Ordinal numCols_;
224 
225 }; // end class SpmdMultiVectorDefaultBase
226 
227 
228 } // end namespace Thyra
229 
230 
231 #endif // THYRA_SPMD_MULTI_VECTOR_DEFAULT_BASE_DECL_HPP
EOpTransp
Enumeration for determining how a linear operator is applied. `*.
RTOpPack::SubMultiVectorView< Scalar > getNonconstLocalSubMultiVectorImpl()
void euclideanApply(const EOpTransp M_trans, const MultiVectorBase< Scalar > &X, const Ptr< MultiVectorBase< Scalar > > &Y, const Scalar alpha, const Scalar beta) const
Uses GEMM() and Teuchos::reduceAll() to implement.
Base interface class for SPMD multi-vectors.
void mvMultiReductApplyOpImpl(const RTOpPack::RTOpT< Scalar > &primary_op, const ArrayView< const Ptr< const MultiVectorBase< Scalar > > > &multi_vecs, const ArrayView< const Ptr< MultiVectorBase< Scalar > > > &targ_multi_vecs, const ArrayView< const Ptr< RTOpPack::ReductTarget > > &reduct_objs, const Ordinal primary_global_offset) const
Base node implementation class for SPMD multi-vectors.
RTOpPack::ConstSubMultiVectorView< Scalar > getLocalSubMultiVectorImpl() const
RCP< const ScalarProdVectorSpaceBase< Scalar > > rangeScalarProdVecSpc() const
Returns spmdSpace.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Interface for a collection of column vectors called a multi-vector.
void acquireDetachedMultiVectorViewImpl(const Range1D &rowRng, const Range1D &colRng, RTOpPack::ConstSubMultiVectorView< Scalar > *sub_mv) const
void commitNonconstDetachedMultiVectorViewImpl(RTOpPack::SubMultiVectorView< Scalar > *sub_mv)
void releaseDetachedMultiVectorViewImpl(RTOpPack::ConstSubMultiVectorView< Scalar > *sub_mv) const
Node subclass for MultiVectorBase subclasses that allows the insertion of an application defined scal...
Range1D validateColRange(const Range1D &rowCol) const
Validate and resize the column range.
void acquireNonconstDetachedMultiVectorViewImpl(const Range1D &rowRng, const Range1D &colRng, RTOpPack::SubMultiVectorView< Scalar > *sub_mv)
virtual void updateSpmdSpace()
Subclasses should call whenever the structure of the VectorSpaceBase changes.
Range1D validateRowRange(const Range1D &rowRng) const
Validate and resize the row range.