5 #include <amdis/common/Math.hpp> 6 #include <amdis/common/Concepts.hpp> 7 #include <amdis/operations/Basic.hpp> 8 #include <amdis/operations/Composer.hpp> 21 template <
class... Ts>
22 constexpr
auto operator()(Ts
const&... ts)
const 24 return Math::sum(ts...);
45 template <
class... Int>
46 constexpr
int order(
Plus const&, Int... orders)
48 return Math::max(
int(orders)...);
51 template <std::
size_t I>
54 static_assert((I < 2),
"Derivatives of `Plus` only defined for the binary case.");
63 template <
class T,
class S>
64 constexpr
auto operator()(T
const& lhs, S
const& rhs)
const 69 friend constexpr
int order(
Minus const&,
int lhs,
int rhs)
71 return Math::max(lhs, rhs);
102 template <
class... Ts>
103 constexpr
auto operator()(Ts
const&... ts)
const 128 template <
class... Int>
131 return Math::sum(
int(orders)...);
136 template <std::
size_t I>
139 static_assert((I < 2),
"Derivatives of `Multiplies` only defined for the binary case.");
148 template <
class T,
class S>
149 constexpr
auto operator()(T
const& lhs, S
const& rhs)
const 170 constexpr
auto operator()(T
const& x)
const 206 template <
int p,
bool positive>
228 constexpr
auto operator()(T
const& x)
const 230 return Math::pow<p>(x);
246 :
public Composer<Divides, One, Pow<-p>>
253 constexpr
auto operator()(T
const& x)
const 255 return T(1) / Math::pow<-p>(x);
262 template <
int p1,
bool pos1,
int p2,
bool pos2>
267 template <
int p,
bool pos>
276 compose(Pow<2>{},
Arg<1>{}));
282 constexpr
Pow_(
int p)
287 auto operator()(T
const& x)
const 289 return std::pow(x, p_);
292 friend constexpr
int order(Pow_
const& P,
int d)
297 friend constexpr
auto partial(Pow_
const& P,
index_t<0>)
Definition: Basic.hpp:132
Composition of Functors.
Definition: Composer.hpp:31
Functor that represents A-B.
Definition: Arithmetic.hpp:167
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
Functor that represents x^p,.
Definition: Arithmetic.hpp:280
Definition: Arithmetic.hpp:207
Functor that represents A*B.
Definition: Arithmetic.hpp:100
Functor that represents A+B.
Definition: Arithmetic.hpp:19
Functor representing a static constant value.
Definition: Basic.hpp:37
auto order(F const &f) -> decltype(&F::operator(), f.order())
polynomial order of functions
Definition: Order.hpp:11
Functor that represents A/B.
Definition: Arithmetic.hpp:146
std::integral_constant< std::size_t, I > index_t
A wrapper for std::size_t type.
Definition: Index.hpp:31
Definition: Composer.hpp:53
Functor that represents A-B.
Definition: Arithmetic.hpp:61
Functor representing a constant value.
Definition: Basic.hpp:87
Definition: Arithmetic.hpp:210
(Unary-)Functor representing the identity
Definition: Basic.hpp:64