MCPcopy Create free account
hub / github.com/boutproject/BOUT-dev / generate

Method generate

src/sys/expressionparser.cxx:110–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 : variables(std::move(variables)), expr(std::move(expr)) {}
109
110 double generate(const Context& ctx) override {
111 // Create a new context
112 Context new_context{ctx};
113
114 // Set values in the context by evaluating the generators
115 for (auto const& var : variables) {
116 new_context.set(var.first, var.second->generate(ctx));
117 }
118
119 // Evaluate the expression in the new context
120 return expr->generate(new_context);
121 }
122 std::string str() const override {
123 auto result = "["s;
124 for (auto const& var : variables) {

Callers

nothing calls this directly

Calls 1

generateMethod · 0.45

Tested by

no test coverage detected