10 #ifndef THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
11 #define THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
13 #include "Thyra_MultiVectorBase.hpp"
14 #include "RTOpPack_ROpNorm1.hpp"
15 #include "RTOpPack_ROpNorm2.hpp"
16 #include "RTOpPack_ROpNormInf.hpp"
31 template<
class Scalar>
32 void norms(
const MultiVectorBase<Scalar>& V,
49 template<
class Scalar,
class NormOp>
50 void reductions(
const MultiVectorBase<Scalar>& V,
const NormOp &op,
64 template<
class Scalar>
65 void norms_1(
const MultiVectorBase<Scalar>& V,
79 template<
class Scalar>
80 void norms_2(
const MultiVectorBase<Scalar>& V,
94 template<
class Scalar>
95 void norms_inf(
const MultiVectorBase<Scalar>& V,
103 template<
class Scalar>
104 Array<typename ScalarTraits<Scalar>::magnitudeType>
105 norms_inf(
const MultiVectorBase<Scalar>& V );
120 template<
class Scalar>
121 void dots(
const MultiVectorBase<Scalar>& V1,
const MultiVectorBase<Scalar>& V2,
122 const ArrayView<Scalar> &dots );
135 template<
class Scalar>
136 void sums(
const MultiVectorBase<Scalar>& V,
const ArrayView<Scalar> &sums );
143 template<
class Scalar>
145 norm_1(
const MultiVectorBase<Scalar>& V );
155 template<
class Scalar>
156 void scale( Scalar alpha,
const Ptr<MultiVectorBase<Scalar> > &V );
163 template<
class Scalar>
164 void scaleUpdate(
const VectorBase<Scalar>& a,
const MultiVectorBase<Scalar>& U,
165 const Ptr<MultiVectorBase<Scalar> > &V );
171 template<
class Scalar>
172 void assign(
const Ptr<MultiVectorBase<Scalar> > &V, Scalar alpha );
178 template<
class Scalar>
179 void assign(
const Ptr<MultiVectorBase<Scalar> > &V,
180 const MultiVectorBase<Scalar>& U );
187 template<
class Scalar>
188 void update( Scalar alpha,
const MultiVectorBase<Scalar>& U,
189 const Ptr<MultiVectorBase<Scalar> > &V );
197 template<
class Scalar>
199 const ArrayView<const Scalar> &alpha,
201 const MultiVectorBase<Scalar>& U,
202 const Ptr<MultiVectorBase<Scalar> > &V
211 template<
class Scalar>
213 const MultiVectorBase<Scalar>& U,
214 const ArrayView<const Scalar> &alpha,
216 const Ptr<MultiVectorBase<Scalar> > &V
246 template<
class Scalar>
247 void linear_combination(
248 const ArrayView<const Scalar> &alpha,
249 const ArrayView<
const Ptr<
const MultiVectorBase<Scalar> > > &X,
251 const Ptr<MultiVectorBase<Scalar> > &Y
265 template<
class Scalar>
266 void randomize( Scalar l, Scalar u,
const Ptr<MultiVectorBase<Scalar> > &V );
274 template<
class Scalar>
275 void Vt_S(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar& alpha );
283 template<
class Scalar>
284 void Vp_S(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar& alpha );
292 template<
class Scalar>
293 void Vp_V(
const Ptr<MultiVectorBase<Scalar> > &Z,
294 const MultiVectorBase<Scalar>& X );
302 template<
class Scalar>
303 void V_VpV(
const Ptr<MultiVectorBase<Scalar> > &Z,
304 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
312 template<
class Scalar>
313 void V_VmV(
const Ptr<MultiVectorBase<Scalar> > &Z,
314 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
322 template<
class Scalar>
323 void V_StVpV(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar &alpha,
324 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
334 template<
class Scalar>
336 void Thyra::norms_1(
const MultiVectorBase<Scalar>& V,
343 template<
class Scalar>
345 void Thyra::norms_2(
const MultiVectorBase<Scalar>& V,
352 template<
class Scalar>
354 void Thyra::norms_inf(
const MultiVectorBase<Scalar>& V,
361 template<
class Scalar>
363 Thyra::norms_inf(
const MultiVectorBase<Scalar>& V )
366 Array<ScalarMag>
norms(V.domain()->dim());
367 Thyra::norms_inf<Scalar>(V,
norms());
376 template<
class Scalar,
class NormOp>
377 void Thyra::reductions(
const MultiVectorBase<Scalar>& V,
const NormOp &op,
380 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
381 const int m = V.domain()->dim();
382 Array<RCP<RTOpPack::ReductTarget> > rcp_op_targs(m);
383 Array<Ptr<RTOpPack::ReductTarget> > op_targs(m);
384 for(
int kc = 0; kc < m; ++kc ) {
385 rcp_op_targs[kc] = op.reduct_obj_create();
386 op_targs[kc] = rcp_op_targs[kc].ptr();
388 applyOp<Scalar>(op, tuple(ptrInArg(V)),
389 ArrayView<Ptr<MultiVectorBase<Scalar> > >(null),
391 for(
int kc = 0; kc < m; ++kc ) {
392 norms[kc] = op(*op_targs[kc]);
397 #endif // THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
void norms(const MultiVectorBase< Scalar > &V, const ArrayView< typename ScalarTraits< Scalar >::magnitudeType > &norms)
Column-wise multi-vector natural norm.