45#include "optimization/OptimizationFactory.hpp"
47#include "optimization/OptimizationCreator.hpp"
52 OptimizationFactory::~OptimizationFactory() {
53 Utils::deletePointers(creatorMap_);
58 .insert(CreatorMapType::value_type(creator->getIdent(), creator))
63 return creatorMap_.erase(
id) == 1;
67 const std::string&
id,
SimInfo*) {
68 CreatorMapType::iterator i = creatorMap_.find(
id);
69 if (i != creatorMap_.end()) {
71 return (i->second)->create();
78 IdentVectorType idents;
79 CreatorMapType::iterator i;
81 for (i = creatorMap_.begin(); i != creatorMap_.end(); ++i) {
82 idents.push_back(i->first);
89 OptimizationFactory::IdentVectorType idents;
90 OptimizationFactory::IdentVectorIterator i;
94 o <<
"Avaliable type identifiers in this factory: " << std::endl;
95 for (i = idents.begin(); i != idents.end(); ++i) {
Factory pattern and Singleton Pattern are used to define an interface for creating an Optimization.
IdentVectorType getIdents()
Returns all of the registed type identifiers.
bool unregisterOptimization(const std::string &id)
Unregisters the creator for the given type identifier.
QuantLib::OptimizationMethod * createOptimization(const std::string &id, SimInfo *info)
Looks up the type identifier in the internal map.
bool registerOptimization(OptimizationCreator *creator)
Registers a creator with a type identifier.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Abstract class for constrained optimization method.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.