42 #ifndef THYRA_APPLY_OP_HELPER_HPP 43 #define THYRA_APPLY_OP_HELPER_HPP 45 #include "Thyra_apply_op_helper_decl.hpp" 46 #include "Thyra_VectorBase.hpp" 47 #include "Thyra_VectorSpaceBase.hpp" 48 #include "Thyra_AssertOp.hpp" 49 #include "Teuchos_Assert.hpp" 50 #include "Teuchos_as.hpp" 53 template<
class Scalar>
55 const std::string &func_name,
60 const Ptr<RTOpPack::ReductTarget> &reduct_obj,
64 const int num_vecs = vecs.size();
65 const int num_targ_vecs = targ_vecs.size();
66 TEUCHOS_TEST_FOR_EXCEPTION(
67 global_offset_in < 0, std::logic_error
68 ,func_name <<
" : Error! global_offset_in = " 69 <<global_offset_in<<
" is not valid" );
70 for (
int k = 0; k < num_vecs; ++k)
72 for (
int k = 0; k < num_targ_vecs; ++k)
77 template<
class Scalar>
79 const std::string &func_name,
85 const ArrayView<
const Ptr<RTOpPack::ReductTarget> > &reduct_objs,
86 const Ordinal primary_global_offset_in
91 TEUCHOS_TEST_FOR_EXCEPTION(
92 primary_global_offset_in < 0, std::logic_error
93 ,func_name <<
" : Error! primary_global_offset_in = " 94 <<primary_global_offset_in<<
" is not valid" );
97 for (
int k = 0; k < multi_vecs.size(); ++k) {
101 for (
int k = 0; k < targ_multi_vecs.size(); ++k) {
112 #define THYRA_APPLY_OP_HELPER_INSTANT(SCALAR) \ 114 template void apply_op_validate_input( \ 115 const std::string &func_name, \ 116 const VectorSpaceBase<SCALAR > &space, \ 117 const RTOpPack::RTOpT<SCALAR > &op, \ 118 const ArrayView<const Ptr<const VectorBase<SCALAR > > > &vecs, \ 119 const ArrayView<const Ptr<VectorBase<SCALAR > > > &targ_vecs, \ 120 const Ptr<RTOpPack::ReductTarget> &reduct_obj, \ 121 const Ordinal global_offset_in \ 124 template void apply_op_validate_input( \ 125 const std::string &func_name, \ 126 const VectorSpaceBase<SCALAR > &domain, \ 127 const VectorSpaceBase<SCALAR > &range, \ 128 const RTOpPack::RTOpT<SCALAR > &primary_op, \ 129 const ArrayView<const Ptr<const MultiVectorBase<SCALAR > > > &multi_vecs, \ 130 const ArrayView<const Ptr<MultiVectorBase<SCALAR > > > &targ_multi_vecs, \ 131 const ArrayView<const Ptr<RTOpPack::ReductTarget> > &reduct_objs, \ 132 const Ordinal primary_global_offset_in \ 137 #endif // THYRA_APPLY_OP_HELPER_HPP #define THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2)
This is a very useful macro that should be used to validate that two vector spaces are compatible...
void apply_op_validate_input(const std::string &func_name, const VectorSpaceBase< Scalar > &space, 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)
Validate the inputs to VectorBase::applyOp().
Abstract interface for objects that represent a space for vectors.
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Interface for a collection of column vectors called a multi-vector.
Abstract interface for finite-dimensional dense vectors.