3 #include <funcy/concepts.h> 4 #include <funcy/constant.h> 5 #include <funcy/operations.h> 6 #include <funcy/variable.h> 20 template < Function F, Function G >
23 return mathop::Sum( std::forward< F >( f ), std::forward< G >( g ) );
32 template <
class F, Function G >
44 template < Function F,
class G >
56 template < Function F, Function G >
59 return mathop::Product( std::forward< F >( f ), std::forward< G >( g ) );
68 template <
class F, Function G >
80 template < Arithmetic F, Function G >
83 return mathop::Scale( std::forward< F >( f ), std::forward< G >( g ) );
92 template < Function F,
class G >
104 template < Function F, Arithmetic G >
107 return mathop::Scale( std::forward< G >( g ), std::forward< F >( f ) );
116 template < Function F, Function G >
120 std::forward< G >( g ) );
129 template <
class F, Function G >
130 auto dot( F&& f, G&& g )
133 constant( std::forward< F >( f ) ), std::forward< G >( g ) );
142 template < Function F,
class G >
143 auto dot( F&& f, G&& g )
146 std::forward< F >( f ),
constant( std::forward< G >( g ) ) );
155 template < Function F >
167 template < Function F, Function G >
179 template <
class F, Function G >
191 template < Function F,
class G >
204 template <
class F,
class G >
205 auto operator/( F&& f, G&& g ) requires( requires( G g ) {
209 ->std::convertible_to<
double >;
212 return std::forward< F >( f ) * pow< -1 >( std::forward< G >( g ) );
222 template <
class F, Arithmetic G >
225 return std::forward< F >( f ) *
constant( 1 / g );
Subtraction of functions of type F and G.
Definition: subtraction.h:20
auto dot(F &&f, G &&g)
overload of "dot"-function for the generation of functions.
Definition: generate.h:117
Dot of functions of type F and G.
Definition: dot.h:21
Sum of functions of type F and G.
Definition: sum.h:20
Product of functions of type F and G.
Definition: product.h:21
Main namespace of the funcy library.
constexpr auto constant(Arg &&x) noexcept((std::is_rvalue_reference_v< Arg > &&std::is_nothrow_move_constructible_v< Arg >)||(std::is_lvalue_reference_v< Arg > &&std::is_nothrow_copy_constructible_v< Arg >))
Wrap a constant.
Definition: constant.h:51
auto operator+(F &&f, G &&g)
overload of "+"-operator for the generation of functions.
Definition: generate.h:21
Squared function .
Definition: squared.h:22
auto operator/(F &&f, G &&g) requires(requires(G g)
overload of "/"-operator for the generation of functions.
Definition: generate.h:205
auto operator-(F &&f, G &&g)
overload of "-"-operator for the generation of functions.
Definition: generate.h:168
auto squared(F &&f)
Generate squared function.
Definition: generate.h:156
Scaling of some function with a double .
Definition: scale.h:20
auto operator*(F &&f, G &&g)
overload of "*"-operator for the generation of functions.
Definition: generate.h:57