diff --git a/NumLib/NamedFunctionCaller.cpp b/NumLib/NamedFunctionCaller.cpp index eeab28cef3fab5e78815979ec386990710651370..6015c96a438461899772d283b26bea24817948d1 100644 --- a/NumLib/NamedFunctionCaller.cpp +++ b/NumLib/NamedFunctionCaller.cpp @@ -191,21 +191,6 @@ void NamedFunctionCaller::applyPlugs() } } -double NamedFunctionCaller::call( - const std::string& function_name, - const std::vector<double>& unbound_arguments) const -{ - assert(unbound_arguments.size() == getNumberOfUnboundArguments()); - - auto it = _map_name_idx.find(function_name); - if (it == _map_name_idx.end()) { - OGS_FATAL("A function with the name `%s' has not been found.", - function_name.c_str()); - } - - return call(it->second, unbound_arguments); -} - double NamedFunctionCaller::call( std::size_t function_idx, const std::vector<double>& unbound_arguments) const diff --git a/NumLib/NamedFunctionCaller.h b/NumLib/NamedFunctionCaller.h index 10276269106ca3888a64e94b5847ba84201998c1..6aee7086464fe54446a2d7451c0f5ebcc7192184 100644 --- a/NumLib/NamedFunctionCaller.h +++ b/NumLib/NamedFunctionCaller.h @@ -48,12 +48,6 @@ public: //! \pre All functions involved must have been added. void applyPlugs(); - //! Calls the function with the given name with the given unbound arguments. - //! - //! \pre applyPlugs() must have been called before. - double call(std::string const& function_name, - std::vector<double> const& unbound_arguments) const; - //! Creates a function caller that is able to call the function with the //! given name. SpecialFunctionCaller getSpecialFunction(std::string const& function_name); diff --git a/Tests/NumLib/TestNamedFunction.cpp b/Tests/NumLib/TestNamedFunction.cpp index da526595c65ead4de23c701f35ac7cff1f8e4ecd..1f046265ad83d22a7ac8a54769c6a21a6fb6c3b4 100644 --- a/Tests/NumLib/TestNamedFunction.cpp +++ b/Tests/NumLib/TestNamedFunction.cpp @@ -100,8 +100,9 @@ TEST(NumLib, NamedFunctionCaller) double x = 1.0; double y = 2.0; + auto const g_caller = caller.getSpecialFunction("g"); DBUG("calling %s", caller.getCallExpression("g").c_str()); - EXPECT_EQ(g_inst.g(x), caller.call("g", {x, y})); + EXPECT_EQ(g_inst.g(x), g_caller.call({x, y})); auto const f_caller = caller.getSpecialFunction("f"); DBUG("calling %s", caller.getCallExpression("f").c_str());