6 #include "../types.hpp" 11 template <
int N,
int C,
12 template <
typename,
int,
int>
class M,
15 template <
typename...>
class F = std::function >
17 static M<R, N, C>
apply(
const M<F<R( A )> , N, C>& mf,
const A& arg )
21 for (
int i = 0; i < N; ++i ) {
22 for (
int j = 0; j < C; ++j ) {
23 m( i, j ) = mf( i, j )( arg );
29 template<
template <
typename...>
class G_in = std::vector,
30 template <
typename...>
class G_out = G_in>
31 static G_out<M<R, N, C> >
35 G_out<M<R, N, C> > result( g.size() );
36 auto it = result.begin();
38 for (
const auto & arg : g ) {
39 *it =
apply( mf, arg );
48 template <
template <
typename,
int,
int>
class M,
51 template <
typename...>
class F>
53 static R
apply(
const F<R(A)>& f,
const A& arg) {
56 static M<R, 1,1>
apply(
const M<F<R( A )>, 1,1 >& mf,
const A& arg )
59 m( 0,0 ) = mf( 0,0 )( arg );
64 template<
template <
typename...>
class G_in = std::vector,
65 template <
typename...>
class G_out = G_in>
66 static G_out<M<R, 1,1> >
70 G_out<M<R, 1,1> > result( g.size() );
71 auto it = result.begin();
73 for (
const auto & arg : g ) {
74 *it =
apply( mf, arg );
81 template<
template <
typename...>
class G_in = std::vector,
82 template <
typename...>
class G_out = G_in>
87 G_out<R > result( g.size() );
88 auto it = result.begin();
90 for (
const auto & arg : g ) {
91 *it =
apply( mf, arg );
127 template <
typename...>
class G_in = std::vector,
128 template <
typename...>
class G_out = G_in,
129 template <
typename...>
class F = std::function >
132 G_out<R> result( g.size() );
133 auto it = result.begin();
135 for (
const auto & arg : g ) {
Definition: coefficients_file_parser.cpp:10
static M< R, 1, 1 > apply(const M< F< R(A)>, 1, 1 > &mf, const A &arg)
Definition: evaluations.hpp:56
static G_out< R > in_grid(const F< R(A)> &mf, const G_in< A > &g)
Definition: evaluations.hpp:84
G_out< R > evaluate_function_in_grid(const F< R(A)> &f, const G_in< A > &g)
Evaluate a function in multiple points at once.
Definition: evaluations.hpp:130
static G_out< M< R, 1, 1 > > in_grid(const M< F< R(A)>, 1, 1 > &mf, const G_in< A > &g)
Definition: evaluations.hpp:67
static M< R, N, C > apply(const M< F< R(A)>, N, C > &mf, const A &arg)
Definition: evaluations.hpp:17
static G_out< M< R, N, C > > in_grid(const M< F< R(A)>, N, C > &mf, G_in< A > g)
Definition: evaluations.hpp:32
Definition: evaluations.hpp:16
static R apply(const F< R(A)> &f, const A &arg)
Definition: evaluations.hpp:53