31 if (str.find(
',') == std::string::npos) {
39 const size_t n = parser.
size();
41 std::string mess =
"Found empty initialization string";
42 throw std::invalid_argument(mess);
46 const std::string type = parser[0].
str();
47 auto minimizer =
create(type);
50 for (
size_t i = 1; i <
n; ++i) {
51 auto ¶m = parser[i];
52 if (param.size() == 2 && param.name() ==
"=") {
53 const std::string parName = param[0].
str();
54 if (minimizer->existsProperty(parName)) {
55 minimizer->setPropertyValue(parName, param[1].str());
This class represents an expression made up of names, binary operators and brackets.
void parse(const std::string &str)
Parse a string and create an expression.
std::string str() const
Returns this expression as a string.
void toList(const std::string &sep=",")
Make sure the expression is a list of expression separated by sep, eg "term1,term2,...
size_t size() const
Returns the number of argumens.
FuncMinimizerFactoryImpl()
Private Constructor for singleton class.
std::shared_ptr< IFuncMinimizer > createMinimizer(const std::string &str) const
Creates an instance of a minimizer.
An interface for function minimizers.
The dynamic factory is a base dynamic factory for serving up objects in response to requests from oth...
virtual std::shared_ptr< IFuncMinimizer > create(const std::string &className) const
Creates a new instance of the class with the given name.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...