RTOp Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
RTOpPack_RTOpSubRangeDecorator_decl.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// RTOp: Interfaces and Support Software for Vector Reduction Transformation
5// Operations
6// Copyright (2006) Sandia Corporation
7//
8// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9// license for use of this work by or on behalf of the U.S. Government.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
39//
40// ***********************************************************************
41// @HEADER
42
43#ifndef RTOPPACK_RTOP_SUB_RANGE_DECORATOR_DECL_HPP
44#define RTOPPACK_RTOP_SUB_RANGE_DECORATOR_DECL_HPP
45
46
47#include "RTOpPack_RTOpT.hpp"
48#include "Teuchos_ConstNonconstObjectContainer.hpp"
49
50
51namespace RTOpPack {
52
53
84template<class Scalar>
85class RTOpSubRangeDecorator : public RTOpT<Scalar> {
86public:
87
90
93
95
98
101
104 const RCP<RTOpT<Scalar> > &op,
105 const Ordinal first_ele_offset = 0,
106 const Ordinal sub_dim = -1
107 );
108
111 const RCP<const RTOpT<Scalar> > &op,
112 const Ordinal first_ele_offset = 0,
113 const Ordinal sub_dim = -1
114 );
115
118 const RCP<RTOpT<Scalar> > &op,
119 const Ordinal first_ele_offset = 0,
120 const Ordinal sub_dim = -1
121 );
122
124 void initialize(
125 const RCP<const RTOpT<Scalar> > &op,
126 const Ordinal first_ele_offset = 0,
127 const Ordinal sub_dim = -1
128 );
129
131 RCP<RTOpT<Scalar> > getNonconstOp();
132
134 RCP<const RTOpT<Scalar> > getOp() const;
135
137
140
143 const Ptr<int> &num_values,
144 const Ptr<int> &num_indexes,
145 const Ptr<int> &num_chars
146 ) const;
148 Teuchos::RCP<ReductTarget> reduct_obj_create_impl() const;
150 void reduce_reduct_objs_impl( const ReductTarget &in_reduct_obj,
151 const Ptr<ReductTarget> &inout_reduct_obj) const;
153 void reduct_obj_reinit_impl( const Ptr<ReductTarget> &reduct_obj ) const;
156 const ReductTarget &reduct_obj,
157 const ArrayView<primitive_value_type> &value_data,
158 const ArrayView<index_type> &index_data,
159 const ArrayView<char_type> &char_data
160 ) const;
163 const ArrayView<const primitive_value_type> &value_data,
164 const ArrayView<const index_type> &index_data,
165 const ArrayView<const char_type> &char_data,
166 const Ptr<ReductTarget> &reduct_obj
167 ) const;
169 std::string op_name_impl() const;
171 bool coord_invariant_impl() const;
173 void apply_op_impl(
174 const ArrayView<const ConstSubVectorView<Scalar> > &sub_vecs,
175 const ArrayView<const SubVectorView<Scalar> > &targ_sub_vecs,
176 const Ptr<ReductTarget> &reduct_obj
177 ) const;
178
180
181private:
182
183 Teuchos::ConstNonconstObjectContainer<RTOpT<Scalar> > op_;
186
187};
188
189
190} // namespace RTOpPack
191
192
193#endif // RTOPPACK_RTOP_SUB_RANGE_DECORATOR_DECL_HPP
Class for a non-changeable sub-vector.
Decorator subclass that restricts the range of elements to apply the underlying RTOpT object to.
Teuchos::ConstNonconstObjectContainer< RTOpT< Scalar > > op_
void load_reduct_obj_state_impl(const ArrayView< const primitive_value_type > &value_data, const ArrayView< const index_type > &index_data, const ArrayView< const char_type > &char_data, const Ptr< ReductTarget > &reduct_obj) const
void reduce_reduct_objs_impl(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
void initialize(const RCP< const RTOpT< Scalar > > &op, const Ordinal first_ele_offset=0, const Ordinal sub_dim=-1)
RCP< const RTOpT< Scalar > > getOp() const
void apply_op_impl(const ArrayView< const ConstSubVectorView< Scalar > > &sub_vecs, const ArrayView< const SubVectorView< Scalar > > &targ_sub_vecs, const Ptr< ReductTarget > &reduct_obj) const
RTOpT< Scalar >::primitive_value_type primitive_value_type
void reduct_obj_reinit_impl(const Ptr< ReductTarget > &reduct_obj) const
void get_reduct_type_num_entries_impl(const Ptr< int > &num_values, const Ptr< int > &num_indexes, const Ptr< int > &num_chars) const
void extract_reduct_obj_state_impl(const ReductTarget &reduct_obj, const ArrayView< primitive_value_type > &value_data, const ArrayView< index_type > &index_data, const ArrayView< char_type > &char_data) const
void nonconstInitialize(const RCP< RTOpT< Scalar > > &op, const Ordinal first_ele_offset=0, const Ordinal sub_dim=-1)
Teuchos::RCP< ReductTarget > reduct_obj_create_impl() const
Templated interface to vector reduction/transformation operators {abstract}.
PrimitiveTypeTraits< Scalar, Scalar >::primitiveType primitive_value_type
Abstract base class for all reduction objects.
Class for a changeable sub-vector.
Teuchos_Ordinal Ordinal