RTOp Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
interfaces
RTOpPack_RTOpT_def.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_NEW_T_HPP
44
#define RTOPPACK_RTOP_NEW_T_HPP
45
46
#include "
RTOpPack_RTOpT_decl.hpp
"
47
#include "Teuchos_Workspace.hpp"
48
#include "Teuchos_Assert.hpp"
49
#include "Teuchos_ScalarTraits.hpp"
50
51
52
namespace
RTOpPack
{
53
54
55
// Protected functions to be overridden by subclasses
56
57
58
template
<
class
Scalar>
59
void
RTOpT<Scalar>::get_reduct_type_num_entries_impl
(
60
const
Ptr<int> &num_values,
61
const
Ptr<int> &num_indexes,
62
const
Ptr<int> &num_chars
63
)
const
64
{
65
*num_values = 0;
66
*num_indexes = 0;
67
*num_chars = 0;
68
}
69
70
71
template
<
class
Scalar>
72
Teuchos::RCP<ReductTarget>
73
RTOpT<Scalar>::reduct_obj_create_impl
()
const
74
{
75
return
Teuchos::null;
76
}
77
78
79
template
<
class
Scalar>
80
void
RTOpT<Scalar>::reduce_reduct_objs_impl
(
81
const
ReductTarget
&
/* in_reduct_obj */
,
const
Ptr<ReductTarget>&
/* inout_reduct_obj */
82
)
const
83
{
84
throwNoReductError
();
85
}
86
87
88
template
<
class
Scalar>
89
void
RTOpT<Scalar>::reduct_obj_reinit_impl
(
90
const
Ptr<ReductTarget> &
/* reduct_obj */
)
const
91
{
92
throwNoReductError
();
93
}
94
95
96
template
<
class
Scalar>
97
void
RTOpT<Scalar>::extract_reduct_obj_state_impl
(
98
const
ReductTarget
&
/* reduct_obj */
,
99
const
ArrayView<primitive_value_type> &
/* value_data */
,
100
const
ArrayView<index_type> &
/* index_data */
,
101
const
ArrayView<char_type> &
/* char_data */
102
)
const
103
{
104
throwNoReductError
();
105
}
106
107
108
template
<
class
Scalar>
109
void
RTOpT<Scalar>::load_reduct_obj_state_impl
(
110
const
ArrayView<const primitive_value_type> &
/* value_data */
,
111
const
ArrayView<const index_type> &
/* index_data */
,
112
const
ArrayView<const char_type> &
/* char_data */
,
113
const
Ptr<ReductTarget> &
/* reduct_obj */
114
)
const
115
{
116
throwNoReductError
();
117
}
118
119
120
template
<
class
Scalar>
121
std::string
RTOpT<Scalar>::op_name_impl
()
const
122
{
123
return
op_name_
;
124
}
125
126
127
template
<
class
Scalar>
128
bool
RTOpT<Scalar>::coord_invariant_impl
()
const
129
{
130
return
true
;
131
}
132
133
134
template
<
class
Scalar>
135
Range1D
RTOpT<Scalar>::range_impl
()
const
136
{
137
return
Range1D();
138
}
139
140
141
// Nonvirtual protected functions
142
143
144
template
<
class
Scalar>
145
RTOpT<Scalar>::RTOpT
(
const
std::string &op_name_base )
146
{
147
setOpNameBase
(op_name_base);
148
}
149
150
151
template
<
class
Scalar>
152
void
RTOpT<Scalar>::setOpNameBase
(
const
std::string &op_name_base )
153
{
154
op_name_
= op_name_base+
"<"
+ScalarTraits<Scalar>::name()+
">"
;
155
}
156
157
158
// private
159
160
161
template
<
class
Scalar>
162
void
RTOpT<Scalar>::throwNoReductError
()
const
163
{
164
TEUCHOS_TEST_FOR_EXCEPTION(
true
, std::logic_error,
165
"Error, no reduction is defined for concrete reduction op \'"
166
<< this->description() <<
"\'!"
);
167
}
168
169
170
171
}
// end namespace RTOpPack
172
173
174
#endif
// RTOPPACK_RTOP_NEW_T_HPP
RTOpPack_RTOpT_decl.hpp
RTOpPack::RTOpT::op_name_impl
virtual std::string op_name_impl() const
Definition
RTOpPack_RTOpT_def.hpp:121
RTOpPack::RTOpT::op_name_
std::string op_name_
Definition
RTOpPack_RTOpT_decl.hpp:479
RTOpPack::RTOpT::extract_reduct_obj_state_impl
virtual 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_RTOpT_def.hpp:97
RTOpPack::RTOpT::reduce_reduct_objs_impl
virtual void reduce_reduct_objs_impl(const ReductTarget &in_reduct_obj, const Ptr< ReductTarget > &inout_reduct_obj) const
Definition
RTOpPack_RTOpT_def.hpp:80
RTOpPack::RTOpT::reduct_obj_create_impl
virtual Teuchos::RCP< ReductTarget > reduct_obj_create_impl() const
Definition
RTOpPack_RTOpT_def.hpp:73
RTOpPack::RTOpT::reduct_obj_reinit_impl
virtual void reduct_obj_reinit_impl(const Ptr< ReductTarget > &reduct_obj) const
Definition
RTOpPack_RTOpT_def.hpp:89
RTOpPack::RTOpT::range_impl
virtual Range1D range_impl() const
Definition
RTOpPack_RTOpT_def.hpp:135
RTOpPack::RTOpT::get_reduct_type_num_entries_impl
virtual 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_RTOpT_def.hpp:59
RTOpPack::RTOpT::load_reduct_obj_state_impl
virtual 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_RTOpT_def.hpp:109
RTOpPack::RTOpT::setOpNameBase
void setOpNameBase(const std::string &op_name_base)
Just set the operator name.
Definition
RTOpPack_RTOpT_def.hpp:152
RTOpPack::RTOpT::throwNoReductError
void throwNoReductError() const
Definition
RTOpPack_RTOpT_def.hpp:162
RTOpPack::RTOpT::coord_invariant_impl
virtual bool coord_invariant_impl() const
Definition
RTOpPack_RTOpT_def.hpp:128
RTOpPack::RTOpT::RTOpT
RTOpT(const std::string &op_name_base="")
Constructor that creates an operator name appended with the type.
Definition
RTOpPack_RTOpT_def.hpp:145
RTOpPack::ReductTarget
Abstract base class for all reduction objects.
Definition
RTOpPack_RTOpT_decl.hpp:58
RTOpPack
Definition
RTOpPack_RTOpT_decl.hpp:52
Generated by
1.17.0