00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RTOPPACK_RTOP_NEW_T_HPP
00031 #define RTOPPACK_RTOP_NEW_T_HPP
00032
00033 #include "RTOpPack_RTOpT_decl.hpp"
00034 #include "Teuchos_Workspace.hpp"
00035 #include "Teuchos_TestForException.hpp"
00036 #include "Teuchos_ScalarTraits.hpp"
00037
00038
00039 namespace RTOpPack {
00040
00041
00042
00043
00044
00045 template<class Scalar>
00046 void RTOpT<Scalar>::get_reduct_type_num_entries_impl(
00047 const Ptr<int> &num_values,
00048 const Ptr<int> &num_indexes,
00049 const Ptr<int> &num_chars
00050 ) const
00051 {
00052 *num_values = 0;
00053 *num_indexes = 0;
00054 *num_chars = 0;
00055 }
00056
00057
00058 template<class Scalar>
00059 Teuchos::RCP<ReductTarget>
00060 RTOpT<Scalar>::reduct_obj_create_impl() const
00061 {
00062 return Teuchos::null;
00063 }
00064
00065
00066 template<class Scalar>
00067 void RTOpT<Scalar>::reduce_reduct_objs_impl(
00068 const ReductTarget& in_reduct_obj, const Ptr<ReductTarget>& inout_reduct_obj
00069 ) const
00070 {
00071 throwNoReductError();
00072 }
00073
00074
00075 template<class Scalar>
00076 void RTOpT<Scalar>::reduct_obj_reinit_impl(
00077 const Ptr<ReductTarget> &reduct_obj ) const
00078 {
00079 throwNoReductError();
00080 }
00081
00082
00083 template<class Scalar>
00084 void RTOpT<Scalar>::extract_reduct_obj_state_impl(
00085 const ReductTarget &reduct_obj,
00086 const ArrayView<primitive_value_type> &value_data,
00087 const ArrayView<index_type> &index_data,
00088 const ArrayView<char_type> &char_data
00089 ) const
00090 {
00091 throwNoReductError();
00092 }
00093
00094
00095 template<class Scalar>
00096 void RTOpT<Scalar>::load_reduct_obj_state_impl(
00097 const ArrayView<const primitive_value_type> &value_data,
00098 const ArrayView<const index_type> &index_data,
00099 const ArrayView<const char_type> &char_data,
00100 const Ptr<ReductTarget> &reduct_obj
00101 ) const
00102 {
00103 throwNoReductError();
00104 }
00105
00106
00107 template<class Scalar>
00108 const std::string RTOpT<Scalar>::op_name_impl() const
00109 {
00110 return op_name_;
00111 }
00112
00113
00114 template<class Scalar>
00115 bool RTOpT<Scalar>::coord_invariant_impl() const
00116 {
00117 return true;
00118 }
00119
00120
00121
00122
00123
00124 template<class Scalar>
00125 RTOpT<Scalar>::RTOpT( const std::string &op_name_base )
00126 {
00127 setOpNameBase(op_name_base);
00128 }
00129
00130
00131 template<class Scalar>
00132 void RTOpT<Scalar>::setOpNameBase( const std::string &op_name_base )
00133 {
00134 op_name_ = op_name_base+"<"+ScalarTraits<Scalar>::name()+">";
00135 }
00136
00137
00138
00139
00140
00141 template<class Scalar>
00142 void RTOpT<Scalar>::throwNoReductError() const
00143 {
00144 TEST_FOR_EXCEPTION(true, std::logic_error,
00145 "Error, no reduction is defined for concrete reduction op \'"
00146 << this->description() << "\'!" );
00147 }
00148
00149
00150
00151 }
00152
00153
00154 #endif // RTOPPACK_RTOP_NEW_T_HPP