10 #ifndef THYRA_VECTOR_STD_OPS_HPP
11 #define THYRA_VECTOR_STD_OPS_HPP
13 #include "Thyra_VectorStdOps_decl.hpp"
14 #include "Thyra_VectorSpaceBase.hpp"
15 #include "Thyra_VectorBase.hpp"
16 #include "RTOpPack_ROpGetElement.hpp"
17 #include "RTOpPack_TOpSetElement.hpp"
18 #include "RTOpPack_ROpMin.hpp"
19 #include "RTOpPack_ROpMinIndex.hpp"
20 #include "RTOpPack_ROpMinIndexGreaterThanBound.hpp"
21 #include "RTOpPack_ROpMax.hpp"
22 #include "RTOpPack_ROpMaxIndex.hpp"
23 #include "RTOpPack_ROpMaxIndexLessThanBound.hpp"
24 #include "RTOpPack_ROpSum.hpp"
25 #include "RTOpPack_TOpAddScalar.hpp"
26 #include "RTOpPack_TOpEleWiseDivide.hpp"
27 #include "RTOpPack_TOpEleWiseProd.hpp"
28 #include "RTOpPack_TOpPairWiseMax.hpp"
29 #include "RTOpPack_TOpEleWiseConjProd.hpp"
30 #include "RTOpPack_TOpEleWiseProdUpdate.hpp"
31 #include "RTOpPack_TOpPairWiseMaxUpdate.hpp"
32 #include "RTOpPack_TOpRandomize.hpp"
33 #include "Teuchos_Assert.hpp"
34 #include "Teuchos_Assert.hpp"
48 template<
class Scalar>
49 Scalar Thyra::sum(
const VectorBase<Scalar>& v_rhs )
51 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
52 RTOpPack::ROpSum<Scalar> sum_op;
54 applyOp<Scalar>(sum_op,
55 tuple(ptrInArg(v_rhs)),
56 ArrayView<Ptr<VectorBase<Scalar> > >(null),
58 return sum_op(*sum_targ);
62 template<
class Scalar>
64 Thyra::norm_1(
const VectorBase<Scalar>& v_rhs )
66 return v_rhs.norm_1();
70 template<
class Scalar>
72 Thyra::norm_2(
const VectorBase<Scalar>& v_rhs )
74 return v_rhs.norm_2();
78 template<
class Scalar>
80 Thyra::norm_2(
const VectorBase<Scalar>& w,
const VectorBase<Scalar>& v )
86 template<
class Scalar>
88 Thyra::norm_inf(
const VectorBase<Scalar>& v_rhs )
90 return v_rhs.norm_inf();
94 template<
class Scalar>
95 Scalar Thyra::dot(
const VectorBase<Scalar>& v_rhs1,
const VectorBase<Scalar>& v_rhs2 )
97 return v_rhs2.dot(v_rhs1);
101 template<
class Scalar>
102 Scalar Thyra::get_ele(
const VectorBase<Scalar>& v,
Ordinal i )
104 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
110 applyOp<Scalar>(get_ele_op, tuple(ptrInArg(v)),
111 ArrayView<Ptr<VectorBase<Scalar> > >(null),
112 get_ele_targ.
ptr() );
113 return get_ele_op(*get_ele_targ);
120 template<
class Scalar>
121 void Thyra::set_ele(
Ordinal i, Scalar alpha,
const Ptr<VectorBase<Scalar> > &v )
123 using Teuchos::tuple;
using Teuchos::null;
128 applyOp<Scalar>(set_ele_op,
129 ArrayView<Ptr<const VectorBase<Scalar> > >(null),
135 template<
class Scalar>
136 void Thyra::put_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
138 v_lhs->assign(alpha);
142 template<
class Scalar>
143 void Thyra::copy(
const VectorBase<Scalar>& v_rhs,
144 const Ptr<VectorBase<Scalar> > &v_lhs )
146 v_lhs->assign(v_rhs);
150 template<
class Scalar>
151 void Thyra::add_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
153 using Teuchos::tuple;
using Teuchos::null;
155 applyOp<Scalar>(add_scalar_op,
156 ArrayView<Ptr<const VectorBase<Scalar> > >(null),
157 tuple(v_lhs), null );
161 template<
class Scalar>
162 void Thyra::scale(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
168 template<
class Scalar>
169 void Thyra::abs(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y )
175 template<
class Scalar>
176 void Thyra::reciprocal(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y )
182 template<
class Scalar>
183 void Thyra::ele_wise_prod(
184 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
185 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
188 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
190 applyOp<Scalar>( ele_wise_prod_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
191 tuple(v_lhs), null );
194 template<
class Scalar>
195 void Thyra::pair_wise_max(
196 const Scalar &alpha,
const VectorBase<Scalar>& v_rhs1,
197 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
200 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
202 applyOp<Scalar>( pair_wise_max_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
203 tuple(v_lhs), null );
207 template<
class Scalar>
208 void Thyra::ele_wise_conj_prod(
209 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
210 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
213 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
215 applyOp<Scalar>( ele_wise_conj_prod_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
216 tuple(v_lhs), null );
220 template<
class Scalar>
221 void Thyra::ele_wise_scale(
const VectorBase<Scalar>& x,
222 const Ptr<VectorBase<Scalar> > &y )
224 y->ele_wise_scale(x);
228 template<
class Scalar>
229 void Thyra::Vp_StVtV(
230 const Ptr<VectorBase<Scalar> > &v_lhs,
231 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
232 const VectorBase<Scalar>& v_rhs2
239 template<
class Scalar>
240 void Thyra::ele_wise_prod_update(
241 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
242 const Ptr<VectorBase<Scalar> > &v_lhs
245 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
247 applyOp<Scalar>( ele_wise_prod_update_op, tuple(ptrInArg(v_rhs1)),
248 tuple(v_lhs), null );
252 template<
class Scalar>
253 void Thyra::pair_wise_max_update(
254 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
255 const Ptr<VectorBase<Scalar> > &v_lhs
258 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
260 applyOp<Scalar>( pair_wise_max_update_op, tuple(ptrInArg(v_rhs1)),
261 tuple(v_lhs), null );
266 template<
class Scalar>
268 const Ptr<VectorBase<Scalar> > &v_lhs,
269 const Scalar& alpha,
const VectorBase<Scalar>& x )
275 template<
class Scalar>
276 void Thyra::ele_wise_divide(
277 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
278 const VectorBase<Scalar>& v_rhs2,
279 const Ptr<VectorBase<Scalar> > &v_lhs
282 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
284 applyOp<Scalar>( ele_wise_divide_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
285 tuple(v_lhs), null );
289 template<
class Scalar>
290 void Thyra::linear_combination(
291 const ArrayView<const Scalar> &alpha,
292 const ArrayView<
const Ptr<
const VectorBase<Scalar> > > &x,
294 const Ptr<VectorBase<Scalar> > &y
297 y->linear_combination(alpha, x, beta);
301 template<
class Scalar>
302 void Thyra::seed_randomize(
unsigned int s )
308 template<
class Scalar>
309 void Thyra::randomize( Scalar l, Scalar u,
const Ptr<VectorBase<Scalar> > &v )
323 template<
class Scalar>
324 void Thyra::assign(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
330 template<
class Scalar>
331 void Thyra::assign(
const Ptr<VectorBase<Scalar> > &v_lhs,
const VectorBase<Scalar>& v_rhs )
337 template<
class Scalar>
338 void Thyra::Vp_S(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
344 template<
class Scalar>
345 void Thyra::Vt_S(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
351 template<
class Scalar>
352 void Thyra::V_StV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
353 const VectorBase<Scalar> &x
356 using Teuchos::tuple;
using Teuchos::ptrInArg;
357 linear_combination<Scalar>( tuple<Scalar>(alpha), tuple(ptrInArg(x)),
362 template<
class Scalar>
363 void Thyra::Vp_StV(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha,
364 const VectorBase<Scalar>& v_rhs
367 v_lhs->update(alpha, v_rhs);
371 template<
class Scalar>
372 void Thyra::Vp_V(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x,
376 using Teuchos::tuple;
using Teuchos::ptrInArg;
377 linear_combination<Scalar>(
384 template<
class Scalar>
385 void Thyra::V_V(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x )
391 template<
class Scalar>
392 void Thyra::V_S(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha )
398 template<
class Scalar>
399 void Thyra::V_VpV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
400 const VectorBase<Scalar>& y
403 using Teuchos::tuple;
using Teuchos::ptrInArg;
405 linear_combination<Scalar>(
406 tuple(ST::one(),ST::one()),
407 tuple(ptrInArg(x),ptrInArg(y)),
413 template<
class Scalar>
414 void Thyra::V_VmV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
415 const VectorBase<Scalar>& y
418 using Teuchos::tuple;
using Teuchos::ptrInArg;
420 linear_combination<Scalar>(
421 tuple(ST::one(),Scalar(-ST::one())),
422 tuple(ptrInArg(x),ptrInArg(y)),
428 template<
class Scalar>
429 void Thyra::V_StVpV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
430 const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y
433 using Teuchos::tuple;
using Teuchos::ptrInArg;
435 linear_combination<Scalar>(
436 tuple(alpha, ST::one()), tuple(ptrInArg(x),ptrInArg(y)),
442 template<
class Scalar>
443 void Thyra::V_VpStV(
const Ptr<VectorBase<Scalar> > &z,
444 const VectorBase<Scalar>& x,
445 const Scalar &alpha,
const VectorBase<Scalar>& y )
447 using Teuchos::tuple;
using Teuchos::ptrInArg;
449 linear_combination<Scalar>(
450 tuple(ST::one(), alpha), tuple(ptrInArg(x),ptrInArg(y)),
456 template<
class Scalar>
457 void Thyra::V_StVpStV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
458 const VectorBase<Scalar>& x,
const Scalar &beta,
const VectorBase<Scalar>& y
461 using Teuchos::tuple;
using Teuchos::ptrInArg;
463 linear_combination<Scalar>(
464 tuple(alpha, beta), tuple(ptrInArg(x),ptrInArg(y)),
475 template<
class Scalar>
476 Scalar Thyra::min(
const VectorBase<Scalar>& x ) {
477 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
478 RTOpPack::ROpMin<Scalar> min_op;
480 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
481 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
483 return min_op(*min_targ);
487 template<
class Scalar>
488 void Thyra::min(
const VectorBase<Scalar>& x,
489 const Ptr<Scalar> &minEle,
const Ptr<Ordinal> &minIndex
492 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
495 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
496 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
499 *minEle = scalarIndex.scalar;
500 *minIndex = scalarIndex.index;
504 template<
class Scalar>
505 void Thyra::minGreaterThanBound(
const VectorBase<Scalar>& x,
506 const Scalar &bound,
const Ptr<Scalar> &minEle,
const Ptr<Ordinal> &minIndex
509 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
512 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
513 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
516 *minEle = scalarIndex.scalar;
517 *minIndex = scalarIndex.index;
521 template<
class Scalar>
522 Scalar Thyra::max(
const VectorBase<Scalar>& x )
524 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
525 RTOpPack::ROpMax<Scalar> max_op;
527 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
528 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
530 return max_op(*max_targ);
534 template<
class Scalar>
535 void Thyra::max(
const VectorBase<Scalar>& x,
536 const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex
539 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
542 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
543 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
546 *maxEle = scalarIndex.scalar;
547 *maxIndex = scalarIndex.index;
551 template<
class Scalar>
552 void Thyra::maxLessThanBound(
const VectorBase<Scalar>& x,
553 const Scalar &bound,
const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex
556 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
559 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
560 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
563 *maxEle = scalarIndex.scalar;
564 *maxIndex = scalarIndex.index;
573 #define THYRA_VECTOR_STD_OPS_INSTANT(SCALAR) \
575 template SCALAR sum( const VectorBase<SCALAR >& v_rhs ); \
577 template ScalarTraits<SCALAR >::magnitudeType \
578 norm_1( const VectorBase<SCALAR >& v_rhs ); \
580 template ScalarTraits<SCALAR >::magnitudeType \
581 norm_2( const VectorBase<SCALAR >& v_rhs ); \
583 template ScalarTraits<SCALAR >::magnitudeType \
584 norm_2( const VectorBase<SCALAR >& w, const VectorBase<SCALAR >& v ); \
586 template ScalarTraits<SCALAR >::magnitudeType \
587 norm_inf( const VectorBase<SCALAR >& v_rhs ); \
589 template SCALAR dot( const VectorBase<SCALAR >& v_rhs1, const VectorBase<SCALAR >& v_rhs2 ); \
591 template SCALAR get_ele( const VectorBase<SCALAR >& v, Ordinal i ); \
593 template void set_ele( Ordinal i, SCALAR alpha, const Ptr<VectorBase<SCALAR > > &v ); \
595 template void put_scalar( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
597 template void copy( const VectorBase<SCALAR >& v_rhs, \
598 const Ptr<VectorBase<SCALAR > > &v_lhs ); \
600 template void add_scalar( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
602 template void scale( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
604 template void abs( const VectorBase< SCALAR > &x, const Ptr<VectorBase< SCALAR > > &y ); \
606 template void reciprocal( const VectorBase< SCALAR > &x, const Ptr<VectorBase< SCALAR > > &y ); \
608 template void ele_wise_prod( \
609 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
610 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
613 template void ele_wise_conj_prod( \
614 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
615 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
618 template void ele_wise_scale( const VectorBase<SCALAR>& x, \
619 const Ptr<VectorBase<SCALAR> > &y ); \
621 template void Vp_StVtV( \
622 const Ptr<VectorBase<SCALAR > > &v_lhs, \
623 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
624 const VectorBase<SCALAR >& v_rhs2 \
627 template void ele_wise_prod_update( \
628 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
629 const Ptr<VectorBase<SCALAR > > &v_lhs \
632 template void Vt_StV( \
633 const Ptr<VectorBase<SCALAR > > &v_lhs, \
634 const SCALAR& alpha, const VectorBase<SCALAR >& x ); \
636 template void ele_wise_divide( \
637 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
638 const VectorBase<SCALAR >& v_rhs2, \
639 const Ptr<VectorBase<SCALAR > > &v_lhs \
642 template void linear_combination( \
643 const ArrayView<const SCALAR > &alpha, \
644 const ArrayView<const Ptr<const VectorBase<SCALAR > > > &x, \
645 const SCALAR &beta, \
646 const Ptr<VectorBase<SCALAR > > &y \
649 template void seed_randomize<SCALAR >( unsigned int s ); \
651 template void randomize( SCALAR l, SCALAR u, const Ptr<VectorBase<SCALAR > > &v ); \
653 template void assign( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
655 template void assign( const Ptr<VectorBase<SCALAR > > &v_lhs, const VectorBase<SCALAR >& v_rhs ); \
657 template void Vp_S( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
659 template void Vt_S( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
661 template void V_StV( const Ptr<VectorBase<SCALAR > > &y, const SCALAR& alpha, \
662 const VectorBase<SCALAR > &x \
665 template void Vp_StV( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha, \
666 const VectorBase<SCALAR >& v_rhs \
669 template void Vp_V( const Ptr<VectorBase<SCALAR > > &y, const VectorBase<SCALAR >& x, \
673 template void V_V( const Ptr<VectorBase<SCALAR > > &y, const VectorBase<SCALAR >& x ); \
675 template void V_S( const Ptr<VectorBase<SCALAR > > &y, const SCALAR& alpha ); \
677 template void V_VpV( const Ptr<VectorBase<SCALAR > > &z, const VectorBase<SCALAR >& x, \
678 const VectorBase<SCALAR >& y \
681 template void V_VmV( const Ptr<VectorBase<SCALAR > > &z, const VectorBase<SCALAR >& x, \
682 const VectorBase<SCALAR >& y \
685 template void V_StVpV( const Ptr<VectorBase<SCALAR > > &z, const SCALAR &alpha, \
686 const VectorBase<SCALAR >& x, const VectorBase<SCALAR >& y \
689 template void V_VpStV( const Ptr<VectorBase<SCALAR > > &z, \
690 const VectorBase<SCALAR >& x, \
691 const SCALAR &alpha, const VectorBase<SCALAR >& y ); \
693 template void V_StVpStV( const Ptr<VectorBase<SCALAR > > &z, const SCALAR &alpha, \
694 const VectorBase<SCALAR >& x, const SCALAR &beta, const VectorBase<SCALAR >& y \
699 #define THYRA_VECTOR_STD_OPS_REAL_INSTANT(SCALAR) \
701 template SCALAR min( const VectorBase<SCALAR >& x ); \
703 template void pair_wise_max( \
704 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
705 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
708 template void pair_wise_max_update( \
709 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
710 const Ptr<VectorBase<SCALAR > > &v_lhs \
713 template void min( const VectorBase<SCALAR >& x, \
714 const Ptr<SCALAR > &minEle, const Ptr<Ordinal> &minIndex \
717 template void minGreaterThanBound( const VectorBase<SCALAR >& x, \
718 const SCALAR &bound, const Ptr<SCALAR > &minEle, const Ptr<Ordinal> &minIndex \
721 template SCALAR max( const VectorBase<SCALAR >& x ); \
723 template void max( const VectorBase<SCALAR >& x, \
724 const Ptr<SCALAR > &maxEle, const Ptr<Ordinal> &maxIndex \
727 template void maxLessThanBound( const VectorBase<SCALAR >& x, \
728 const SCALAR &bound, const Ptr<SCALAR > &maxEle, const Ptr<Ordinal> &maxIndex \
732 #endif // THYRA_VECTOR_STD_OPS_HPP
void put_scalar(const Scalar &alpha, const Ptr< VectorBase< Scalar > > &y)
Assign all elements to a scalar: y(i) = alpha, i = 0...y->space()->dim()-1.
void ele_wise_prod_update(const Scalar &alpha, const VectorBase< Scalar > &x, const Ptr< VectorBase< Scalar > > &y)
Element-wise product update: y(i) *= alpha * x(i), i = 0...y->space()->dim()-1.
void assign(const Ptr< MultiVectorBase< Scalar > > &V, Scalar alpha)
V = alpha.
void copy(const VectorBase< Scalar > &x, const Ptr< VectorBase< Scalar > > &y)
Vector assignment: y(i) = x(i), i = 0...y->space()->dim()-1.
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
RCP< const LinearOpBase< Scalar > > scale(const Scalar &scalar, const RCP< const LinearOpBase< Scalar > > &Op, const std::string &label="")
Build an implicit const scaled linear operator.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
void add_scalar(const Scalar &alpha, const Ptr< VectorBase< Scalar > > &y)
Add a scalar to all elements: y(i) += alpha, i = 0...y->space()->dim()-1.
Teuchos::RCP< ReductTarget > reduct_obj_create() const
static void set_static_seed(const unsigned int static_seed)
void ele_wise_prod(const Scalar &alpha, const VectorBase< Scalar > &x, const VectorBase< Scalar > &v, const Ptr< VectorBase< Scalar > > &y)
Element-wise product update: y(i) += alpha * x(i) * v(i), i = 0...y->space()->dim()-1.