TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
evaluate.cpp
1#include <triqs/mesh.hpp>
2#include <iostream>
3
4// Dummy domain.
5struct domain {};
6
7// Overload evaluate for a single dummy domain.
8auto evaluate(domain d, auto f, double x) { return f(x); }
9
10int main() {
11 // function to evaluate by currying
12 auto f = [](double x, double y, double z) { return x + y + z; };
13
14 // calculate f(1, 2, 3) = 6 using triqs::mesh::evaluate
15 std::cout << triqs::mesh::evaluate(std::make_tuple(domain{}, domain{}, domain{}), f, 1, 2, 3) << std::endl;
16}
Umbrella header for the TRIQS mesh types.