43 #ifndef THYRA_VECTOR_STD_OPS_DECL_HPP
44 #define THYRA_VECTOR_STD_OPS_DECL_HPP
47 #include "Thyra_OperatorVectorTypes.hpp"
58 template<
class Scalar>
59 Scalar sum(
const VectorBase<Scalar>& v );
68 template<
class Scalar>
69 Scalar scalarProd(
const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y );
78 template<
class Scalar>
79 Scalar inner(
const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y );
89 template<
class Scalar>
91 norm(
const VectorBase<Scalar>& v );
98 template<
class Scalar>
100 norm_1(
const VectorBase<Scalar>& v );
107 template<
class Scalar>
109 norm_2(
const VectorBase<Scalar>& v );
117 template<
class Scalar>
119 norm_2(
const VectorBase<Scalar> &w,
const VectorBase<Scalar>& v );
126 template<
class Scalar>
128 norm_inf(
const VectorBase<Scalar>& v_rhs );
135 template<
class Scalar>
136 Scalar dot(
const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y );
143 template<
class Scalar>
144 Scalar get_ele(
const VectorBase<Scalar>& v,
Ordinal i );
151 template<
class Scalar>
152 void set_ele(
Ordinal i, Scalar alpha,
const Ptr<VectorBase<Scalar> > &v );
160 template<
class Scalar>
161 void put_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &y );
169 template<
class Scalar>
170 void copy(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y );
178 template<
class Scalar>
179 void add_scalar(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &y );
191 template<
class Scalar>
192 void scale(
const Scalar& alpha,
const Ptr<VectorBase<Scalar> > &y );
200 template<
class Scalar>
201 void abs(
const VectorBase<Scalar> &x,
const Ptr<VectorBase<Scalar> > &y );
209 template<
class Scalar>
210 void reciprocal(
const VectorBase<Scalar> &x,
const Ptr<VectorBase<Scalar> > &y );
218 template<
class Scalar>
219 void ele_wise_prod(
const Scalar& alpha,
const VectorBase<Scalar>& x,
220 const VectorBase<Scalar>& v,
const Ptr<VectorBase<Scalar> > &y );
228 template<
class Scalar>
229 void pair_wise_max(
const Scalar& alpha,
const VectorBase<Scalar>& x,
230 const VectorBase<Scalar>& v,
const Ptr<VectorBase<Scalar> > &y );
237 template<
class Scalar>
238 void ele_wise_conj_prod(
const Scalar& alpha,
const VectorBase<Scalar>& x,
239 const VectorBase<Scalar>& v,
const Ptr<VectorBase<Scalar> > &y );
247 template<
class Scalar>
248 void ele_wise_scale(
const VectorBase<Scalar>& x,
const Ptr<VectorBase<Scalar> > &y );
256 template<
class Scalar>
257 void Vp_StVtV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
258 const VectorBase<Scalar>& x,
const VectorBase<Scalar>& v);
266 template<
class Scalar>
267 void ele_wise_prod_update(
const Scalar& alpha,
const VectorBase<Scalar>& x,
268 const Ptr<VectorBase<Scalar> > &y );
276 template<
class Scalar>
277 void pair_wise_max_update(
const Scalar& alpha,
const VectorBase<Scalar>& x,
278 const Ptr<VectorBase<Scalar> > &y );
285 template<
class Scalar>
286 void Vt_StV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
287 const VectorBase<Scalar> &x );
295 template<
class Scalar>
296 void ele_wise_divide(
const Scalar& alpha,
const VectorBase<Scalar>& x,
297 const VectorBase<Scalar>& v,
const Ptr<VectorBase<Scalar> > &y );
322 template<
class Scalar>
323 void linear_combination(
324 const ArrayView<const Scalar> &alpha,
325 const ArrayView<
const Ptr<
const VectorBase<Scalar> > > &x,
327 const Ptr<VectorBase<Scalar> > &y
340 template<
class Scalar>
341 void seed_randomize(
unsigned int s );
354 template<
class Scalar>
355 void randomize( Scalar l, Scalar u,
const Ptr<VectorBase<Scalar> > &v );
363 template<
class Scalar>
364 void assign(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha );
372 template<
class Scalar>
373 void assign(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x );
381 template<
class Scalar>
382 void Vp_S(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha );
394 template<
class Scalar>
395 void Vt_S(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha );
403 template<
class Scalar>
404 void V_StV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
405 const VectorBase<Scalar> &x );
413 template<
class Scalar>
414 void Vp_StV(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha,
415 const VectorBase<Scalar>& x );
422 template<
class Scalar>
424 const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x,
425 const Scalar& beta = static_cast<Scalar>(1.0)
433 template<
class Scalar>
434 void V_V(
const Ptr<VectorBase<Scalar> > &y,
const VectorBase<Scalar>& x );
441 template<
class Scalar>
442 void V_S(
const Ptr<VectorBase<Scalar> > &y,
const Scalar& alpha );
449 template<
class Scalar>
450 void V_VpV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
451 const VectorBase<Scalar>& y );
458 template<
class Scalar>
459 void V_VmV(
const Ptr<VectorBase<Scalar> > &z,
const VectorBase<Scalar>& x,
460 const VectorBase<Scalar>& y );
467 template<
class Scalar>
468 void V_StVpV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
469 const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y );
476 template<
class Scalar>
477 void V_VpStV(
const Ptr<VectorBase<Scalar> > &z,
478 const VectorBase<Scalar>& x,
479 const Scalar &alpha,
const VectorBase<Scalar>& y );
486 template<
class Scalar>
487 void V_StVpStV(
const Ptr<VectorBase<Scalar> > &z,
const Scalar &alpha,
488 const VectorBase<Scalar>& x,
const Scalar &beta,
const VectorBase<Scalar>& y );
495 template<
class Scalar>
496 Scalar min(
const VectorBase<Scalar>& x );
518 template<
class Scalar>
519 void min(
const VectorBase<Scalar>& x,
520 const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex );
552 template<
class Scalar>
553 void minGreaterThanBound(
const VectorBase<Scalar>& x,
const Scalar &bound,
554 const Ptr<Scalar> &minEle,
const Ptr<Ordinal> &minIndex );
561 template<
class Scalar>
562 Scalar max(
const VectorBase<Scalar>& x );
584 template<
class Scalar>
585 void max(
const VectorBase<Scalar>& x,
586 const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex );
617 template<
class Scalar>
618 void maxLessThanBound(
const VectorBase<Scalar>& x,
const Scalar &bound,
619 const Ptr<Scalar> &maxEle,
const Ptr<Ordinal> &maxIndex );
631 template<
class Scalar>
633 Scalar Thyra::scalarProd(
const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y )
635 return x.space()->scalarProd(x, y);
639 template<
class Scalar>
641 Scalar Thyra::inner(
const VectorBase<Scalar>& x,
const VectorBase<Scalar>& y )
643 return x.space()->scalarProd(x, y);
647 template<
class Scalar>
650 Thyra::norm(
const VectorBase<Scalar>& v )
653 return ST::magnitude(ST::squareroot(v.space()->scalarProd(v, v)));
657 #endif // THYRA_VECTOR_STD_OPS_DECL_HPP
KOKKOS_INLINE_FUNCTION RealType abs(const complex< RealType > &x)
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.