#ifndef FUNCTIONS_H #define FUNCTIONS_H #include #include // R^1 -> R^1 mappings namespace D1ToD1 { // return a function defined at the vector positions with the vector values // which interpolates linearly between those values // both vectors have to be sorted according to the values in positions std::function PiecewiseLinear(std::vector positions, std::vector values); // return a function, that always returns the constant value "constant" std::function Constant(double constant); // return a function returning the product of the values defined by the functions // in the vector "functions" std::function Product( std::vector> functions); }; // namespace D1ToD1 // R^3 -> R^1 mappings namespace D3ToD1 { // return a function, that always returns the constant value "constant" std::function Constant(double value); // return a function that returns the product of the values of the functions fi, fj and fk // fi calculates its value from the first parameter the function "Product" returns gets, // fj from the second parameter and // fk from the third std::function Product( std::function fi, std::function fj, std::function fk); }; // namespace D3ToD1 #endif /* FUNCTIONS_H */