RTOp Package Browser (Single Doxygen Collection)  Version of the Day
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"
49 
50 
51 namespace RTOpPack {
52 
53 
84 template<class Scalar>
85 class RTOpSubRangeDecorator : public RTOpT<Scalar> {
86 public:
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 
117  void nonconstInitialize(
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 
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;
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 
181 private:
182 
186 
187 };
188 
189 
190 } // namespace RTOpPack
191 
192 
193 #endif // RTOPPACK_RTOP_SUB_RANGE_DECORATOR_DECL_HPP
RTOpPack::RTOpSubRangeDecorator::first_ele_offset_
Ordinal first_ele_offset_
Definition: RTOpPack_RTOpSubRangeDecorator_decl.hpp:184
RTOpPack::RTOpSubRangeDecorator::getNonconstOp
RCP< RTOpT< Scalar > > getNonconstOp()
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:116
RTOpPack::RTOpSubRangeDecorator::nonconstInitialize
void nonconstInitialize(const RCP< RTOpT< Scalar > > &op, const Ordinal first_ele_offset=0, const Ordinal sub_dim=-1)
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:88
RTOpPack::ConstSubVectorView
Class for a non-changeable sub-vector.
Definition: RTOpPack_Types.hpp:144
RTOpPack::RTOpSubRangeDecorator::extract_reduct_obj_state_impl
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
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:170
RTOpPack::RTOpSubRangeDecorator::apply_op_impl
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
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:208
RTOpPack::RTOpSubRangeDecorator::RTOpSubRangeDecorator
RTOpSubRangeDecorator()
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:57
Teuchos::ArrayView
Teuchos::RCP
Teuchos::Ptr
RTOpPack::RTOpSubRangeDecorator::reduce_reduct_objs_impl
void reduce_reduct_objs_impl(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:153
RTOpPack::RTOpSubRangeDecorator::load_reduct_obj_state_impl
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
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:182
RTOpPack::RTOpT::primitive_value_type
PrimitiveTypeTraits< Scalar, Scalar >::primitiveType primitive_value_type
Definition: RTOpPack_RTOpT_decl.hpp:177
RTOpPack
Definition: RTOpPack_RTOpT_decl.hpp:52
Teuchos_ConstNonconstObjectContainer.hpp
RTOpPack::RTOpSubRangeDecorator::primitive_value_type
RTOpT< Scalar >::primitive_value_type primitive_value_type
Definition: RTOpPack_RTOpSubRangeDecorator_decl.hpp:92
RTOpPack::RTOpSubRangeDecorator::op_
Teuchos::ConstNonconstObjectContainer< RTOpT< Scalar > > op_
Definition: RTOpPack_RTOpSubRangeDecorator_decl.hpp:183
RTOpPack::RTOpSubRangeDecorator::get_reduct_type_num_entries_impl
void get_reduct_type_num_entries_impl(const Ptr< int > &num_values, const Ptr< int > &num_indexes, const Ptr< int > &num_chars) const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:134
RTOpPack::SubVectorView
Class for a changeable sub-vector.
Definition: RTOpPack_Types.hpp:247
RTOpPack::RTOpSubRangeDecorator::reduct_obj_create_impl
Teuchos::RCP< ReductTarget > reduct_obj_create_impl() const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:146
RTOpPack::Ordinal
Teuchos_Ordinal Ordinal
Definition: RTOpPack_Types.hpp:68
RTOpPack::RTOpSubRangeDecorator::op_name_impl
std::string op_name_impl() const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:194
RTOpPack::RTOpT
Templated interface to vector reduction/transformation operators {abstract}.
Definition: RTOpPack_RTOpT_decl.hpp:169
RTOpPack::RTOpSubRangeDecorator::initialize
void initialize(const RCP< const RTOpT< Scalar > > &op, const Ordinal first_ele_offset=0, const Ordinal sub_dim=-1)
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:102
RTOpPack::ReductTarget
Abstract base class for all reduction objects.
Definition: RTOpPack_RTOpT_decl.hpp:57
RTOpPack::RTOpSubRangeDecorator::reduct_obj_reinit_impl
void reduct_obj_reinit_impl(const Ptr< ReductTarget > &reduct_obj) const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:162
RTOpPack::RTOpSubRangeDecorator::sub_dim_
Ordinal sub_dim_
Definition: RTOpPack_RTOpSubRangeDecorator_decl.hpp:185
Teuchos::ConstNonconstObjectContainer
RTOpPack::RTOpSubRangeDecorator::getOp
RCP< const RTOpT< Scalar > > getOp() const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:124
RTOpPack::RTOpSubRangeDecorator
Decorator subclass that restricts the range of elements to apply the underlying RTOpT object to.
Definition: RTOpPack_RTOpSubRangeDecorator_decl.hpp:85
RTOpPack::RTOpSubRangeDecorator::coord_invariant_impl
bool coord_invariant_impl() const
Definition: RTOpPack_RTOpSubRangeDecorator_def.hpp:201