42 #ifndef THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
43 #define THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
45 #include "Thyra_MultiVectorBase.hpp"
46 #include "RTOpPack_ROpNorm1.hpp"
47 #include "RTOpPack_ROpNorm2.hpp"
48 #include "RTOpPack_ROpNormInf.hpp"
63 template<
class Scalar>
64 void norms(
const MultiVectorBase<Scalar>& V,
81 template<
class Scalar,
class NormOp>
82 void reductions(
const MultiVectorBase<Scalar>& V,
const NormOp &op,
96 template<
class Scalar>
97 void norms_1(
const MultiVectorBase<Scalar>& V,
111 template<
class Scalar>
112 void norms_2(
const MultiVectorBase<Scalar>& V,
126 template<
class Scalar>
127 void norms_inf(
const MultiVectorBase<Scalar>& V,
135 template<
class Scalar>
136 Array<typename ScalarTraits<Scalar>::magnitudeType>
137 norms_inf(
const MultiVectorBase<Scalar>& V );
152 template<
class Scalar>
153 void dots(
const MultiVectorBase<Scalar>& V1,
const MultiVectorBase<Scalar>& V2,
154 const ArrayView<Scalar> &dots );
167 template<
class Scalar>
168 void sums(
const MultiVectorBase<Scalar>& V,
const ArrayView<Scalar> &sums );
175 template<
class Scalar>
177 norm_1(
const MultiVectorBase<Scalar>& V );
187 template<
class Scalar>
188 void scale( Scalar alpha,
const Ptr<MultiVectorBase<Scalar> > &V );
195 template<
class Scalar>
196 void scaleUpdate(
const VectorBase<Scalar>& a,
const MultiVectorBase<Scalar>& U,
197 const Ptr<MultiVectorBase<Scalar> > &V );
203 template<
class Scalar>
204 void assign(
const Ptr<MultiVectorBase<Scalar> > &V, Scalar alpha );
210 template<
class Scalar>
211 void assign(
const Ptr<MultiVectorBase<Scalar> > &V,
212 const MultiVectorBase<Scalar>& U );
219 template<
class Scalar>
220 void update( Scalar alpha,
const MultiVectorBase<Scalar>& U,
221 const Ptr<MultiVectorBase<Scalar> > &V );
229 template<
class Scalar>
231 const ArrayView<const Scalar> &alpha,
233 const MultiVectorBase<Scalar>& U,
234 const Ptr<MultiVectorBase<Scalar> > &V
243 template<
class Scalar>
245 const MultiVectorBase<Scalar>& U,
246 const ArrayView<const Scalar> &alpha,
248 const Ptr<MultiVectorBase<Scalar> > &V
278 template<
class Scalar>
279 void linear_combination(
280 const ArrayView<const Scalar> &alpha,
281 const ArrayView<
const Ptr<
const MultiVectorBase<Scalar> > > &X,
283 const Ptr<MultiVectorBase<Scalar> > &Y
297 template<
class Scalar>
298 void randomize( Scalar l, Scalar u,
const Ptr<MultiVectorBase<Scalar> > &V );
306 template<
class Scalar>
307 void Vt_S(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar& alpha );
315 template<
class Scalar>
316 void Vp_S(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar& alpha );
324 template<
class Scalar>
325 void Vp_V(
const Ptr<MultiVectorBase<Scalar> > &Z,
326 const MultiVectorBase<Scalar>& X );
334 template<
class Scalar>
335 void V_VpV(
const Ptr<MultiVectorBase<Scalar> > &Z,
336 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
344 template<
class Scalar>
345 void V_VmV(
const Ptr<MultiVectorBase<Scalar> > &Z,
346 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
354 template<
class Scalar>
355 void V_StVpV(
const Ptr<MultiVectorBase<Scalar> > &Z,
const Scalar &alpha,
356 const MultiVectorBase<Scalar>& X,
const MultiVectorBase<Scalar>& Y );
366 template<
class Scalar>
368 void Thyra::norms_1(
const MultiVectorBase<Scalar>& V,
375 template<
class Scalar>
377 void Thyra::norms_2(
const MultiVectorBase<Scalar>& V,
384 template<
class Scalar>
386 void Thyra::norms_inf(
const MultiVectorBase<Scalar>& V,
393 template<
class Scalar>
395 Thyra::norms_inf(
const MultiVectorBase<Scalar>& V )
398 Array<ScalarMag>
norms(V.domain()->dim());
399 Thyra::norms_inf<Scalar>(V,
norms());
408 template<
class Scalar,
class NormOp>
409 void Thyra::reductions(
const MultiVectorBase<Scalar>& V,
const NormOp &op,
412 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
413 const int m = V.domain()->dim();
414 Array<RCP<RTOpPack::ReductTarget> > rcp_op_targs(m);
415 Array<Ptr<RTOpPack::ReductTarget> > op_targs(m);
416 for(
int kc = 0; kc < m; ++kc ) {
417 rcp_op_targs[kc] = op.reduct_obj_create();
418 op_targs[kc] = rcp_op_targs[kc].ptr();
420 applyOp<Scalar>(op, tuple(ptrInArg(V)),
421 ArrayView<Ptr<MultiVectorBase<Scalar> > >(null),
423 for(
int kc = 0; kc < m; ++kc ) {
424 norms[kc] = op(*op_targs[kc]);
429 #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.