Commit 0b25b49d authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

functor expression corrected

parent 79865e8e
...@@ -250,7 +250,7 @@ namespace AMDiS ...@@ -250,7 +250,7 @@ namespace AMDiS
F f; ///< the functor F f; ///< the functor
template <class... Terms_> template <class... Terms_>
FunctionN(F&& f_, Terms_... terms_) FunctionN(F const& f_, Terms_... terms_)
: super(terms_...), f(f_) {} : super(terms_...), f(f_) {}
// call f.getDegree() function // call f.getDegree() function
...@@ -404,27 +404,27 @@ namespace AMDiS ...@@ -404,27 +404,27 @@ namespace AMDiS
template<typename F, typename... Terms> template<typename F, typename... Terms>
inline typename result_of::FunctionN<F, Terms...>::type inline typename result_of::FunctionN<F, Terms...>::type
function_(F&& f, Terms... ts) function_(F const& f, Terms... ts)
{ {
return expressions::FunctionN<F, typename traits::to_expr<Terms>::to::type...> return expressions::FunctionN<F, typename traits::to_expr<Terms>::to::type...>
(std::forward<F>(f), traits::to_expr<Terms>::to::get(ts)...); (f, traits::to_expr<Terms>::to::get(ts)...);
} }
template<typename F, typename... Terms> template<typename F, typename... Terms>
inline typename result_of::FunctionN<F, Terms...>::type inline typename result_of::FunctionN<F, Terms...>::type
func(F&& f, Terms... ts) func(F const& f, Terms... ts)
{ {
return expressions::FunctionN<F, typename traits::to_expr<Terms>::to::type...> return expressions::FunctionN<F, typename traits::to_expr<Terms>::to::type...>
(std::forward<F>(f), traits::to_expr<Terms>::to::get(ts)...); (f, traits::to_expr<Terms>::to::get(ts)...);
} }
template<typename F, typename Term0, typename... Terms> template<typename F, typename Term0, typename... Terms>
inline typename result_of::FunctionN<F, Term0, Terms...>::type inline typename result_of::FunctionN<F, Term0, Terms...>::type
eval(F&& f, Term0 t0, Terms... ts) eval(F const& f, Term0 t0, Terms... ts)
{ {
return expressions::FunctionN<F, typename traits::to_expr<Term0>::to::type, return expressions::FunctionN<F, typename traits::to_expr<Term0>::to::type,
typename traits::to_expr<Terms>::to::type...> typename traits::to_expr<Terms>::to::type...>
(std::forward<F>(f), traits::to_expr<Term0>::to::get(t0), traits::to_expr<Terms>::to::get(ts)...); (f, traits::to_expr<Term0>::to::get(t0), traits::to_expr<Terms>::to::get(ts)...);
} }
...@@ -436,16 +436,16 @@ namespace AMDiS ...@@ -436,16 +436,16 @@ namespace AMDiS
template <int Degree, class F> template <int Degree, class F>
inline expressions::DegreeWrapper<Degree, F> inline expressions::DegreeWrapper<Degree, F>
deg(F&& fct) deg(F const& fct)
{ {
return expressions::DegreeWrapper<Degree, F>(std::forward<F>(fct)); return expressions::DegreeWrapper<Degree, F>(fct);
} }
template <class F, class DegF> template <class F, class DegF>
inline expressions::DegreeWrapper2<F, DegF> inline expressions::DegreeWrapper2<F, DegF>
deg(F&& fct, DegF&& degfct) deg(F const& fct, DegF const& degfct)
{ {
return expressions::DegreeWrapper2<F, DegF>(std::forward<F>(fct), std::forward<DegF>(degfct)); return expressions::DegreeWrapper2<F, DegF>(fct, degfct);
} }
} // end namespace AMDiS } // end namespace AMDiS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment