42 #ifndef THYRA_VECTOR_STD_OPS_HPP
43 #define THYRA_VECTOR_STD_OPS_HPP
45 #include "Thyra_VectorStdOps_decl.hpp"
46 #include "Thyra_VectorSpaceBase.hpp"
47 #include "Thyra_VectorBase.hpp"
48 #include "RTOpPack_ROpGetElement.hpp"
49 #include "RTOpPack_TOpSetElement.hpp"
50 #include "RTOpPack_ROpMin.hpp"
51 #include "RTOpPack_ROpMinIndex.hpp"
52 #include "RTOpPack_ROpMinIndexGreaterThanBound.hpp"
53 #include "RTOpPack_ROpMax.hpp"
54 #include "RTOpPack_ROpMaxIndex.hpp"
55 #include "RTOpPack_ROpMaxIndexLessThanBound.hpp"
56 #include "RTOpPack_ROpSum.hpp"
57 #include "RTOpPack_TOpAddScalar.hpp"
58 #include "RTOpPack_TOpEleWiseDivide.hpp"
59 #include "RTOpPack_TOpEleWiseProd.hpp"
60 #include "RTOpPack_TOpPairWiseMax.hpp"
61 #include "RTOpPack_TOpEleWiseConjProd.hpp"
62 #include "RTOpPack_TOpEleWiseProdUpdate.hpp"
63 #include "RTOpPack_TOpPairWiseMaxUpdate.hpp"
64 #include "RTOpPack_TOpRandomize.hpp"
65 #include "Teuchos_Assert.hpp"
66 #include "Teuchos_Assert.hpp"
80 template<
class Scalar>
81 Scalar Thyra::sum(
const VectorBase<Scalar>& v_rhs )
83 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
84 RTOpPack::ROpSum<Scalar> sum_op;
86 applyOp<Scalar>(sum_op,
87 tuple(ptrInArg(v_rhs)),
88 ArrayView<Ptr<VectorBase<Scalar> > >(null),
90 return sum_op(*sum_targ);
94 template<
class Scalar>
96 Thyra::norm_1(
const VectorBase<Scalar>& v_rhs )
98 return v_rhs.norm_1();
102 template<
class Scalar>
104 Thyra::norm_2(
const VectorBase<Scalar>& v_rhs )
106 return v_rhs.norm_2();
110 template<
class Scalar>
112 Thyra::norm_2(
const VectorBase<Scalar>& w,
const VectorBase<Scalar>& v )
118 template<
class Scalar>
120 Thyra::norm_inf(
const VectorBase<Scalar>& v_rhs )
122 return v_rhs.norm_inf();
126 template<
class Scalar>
127 Scalar Thyra::dot(
const VectorBase<Scalar>& v_rhs1,
const VectorBase<Scalar>& v_rhs2 )
129 return v_rhs2.dot(v_rhs1);
133 template<
class Scalar>
134 Scalar Thyra::get_ele(
const VectorBase<Scalar>& v,
Ordinal i )
136 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
142 applyOp<Scalar>(get_ele_op, tuple(ptrInArg(v)),
143 ArrayView<Ptr<VectorBase<Scalar> > >(null),
144 get_ele_targ.
ptr() );
145 return get_ele_op(*get_ele_targ);
152 template<
class Scalar>
153 void Thyra::set_ele(
Ordinal i, Scalar alpha,
const Ptr<VectorBase<Scalar> > &v )
155 using Teuchos::tuple;
using Teuchos::null;
160 applyOp<Scalar>(set_ele_op,
161 ArrayView<Ptr<const VectorBase<Scalar> > >(null),
167 template<
class Scalar>
168 void Thyra::put_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
170 v_lhs->assign(alpha);
174 template<
class Scalar>
175 void Thyra::copy(
const VectorBase<Scalar>& v_rhs,
176 const Ptr<VectorBase<Scalar> > &v_lhs )
178 v_lhs->assign(v_rhs);
182 template<
class Scalar>
183 void Thyra::add_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
185 using Teuchos::tuple;
using Teuchos::null;
187 applyOp<Scalar>(add_scalar_op,
188 ArrayView<Ptr<const VectorBase<Scalar> > >(null),
189 tuple(v_lhs), null );
193 template<
class Scalar>
194 void Thyra::scale(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &v_lhs )
200 template<
class Scalar>
201 void Thyra::abs(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y )
207 template<
class Scalar>
208 void Thyra::reciprocal(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y )
214 template<
class Scalar>
215 void Thyra::ele_wise_prod(
216 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
217 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
220 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
222 applyOp<Scalar>( ele_wise_prod_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
223 tuple(v_lhs), null );
226 template<
class Scalar>
227 void Thyra::pair_wise_max(
228 const Scalar &alpha,
const VectorBase<Scalar>& v_rhs1,
229 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
232 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
234 applyOp<Scalar>( pair_wise_max_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
235 tuple(v_lhs), null );
239 template<
class Scalar>
240 void Thyra::ele_wise_conj_prod(
241 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
242 const VectorBase<Scalar>& v_rhs2,
const Ptr<VectorBase<Scalar> > &v_lhs
245 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
247 applyOp<Scalar>( ele_wise_conj_prod_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
248 tuple(v_lhs), null );
252 template<
class Scalar>
253 void Thyra::ele_wise_scale(
const VectorBase<Scalar>& x,
254 const Ptr<VectorBase<Scalar> > &y )
256 y->ele_wise_scale(x);
260 template<
class Scalar>
261 void Thyra::Vp_StVtV(
262 const Ptr<VectorBase<Scalar> > &v_lhs,
263 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
264 const VectorBase<Scalar>& v_rhs2
271 template<
class Scalar>
272 void Thyra::ele_wise_prod_update(
273 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
274 const Ptr<VectorBase<Scalar> > &v_lhs
277 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
279 applyOp<Scalar>( ele_wise_prod_update_op, tuple(ptrInArg(v_rhs1)),
280 tuple(v_lhs), null );
284 template<
class Scalar>
285 void Thyra::pair_wise_max_update(
286 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
287 const Ptr<VectorBase<Scalar> > &v_lhs
290 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
292 applyOp<Scalar>( pair_wise_max_update_op, tuple(ptrInArg(v_rhs1)),
293 tuple(v_lhs), null );
298 template<
class Scalar>
300 const Ptr<VectorBase<Scalar> > &v_lhs,
301 const Scalar& alpha,
const VectorBase<Scalar>& x )
307 template<
class Scalar>
308 void Thyra::ele_wise_divide(
309 const Scalar& alpha,
const VectorBase<Scalar>& v_rhs1,
310 const VectorBase<Scalar>& v_rhs2,
311 const Ptr<VectorBase<Scalar> > &v_lhs
314 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
316 applyOp<Scalar>( ele_wise_divide_op, tuple(ptrInArg(v_rhs1),ptrInArg(v_rhs2)),
317 tuple(v_lhs), null );
321 template<
class Scalar>
322 void Thyra::linear_combination(
323 const ArrayView<const Scalar> &alpha,
324 const ArrayView<
const Ptr<
const VectorBase<Scalar> > > &x,
326 const Ptr<VectorBase<Scalar> > &y
329 y->linear_combination(alpha, x, beta);
333 template<
class Scalar>
334 void Thyra::seed_randomize(
unsigned int s )
340 template<
class Scalar>
341 void Thyra::randomize( Scalar l, Scalar u,
const Ptr<VectorBase<Scalar> > &v )
355 template<
class Scalar>
356 void Thyra::assign(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
362 template<
class Scalar>
363 void Thyra::assign(
const Ptr<VectorBase<Scalar> > &v_lhs,
const VectorBase<Scalar>& v_rhs )
369 template<
class Scalar>
370 void Thyra::Vp_S(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
376 template<
class Scalar>
377 void Thyra::Vt_S(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha )
383 template<
class Scalar>
384 void Thyra::V_StV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
385 const VectorBase<Scalar> &x
388 using Teuchos::tuple;
using Teuchos::ptrInArg;
389 linear_combination<Scalar>( tuple<Scalar>(alpha), tuple(ptrInArg(x)),
394 template<
class Scalar>
395 void Thyra::Vp_StV(
const Ptr<VectorBase<Scalar> > &v_lhs,
const Scalar& alpha,
396 const VectorBase<Scalar>& v_rhs
399 v_lhs->update(alpha, v_rhs);
403 template<
class Scalar>
404 void Thyra::Vp_V(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x,
408 using Teuchos::tuple;
using Teuchos::ptrInArg;
409 linear_combination<Scalar>(
416 template<
class Scalar>
417 void Thyra::V_V(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x )
423 template<
class Scalar>
424 void Thyra::V_S(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha )
430 template<
class Scalar>
431 void Thyra::V_VpV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
432 const VectorBase<Scalar>& y
435 using Teuchos::tuple;
using Teuchos::ptrInArg;
437 linear_combination<Scalar>(
438 tuple(ST::one(),ST::one()),
439 tuple(ptrInArg(x),ptrInArg(y)),
445 template<
class Scalar>
446 void Thyra::V_VmV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
447 const VectorBase<Scalar>& y
450 using Teuchos::tuple;
using Teuchos::ptrInArg;
452 linear_combination<Scalar>(
453 tuple(ST::one(),Scalar(-ST::one())),
454 tuple(ptrInArg(x),ptrInArg(y)),
460 template<
class Scalar>
461 void Thyra::V_StVpV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
462 const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y
465 using Teuchos::tuple;
using Teuchos::ptrInArg;
467 linear_combination<Scalar>(
468 tuple(alpha, ST::one()), tuple(ptrInArg(x),ptrInArg(y)),
474 template<
class Scalar>
475 void Thyra::V_VpStV(
const Ptr<VectorBase<Scalar> > &z,
476 const VectorBase<Scalar>& x,
477 const Scalar &alpha,
const VectorBase<Scalar>& y )
479 using Teuchos::tuple;
using Teuchos::ptrInArg;
481 linear_combination<Scalar>(
482 tuple(ST::one(), alpha), tuple(ptrInArg(x),ptrInArg(y)),
488 template<
class Scalar>
489 void Thyra::V_StVpStV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
490 const VectorBase<Scalar>& x,
const Scalar &beta,
const VectorBase<Scalar>& y
493 using Teuchos::tuple;
using Teuchos::ptrInArg;
495 linear_combination<Scalar>(
496 tuple(alpha, beta), tuple(ptrInArg(x),ptrInArg(y)),
507 template<
class Scalar>
508 Scalar Thyra::min(
const VectorBase<Scalar>& x ) {
509 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
510 RTOpPack::ROpMin<Scalar> min_op;
512 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
513 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
515 return min_op(*min_targ);
519 template<
class Scalar>
520 void Thyra::min(
const VectorBase<Scalar>& x,
521 const Ptr<Scalar> &minEle,
const Ptr<Ordinal> &minIndex
524 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
527 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
528 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
531 *minEle = scalarIndex.scalar;
532 *minIndex = scalarIndex.index;
536 template<
class Scalar>
537 void Thyra::minGreaterThanBound(
const VectorBase<Scalar>& x,
538 const Scalar &bound,
const Ptr<Scalar> &minEle,
const Ptr<Ordinal> &minIndex
541 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
544 applyOp<Scalar>( min_op, tuple(ptrInArg(x)),
545 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
548 *minEle = scalarIndex.scalar;
549 *minIndex = scalarIndex.index;
553 template<
class Scalar>
554 Scalar Thyra::max(
const VectorBase<Scalar>& x )
556 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
557 RTOpPack::ROpMax<Scalar> max_op;
559 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
560 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
562 return max_op(*max_targ);
566 template<
class Scalar>
567 void Thyra::max(
const VectorBase<Scalar>& x,
568 const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex
571 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
574 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
575 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
578 *maxEle = scalarIndex.scalar;
579 *maxIndex = scalarIndex.index;
583 template<
class Scalar>
584 void Thyra::maxLessThanBound(
const VectorBase<Scalar>& x,
585 const Scalar &bound,
const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex
588 using Teuchos::tuple;
using Teuchos::ptrInArg;
using Teuchos::null;
591 applyOp<Scalar>( max_op, tuple(ptrInArg(x)),
592 ArrayView<const Ptr<VectorBase<Scalar> > >(null),
595 *maxEle = scalarIndex.scalar;
596 *maxIndex = scalarIndex.index;
605 #define THYRA_VECTOR_STD_OPS_INSTANT(SCALAR) \
607 template SCALAR sum( const VectorBase<SCALAR >& v_rhs ); \
609 template ScalarTraits<SCALAR >::magnitudeType \
610 norm_1( const VectorBase<SCALAR >& v_rhs ); \
612 template ScalarTraits<SCALAR >::magnitudeType \
613 norm_2( const VectorBase<SCALAR >& v_rhs ); \
615 template ScalarTraits<SCALAR >::magnitudeType \
616 norm_2( const VectorBase<SCALAR >& w, const VectorBase<SCALAR >& v ); \
618 template ScalarTraits<SCALAR >::magnitudeType \
619 norm_inf( const VectorBase<SCALAR >& v_rhs ); \
621 template SCALAR dot( const VectorBase<SCALAR >& v_rhs1, const VectorBase<SCALAR >& v_rhs2 ); \
623 template SCALAR get_ele( const VectorBase<SCALAR >& v, Ordinal i ); \
625 template void set_ele( Ordinal i, SCALAR alpha, const Ptr<VectorBase<SCALAR > > &v ); \
627 template void put_scalar( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
629 template void copy( const VectorBase<SCALAR >& v_rhs, \
630 const Ptr<VectorBase<SCALAR > > &v_lhs ); \
632 template void add_scalar( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
634 template void scale( const SCALAR& alpha, const Ptr<VectorBase<SCALAR > > &v_lhs ); \
636 template void abs( const VectorBase< SCALAR > &x, const Ptr<VectorBase< SCALAR > > &y ); \
638 template void reciprocal( const VectorBase< SCALAR > &x, const Ptr<VectorBase< SCALAR > > &y ); \
640 template void ele_wise_prod( \
641 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
642 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
645 template void ele_wise_conj_prod( \
646 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
647 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
650 template void ele_wise_scale( const VectorBase<SCALAR>& x, \
651 const Ptr<VectorBase<SCALAR> > &y ); \
653 template void Vp_StVtV( \
654 const Ptr<VectorBase<SCALAR > > &v_lhs, \
655 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
656 const VectorBase<SCALAR >& v_rhs2 \
659 template void ele_wise_prod_update( \
660 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
661 const Ptr<VectorBase<SCALAR > > &v_lhs \
664 template void Vt_StV( \
665 const Ptr<VectorBase<SCALAR > > &v_lhs, \
666 const SCALAR& alpha, const VectorBase<SCALAR >& x ); \
668 template void ele_wise_divide( \
669 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
670 const VectorBase<SCALAR >& v_rhs2, \
671 const Ptr<VectorBase<SCALAR > > &v_lhs \
674 template void linear_combination( \
675 const ArrayView<const SCALAR > &alpha, \
676 const ArrayView<const Ptr<const VectorBase<SCALAR > > > &x, \
677 const SCALAR &beta, \
678 const Ptr<VectorBase<SCALAR > > &y \
681 template void seed_randomize<SCALAR >( unsigned int s ); \
683 template void randomize( SCALAR l, SCALAR u, const Ptr<VectorBase<SCALAR > > &v ); \
685 template void assign( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
687 template void assign( const Ptr<VectorBase<SCALAR > > &v_lhs, const VectorBase<SCALAR >& v_rhs ); \
689 template void Vp_S( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
691 template void Vt_S( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha ); \
693 template void V_StV( const Ptr<VectorBase<SCALAR > > &y, const SCALAR& alpha, \
694 const VectorBase<SCALAR > &x \
697 template void Vp_StV( const Ptr<VectorBase<SCALAR > > &v_lhs, const SCALAR& alpha, \
698 const VectorBase<SCALAR >& v_rhs \
701 template void Vp_V( const Ptr<VectorBase<SCALAR > > &y, const VectorBase<SCALAR >& x, \
705 template void V_V( const Ptr<VectorBase<SCALAR > > &y, const VectorBase<SCALAR >& x ); \
707 template void V_S( const Ptr<VectorBase<SCALAR > > &y, const SCALAR& alpha ); \
709 template void V_VpV( const Ptr<VectorBase<SCALAR > > &z, const VectorBase<SCALAR >& x, \
710 const VectorBase<SCALAR >& y \
713 template void V_VmV( const Ptr<VectorBase<SCALAR > > &z, const VectorBase<SCALAR >& x, \
714 const VectorBase<SCALAR >& y \
717 template void V_StVpV( const Ptr<VectorBase<SCALAR > > &z, const SCALAR &alpha, \
718 const VectorBase<SCALAR >& x, const VectorBase<SCALAR >& y \
721 template void V_VpStV( const Ptr<VectorBase<SCALAR > > &z, \
722 const VectorBase<SCALAR >& x, \
723 const SCALAR &alpha, const VectorBase<SCALAR >& y ); \
725 template void V_StVpStV( const Ptr<VectorBase<SCALAR > > &z, const SCALAR &alpha, \
726 const VectorBase<SCALAR >& x, const SCALAR &beta, const VectorBase<SCALAR >& y \
731 #define THYRA_VECTOR_STD_OPS_REAL_INSTANT(SCALAR) \
733 template SCALAR min( const VectorBase<SCALAR >& x ); \
735 template void pair_wise_max( \
736 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
737 const VectorBase<SCALAR >& v_rhs2, const Ptr<VectorBase<SCALAR > > &v_lhs \
740 template void pair_wise_max_update( \
741 const SCALAR& alpha, const VectorBase<SCALAR >& v_rhs1, \
742 const Ptr<VectorBase<SCALAR > > &v_lhs \
745 template void min( const VectorBase<SCALAR >& x, \
746 const Ptr<SCALAR > &minEle, const Ptr<Ordinal> &minIndex \
749 template void minGreaterThanBound( const VectorBase<SCALAR >& x, \
750 const SCALAR &bound, const Ptr<SCALAR > &minEle, const Ptr<Ordinal> &minIndex \
753 template SCALAR max( const VectorBase<SCALAR >& x ); \
755 template void max( const VectorBase<SCALAR >& x, \
756 const Ptr<SCALAR > &maxEle, const Ptr<Ordinal> &maxIndex \
759 template void maxLessThanBound( const VectorBase<SCALAR >& x, \
760 const SCALAR &bound, const Ptr<SCALAR > &maxEle, const Ptr<Ordinal> &maxIndex \
764 #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.