MUQ  0.4.3
SimpleWorkGraph.cpp
Go to the documentation of this file.
4 
5 using namespace muq::Modeling;
6 
7 int main(){
8  unsigned int dim = 2;
9  auto f = std::make_shared<SinOperator>(dim);
10  auto g = std::make_shared<ExpOperator>(dim);
11 
12  auto graph = std::make_shared<WorkGraph>();
13 
14  graph->AddNode(f,"f");
15  graph->AddNode(g,"g");
16  graph->AddEdge("f",0,"g",0); // connect output 0 of f with input 0 of g
17 
18  auto gof = graph->CreateModPiece("f");
19 
20  Eigen::VectorXd x = Eigen::VectorXd::Random(dim);
21  std::cout << "exp(sin) = " << gof->Evaluate(x).at(0).transpose() << std::endl;
22  return 0;
23 }
int main()