Commit f7c1c192 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Changed the exponent type from int to double in the power grid-function

parent 80025775
Pipeline #6257 passed with stage
in 78 minutes and 40 seconds
......@@ -136,12 +136,12 @@ namespace AMDiS
return invokeAtQP(Operation::Pow<p>{}, FWD(value));
}
/// \brief Applies \ref Operation::Pow_ to GridFunction. \relates FunctorGridFunction
/// \brief Applies \ref Operation::Power to GridFunction. \relates FunctorGridFunction
template <class T,
REQUIRES(Concepts::AnyGridFunction<T>)>
auto pow(T&& value, int p)
auto pow(T&& value, double p)
{
return invokeAtQP(Operation::Pow_{p}, FWD(value));
return invokeAtQP(Operation::Power{p}, FWD(value));
}
/// \brief Applies \ref Operation::Get<I> to GridFunction. \relates FunctorGridFunction
......
......@@ -277,9 +277,9 @@ namespace AMDiS
}
/// Functor that represents x^p, \see \ref Pow
struct Pow_
struct Power
{
constexpr Pow_(int p)
constexpr Power(double p)
: p_(p)
{}
......@@ -289,17 +289,17 @@ namespace AMDiS
return std::pow(x, p_);
}
friend constexpr int order(Pow_ const& P, int d)
friend constexpr int order(Power const& P, double d)
{
return P.p_ * d;
}
friend constexpr auto partial(Pow_ const& P, index_t<0>)
friend constexpr auto partial(Power const& P, index_t<0>)
{
return compose(Multiplies{}, Constant<int>{P.p_}, Pow_{P.p_-1});
return compose(Multiplies{}, Constant<double>{P.p_}, Power{P.p_-1});
}
int p_;
double p_;
};
/** @} **/
......
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