10 #ifndef THYRA_VECTOR_BASE_DECL_HPP
11 #define THYRA_VECTOR_BASE_DECL_HPP
14 #include "Thyra_OperatorVectorTypes.hpp"
15 #include "Thyra_MultiVectorBase_decl.hpp"
16 #include "RTOpPack_RTOpT.hpp"
17 #include "RTOpPack_SparseSubVectorT.hpp"
113 template<
class Scalar>
114 class VectorBase :
virtual public MultiVectorBase<Scalar>
118 #ifdef THYRA_INJECT_USING_DECLARATIONS
119 using MultiVectorBase<Scalar>::apply;
126 using MultiVectorBase<Scalar>::assign;
273 applyOpImpl(op, vecs, targ_vecs, reduct_obj, global_offset);
654 void reciprocal(
const VectorBase<Scalar>& x)
660 void ele_wise_scale(
const VectorBase<Scalar>& x)
736 template<
class Scalar>
743 const Ordinal global_offset = 0
747 vecs[0]->applyOp(op, vecs, targ_vecs, reduct_obj, global_offset);
748 else if (targ_vecs.size())
749 targ_vecs[0]->applyOp(op, vecs, targ_vecs, reduct_obj, global_offset);
756 #endif // THYRA_VECTOR_BASE_DECL_HPP
virtual RCP< const VectorSpaceBase< Scalar > > space() const =0
Return a smart pointer to the vector space that this vector belongs to.
void setSubVector(const RTOpPack::SparseSubVectorT< Scalar > &sub_vec)
Calls setSubVectorImpl().
virtual void commitNonconstDetachedVectorViewImpl(RTOpPack::SubVectorView< Scalar > *sub_vec)=0
Commit changes for a mutable explicit view of a sub-vector.
void applyOp(const RTOpPack::RTOpT< Scalar > &op, const ArrayView< const Ptr< const VectorBase< Scalar > > > &vecs, const ArrayView< const Ptr< VectorBase< Scalar > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const Ordinal global_offset) const
Calls applyOpImpl().
virtual void randomizeImpl(Scalar l, Scalar u)=0
Virtual implementation for NVI randomize.
virtual void assignVecImpl(const VectorBase< Scalar > &x)=0
Virtual implementation for NVI assign.
void releaseDetachedView(RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const
Calls releaseDetachedVectorViewImpl().
virtual void releaseDetachedVectorViewImpl(RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const =0
Free an explicit view of a sub-vector.
virtual void reciprocalImpl(const VectorBase< Scalar > &x)=0
Virtual implementation for NVI reciprocal.
void randomize(Scalar l, Scalar u)
Random vector generation:
virtual void setSubVectorImpl(const RTOpPack::SparseSubVectorT< Scalar > &sub_vec)=0
Set a specific sub-vector.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType normInfImpl() const =0
Virtual implementation for NVI norm_inf.
void assign(const VectorBase< Scalar > &x)
Vector assignment:
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
virtual void linearCombinationVecImpl(const ArrayView< const Scalar > &alpha, const ArrayView< const Ptr< const VectorBase< Scalar > > > &x, const Scalar &beta)=0
Virtual implementation for NVI linear_combination.
Interface for a collection of column vectors called a multi-vector.
void applyOp(const RTOpPack::RTOpT< Scalar > &op, const ArrayView< const Ptr< const VectorBase< Scalar > > > &vecs, const ArrayView< const Ptr< VectorBase< Scalar > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const Ordinal global_offset=0)
Apply a reduction/transformation operator over a set of vectors: op(op(v[0]...v[nv-1],z[0]...z[nz-1]),(*reduct_obj)) -> z[0]...z[nz-1],(*reduct_obj).
Teuchos::ScalarTraits< Scalar >::magnitudeType norm_inf() const
Infinity norm: result = ||v||inf.
virtual void applyOpImpl(const RTOpPack::RTOpT< Scalar > &op, const ArrayView< const Ptr< const VectorBase< Scalar > > > &vecs, const ArrayView< const Ptr< VectorBase< Scalar > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const Ordinal global_offset) const =0
Apply a reduction/transformation operator over a set of vectors: op(op(v[0]...v[nv-1],z[0]...z[nz-1]),(*reduct_obj)) -> z[0]...z[nz-1],(*reduct_obj).
virtual void updateVecImpl(Scalar alpha, const VectorBase< Scalar > &x)=0
Virtual implementation for NVI update.
Abstract interface for finite-dimensional dense vectors.
void acquireDetachedView(const Range1D &rng, RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const
Calls acquireDetachedVectorViewImpl().
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2WeightedImpl(const VectorBase< Scalar > &x) const =0
Virtual implementation for NVI norm_2 (weighted).
Teuchos::ScalarTraits< Scalar >::magnitudeType norm_2() const
Euclidean (2) norm: result = ||v||2.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm_1() const
One (1) norm: result = ||v||1.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm1Impl() const =0
Virtual implementation for NVI norm_1.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2Impl() const =0
Virtual implementation for NVI norm_2.
void commitDetachedView(RTOpPack::SubVectorView< Scalar > *sub_vec)
Calls commitDetachedView().
void linear_combination(const ArrayView< const Scalar > &alpha, const ArrayView< const Ptr< const VectorBase< Scalar > > > &x, const Scalar &beta)
Linear combination:
virtual void eleWiseScaleImpl(const VectorBase< Scalar > &x)=0
Virtual implementation for NVI ele_wise_scale.
virtual void absImpl(const VectorBase< Scalar > &x)=0
Virtual implementation for NVI abs.
void update(Scalar alpha, const VectorBase< Scalar > &x)
AXPY:
virtual void acquireNonconstDetachedVectorViewImpl(const Range1D &rng, RTOpPack::SubVectorView< Scalar > *sub_vec)=0
Get a mutable explicit view of a sub-vector.
Scalar dot(const VectorBase< Scalar > &x) const
Euclidean dot product: result = x^H * this.
void acquireDetachedView(const Range1D &rng, RTOpPack::SubVectorView< Scalar > *sub_vec)
Calls acquireNonconstDetachedVectorViewImpl().
virtual void acquireDetachedVectorViewImpl(const Range1D &rng, RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const =0
Get a non-mutable explicit view of a sub-vector.
virtual RCP< VectorBase< Scalar > > clone_v() const =0
Returns a seprate cloned copy of *this vector with the same values but different storage.
Teuchos::ScalarTraits< Scalar >::magnitudeType norm_2(const VectorBase< Scalar > &x) const
Weighted Euclidean (2) norm: result = ||v||2.
virtual Scalar dotImpl(const VectorBase< Scalar > &x) const =0
Virtual implementation for NVI dot.